Hello Guest it is March 28, 2024, 02:02:00 PM

Author Topic: passing variable values from macro to macro , using parameters?  (Read 6390 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: passing variable values from macro to macro , using parameters?
« Reply #10 on: April 27, 2015, 04:12:00 PM »
#vars 500 -600 are persistance (saved to the XML) on shutdown. The value should be there when you start up again.
IF you want a VAR that clears back to NILL on shut down use any other VAR. On shut down it is NOT saved and will be NILL when you start up again.

IF you need the Nill Var to be populated on start then in the initiation string add the code

#300 = 1    That will set the var #300 to 1

(;-) TP



Re: passing variable values from macro to macro , using parameters?
« Reply #11 on: April 27, 2015, 05:01:09 PM »
Thanks, that sounds simpler still.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: passing variable values from macro to macro , using parameters?
« Reply #12 on: April 27, 2015, 05:08:35 PM »
#vars 500 -600 are persistance (saved to the XML) on shutdown. The value should be there when you start up again.
IF you want a VAR that clears back to NILL on shut down use any other VAR. On shut down it is NOT saved and will be NILL when you start up again.

IF you need the Nill Var to be populated on start then in the initiation string add the code

#300 = 1    That will set the var #300 to 1

(;-) TP



Re: passing variable values from macro to macro , using parameters?
« Reply #13 on: April 27, 2015, 05:38:35 PM »
Terry, you're stuttering. :)
Re: passing variable values from macro to macro , using parameters?
« Reply #14 on: April 27, 2015, 06:17:38 PM »
Just as a heads up, if you declare a variable as a global or Public (Static x as Double or Public x as Double)it will exist outside of a procedure(macro), any variable declared (Dim x as Double) inside a sub will always only exist within the sub. This is Visual Basic std operating procedure, so I would assume( is this going to make an ASS of U and ME ;-) ) it would stand true with Cypress as well.
Eg
' Your code here
Public x as double
' exists everywhere
Sub
' Your code here
Dim x as Double
' Only exists here
End Sub

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: passing variable values from macro to macro , using parameters?
« Reply #15 on: April 27, 2015, 08:01:04 PM »
HUM,  I believe that even a public variable ceases to exist when you  end the script in CB.

(;-) TP
Re: passing variable values from macro to macro , using parameters?
« Reply #16 on: April 27, 2015, 10:40:02 PM »
Ouch. ;-) , I'll do some research.
Re: passing variable values from macro to macro , using parameters?
« Reply #17 on: April 27, 2015, 11:04:14 PM »
This is from the Cypress FAQ section
Can I reference variables in my applications? Cypress Enables sports a well designed powerful API that allows global variables to be referenced directly or to be set and the values retrieved as needed.

My understanding / interpretation on this would be that a Global  can be set then called later, however it shouldn't persist on shutdown unless the variable is stored in a DLL or exe variable. I.e. A DRO.