
How-to Passing Parameters to a goSub
One of the issues I deal with is the inability to pass parameters for certain scripts to a goSub. An example of a workaround is below, but it is just typed in and not tested. It is a simple right side padding gosub, and does have a limitation in that you must know how many words are in it - this version anyway

I will leave it up to you to figure out what my actual version is where it doesn't require any previous word count knowledge since it is easy to do.
There are scripts out that do this already, most bots for instance, but for a new scripter writing their first scripts w/o coding knowledge this might help. Feel free to post improvements to this and alternate ways of doing it such as making it a pad routine for left and right and center.
Code:
// I want the gosub, padR to be reusable so
// I pass it the variable to be padded and a second entry as the length.
// So to pad a sector number to a length of 5, the following would work
// |- var to pad
// | |- length to pad
// v v
setVar $padR $firstHit[$sect] & " 5"
goSub :padR
setVar $gType[$lineCnt] $padR & " -- Some information"
// goSubs
:padR
// get the length of padding from our variable
getword $padR $padding 2
// get the actual word in the variable to pad
getword $padR $padR 1
// get the vars length
getLength $padR $len
// do it
setVar $i 1
while ($i <= $padding)
setVar $padR $padR & " "
add $i 1
end
return
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."