18X gosubs

Maleny

New Member
page 56 manual2 list the 18X as having 255 gosubs available but when I check the syntax of a program in the 18X mode the compile error tells me that ony 16 gosubs are allowed.
 

tjetson

Senior Member
In the View-> Options dialog box when you select 18X, there is an option to have 16 or 255 gosubs.
 

InvaderZim

Senior Member
You can also specifiy those options in your code to make it more clear:
Code:
'DIRECTIVES
#com 4							'com port: 3 for Dock USB, 4 for PC upper left port
#picaxe 18x						'developed for the 18x; no internal timer or soft reset, 5 inputs, 8 outputs
#gosubs 256						'18x has 256 gosubs
Note that using 256 instead of 16 gosubs increases your code size, but only slightly.
 

westaust55

Moderator
Zim's method is ideal as you do not have to remember to set the PE each time you change PE settings, etc and the setting goes with the program code in case you do change the PE setting for another program.

The directive is covered in Manual 2 (V6.9) on page 9

Note that the PE will "remember" your X part "gosub setting" even if you change to another chip type or shut down and restart.
 
Top