Post Reply 
Variables global to a program
12-22-2013, 05:51 AM (This post was last modified: 12-22-2013 06:21 AM by Michael de Estrada.)
Post: #10
RE: Variables global to a program
(12-22-2013 04:43 AM)Han Wrote:  
Code:

MYVAR;

EXPORT TEST()
BEGIN
  MYVAR:=MYVAR+1;
END;

Run TEST() a few times.

Wow ! So, if you fail to explicitly initialize variables that are used as counters you will get unpredictable results. Also, I created a second program TEST1() in a separate program group with MYVAR; and it started at 1 and is not in sync with the MYVAR in TEST(). So, the variable name is not unique, and values are being stored at different locations. This is crazy.

Also, if I change the variable name to say MYVAR1, it resets to zero and increments again. Just for yucks, I did a soft reset (On Symb), but it did not reset these values. I've never encountered any programming languages that worked like this, and am having a hard time understanding the purpose if any.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Variables global to a program - Bob Frazee - 12-22-2013, 01:09 AM
RE: Variables global to a program - Han - 12-22-2013, 03:56 AM
RE: Variables global to a program - Han - 12-22-2013, 04:43 AM
RE: Variables global to a program - Michael de Estrada - 12-22-2013 05:51 AM
RE: Variables global to a program - Han - 12-22-2013, 02:06 PM
RE: Variables global to a program - Snorre - 12-22-2013, 11:56 AM
RE: Variables global to a program - Han - 12-22-2013, 03:52 PM



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