Author Topic: Global variables  (Read 10884 times)

hubieg

  • Guest
Global variables
« on: March 22, 2005, 07:34:50 AM »
Thanks for the info on the ASCII question I posted yesterday!
My next question concerns the usage of variables.

Are variables declared in a function "local" to that function or can they be used in other functions after they've been defined? What I would like to do is define the variables to be used in all the functions on the first scan and then use them throughout the program.
Can I do it like this or must I define them in each user function.

Thanks,
Todd

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Global variables
« Reply #1 on: March 22, 2005, 05:49:29 PM »
In TBASIC currently you can't define your own local variables. All variables used have pre-defined names and they are all global variables and accessible from any custom functions.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS