Post Reply 
Programs()
12-28-2014, 07:29 AM
Post: #1
Programs()
Hello.
After updating my machine from a PC running Windows 8, a small modest example of the use of the new command Programs ().
Code:

EXPORT Exist(n)
BEGIN
 SIGN(POS(Programs(),n));
END;
Find all posts by this user
Quote this message in a reply
12-28-2014, 04:51 PM
Post: #2
RE: Programs()
Programs(), returns the list of programs, ideal to keep on rewriting a program by accident, but it would be better to define a working directory

FOLDER myProject

EXPORT Exist(n)
BEGIN
SIGN(POS(Programs(),n));
END;

END;
-----------------

Sample the use of the function Programs()

EntryLine

Exist("Exist") [ENTER] returns 1 (true found )

Exist("abcdee") [ENTER] returns 0 ( false not found )

Request for the HPPrime team

If the argument is ("HOME") to return the list of programs type HOME, if the argument is ("CAS") return the list of programs type CAS

Programs("HOME") [ENTER] { .... }

Programs("CAS") [ENTER] { .... }
Find all posts by this user
Quote this message in a reply
12-29-2014, 06:09 AM (This post was last modified: 12-29-2014 06:15 AM by bobkrohn.)
Post: #3
RE: Programs()
Thanks
This doesn't show up in the Catalog on my machine.
Had to play with it to discover that it generates a List.

"Programs()" works from Home and creates a List

But for some reason the program code example did not work on my machine using RUN in Program Editor.
I tried using program name in quotes and without
Works from Home when used as a Function call and keyed in directly though.
Find all posts by this user
Quote this message in a reply
12-29-2014, 07:51 AM
Post: #4
RE: Programs()
(12-29-2014 06:09 AM)bobkrohn Wrote:  But for some reason the program code example did not work on my machine using RUN in Program Editor.
I tried using program name in quotes and without
Works from Home when used as a Function call and keyed in directly though.
See the remark at the end of Part II - section 1 of HP Prime Programming: An Introduction.
Find all posts by this user
Quote this message in a reply
12-29-2014, 08:28 AM
Post: #5
RE: Programs()
I'm not following or seeing the relevance the citation you point out.

Using RUN in Program Editor list of programs, it will pop up an Input Box for the variable "n".
Input Box does not allow text entry as in "MyProgram".
It doesn't make any sense to me but may be yet another big BUG in HP Prime.
Find all posts by this user
Quote this message in a reply
12-29-2014, 09:12 AM
Post: #6
RE: Programs()
(12-29-2014 08:28 AM)bobkrohn Wrote:  Using RUN in Program Editor list of programs, it will pop up an Input Box for the variable "n".
Input Box does not allow text entry as in "MyProgram".
This is exactly what is explained in the text I pointed out, using RUN in Program Editor you can enter only real numbers as inputs to your program:
Quote:Remark: When a program which takes arguments is executed from the Run menu option in the Program Catalog, then the argument variables are initialized to real numbers, and have a default value of 0. While this feature is nice in that it allows users to enter their arguments in a nice input form, the input form will only accept real-valued inputs and produce input errors otherwise. So while PROG1 was designed to expect a string of characters as its input, executing it from the Run menu option prevents users from actually using a string as an argument!
Find all posts by this user
Quote this message in a reply
12-30-2014, 12:49 AM
Post: #7
RE: Programs()
Oh, OK when it's explained as you have done it's clear now.
Thank You.
Find all posts by this user
Quote this message in a reply
12-30-2014, 12:59 AM
Post: #8
RE: Programs()
(12-29-2014 09:12 AM)Didier Lachieze Wrote:  This is exactly what is explained in the text I pointed out, using RUN in Program Editor you can enter only real numbers as inputs to your program:

Dang! Thought that had been fixed already. :-(

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
12-30-2014, 06:19 AM
Post: #9
RE: Programs()
It's certainly not an intuitive "feature".
Find all posts by this user
Quote this message in a reply
Post Reply 




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