Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass variables to commands
#1
Hello,

It is possible to pass the contents of a variable to a QM command.

For example, I use this code to provide a menu selection:

Code:
Copy      Help
str CASTLEmenuCSV=
; CASTLE Account Request, "CASTLE - Account Request"
; CASTLE Application Issue, "CASTLE - Application Issue"
; CASTLE Login Issue, "CASTLE - Login Issue"
; CASTLE Password Reset, "CASTLE - Password Reset"
; CASTLE Unlock Account, "CASTLE - Unlock Account"
ICsv c=CreateCsv(1); c.FromString(CASTLEmenuCSV)

MenuPopup m
int i
for i 0 c.RowCount
    m.AddItems(c.Cell(i 0) i+1)
i=m.Show
str CASTLEmacro=c.Cell(i-1 1)
if(!CASTLEmacro.len) CASTLEmacro=c.Cell(i-1 0)

Is it possible to use the value of the variable CASTLEmacro to execute a goto or return command?

Whytewhysper
#2
With goto cannot be used variable. With return can, but the function must be declared as returning this type.

function'str
str s="test"
ret s


Forum Jump:


Users browsing this thread: 1 Guest(s)