Post Reply 
string to variable
04-24-2014, 01:38 AM
Post: #1
string to variable
in a program can you convert a string into a variable?
Find all posts by this user
Quote this message in a reply
04-24-2014, 01:40 AM
Post: #2
RE: string to variable
Sure, if you initialize it to some value you can.

Code:

LOCAL mystring:="MyVar";

mystring:=mystring+":=0"; // mystring = "MyVar:=0"
CAS(mystring);

This creates a CAS variable named MyVar with an initial value of 0.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-24-2014, 02:06 AM
Post: #3
RE: string to variable
Thank you very much

Smile))))
Find all posts by this user
Quote this message in a reply
04-30-2014, 09:57 AM
Post: #4
RE: string to variable
An other way for this (in a CAS-Program) is

#("ABC_"):=4711;

This creates the global CAS-Variable ABC_ with value 4711. Of course this is also possible with a variable which contains a string:

#CDE_:=4712;

creates the global CAS-Variable ABC_ with value 4712, if the variable CDE_ has the value "ABC_".

OldHPUser
Find all posts by this user
Quote this message in a reply
Post Reply 




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