Can subroutines pass parmeters in PBasic?
beats
Posts: 17
I know its usually the other way around, but I need to convert some SX/B code into BS2.
As you know, in SX/B language you are aloud to pass parameters to the subroutines when you declare them and when you call them later on. I am wondering if PBasic/Basic Stamp2 can do this? If so, how can you pass the parameters when you call GOSUB?
Thanks,
Tony
As you know, in SX/B language you are aloud to pass parameters to the subroutines when you declare them and when you call them later on. I am wondering if PBasic/Basic Stamp2 can do this? If so, how can you pass the parameters when you call GOSUB?
Thanks,
Tony
Comments
a = 1 : b = x + 5 : GOSUB 500
I liked the way you addressed passing paramters via shared variables,This is a very clever approach. I've been asked for some help w/ passing Math instructions from a MEMKey to a BS2p40,and displaying them in A debug window, this would act like a calculator...It seemed pretty simple at first,But as I started to write some code ,It became really complicated.? Would the method You showed in the post above handle the MATH, By this I mean the Actual math Func.s " + "," - "," / ",ETC....I know the keypad code needs to be converted to a usable #...It was the Math "symbol" part that got Me confused....I don't want to be off topic, I feel its related...Is there another approach????