is there a way to change the cas check in an existing program - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: is there a way to change the cas check in an existing program (/thread-8683.html) |
is there a way to change the cas check in an existing program - webmasterpdx - 07-14-2017 09:38 AM If I already have a program and I didn't set the CAS checkbox when I created it and I now wish to do so. Is there a way to do that and change the program to be a CAS program without having to create a new program? Thx -Donald RE: is there a way to change the cas check in an existing program - Didier Lachieze - 07-14-2017 10:23 AM Some links about the CAS programming and interaction between Home and CAS that you may find useful: Much more links about the Prime have been compiled by jebem here. RE: is there a way to change the cas check in an existing program - webmasterpdx - 07-14-2017 10:54 AM Thank you....these are really useful links with some info I didn't have before. However, they don't address if I can mix a #cas type program with a conventional EXPORT type program in the same program document. Is that possible....i.e. to have a home program and a cas program in the same program document? Thx -Donald RE: is there a way to change the cas check in an existing program - Didier Lachieze - 07-14-2017 11:45 AM (07-14-2017 10:54 AM)webmasterpdx Wrote: Is that possible....i.e. to have a home program and a cas program in the same program document?Yes, this is called the hybrid approach in the first link. RE: is there a way to change the cas check in an existing program - Arno K - 07-14-2017 11:47 AM I think you mean something like: Code: #cas Arno RE: is there a way to change the cas check in an existing program - webmasterpdx - 07-15-2017 12:51 AM Thank you very much. RE: is there a way to change the cas check in an existing program - cyrille de brébisson - 07-18-2017 07:00 AM 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 |