PDA

View Full Version : Subs and functions



bearpawz
- 27th December 2006, 07:38
What I REALLY wish they would do is give the ability to create subs and functions like in visual basic.. passing variables and the whols works. Instead of:


X = some value...
Gosub ModifyX
.
.
.
Do something with x now...


ModifyX:
; Really long subroutine/function...
Return


You simply do:

ModifyX
.
.
Do something with x


Sub ModifyX (X as {bit/byte/word/whatever})
; Really long subroutine that modifies x
End Sub


It seems trivial at first but Ive used subs and functions to write some prety complicated routines and plus you dont have to worry about setting variable values first: they just get passed by reference or value to the sub or function and then passed back.


But oh well... I guss its like winning the lottery... never gonna happen but fun to dream about