Post Reply 
How to save a CAS program
07-29-2014, 06:36 AM
Post: #3
RE: How to save a CAS program
(07-29-2014 05:08 AM)Helge Gabert Wrote:  If I try to initialize local variables with the STO key in a CAS program, the program doesn't even compile.

I can change that to :=, e.g., LOCAL a:= 1; the program compiles and runs OK (even multiple times), as long as I don't open the program for editing. Once I try to edit the program, the line now reads LOCAL a; and running the same program as before returns "uninitialized local variable."

So it seems to me that you have to assign values to your local variables on separate lines.

The loss of the LOCAL assignments in CAS programs is a known bug. As you mention, the workaround is to declare them first, then assign their values in subsequent lines.

(07-29-2014 05:08 AM)Helge Gabert Wrote:  Do you even need the local statements? My programs seem to run fine without them.

I suggest not omitting the LOCAL declaration. Doing so is a Bad Thing (even though the program will run), because (1) if that variable already exists as a global CAS variable, then its contents will silently be blown away by your program, which would be most unfortunate if that variable contains a CAS program or anything else you don't want silently blown away, and (2) if the variable does not already exist as a global variable, then it will be created as a global CAS variable, and thus clutter up your CAS variable list and waste memory.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How to save a CAS program - Alberto Candel - 07-24-2014, 05:55 PM
RE: How to save a CAS program - Joe Horn - 07-29-2014 06:36 AM
RE: How to save a CAS program - Thomas_Sch - 07-29-2014, 02:19 PM
RE: How to save a CAS program - Joe Horn - 07-30-2014, 08:31 AM
RE: How to save a CAS program - Thomas_Sch - 07-30-2014, 08:55 AM
RE: How to save a CAS program - parisse - 07-30-2014, 03:22 PM
RE: How to save a CAS program - Thomas_Sch - 07-30-2014, 08:17 PM
RE: How to save a CAS program - parisse - 07-31-2014, 07:48 AM
RE: How to save a CAS program - Thomas_Sch - 07-31-2014, 11:47 AM
RE: How to save a CAS program - debrouxl - 07-30-2014, 05:47 PM



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