Jump to content

AddGlobals()


Recommended Posts

The scripting action AddGlobals() only works for "GLOBAL" variables. This action does nothing for "LOCALS" or "MYAREA" or any other type of variable that is not a "GLOBAL" variable.
This example from the IESDP works

IF
  Global("Var1","GLOBAL",0)
THEN
  RESPONSE #100
    SetGlobal("Var1","GLOBAL",75) //Var1 = 75
    SetGlobal("Var2","GLOBAL",25) //Var2 = 25
    AddGlobals("Var1","Var2") //Var1 = 100
END
But this does not:


IF
  Global("Var1","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("Var1","LOCALS",75) //Var1 = 75
    SetGlobal("Var2","LOCALS",25) //Var2 = 25
    AddGlobals("Var1","Var2") //Var1 will still be set to 75
END
Edited by Galactygon
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...