Post Reply 
HPPPL: How to get String input
07-15-2018, 09:11 PM
Post: #1
HPPPL: How to get String input
I noticed that the INPUT function only input numbers because if I try to input anything other than numbers, I get an error. I'm curious how to get a String input?
Find all posts by this user
Quote this message in a reply
07-16-2018, 02:05 AM
Post: #2
RE: HPPPL: How to get String input
Here's an example:

PHP Code:
EXPORT eraseme()
BEGIN
 local x
;
 
INPUT({{x,[2]}},"title","label","help","reset","initial");
 
x;
END

-road
Find all posts by this user
Quote this message in a reply
07-16-2018, 06:44 AM
Post: #3
RE: HPPPL: How to get String input
Hello,

the [2] here forces the type for the user input to be a string (TYPE("bla") -> 2)...
Since the ONLY allowed type allowed here is 2, then the input will be shown WITHOUT the quotes and save directly as a string in the local variable (A-Z globals can only contain reals)...

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 




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