variable name characters allowed.
|
11-15-2017, 11:50 AM
Post: #1
|
|||
|
|||
variable name characters allowed.
Is there a way to know what characters can be used in a variable name and also as the first character in the name. e.g. V_1 is a valid variable name, but _V1 is not. Also, there are "other" characters from the Char key that are allowed, but I don't know how to tell which ones are valid. e.g. %1 is valid, but $1 is not. Likewise some of the odder characters like the w omega character is valid, and others are not. I test them by trying them out.
Anyway, if anyone knows whats valid in the name and also what is valid for the first character...please let me know. Note that while I can use regular alpha chars, I was thinking there might be uses in obfuscation for those who want to protect their program code. |
|||
11-15-2017, 02:48 PM
Post: #2
|
|||
|
|||
RE: variable name characters allowed.
The HP Prime User Guide says this: "The name of a variable must be a sequence of alphanumeric characters (letters and numbers), starting with a letter. Names are case-sensitive, so the variables named MaxTemp and maxTemp are different."
<0|ɸ|0> -Joe- |
|||
11-15-2017, 06:47 PM
Post: #3
|
|||
|
|||
RE: variable name characters allowed.
Yet %1 is not alpha numeric and there are other weird characters that are not alphanum, like a zeta with a circle at the center....from the Char button.
|
|||
11-15-2017, 06:52 PM
Post: #4
|
|||
|
|||
RE: variable name characters allowed.
%1 doesn't work in [CAS].
|
|||
11-15-2017, 07:10 PM
Post: #5
|
|||
|
|||
RE: variable name characters allowed.
That's interesting. I can do %1:=1 in Home, but not in CAS and when defined in Home, to try to read %1 in CAS doesn't work, but it does in HOME.
|
|||
11-16-2017, 05:52 AM
Post: #6
|
|||
|
|||
RE: variable name characters allowed.
Hello,
Here is the code that identifies an identifier (var names and the like) Code:
Cyrille[/code] Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
11-16-2017, 06:13 AM
Post: #7
|
|||
|
|||
RE: variable name characters allowed.
Ah, interesting....of course! It's unicode. I forgot about that. Thanks Cyrille.
-Donald |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)