I need to shorten my program..

Alexrowland

New Member
I'm designing a project to be used in rowing clubs,

Design Brief
I need to design a system that will organise the rowing club boat house in order to teach the rowers what boat will work best for them. It will show the rowers that some of the boats in the club cannot be used by them because it will be too unstable because of the weight the boat.

I have come to the end of my program and I am using the 20X2 chip but I have become over 1000 bytes over the maximum 4000 the chip has and there are no chips i know of which have a larger limit

Any advice would be good:D

I have used CODE SHARE here is the link

https://codeshare.io/BNdaG

Just a warning , its 600 lines!

Thank you:D
 
Last edited:

BESQUEUT

Senior Member
First idea :
each time a group of lines are identical, replace them with a GOSUB.
For example, replace :
serout c.4,t2400,(100,1,1,0,"RECOMMENDED BOAT")
pause 50

with
GOSUB S_RECOMMANDED

and add somewhere :
S_RECOMMANDED:
serout c.4,t2400,(100,1,1,0,"RECOMMENDED BOAT")
pause 50
RETURN


You can also replace :
pause 50
serout c.4,t2400,(100,1,3,0,"Age = 18")


with :
GOSUB S_AGE
serout c.4,t2400,("18")


And add somewhere :
S_AGE :
pause 50
serout c.4,t2400,(100,1,3,0,"Age = ")
RETURN


Second idea :
Use a 28X2 or a 40X2 : they have 4 slots...

Third (and prefered) idea :
Use TABLE and READTABLE commands...

NB : For a very large program, you can combinate the 3 ideas...
 
Last edited:

inglewoodpete

Senior Member
I think you can save quite a few bytes by using a single subroutine to do the following. A similar thing can be done with a subroutine for showing the age (partly described by BESQUEUT).

Code:
b25 = 85: GoSub ShowWeight
(elsewhere)
b25 = 75: GoSub ShowWeight

ShowWeight: serout c.4,t2400,(100,1,3,0," Weight = ", #b25): Return
Also, the first 20 or so lines are wasted program space. The registers are zeroised at boot-up.
 

hippy

Ex-Staff (retired)
SEROUT commands and character strings in PICAXE Basic will eat up over a byte of memory per character or byte included so using subroutines as suggested above is one way to reduce memory.

If the amount of output data is particularly large it is possible to store this in external I2C Eeprom then read and display that as needed. Special codes can be used to indicate whether characters are for display or where varying data held in variables should be inserted.

The 28X2 and 40x2 have four pages of programming memory ( 4 x 4096 bytes ) so it might be possible to split the code across those pages and jump between them.

The best approach may be to reduce the number of users so it fits and works on a 20X2, then you can see what results are gained from various optimisations. Then figure out how best to expand that to more users.
 

BESQUEUT

Senior Member
For 341 bytes, you can write all boats :
Code:
[color=Navy]#simspeed 0[/color]

[color=Blue]symbol [/color][color=Purple]StartAddress[/color][color=DarkCyan]=[/color][color=Purple]b0[/color]
[color=Blue]symbol [/color][color=Purple]EndAddress[/color][color=DarkCyan]=[/color][color=Purple]b1[/color]
[color=Blue]symbol [/color][color=Purple]Index[/color][color=DarkCyan]=[/color][color=Purple]b3[/color]
[color=Blue]symbol [/color][color=Purple]Value[/color][color=DarkCyan]=[/color][color=Purple]b4[/color]
[color=Blue]symbol [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Purple]b5[/color]

[color=Blue]symbol DaveHutchins[/color][color=DarkCyan]=[/color][color=Navy]0[/color]
[color=Blue]symbol TAW[/color][color=DarkCyan]=[/color][color=Navy]17[/color]
[color=Blue]symbol Coxless[/color][color=DarkCyan]=[/color][color=Navy]24[/color]
[color=Blue]symbol Kazia[/color][color=DarkCyan]=[/color][color=Navy]35[/color]
[color=Blue]symbol Bowden[/color][color=DarkCyan]=[/color][color=Navy]45[/color]
[color=Blue]symbol Premiercru[/color][color=DarkCyan]=[/color][color=Navy]60[/color]
[color=Blue]symbol Swan[/color][color=DarkCyan]=[/color][color=Navy]76[/color]
[color=Blue]symbol Missrebekka[/color][color=DarkCyan]=[/color][color=Navy]84[/color]
[color=Blue]symbol Southcottrose[/color][color=DarkCyan]=[/color][color=Navy]100[/color]


[color=Blue]TABLE DaveHutchins[/color][color=Black],[/color][color=Blue]([/color][color=Navy]13[/color][color=Black],[/color][color=Red]"Dave Hutchins"[/color][color=Black],[/color][color=Navy]85[/color][color=Black],[/color][color=Navy]4[/color][color=Blue])
TABLE TAW[/color][color=Black],[/color][color=Blue]([/color][color=Navy]3[/color][color=Black],[/color][color=Red]"TAW"[/color][color=Black],[/color][color=Navy]75[/color][color=Black],[/color][color=Navy]4[/color][color=Blue])
TABLE Coxless[/color][color=Black],[/color][color=Blue]([/color][color=Navy]7[/color][color=Black],[/color][color=Red]"Coxless"[/color][color=Black],[/color][color=Navy]75[/color][color=Black],[/color][color=Navy]3[/color][color=Blue])
TABLE Kazia[/color][color=Black],[/color][color=Blue]([/color][color=Navy]5[/color][color=Black],[/color][color=Red]"Kazia"[/color][color=Black],[/color][color=Navy]65[/color][color=Black],[/color][color=Navy]2[/color][color=Blue])
TABLE Bowden[/color][color=Black],[/color][color=Blue]([/color][color=Navy]6[/color][color=Black],[/color][color=Red]"Bowden"[/color][color=Black],[/color][color=Navy]65[/color][color=Black],[/color][color=Navy]3[/color][color=Blue])
TABLE Premiercru[/color][color=Black],[/color][color=Blue]([/color][color=Navy]11[/color][color=Black],[/color][color=Red]"Premier Cru"[/color][color=Black],[/color][color=Navy]75[/color][color=Black],[/color][color=Navy]3[/color][color=Blue])
TABLE Swan[/color][color=Black],[/color][color=Blue]([/color][color=Navy]4[/color][color=Black],[/color][color=Red]"Swan"[/color][color=Black],[/color][color=Navy]85[/color][color=Black],[/color][color=Navy]1[/color][color=Blue])
TABLE Missrebekka[/color][color=Black],[/color][color=Blue]([/color][color=Navy]12[/color][color=Black],[/color][color=Red]"Miss Rebekka"[/color][color=Black],[/color][color=Navy]85[/color][color=Black],[/color][color=Navy]3[/color][color=Blue])
TABLE Southcottrose[/color][color=Black],[/color][color=Blue]([/color][color=Navy]14[/color][color=Black],[/color][color=Red]"Southcott rose"[/color][color=Black],[/color][color=Navy]85[/color][color=Black],[/color][color=Navy]2[/color][color=Blue])

TABLE [/color][color=Navy]150[/color][color=Black],[/color][color=Blue]([/color][color=Navy]16[/color][color=Black],[/color][color=Red]"RECOMMENDED BOAT"[/color][color=Blue])

do
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]DaveHutchins [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]TAW [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]Coxless [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]Kazia [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]Bowden [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]Premiercru [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]Swan [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]Missrebekka [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Purple]StartBoat[/color][color=DarkCyan]=[/color][color=Blue]Southcottrose [/color][color=Black]: [/color][color=Blue]GOSUB [/color][color=Black]WriteBoat
      [/color][color=Blue]sertxd([/color][color=Red]"~~~~~~~~"[/color][color=Black],[/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
      sertxd([/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
loop[/color]


[color=Black]WriteBoat:
      [/color][color=Purple]StartAddress[/color][color=DarkCyan]=[/color][color=Navy]150
      [/color][color=Blue]gosub [/color][color=Black]WriteTable
      [/color][color=Purple]StartAddress[/color][color=DarkCyan]=[/color][color=Purple]StartBoat
      [/color][color=Blue]gosub [/color][color=Black]WriteTable

      [/color][color=Blue]readtable [/color][color=Purple]Index[/color][color=Black],[/color][color=Purple]Value
      [/color][color=Blue]sertxd([/color][color=Red]" weight "[/color][color=Black],#[/color][color=Purple]Value[/color][color=Blue])
      inc [/color][color=Purple]Index[/color][color=Black]:[/color][color=Blue]readtable [/color][color=Purple]Index[/color][color=Black],[/color][color=Purple]Value
      [/color][color=Blue]sertxd([/color][color=Red]" Skill level = "[/color][color=Black],#[/color][color=Purple]Value[/color][color=Black],[/color][color=Red]" / 5"[/color][color=Blue])
      sertxd([/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
RETURN[/color]

[color=Black]WriteTable:
      [/color][color=Blue]readtable [/color][color=Purple]StartAddress[/color][color=Black],[/color][color=Purple]Value
      EndAddress[/color][color=DarkCyan]=[/color][color=Purple]StartAddress[/color][color=DarkCyan]+[/color][color=Purple]Value
      [/color][color=Blue]inc [/color][color=Purple]StartAddress
      [/color][color=Blue]for [/color][color=Purple]Index[/color][color=DarkCyan]=[/color][color=Purple]StartAddress [/color][color=Blue]to [/color][color=Purple]EndAddress
            [/color][color=Blue]readtable [/color][color=Purple]Index[/color][color=Black],[/color][color=Purple]Value[/color]
[color=Green]'           serout c.3,t2400, (Value)
            [/color][color=Blue]sertxd([/color][color=Purple]Value[/color][color=Blue])
      next
      sertxd ([/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
RETURN[/color]
Tested with simulator and serial terminal.
 
Last edited:

BESQUEUT

Senior Member
741 bytes for all boats and persons :
Code:
#simspeed 0

symbol StartAddress=b0
symbol EndAddress=b1
symbol Index=b3
symbol Value=b4
symbol StartObj=b5

symbol DaveHutchins=0
symbol TAW=17
symbol Coxless=24
symbol Kazia=35
symbol Bowden=45
symbol Premiercru=60
symbol Swan=76
symbol Missrebekka=84
symbol Southcottrose=100

symbol AlexR=120
symbol MattH=138
symbol RossB=156
symbol JamieN=174
symbol JessC=192
symbol KeelyM=210
symbol JonL=228


TABLE DaveHutchins,(13,"Dave Hutchins",85,4)
TABLE TAW,(3,"TAW",75,4)
TABLE Coxless,(7,"Coxless",75,3)
TABLE Kazia,(5,"Kazia",65,2)
TABLE Bowden,(6,"Bowden",65,3)
TABLE Premiercru,(11,"Premier Cru",75,3)
TABLE Swan,(4,"Swan",85,1)
TABLE Missrebekka,(12,"Miss Rebekka",85,3)
TABLE Southcottrose,(14,"Southcott rose",85,2)

TABLE AlexR,(12,"Alex Rowland","M",18,4,75,"Y")
TABLE MattH,(11,"Matt Harris","M",18,4,80,"Y")
TABLE RossB,(11,"Ross Bennet","M",18,4,70,"Y")
TABLE JamieN,(12,"Jamie Norton","M",15,3,65,"Y")
TABLE JessC,(8,"Jess Cox","F",18,4,65,"Y")
TABLE KeelyM,(11,"Keely Mills","F",18,3,65,"Y")
TABLE JonL,(11,"Jon Lamount","M",23,4,85,"Y")


do
	StartObj=DaveHutchins : GOSUB WriteBoat
	StartObj=TAW : GOSUB WriteBoat
	StartObj=Coxless : GOSUB WriteBoat
	StartObj=Kazia : GOSUB WriteBoat
	StartObj=Bowden : GOSUB WriteBoat
	StartObj=Premiercru : GOSUB WriteBoat
	StartObj=Swan : GOSUB WriteBoat
	StartObj=Missrebekka : GOSUB WriteBoat
	StartObj=Southcottrose : GOSUB WriteBoat
	sertxd("~~~~~~~~",13,10)
	
	StartObj=AlexR:GOSUB WritePerson
	StartObj=MattH:GOSUB WritePerson
	StartObj=RossB:GOSUB WritePerson
	StartObj=JamieN:GOSUB WritePerson
	StartObj=JessC:GOSUB WritePerson
	StartObj=KeelyM:GOSUB WritePerson
	StartObj=JonL:GOSUB WritePerson
	
	sertxd("~~~~~~~~",13,10)
	sertxd(13,10)
loop

WritePerson:
	StartAddress=StartObj
	gosub WriteTable

	readtable Index,Value
	sertxd(" Sex         = ",Value)
	inc Index:readtable Index,Value
	sertxd(" Age         = ",#Value,13,10)
	inc Index:readtable Index,Value
	sertxd(" Skill level = ",#Value," / 5",13,10)
	inc Index:readtable Index,Value
	sertxd(" Weight      = ",#Value," kg")
	inc Index:readtable Index,Value
	sertxd(" Sweep       = ",Value,13,10,13,10)
RETURN



WriteBoat:
	sertxd("RECOMMENDED BOAT",13,10)
	StartAddress=StartObj
	gosub WriteTable

	readtable Index,Value
	sertxd(" weight ",#Value)
	inc Index:readtable Index,Value
	sertxd(" Skill level = ",#Value," / 5",13,10)
RETURN

WriteTable:
	readtable StartAddress,Value
	EndAddress=StartAddress+Value
	inc StartAddress
	for Index=StartAddress to EndAddress
		readtable Index,Value
'		serout c.3,t2400, (Value)
		sertxd(Value)
	next
	sertxd (13,10)
RETURN
 
Last edited:

Alexrowland

New Member
Sorry for taking so long to respond, I have have projects that i needed time for.

So firstly thank you for your amazing help and your ideas are brilliant, However I am not quite sure how to implement them into the system.
i have a feeling I deleted something something I shouldn't have?
This is my edited version and it is low enough bytes but once it gets to the recommended boat section the screen blanks.
https://codeshare.io/bp2VI

I am enjoying learning these new commands :D

Alex
 

techElder

Well-known member
Alex, I won't visit your outside link to your code. You should post your code here and place it within [code] and [/code] markers. Maybe its just me. :D
 

Alexrowland

New Member
Understandable , however my code has become so long it wont allow me to post that much code in one place
Codeshare is a reliable site but i understand
:D
Alex
 

BESQUEUT

Senior Member
First part :
Code:
let b14 = 0 ; person weight
let b15 = 0 ; Skill, (/5)
let b16 = 0 ; Age
let b17 = 0 ; able to sweep 1= yes 0= no
let b18 = 0 ; sex 0= female 1= male
let b19 = 0 ; crew number so far
let b20 = 0 ; boat size
let b21 = 0 ; skull of sweep 0skull 1sweep
let b22 = 0 ; boat weight 
let b23 = 0 ; skill level of boat (/5)
let b24 = 0 ; size of boat selected
; ibutton
let b6 = 0
let b7 = 0
let b8 = 0
let b9 = 0
let b10 = 0
let b11 = 0
let b12 = 0
let b13 = 0

pause 500
serout c.4,t2400,(10)
pause 50
serout c.4,t2400,(20,1)
pause 50

serout c.4,t2400,(100,1,2,0,"Boat House")
pause 50 
serout c.4,t2400,(100,1,3,0,"Manager")
pause 50
serout c.4,t2400,(155,1,110,15,85,40); right blades
pause 50
serout c.4,t2400,(155,1,85,15,110,40)
pause 50
serout c.4,t2400,(150,110,14);Right spoon
pause 50
serout c.4,t2400,(150,111,15)
pause 50
serout c.4,t2400,(155,1,112,15,116,11)
pause 50
serout c.4,t2400,(155,1,110,13,114,9)
pause 50 
serout c.4,t2400,(155,1,116,11,114,9)
pause 50
serout c.4,t2400,(150,85,14);left spoon
pause 50
serout c.4,t2400,(150,84,15)
pause 50
serout c.4,t2400,(155,1,85,13,81,9)
pause 50
serout c.4,t2400,(155,1,83,15,79,11)
pause 50
serout c.4,t2400,(155,1,79,11,81,9)
wait 3 

serout c.4,t2400,(10) ; clear screen
; boat selection 
pause 500
serout c.4,t2400,(10)
pause 50
serout c.4,t2400,(20,1)
pause 50
main:
serout c.4,t2400,(155,1,25,60,100,60); top line  ( boat 1 )
pause 50
serout c.4,t2400,(155,1,101,59,118,55); left edge
pause 50
serout c.4,t2400,(155,1,101,50,118,55)
pause 50
serout c.4,t2400,(155,1,25,50,100,50); bottom line
pause 50
serout c.4,t2400,(155,1,25,59,8,55); right edge
pause 50
serout c.4,t2400,(155,1,8,55,25,50)
pause 50

Serout c.4,t2400,(160,1,40,55,5)
pause 50
Serout c.4,t2400,(160,1,55,55,5)
pause 50
Serout c.4,t2400,(160,1,70,55,5)
pause 50
Serout c.4,t2400,(160,1,85,55,5)
pause 50

serout c.4,t2400,(155,1,25,40,100,40); top line  ( boat 2 )
pause 50
serout c.4,t2400,(155,1,101,39,118,35); left edge
pause 50
serout c.4,t2400,(155,1,101,30,118,35)
pause 50
serout c.4,t2400,(155,1,25,30,100,30); bottom line
pause 50
serout c.4,t2400,(155,1,25,39,8,35); right edge
pause 50
serout c.4,t2400,(155,1,8,35,25,30)
pause 50

Serout c.4,t2400,(160,1,50,35,5)
pause 50
Serout c.4,t2400,(160,1,75,35,5)
pause 50

serout c.4,t2400,(155,1,25,20,100,20); top line  ( boat 3 )
pause 50
serout c.4,t2400,(155,1,101,19,118,15); left edge
pause 50
serout c.4,t2400,(155,1,101,10,118,15)
pause 50
serout c.4,t2400,(155,1,25,10,100,10); bottom line
pause 50
serout c.4,t2400,(155,1,25,19,8,15); right edge
pause 50
serout c.4,t2400,(155,1,8,15,25,10)
pause 50
Serout c.4,t2400,(160,1,63,15,5)
pause 50
do
if pinb.7 = 1 then let b24 = 1 endif
if pinb.7 = 1 then goto skulls
if pinb.6 = 1 then let b24 = 2 endif
if pinb.6 = 1 then goto skulls
if pinb.5 = 1 then let b24 = 4 endif
if pinb.5 = 1 then goto skulls
loop 
skulls:

pause 500
serout c.4,t2400,(10)
pause 50
serout c.4,t2400,(20,1)
pause 50

serout c.4,t2400,(155,1,64,0,64,63) ; center line
pause 50
serout c.4,t2400,(100,3,6,0,"Sweep"); text
pause 50
serout c.4,t2400,(100,12,6,0,"Sculling")
pause 50 
serout c.4,t2400,(155,1,31,15,31,40); left blade
pause 50
serout c.4,t2400,(150,30,14)
pause 50
serout c.4,t2400,(150,32,14)
pause 50 
serout c.4,t2400,(155,1,29,8,29,13)
pause 50
serout c.4,t2400,(155,1,33,8,33,13)
pause 50
serout c.4,t2400,(155,1,33,7,29,7)
pause 50
serout c.4,t2400,(155,1,110,15,85,40); right blades
pause 50
serout c.4,t2400,(155,1,85,15,110,40)
pause 50
serout c.4,t2400,(150,110,14);Right spoon
pause 50
serout c.4,t2400,(150,111,15)
pause 50
serout c.4,t2400,(155,1,112,15,116,11)
pause 50
serout c.4,t2400,(155,1,110,13,114,9)
pause 50 
serout c.4,t2400,(155,1,116,11,114,9)
pause 50
serout c.4,t2400,(150,85,14);left spoon
pause 50
serout c.4,t2400,(150,84,15)
pause 50
serout c.4,t2400,(155,1,85,13,81,9)
pause 50
serout c.4,t2400,(155,1,83,15,79,11)
pause 50
serout c.4,t2400,(155,1,79,11,81,9)
do
if pinb.7 = 1 then let b21 = 1 endif
if pinb.7 = 1 then goto ibutton
if pinb.5 = 1 then let b21 = 0 endif
if pinb.5 = 1 then goto ibutton
loop 
ibutton:
pause 50 
serout c.4,t2400,(10)
pause 50
serout c.4,t2400,(100,1,1,0,"Rowers Needed=  ",#b24)
pause 50
if b21 = 0 then serout c.4,t2400,(100,1,2,0,"Skulling selected") endif
if b21 = 1 then serout c.4,t2400,(100,1,2,0,"Sweep selected") endif
Wait 3
serout c.4,t2400,(100,1,4,0,"please use Ibutton")
pause 50
Loop1:
		readowsn c.7 ; ibutton scan
		if b6 =1 and b7 =116 and b8 =136 and b9 =106 and b10 =23 and b11 =0 and b12 =0 and b13 =55  then AlexR
		if b6 =1 and b7 =245 and b8 =117 and b9 =106 and b10 =23 and b11 =0 and b12 =0 and b13 =160 then MattH
		if b6 =1 and b7 =5   and b8 =161 and b9 =106 and b10 =23 and b11 =0 and b12 =0 and b13 =147 then RossB
		if b6 =1 and b7 =227 and b8 =196 and b9 =106 and b10 =23 and b11 =0 and b12 =0 and b13 =203 then JamieN
		if b6 =1 and b7 =240 and b8 =195 and b9 =106 and b10 =23 and b11 =0 and b12 =0 and b13 =152 then JessC
		if b6 =1 and b7 =137 and b8 =95  and b9 =106 and b10 =23 and b11 =0 and b12 =0 and b13 =0   then KeelyM
		if b6 =1 and b7 =215 and b8 =182 and b9 =106 and b10 =23 and b11 =0 and b12 =0 and b13 =20  then JonL 	
		Goto Loop1
		
AlexR:
pause 50
serout c.4,t2400,(10)
  let b14 = b14 + 75 ; wieght 
  let b15 = b15 + 4  ; skill
  let b16 = b16 + 18 ; Age
  let b17 = b17 + 1  ; able to sweep 
  let b18 = b18 + 1  ; sex
  let b19 = b19 + 1  ; crew number
pause 500
serout c.4,t2400,(10)
pause 50
serout c.4,t2400,(20,1)
pause 50
serout c.4,t2400,(100,1,1,0,"Alex Rowland")
pause 50
serout c.4,t2400,(100,1,2,0,"Sex         = Male")
pause 50
serout c.4,t2400,(100,1,3,0,"Age         = 18")
pause 50
serout c.4,t2400,(100,1,4,0,"Skill Level = 4/5")
pause 50
serout c.4,t2400,(100,1,5,0,"Weight      = 75Kg ")
pause 50
serout c.4,t2400,(100,1,6,0,"Sweep       = Yes")
wait 5
serout c.4,t2400,(10) ; screenclear 
pause 50
if b19 = b24 then goto finalstage 
serout c.4,t2400,(100,1,3,0,"Next person sign in")
wait 3
serout c.4,t2400,(10) ; screenclear 
pause 50
goto loop1:

MattH:
pause 50
serout c.4,t2400,(10)
      let b14 = b14 + 80 ;Weight
	let b15 = b15 + 4  ;Skill
	let b16 = b16 + 18 ;age
	let b17 = b17 + 1  ;able to sweep
	let b18 = b18 + 1  ;sex
	let b19 = b19 + 1  ;crew number
pause 50
serout c.4,t2400,(100,1,1,0,"Matt Harris")
pause 100
serout c.4,t2400,(100,1,2,0,"Sex         = Male")
pause 100
serout c.4,t2400,(100,1,3,0,"Age         = 18")
pause 100
serout c.4,t2400,(100,1,4,0,"Skill Level = 4/5")
pause 100
serout c.4,t2400,(100,1,5,0,"Weight      = 80Kg ")
pause 50
serout c.4,t2400,(100,1,6,0,"Sweep       = Yes")
wait 5
serout c.4,t2400,(10) ; screenclear 
pause 50
if b19 = b20 then goto finalstage 
serout c.4,t2400,(100,1,3,0,"Next person sign in")
wait 3
serout c.4,t2400,(10) ; screenclear 
pause 50
goto loop1:

RossB:
pause 50
serout c.4,t2400,(10)
      let b14 = b14 + 70 ;Weight
	let b15 = b15 + 4  ;Skill
	let b16 = b16 + 18 ;age
	let b17 = b17 + 1  ;able to sweep
	let b18 = b18 + 1  ;sex
	let b19 = b19 + 1  ;crew number
pause 50
serout c.4,t2400,(100,1,1,0,"Ross Bennet")
pause 100
serout c.4,t2400,(100,1,2,0,"Sex         = Male")
pause 100
serout c.4,t2400,(100,1,3,0,"Age         = 18")
pause 100
serout c.4,t2400,(100,1,4,0,"Skill Level = 4/5")
pause 100
serout c.4,t2400,(100,1,5,0,"Weight      = 70Kg ")
pause 50
serout c.4,t2400,(100,1,6,0,"Sweep       = Yes")
wait 5
serout c.4,t2400,(10) ; screenclear 
pause 50
if b19 = b24 then goto finalstage 
serout c.4,t2400,(100,1,3,0,"Next person sign in")
wait 3
serout c.4,t2400,(10) ; screenclear 
pause 50
goto loop1:
 

BESQUEUT

Senior Member
Second part :
Code:
JamieN:
pause 50
serout c.4,t2400,(10)
      let b14 = b14 + 65 ;Weight
	let b15 = b15 + 3  ;Skill
	let b16 = b16 + 15 ;age
	let b17 = b17 + 1  ;able to sweep
	let b18 = b18 + 1  ;sex
	let b19 = b19 + 1  ;crew number
pause 50
serout c.4,t2400,(100,1,1,0,"Jamie Norton")
pause 100
serout c.4,t2400,(100,1,2,0,"Sex         = Male")
pause 100
serout c.4,t2400,(100,1,3,0,"Age         = 15")
pause 100
serout c.4,t2400,(100,1,4,0,"Skill Level = 3/5")
pause 100
serout c.4,t2400,(100,1,5,0,"Weight      = 65Kg ")
pause 50
serout c.4,t2400,(100,1,6,0,"Sweep       = Yes")
wait 5
serout c.4,t2400,(10) ; screenclear 
pause 50
if b19 = b24 then goto finalstage 
serout c.4,t2400,(100,1,3,0,"Next person sign in")
wait 3
serout c.4,t2400,(10) ; screenclear 
pause 50
goto loop1:

JessC:
pause 50
serout c.4,t2400,(10)
      let b14 = b14 + 65 ;Weight
	let b15 = b15 + 4  ;Skill
	let b16 = b16 + 16 ;age
	let b17 = b17 + 1  ;able to sweep
	let b18 = b18 + 0  ;sex
	let b19 = b19 + 1  ;crew number
pause 50
serout c.4,t2400,(100,1,1,0,"Jess Cox")
pause 100
serout c.4,t2400,(100,1,2,0,"Sex         = Female")
pause 100
serout c.4,t2400,(100,1,3,0,"Age         = 18")
pause 100
serout c.4,t2400,(100,1,4,0,"Skill Level = 4/5")
pause 100
serout c.4,t2400,(100,1,5,0,"Weight      = 65Kg ")
pause 50
serout c.4,t2400,(100,1,6,0,"Sweep       = Yes")
wait 5
serout c.4,t2400,(10) ; screenclear 
pause 50
if b19 = b24 then goto finalstage 
serout c.4,t2400,(100,1,3,0,"Next person sign in")
wait 3
serout c.4,t2400,(10) ; screenclear 
pause 50
goto loop1:

KeelyM:
pause 50
serout c.4,t2400,(10)
      let b14 = b14 + 65 ;Weight
	let b15 = b15 + 3  ;Skill
	let b16 = b16 + 18 ;age
	let b17 = b17 + 1  ;able to sweep
	let b18 = b18 + 8  ;sex
	let b19 = b19 + 1  ;crew number
pause 50
serout c.4,t2400,(100,1,1,0,"Keely Mills")
pause 100
serout c.4,t2400,(100,1,2,0,"Sex         = Female")
pause 100
serout c.4,t2400,(100,1,3,0,"Age         = 18")
pause 100
serout c.4,t2400,(100,1,4,0,"Skill Level = 3/5")
pause 100
serout c.4,t2400,(100,1,5,0,"Weight      = 65Kg ")
pause 50
serout c.4,t2400,(100,1,6,0,"Sweep       = Yes")
wait 5
serout c.4,t2400,(10) ; screenclear 
pause 50
if b19 = b24 then goto finalstage 
serout c.4,t2400,(100,1,3,0,"Next person sign in")
wait 3
serout c.4,t2400,(10) ; screenclear 
pause 50
goto loop1:

JonL:
pause 50
serout c.4,t2400,(10)
      let b14 = b14 + 85 ;Weight
	let b15 = b15 + 4  ;Skill
	let b16 = b16 + 23 ;age
	let b17 = b17 + 1  ;able to sweep
	let b18 = b18 + 1  ;sex
	let b19 = b19 + 1  ;crew number
pause 50
serout c.4,t2400,(100,1,1,0,"Jon Lamount")
pause 100
serout c.4,t2400,(100,1,2,0,"Sex         = Male")
pause 100
serout c.4,t2400,(100,1,3,0,"Age         = 23")
pause 100
serout c.4,t2400,(100,1,4,0,"Skill Level = 4/5")
pause 100
serout c.4,t2400,(100,1,5,0,"Weight      = 85Kg ")
pause 50
serout c.4,t2400,(100,1,6,0,"Sweep       = Yes")
wait 5
serout c.4,t2400,(10) ; screenclear 
pause 50
if b19 = b24 then goto finalstage 
serout c.4,t2400,(100,1,3,0,"Next person sign in")
wait 3
serout c.4,t2400,(10) ; screenclear 
pause 50
goto loop1:

finalstage:
#simspeed 0

symbol StartAddress=b0
symbol EndAddress=b1
symbol Index=b3
symbol Value=b4
symbol StartBoat=b5

symbol DaveHutchins=0
symbol TAW=17
symbol Coxless=24
symbol Kazia=35
symbol Bowden=45
symbol Premiercru=60
symbol Swan=76
symbol Missrebekka=84
symbol Southcottrose=100


TABLE DaveHutchins,(13,"Dave Hutchins",85,4)
TABLE TAW,(3,"TAW",75,4)
TABLE Coxless,(7,"Coxless",75,3)
TABLE Kazia,(5,"Kazia",65,2)
TABLE Bowden,(6,"Bowden",65,3)
TABLE Premiercru,(11,"Premier Cru",75,3)
TABLE Swan,(4,"Swan",85,1)
TABLE Missrebekka,(12,"Miss Rebekka",85,3)
TABLE Southcottrose,(14,"Southcott rose",85,2)

TABLE 150,(16,"RECOMMENDED BOAT")

do
      StartBoat=DaveHutchins : GOSUB WriteBoat
      StartBoat=TAW : GOSUB WriteBoat
      StartBoat=Coxless : GOSUB WriteBoat
      StartBoat=Kazia : GOSUB WriteBoat
      StartBoat=Bowden : GOSUB WriteBoat
      StartBoat=Premiercru : GOSUB WriteBoat
      StartBoat=Swan : GOSUB WriteBoat
      StartBoat=Missrebekka : GOSUB WriteBoat
      StartBoat=Southcottrose : GOSUB WriteBoat
      sertxd("~~~~~~~~",13,10)
      sertxd(13,10)
loop


WriteBoat:
      StartAddress=150
      gosub WriteTable
      StartAddress=StartBoat
      gosub WriteTable

      readtable Index,Value
      sertxd(" weight ",#Value)
      inc Index:readtable Index,Value
      sertxd(" Skill level = ",#Value," / 5")
      sertxd(13,10)
RETURN

WriteTable:
      readtable StartAddress,Value
      EndAddress=StartAddress+Value
      inc StartAddress
      for Index=StartAddress to EndAddress
            readtable Index,Value
'           serout c.3,t2400, (Value)
            sertxd(Value)
      next
      sertxd (13,10)
RETURN
 

BESQUEUT

Senior Member
So firstly thank you for your amazing help and your ideas are brilliant, However I am not quite sure how to implement them into the system.
i have a feeling I deleted something something I shouldn't have?
This is my edited version and it is low enough bytes but once it gets to the recommended boat section the screen blanks.
My code was intended to show you how to use the TABLE command and try it with simulator.
Did you do that ?
To use it within your code you have to replace SERTXD commands with appropriate SEROUT commands...
 
Top