HP Forums
Is it possible to attach some text help to my user functions. - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Is it possible to attach some text help to my user functions. (/thread-10162.html)



Is it possible to attach some text help to my user functions. - John P - 02-13-2018 06:17 PM

Is it possible to attach some text help to my user functions. The user functions in HP Prime now appear in italics in the main Catlg.


RE: Is it possible to attach some text help to my user functions. - salvomic - 02-13-2018 07:32 PM

(02-13-2018 06:17 PM)John P Wrote:  Is it possible to attach some text help to my user functions. The user functions in HP Prime now appear in italics in the main Catlg.

yes, the user functions appear in italics in the Catalog and I think this is a great thing, very useful to see if a user function have (erroneously) the same name of a system one and for other reason.
Still is not possible to attach some help (besides the comments //). I do hope in a next version to have a way to get a help to show in the Catalog pressing on the user name function.
In the present FW it isn't possible.

Salvo


RE: Is it possible to attach some text help to my user functions. - Han - 02-15-2018 07:01 PM

Have you considered created a wrapper (CAS) program that checks the arguments?

Code:

#cas
myprog(args):=
BEGIN
  local s:=SIZE(args);
  CASE
    IF s==0 THEN
      // code for when no arguments supplied
      // presumably here is where you can display some help text or even
      // just return a string with some info on how to use the command
    END;
    IF s==1 THEN
      // code for when a single argument is supplied
      // or simply call another program:
      RunMyHOMEProg(args);
    END;
  END;
END;
#end



RE: Is it possible to attach some text help to my user functions. - John P - 02-15-2018 08:08 PM

(02-15-2018 07:01 PM)Han Wrote:  Have you considered created a wrapper (CAS) program that checks the arguments?

Code:

#cas
myprog(args):=
BEGIN
  local s:=SIZE(args);
  CASE
    IF s==0 THEN
      // code for when no arguments supplied
      // presumably here is where you can display some help text or even
      // just return a string with some info on how to use the command
    END;
    IF s==1 THEN
      // code for when a single argument is supplied
      // or simply call another program:
      RunMyHOMEProg(args);
    END;
  END;
END;
#end

Thank you Han, it seams convincing and should work. I will try it.
Cheers