I've gone through the system documentation and managed to confuse myself and I'm hoping someone might have the inclination to help me out. Here is a simple part of the combine.mac that I've been successful in implementing, at least enough to know that it works fine, however in picking it apart to understand how MQ works in general, I've come across a gaping hole in my basic understanding......MQ variables.
1. Sub FindCombiner
2. /varset v10 99
3. /for v99 0 to 7
4. /if "$pack($v99,combine)"=="$p0" /varset v10 $v99
5. /next v99
6. /return $v10
In line 2. is a variable named v10 created with an initial value of 99? Or is a variable v99 created to be used as a step counter for the /for .. /next loop?
Assuming a variable named v99 is created, and the /for command initializes it's value at 0 in line 3., in the /if statement $v99 is used to identify the position in which a pack might be. Does $v99 represent the value in variable v99? Is it a string literal substitution for the variable? And then if the /if evaluates TRUE the variable v10 is set to the value in v99?
As you can see, I'm confused I guess as the way the /varset command is working and the way the values in a variable are being represented. I think I understand what ultimately is happening, this subroutine is locating the pack with the name specified in the first pass variable on the command line ("$p0"?), and then returning the inventory position that pack is in. I'm just a tad confused about how it's doing it.
If anyone has a chance to step through these 6 lines and let me know specifically what is happening, I'd be very appreciative.
