I am guessing you mean like DATA / EEPROM or SEROUT, HSEROUT etc, do because WRITE doesn't support that.So this is a plea to enhance the PUT and POKE commands to take strings the way WRITE does for eeprom. (Still wouldn't be backwards compatible with PE5, I guess.)
It is possible to achieve the same as -
Code:
Poke 20, "abcdefghi"
Code:
Poke 20, "a", "b", "c", "d", "e", "f", "g", "h", "i"
The difference between POKE, PUT and WRITE, and SEROUT etc, is that the former were only designed to have a single data item so multiple data items generate multiple separate commands. SEROUT and similar were intended to have multiple data items so generate a single command with 'another item follows' flags within them which means they are encoded differently and use less memory.
For example SERTXD("abc") is approximately one byte more than SEROUT("a","b"), size only increases by about one byte for every character added. That's not the case for the single data item commands. POKE 20,"abc" would be POKE 20,"a" : POKE 21,"b" : POKE 22, "c", so increases by more than one byte per character added.
Edited: Clarified above.
The above POKE "abcdefghi" example uses36 bytes on a 40X2, a #MACRO version uses only 33 and allows the single string representation -
Code:
#Macro MacroPut(loc,text)
bPtr = loc
b0 = 0
Do
LookUp b0, ( text, 0 ), @bPtr
b0 = b0 + 1
Loop Until @bPtrInc = 0
#EndMacro
MacroPut( 20, "abcdefghi" )
To have memory efficient multi-data item POKE, PUT and WRITE commands requires a change in the PICAXE firmware and it would only be available for new chips with that firmware. Given that, and that the problem can easily be overcome using #MACRO, there is likely not a compelling business case to make such a change.
Last edited: