Assign a NULL value to a variable?
Hi all,
I've suddenly developed a need to assign a NULL value to a variable.
Obviously the NULL isn't liked by the syntax checker but that is where I need to assign a null value.
My problem is as I am only using the decimal GPS format, I need to determine a way to display the negative symbol if the direction (dir) returned from the GPS receiver for Lat and Long coordinates is W or S.
Is there an easier way to do this or have I just missed how to empty a variable somewhere along the line?
Many Thanks in Advance,
Morrolan
.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Flying is simple. You just throw yourself at the ground and miss.
"I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image."
Stephen Hawking
Post Edited (Morrolan) : 5/30/2008 4:24:50 PM GMT
I've suddenly developed a need to assign a NULL value to a variable.
IF dir = 1 THEN ' dir is a byte, 0 = N, 1 = S from Parallax GPS Receiver) negDisp = negSym ' negDisp is a byte, negSym is a Constant (45) for hyphen/minus symbol on Parallax serial LCD) ELSEIF dir = 0 THEN neg = NULL ENDIF SEROUT TX, LcdBaud, [noparse][[/noparse]$85, negDisp, DEC degrees, ".", DEC4 workVal] ' adapted from the GPS Demo code to output to a serialLCD instead of Debug
Obviously the NULL isn't liked by the syntax checker but that is where I need to assign a null value.
My problem is as I am only using the decimal GPS format, I need to determine a way to display the negative symbol if the direction (dir) returned from the GPS receiver for Lat and Long coordinates is W or S.
Is there an easier way to do this or have I just missed how to empty a variable somewhere along the line?
Many Thanks in Advance,
Morrolan
.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Flying is simple. You just throw yourself at the ground and miss.
"I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image."
Stephen Hawking
Post Edited (Morrolan) : 5/30/2008 4:24:50 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
If sign=1 or sign=0, the "-" is either included or not.
Another way to do this is,
That version sends out either a space (sign=0) or "-" (sign=1).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Of course I should have realised that I should just do it Mike Green's way but I was tired at that point.
I will also investigate the REP modifier as that looks to be the neatest and smallest solution so far.
Many Thanks,
Morrolan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Flying is simple. You just throw yourself at the ground and miss.
"I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image."
Stephen Hawking