Post Reply 
is there a way to change the cas check in an existing program
07-18-2017, 07:00 AM
Post: #7
RE: is there a way to change the cas check in an existing program
Hello

"They don't address if I can mix a #cas type program with a conventional EXPORT type program in the same program document."

You can do this, but it might help to understand the subtle differences between home and CAS programs.

In home, Each program is a separate entity that contains it's global variables and functions (exported or not). A program can also be attached to an app. Programs are a grouped entity of object that, in some ways, know about each others...

in CAS, programs are just a chunk of text which gets parsed and evaluated at compile time (when the calculator starts and/or when you change a program text). This chunk of text can change/alter the CAS global state by changing setting and creating/updating global variables (remember that in the CAS, functions (as in a user program function) is a sequence of instruction that is stored in a global variable).

Thus, in HOME, if you declare a global variable, this global variable is "local" to this program, and 2 different programs can declare 2 non-conflicting global variable (or functions) with the same name without conflicts and issues. Not so much in the CAS where global variables re CAS global and not program global. So 2 cas programs can conflict with each others!

This being taken into concideration, you can create a mixed CAS/Home "program" (as in a source code that contains both home and CAS stuff) by using the #cas #end pairs as many times as you want.

Note that the stuff in between the #cas/#end gets parsed AND EVALUATED as soon as the #end is met!
This means that any symbols created in this area (even if they are created programmatically) are valid for the parsing of the following HOME code!

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 


Messages In This Thread
RE: is there a way to change the cas check in an existing program - cyrille de brébisson - 07-18-2017 07:00 AM



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