whiskeyd
Member in Training
That that is is, that that is not is not, that that is not is not that that is.
Posts: 23
|
Post by whiskeyd on Feb 17, 2023 19:06:58 GMT
Can SUB and FUNCTION routines be used in JB rather than branch labels?
|
|
|
Post by Rod on Feb 17, 2023 19:14:49 GMT
Yes, easily. There are demos that ship with just BASIC that uses subs and functions. The help file discusses branch label and sub handlers, also functions.
|
|
whiskeyd
Member in Training
That that is is, that that is not is not, that that is not is not that that is.
Posts: 23
|
Post by whiskeyd on Feb 17, 2023 20:59:13 GMT
Thank you. One more question, can SUBs be defined for event handlers?
|
|
|
Post by plus on Feb 17, 2023 23:39:03 GMT
Yes, welcome to the forum!
|
|
|
Post by jarych on Feb 18, 2023 0:10:52 GMT
Thank you. One more question, can SUBs be defined for event handlers? Although YES, a person may wish instead not to, simply for his personal comfort in using that style. For myself, I like to take a section of code and place it past the END statement of program; and put code to run the subroutine and then continue onward from there. I just don't have the comfort in turning controls' codes into subroutines. YOU might become comfortable with doing it (and some people ARE comfortable doing it.)
|
|
whiskeyd
Member in Training
That that is is, that that is not is not, that that is not is not that that is.
Posts: 23
|
Post by whiskeyd on Feb 18, 2023 19:11:43 GMT
I am much more comfortable with SUBs and FUNCTIONs then branch labels and GOSUB
|
|
|
Post by Rod on Feb 18, 2023 19:39:58 GMT
Then you only need to be aware that arrays are global in Just BASIC You can also create global variables. But do not pass arrays or global variables to subs or functions as parameters. Simply use the globals within the sub or function.
|
|