Post Reply 
newRPL - Updated to build 1510 [official build remains at 1487]
07-29-2023, 10:33 PM (This post was last modified: 07-29-2023 10:36 PM by Claudio L..)
Post: #293
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-29-2023 08:01 PM)Gilles Wrote:  Hello, I have some questions about the CRLIB command:

1/ When the name of the command is long and truncated in the menu, it is useful to display the complete name of the command with the "help long press". It works like this for internal commands. But is it possible to do it in a library?

My apologies for not having complete documentation written on the wiki for CRLIB. The good news is I don't need to apologize for not supporting what you want to do because $VISIBLE is quite advanced. All you have to do is for any item you would normally have in the list, replace it with an inner list like this:
// $VISIBLE HAS THE FOLLOWING FORMAT:
// { { IDENT NARGS ALLOWINSYMB HELPTEXT } { IDENT NARGS ALLOWINSYMB HELPTEXT } ...

This gives the compiler a lot of extra info about your commands. 'IDENT' is the command name obviously, NARGS is the number of arguments it expects on the stack, this is needed for the compiler to issue an error when you use the command within a symbolic like MYCOMMAND(x,y,z). ALLOWINSYMB is a true/false, whether you want to make your command exist as a function (it has to return something that is valid within a symbolic object, of course or it will cause errors when evaluating the expression).
And last but not least is what you were looking for: HELPTEXT is a string in the same format as the help of the standard commands (a 3-line string where the first two lines are typically a description and the third one is a stack diagram.
The stack diagram follows a weird syntax I came up with (could be better but...):
Code:

@ Stack diagram symbols:
@ I = Integer number
@ R = Real number
@ Z = Complex number
@ S = String
@ L = List
@ U = Unit object
@ V = Vector
@ M = Matrix
@ N = Variable name
@ O = Any object
@ P = Program
@ A = Algebraic object (symbolic)
@ A description or usage for the symbol may be included in <...> following the symbol

For example:
Code:

USBRECV @@ (this is the command name for the example, not part of the string so ignore this line)
"Receive an object, timeout
after given time
R<time> → O I<T/F>"

So it takes a real number <time> and returns any object (whatever came thru the wire) and an integer representing TRUE or FALSE.
As for the description, you need to break the lines thinking of the 50g screen width, it won't break the lines for you.

2/ It's great that auto-completion works with add-on libraries. Cheer!

(07-29-2023 08:01 PM)Gilles Wrote:  3/ Is there a build 1497 ou 1510 for Windows ? I dont find them and I would like to use the FORUP and FORDN loops to avoid some tests.

I typically only do the Windows executables for the official builds, can't promise anything but I'll see if I have time and can move the official version forward, it's probably overdue anyway.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Navigating through sub-menus - Gilles - 05-13-2023, 11:31 AM
RE: newRPL - Updated to build 1510 [official build remains at 1487] - Claudio L. - 07-29-2023 10:33 PM
It's a mystery to me... - Klaus - 11-27-2023, 12:24 PM



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