From: Andreas Möller on
Hello group,

does somebody know, how one can create a named ROMPTR (xNAME - a
command that is visible in the library menu) that is not allowed in a
USER-RPL ?

This is what I’d like to accomplish:
Create a library with a xNAME and if this xNAME is used in a USER-RPL
program the command line parser should give an error.

Example: << My_xNAME >> [ENTER] -> the command line parser errors with
"Invalid Syntax" and the cursor is placed behind the invalid My_xNAME
in the command line.

Can the Property-List Bits in front of a ROMPTR be used for this ?

TIA,
Andreas
http://www.software49g.gmxhome.de
(remove the NOSPAM for a direct answer)
From: Yann on
Do you mean you want to create a Library Command which can be
triggered using the Library menu only,
but not called by any UserRPL program, including any direct call on
the stack ?


In that case, you may separate your library program into 2 parts
(visible - invisible).
The visible part (with the name) is only there for :
1) checking that the triggering is valid.
Typical example :
- the library menu is the current menu,
- the key corresponding to the library command has been pressed
- return stack has no reference to an ongoing ID program
- etc.
2) if ok, then call the invisible part, which starts the real job.

The invisible part, of course, will remain unaccessible from UserRPL.


Regards
Yann
From: andreas_moellerNOSPAM on
Hi Yann,

that could do the job I need.

Do you mind giving an example ?

Regards,
Andreas

From: Yann on
by the way, i was thinking :

there might be a more straightforward
by going the Assembler route
and testing directly if the expected key is being pressed
right at the start.

Normally, this should be fast enough to not even be noticed by the
user.

Do you have some experience at programming in saturn assembler ?
From: andreas_moellerNOSPAM on
Hi Yann,

> Do you have some experience at programming in saturn assembler ?
Yes, one could say though although I did not bother much with key
input/output so far.

> and testing directly if the expected key is being pressed
> right at the start.
Hmm, the key could be any of the six soft menu keys and also the
command name could be entered through the command line.

Easiest is to use the sNAME directive and add an invisible space
character at the end like
sNAME NameIt NameIt\20

So the real name of the xNAME would be NameIt\20 which can not be
entered and the command line parser will always create NameIt from it
which is not the ROMPTR.

However, no message is generated, like "not allowed as a command" or
whatever.

Thanks for you thoughts, if you come up with a ML solution I would be
most interested.

Regards,
Andreas