I just started to learn MQ, and then theres a change in syntax. Since i havent found any macro thats following the new way too the fullest, i would like some help with syntax.
Most of the time im writing my macros, i dont have any EQ to use and debugg them, therefore i could use some help with the syntax.
Dont bother with the paranthentis, what i wonder is how to syntax work.
Code: Select all
/* The old way
Sub Main
/declare IamBad global
/declare MyCrapArray Array
/declare ArrayCore global
/declare counter global
/varset IamBad 1
/varset MyCrapArray(0) 00
/varset MyCrapArray(1) 10
/varset MyCrapArray(2) 20
/varset MyCrapArray(3) 30
/varset MyCrapArray(4) 40
/varset MyCrapArray(5) 50
/varset ArrayCore 5
/if (@IamBad==1){
/for counter 0 to @ArrayCore
/if (${Time.Minute}==@MyCrapArray(@counter)) {
/echo "it worked!!"
}
else {
/echo "crap, wrong minut"
/Delay 30s
/next counter
}
}
/return
/endmacro
Code: Select all
/* The new way
Sub Main
/declare IamBad int outer
/declare ArrayCore int outer
/declare counter int outer
/declare MyCrapArray[6] int
/varset IamBad 1
/varset MyCrapArray[1] 00
/varset MyCrapArray[2] 10
/varset MyCrapArray[3] 20
/varset MyCrapArray[4] 30
/varset MyCrapArray[5] 40
/varset MyCrapArray[6] 50
/varset ArrayCore 6
/if (${IamBad }==1){
/for counter 1 to ${ArrayCore}
/if (${Time.Minute}==${MyCrapArray}[${counter}]) {
/echo "It worked"
}
else {
/echo "Crap, wrong minut"
/Delay 30s
/next counter
}
}
/return
/endmacro
