Thanks Bruce, what i am getting at is writing a function that operates on a byte of data, when you want the same operation performed on 50 bytes, if you can pass a variable to a function what you end up with is one chunk of code executing 50 times with different parameters rather than 50 chunks of code each executing once.

example:

myVar as byte
myVar2 as byte

loop:
gosub test(myVar)
gosub test(myVar2)
goto loop

test(temp as byte):
'operations on temp byte passed in
return

my other question was about return types and whether or not PBP can use returning functions so that you can have a procedure that is called to test some outside conditions and returns a byte.

example:

myVar as byte

loop:
myVar = gosub test
goto loop

test:
myVar2 as byte
'operations on myVar2
return myVar2

Even with all variables being global it might still be possible if you use placeholder bytes declared globally and used only in these types of routines. Have you ever seen syntax that would allow this?


james