Inputting a string.
|
02-16-2022, 09:11 PM
Post: #1
|
|||
|
|||
Inputting a string.
Is there a way to have an INPUT variable recognised as a string?
I was writing a program that required the leading zeros to be retained and thought that if I could input it as a string, then I could manipluate it the way I want earlier. If I input 07021999 as a number variable, then it becomes 7021999 instantly. Also, if I just had to input a name for example, obviously it would just be useful to be able to input letters instead of numbers. |
|||
02-16-2022, 09:44 PM
Post: #2
|
|||
|
|||
RE: Inputting a string.
(02-16-2022 09:11 PM)matalog Wrote: Is there a way to have an INPUT variable recognised as a string? INPUT({{A1,[2]}}) will expect a string for variable A1. The [2] determines the datatype of string. [-1] means all types are allowed. See the manual for other types. Tom L Cui bono? |
|||
02-16-2022, 10:00 PM
Post: #3
|
|||
|
|||
RE: Inputting a string.
Yes it is possible, also described if you put INPUT on the command line and press help. But I have to admit, that it is not so easy to be understood.
Code: Syntax: For your required input you need the second more complex form. Don't worry it's not overly complicated.
You may of course add some bells and whistles, but start it simple HTH Günter |
|||
02-16-2022, 11:35 PM
Post: #4
|
|||
|
|||
RE: Inputting a string.
That's great thanks guys. I don't realy understand how you got all of that information from the Help entry on the calc.
Where are the various allowed types identifier numbers listed? I can see that -1 will allow all, but where does it state that type 2 will be a definite string? |
|||
02-16-2022, 11:54 PM
Post: #5
|
|||
|
|||
RE: Inputting a string.
(02-16-2022 11:35 PM)matalog Wrote: That's great thanks guys. I don't realy understand how you got all of that information from the Help entry on the calc. Help is your help ..not always but.. Toolbox ,"Type" help et Voilà Günter |
|||
02-17-2022, 02:36 AM
Post: #6
|
|||
|
|||
RE: Inputting a string.
(02-16-2022 11:35 PM)matalog Wrote: That's great thanks guys. I don't realy understand how you got all of that information from the Help entry on the calc. Page 657 of the User Guide has all the types: Code: TYPE Tom L Cui bono? |
|||
02-17-2022, 02:45 PM
Post: #7
|
|||
|
|||
RE: Inputting a string.
Not to forget the manual: https://www.hpcalc.org/prime/docs/hpprimeug.zip . It is a bit outdated but still helpful.
Arno |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)