Contents | Index | < Browse | Browse >

 INTERNAL VARIABLES :
 =============================================================

 Internal variables do what functions would in other languages.
 They are there, so you can get various information about the
 system and the guis running. You can *not* set them - only read 
 them.

 They can be accessed by placing a double dollar sign in front of
 them :

   > curdir = $$G4C.DIR

   for example, will store the name of the current dir Gui4Cli is
   at, in variable "curdir".

   These are the currently defined  Internal Variables 

 It is very important to understand how internal variables work,
 before using them extensively. Internal variables always try to
 show the values of the last thing that happened. You can, if you
 need these values later, store them into variables, as they are
 going to change the next time something happens.

 Gui4Cli works in "Command Execution Cycles" 
 (Sounds much more impressive than it is :)

 This means that it sits around waiting for an event to happen,
 like the clicking of the mouse, a keypress etc..

 When such an event happens, if it is declared in the gui it
 happens in, the commands attached to this event start executing.
 Gui4Cli may, while executing, jump to subroutines in other files,
 come back etc and it will finally stop. That's the end of the
 "command execution cycle" - The DEBUG mode will show this
 clearly.

 All the internal variables below, will (unless otherwise stated)
 remain valid throughout the life of such a cycle. Thereafter the
 user might have done anything and you can't be sure that the
 values are correct.

 For example, when a button is hit, the GAD.L etc values will be
 correct for that button, throughout the life of a command
 execution cycle (unless you issue an INFO command and thereby
 change the gadget that Gui4Cli thinks of as "current")

 When something else happens, the above values are history. The
 values returned will be the ones of the new event.

 example : (file name = test.gc)
 ; Slider (gadget No 1) has a width of 100
 xHSlider 10 10 100 15 Title Var 0 100 50 %2ld
 gadID  1

 ; button (gadget No 2) is 200 pixels wide
 xButton 10 50 200 50 button2
 gadID  2
 ; here $$GAD.W = 200 i.e. the width of the button we clicked
 ; now we tell Gui4Cli that we want information on the slider
 Info GAD test.gc/1
 ; now $$GAD.W = 100 - i.e. the width of the slider

 Only the User (through his actions) or the INFO command will 
 ever change the value of a variable.

 --------------------------------------
 HOW GUI4CLI SEES INTERNAL VARIABLES :
 --------------------------------------

 In order to make these functions as fast as possible, the
 checking of the variable names is done only by checking the
 first 1-2 letters.

 So :
 - $$SYS.Time - can also be written as $$SYS.T or $$SYS.TeriyakiSauce
   and Gui4Cli wouldn't know the difference.

 The checking is done on as many letters as it takes to avoid
 any possible conflict between variable names, so, for example
 $$sys.date and $$sys.day have the 1st 3 letters checked.

 You should *not* however depend on this behaviour, since other
 conflicting vars may be added later..