I understood their function, I just did not know how or where they were getting their value. As Phil so kindly pointed out, it was all in the Propeller Manual, which explained the enumeration clearly. I just missed finding it when I looked the first time. Did I mention that my eye sight is getting bad?
Just as well you posed the question.
I've never noticed they were even in there before and I was defining them again in my own code. Or worse just using the appropriate "magic numbers" here and there.
This is from the Parallax Serial Terminal example downloaded with Propeller Tool. I modified it a little to suit my liking, but here they are:
'Parallax Serial Terminal Control Character Constants
HM = 1 'HM: Home Cursor
PC = 2 'PC: Position Cursor In X, Y
ML = 3 'ML: Move Cursor Left
MR = 4 'MR: Move Cursor Right
MU = 5 'MU: Move Cursor Up
MD = 6 'MD: Move Cursor Down
BP = 7 'BP: Beep Speaker
BS = 8 'BS: Backspace
TB = 9 'TB: Tab
LF = 10 'LF: Line Feed
CE = 11 'CE: Clear To End Of line
CB = 12 'CB: Clear Lines Below
CR = 13 'CR: Carriage Return
PX = 14 'PX: Position Cursor In X
PY = 15 'PY: Position Cursor In Y
CS = 16 'CS: Clear Screen
SP = 32 'Space
It's too bad there isn't some sort of mechanism to import constants and methods, rather than having to refer to them as sio#LF, sio#CLS, sio.tx, etc. This is something that could be included in the OBJ section, perhaps:
OBJ
sio : "FullDuplexSerial" CR, LF, CLS, tx, rx, dec
Even a using pragma would be helpful for including an object's namespace in certain sections of code.
I know you said you don't like autoupdates, but it sure would be nice that if you declared a FDS object that a message box would pop up asking you if you would like to add FDS constants to the current file
Comments
Why not check the Propeller Manual under "Constants"? It's all there. (Hint: It's called an "enumeration".)
-Phil
I looked before posting, but couldn't find anything. After your post, I looked again, and found it. Sorry and thank you.
Bruce
Perhaps. But maybe they are provide for convenience to be used from the clients of FullDuplexSerial.
For example LF is the character (byte) value of "Line Feed". In an object using FullDupexSerial it could be used as:
Which woul transmit a line feed character down the line.
I understood their function, I just did not know how or where they were getting their value. As Phil so kindly pointed out, it was all in the Propeller Manual, which explained the enumeration clearly. I just missed finding it when I looked the first time. Did I mention that my eye sight is getting bad?
Thanks for the response Heater
Bruce
I've never noticed they were even in there before and I was defining them again in my own code. Or worse just using the appropriate "magic numbers" here and there.
This is from the Parallax Serial Terminal example downloaded with Propeller Tool. I modified it a little to suit my liking, but here they are:
Cheers
Bruce
Even a using pragma would be helpful for including an object's namespace in certain sections of code.
-Phil
I know you said you don't like autoupdates, but it sure would be nice that if you declared a FDS object that a message box would pop up asking you if you would like to add FDS constants to the current file
Bruce