Confused about LOCAL....
|
11-17-2017, 04:04 PM
Post: #10
|
|||
|
|||
RE: Confused about LOCAL....
(11-16-2017 06:04 AM)webmasterpdx Wrote: Cyrille, my understanding (and this is what the documentation says) is that a program global is EXPORT A; outside of a function. To answer your question directly: YES. In the specific case when you try to declare a LOCAL variable OUTSIDE of any function AND using an existing system variable name, you will get a compile error. Now, if you had a different program file (say, PROG1) that declared EXPORT MYVAR1; and within yet another program file (named PROG2) you declared EXPORT MYVAR1, you will NOT get a compile error. The program will (I have not tested this) use the correct MYVAR1 since at compile time it creates reference links to variables and functions. However, if you try to access MYVAR1 from outside the program (i.e. via command line to perhaps modify the content of MYVAR1), then the MYVAR1 that was last compiled is what gets referenced. In order to reference the correct MYVAR1, you need to qualify them with the program file name: PROG1.MYVAR1 or PROG2.MYVAR2 The ambiguous behavior only occurs when you use the (ambiguous) shorthand names to reference the variables. Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Confused about LOCAL.... - webmasterpdx - 11-15-2017, 06:19 AM
RE: Confused about LOCAL.... - Dirk.nl - 11-15-2017, 12:18 PM
RE: Confused about LOCAL.... - webmasterpdx - 11-15-2017, 07:02 PM
RE: Confused about LOCAL.... - cyrille de brébisson - 11-16-2017, 05:57 AM
RE: Confused about LOCAL.... - Carlos295pz - 11-16-2017, 06:43 AM
RE: Confused about LOCAL.... - webmasterpdx - 11-16-2017, 06:04 AM
RE: Confused about LOCAL.... - Carlos295pz - 11-16-2017, 06:55 AM
RE: Confused about LOCAL.... - Tim Wessman - 11-16-2017, 05:13 PM
RE: Confused about LOCAL.... - cyrille de brébisson - 11-17-2017, 06:20 AM
RE: Confused about LOCAL.... - Han - 11-17-2017 04:04 PM
|
User(s) browsing this thread: 1 Guest(s)