Wednesday, 2 July 2014

iLogic - Transfer a variable to a Sub routine

I discovered this one today, as I wanted a nice clean script, but I just could not pass a variable between my Sub Routines within iLogic.

I am pretty pleased with this, and will now try and make use of in other scripts.

Sub Main()
Dim oNewParam as String
Blah blah ... stuff in the script
Call NextSubRoutine (oNewParam)  'This is the important stuff - The bit in the brackets.
End Sub

Sub NextSubRoutine (ByRef oNewParam as String'NOTE: The bit in the brackets.
MessageBox.Show(oNewParam, "Variable transferred from the Main Sub")
blah blah ... stuff in the script
End Sub

No comments:

Post a Comment