WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Variables and Parameters

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Define Global Variables and Constants

Keywords:     Define Global Variables and Constants 

Question:

My question has to do with, for example, being able to define global Errror Codes and using them inside User Define Functions.

Answer:

Make a defined subbroutine like
#DefineSubroutine InitConstants()
   a=5
   b=6
   c=7
   d=8
   return
#EndSubroutine
Then in the main script AND inside EACH #DefineFunction that needs them just add a
InitConstants()
line to define the constants. Note that the constant definition MUST be a #DefineSubroutine, NOT a #DefineFuntion.
Article ID:   W15347
File Created: 2002:09:05:13:51:24
Last Updated: 2002:09:05:13:51:24