Suggestion: Label Addressing of Strings in PBasic
Paul Romsky
Posts: 66
Parallax,
In BS1 and BS2's programs, all the text strings for the DEBUG commands tie up a lot of the EEPROM. This makes sense because the compiler does not optimize strings. I use a lot of techniques to reduce the amount of redundant strings, but the best way I can think of does not seem to be possible.
Do you think Parallax could add a feature like "Label Addressing of Strings"?
Example:
BS2 (code fragment):
String1:
DATA @0, "This is string one that is used many, many times, in many different points in a program", 0
String2:
DATA "This is another string that is used", 0
String3:
DATA "And... so on", 0
'
' It would be nice if DEBUG could ALSO refer to the strings by their addresses (labels)
' Right now PBasic does not allow this, it only allows RAM Byte Arrays for the DEBUG STR command (and as you know, there is not much RAM in a BS2).
' Expanding this to subsitute an address from the EEPROM could save a lot a space in DEBUG rich programs that use a lot of the same sub strings over and over again.
'
DEBUG STR String1 ' Not allowed in PBasic 2.5 - I suggest this capability
DEBUG STR String2 ' Not allowed in PBasic 2.5 - I suggest this capability
DEBUG STR String3 ' Not allowed in PBasic 2.5 - I suggest this capability
End Example:
Your thoughts?
Paul
In BS1 and BS2's programs, all the text strings for the DEBUG commands tie up a lot of the EEPROM. This makes sense because the compiler does not optimize strings. I use a lot of techniques to reduce the amount of redundant strings, but the best way I can think of does not seem to be possible.
Do you think Parallax could add a feature like "Label Addressing of Strings"?
Example:
BS2 (code fragment):
String1:
DATA @0, "This is string one that is used many, many times, in many different points in a program", 0
String2:
DATA "This is another string that is used", 0
String3:
DATA "And... so on", 0
'
' It would be nice if DEBUG could ALSO refer to the strings by their addresses (labels)
' Right now PBasic does not allow this, it only allows RAM Byte Arrays for the DEBUG STR command (and as you know, there is not much RAM in a BS2).
' Expanding this to subsitute an address from the EEPROM could save a lot a space in DEBUG rich programs that use a lot of the same sub strings over and over again.
'
DEBUG STR String1 ' Not allowed in PBasic 2.5 - I suggest this capability
DEBUG STR String2 ' Not allowed in PBasic 2.5 - I suggest this capability
DEBUG STR String3 ' Not allowed in PBasic 2.5 - I suggest this capability
End Example:
Your thoughts?
Paul