Post Reply 
SIZE instruction on HP41CX
04-21-2017, 12:53 PM (This post was last modified: 04-21-2017 01:10 PM by Dieter.)
Post: #11
RE: SIZE instruction on HP41CX
(04-21-2017 07:35 AM)Cancuino Wrote:  I've located the problem. If I attach the Structure or Stress modules SIZE? doesn't work like it's meant to.

Of course SIZE? works – but it's just the "other SIZE?" that is executed, i.e. the program starting with that label. Who wants to tell which SIZE? is right or wrong, or even which one is meant by the user ?-)

(04-21-2017 07:35 AM)Cancuino Wrote:  They both have a SIZE? command.

That's the problem. If duplicate function names in programs (both in regular RAM or in ROM modules) and/or among the calculator functions exist, a certain preference rule applies if the user executes the function by spelling it out (XEQ"SIZE"): first the device looks for a user-defined program with that name (CAT 3), then it looks for a function/program in an extension ROM (CAT 2), and finally it tries to find a function with that name among the regular calculator functions (CAT 1). So since there is a "SIZE?" program in the ROM module, that's what is executed if you press XEQ"SIZE?".

(04-21-2017 07:35 AM)Cancuino Wrote:  Is there any way to execute the SIZE? command that is not on the modules?.

There are several ways to do so. The various SIZE? functions themselves are distinct and different, so the only problem is the call by typing XEQ"SIZE?" that makes the calculator select one of the two possible functions. You can use Joes's method and remove the module (so that there is just one SIZE? left), assign this function to a key and plug back the module. Then pressing this key in user mode will call the internal function while XEQ"SIZE" will start the respective program within the module.

You can also write your own SIZE? program that calls the SIZE? function you want. If this is the internal function better unplug the module before entering this and start with line 02 (!) because else the program will call itself (line 02 would be displayed as XEQ"SIZE?").

Code:
01 LBL "SIZE?"
02 SIZE?
03 END

This way always your program will be called if you enter XEQ"SIZE?".
Or, even better, do this with a different label:

Code:
01 LBL "?SIZE"
02 SIZE?
03 END

BTW, if you write a program where the SIZE? function is called you can easily distinguish the three different possible SIZE? functions. The respective program line will be displayed differently:

Regular 41CX function: "SIZE?"
ROM program: "XROM SIZE?"
User program: "XEQ SIZE?"

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
SIZE instruction on HP41CX - Cancuino - 04-20-2017, 10:25 PM
RE: SIZE instruction on HP41CX - Dieter - 04-20-2017, 10:33 PM
RE: SIZE instruction on HP41CX - Cancuino - 04-20-2017, 11:32 PM
RE: SIZE instruction on HP41CX - Namir - 04-20-2017, 11:44 PM
RE: SIZE instruction on HP41CX - Namir - 04-21-2017, 12:02 AM
RE: SIZE instruction on HP41CX - Cancuino - 04-21-2017, 07:35 AM
RE: SIZE instruction on HP41CX - Joe Horn - 04-21-2017, 07:48 AM
RE: SIZE instruction on HP41CX - Dieter - 04-21-2017 12:53 PM



User(s) browsing this thread: 2 Guest(s)