Shop OBEX P1 Docs P2 Docs Learn Events
SX/B sub declaration enhancement idea — Parallax Forums

SX/B sub declaration enhancement idea

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2006-09-16 11:40 in General Discussion
Hi,
sub declaration take the form SUB MIN,MAX
where MIN and MAX define the number of parameter.
It would be nice if we could use a more elaborate format.
Something like
SUB mysub [noparse][[/noparse]word,word][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]word,byte,byte][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]word,byte][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]word][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]byte,byte,byte,byte][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]byte,byte,byte][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]byte,byte][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]byte][noparse][[/noparse]/word|byte|bit]
SUB mysub [noparse][[/noparse]/word|byte|bit]
The first options between [noparse]/noparse define the parameter types (for up to 4 bytes)
the second [noparse]/noparse defines the return type (the / marks it as returntype.)
The bit returntype returns a byte with value 0 or 1.

Just a thought for a future enhancement.
It can coexist with the current format.
SUB mysub word,byte[noparse][[/noparse],byte]/byte
equals SUB mysub 3,4

regards peter

Post Edited (Peter Verkaik) : 9/16/2006 11:46:56 AM GMT
Sign In or Register to comment.