MrValentine:
When creating the function, he is declaring new
local variables for use inside the function:
iSpriteId
iX
iY
This way, when he calls the function:
DisplaySprite(SpriteId, X, Y)
It passes the information from:
SpriteId to
iSpriteId
X to
iX
Y to
iY
So that it can be used inside the function and not take global variables.
It could also be interpreted as:
Function DisplaySprite( iSpriteId as integer, iX as integer, iY as integer)
Sprite iSpriteId, iX, iY, Sprite Image( iSpriteId )
Paste Sprite iSpriteId, iX, iY
EndFunction
Another example:
StringToSend$ = "Hello, I'm sending this string!!!"
NewPrintFunction(StringToSend$)
Function NewPrintFunction(CatchThatString$)
`in essence, CatchThatString$ = StringToSend$
print CatchThatString$
`which will print, "Hello, I'm sending this string!!!"
EndFunction
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.