PPL programming question; local variables
|
02-13-2014, 04:28 PM
(This post was last modified: 02-13-2014 07:15 PM by Han.)
Post: #10
|
|||
|
|||
RE: PPL programming question; local variables
(02-13-2014 02:53 PM)CR Haeger Wrote: Han, thank you again for the reply and the informative articles. They are really helpful for me to start PPL programming. In terms of priority, the angle1 and angle2 variables within THIRDANG() have higher priority over angle1 and angle2 declared toward the top. Unlike app variables, which can be fully named via Appname.variablename, there is no mechanism to reference the angle1 and angle2 declared outside of a procedural block if you also use local variables of the same name within said procedural block. In general, a local variable declared inside a procedural block will have highest priority. You can confirm this with (updated): Code:
If you run MYPROG(-1,-2) then you will see that MYPROG prints -1,-2 even though var1 and var2 were initialized to 1 and 2 respectively. Moreover, the var1 and var2 values declared outside of MYPROG are still retained (they are distinct from those declared within the definition of MYPROG. Hence SUBPRG prints 1, 2. Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)