Strings

Phockzie

New Member
Hi.
Is there a better way to handle strings of characters. I currently do this ...
X = "1"
gosub SPI_SendCmd
X = "."
gosub SPI_SendCmd
X = "m"
gosub SPI_SendCmd
X = "p"
gosub SPI_SendCmd
X = "3"
gosub SPI_SendCmd
Thank you very much.
 

Jeremy Leach

Senior Member
Well, one thing you could do is to store the string in internal EEPROM, then access the string through a loop. e.g, suppose you had the characters 1.mp3 stored at EEPROM addresses 0,1,2,3,4 :

Code:
Symbol StringStart = b0
Symbol StringEnd = b1
Symbol Address = b3
Symbol X = b4

'Main
StringStart = 0
StringEnd = 4
Gosub DisplayString
End

'Subroutines
DisplayString:
    For Address = StringStart To StringEnd
        Read Address, X
        Gosub SPI_SendCmd
    Next
Return
 
Top