Hello
Im using a uLCD-32PT GFX2 device by the way.
Im hoping that some one can shed some light on this for me. I have spent countless days trying to get my head around SIMPLE string parsing in this device. I have bumbled my way through by just simply trying different things. I have to say, its the worst device Ive ever tried to manage by streets, but Im not about to give up on it.
Basically Im sending a 14 byte data stream to it from a processor. Part of the stream contains calender information from a RTC.
I have successfully managed to extract the pieces of information from the stream ( after at least a week ... something that takes mere minutes using any other language)
Please look at the code attached.
The part of the data stream with calander information looks like this 110802094734.
11 - year
08 - month
02 - day
09 - hour
47 - second
34 - minute
I use 3 global variables to hold the information:
var curryear[1]
var currmonth[1]
var currday[1]
You'll see that I print out each parameter as I get the information thus ..
print ( "year ",[STR] curryear); - prints year 2011 ----- which is correct
print ( "month ",[STR] currmonth); - prints month 08 ----- which is correct
print ( "day ",[STR] currday); - prints day 02 ------ which is correct
BUT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! and this is the kicker
print ([STR]currday, "/" ,[STR]currmonth,"/", [STR]curryear);
prints 02/0802/200802 ---- only the currday variable has printed correctly
Go figure .. I am at a loss how a variable can hold one lot of information and then without being altered can produce something entirely different.
Unfortunately the information available for this language is scant to say the least.
Basically its a trial and error type of education whichis why it takes so long.
Any information would be greatly appreciated.
Thank You
Attached files
Im using a uLCD-32PT GFX2 device by the way.
Im hoping that some one can shed some light on this for me. I have spent countless days trying to get my head around SIMPLE string parsing in this device. I have bumbled my way through by just simply trying different things. I have to say, its the worst device Ive ever tried to manage by streets, but Im not about to give up on it.
Basically Im sending a 14 byte data stream to it from a processor. Part of the stream contains calender information from a RTC.
I have successfully managed to extract the pieces of information from the stream ( after at least a week ... something that takes mere minutes using any other language)
Please look at the code attached.
The part of the data stream with calander information looks like this 110802094734.
11 - year
08 - month
02 - day
09 - hour
47 - second
34 - minute
I use 3 global variables to hold the information:
var curryear[1]
var currmonth[1]
var currday[1]
You'll see that I print out each parameter as I get the information thus ..
print ( "year ",[STR] curryear); - prints year 2011 ----- which is correct
print ( "month ",[STR] currmonth); - prints month 08 ----- which is correct
print ( "day ",[STR] currday); - prints day 02 ------ which is correct
BUT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! and this is the kicker
print ([STR]currday, "/" ,[STR]currmonth,"/", [STR]curryear);
prints 02/0802/200802 ---- only the currday variable has printed correctly
Go figure .. I am at a loss how a variable can hold one lot of information and then without being altered can produce something entirely different.
Unfortunately the information available for this language is scant to say the least.
Basically its a trial and error type of education whichis why it takes so long.
Any information would be greatly appreciated.
Thank You
Attached files
Comment