string content problem

General discussion on mikroPascal for AVR.
Post Reply
Author
Message
alm_lug
Posts: 2
Joined: 18 Aug 2008 20:05

string content problem

#1 Post by alm_lug » 18 Aug 2008 20:08

lcd_cmd(LCD_CLEAR);

lcd_cmd(LCD_SECOND_ROW);
tmpst2:='+++++++++';
strAppendSuf(tmpst2,255);strAppendSuf(tmpst2,255);Strcat(tmpst2,'OK');
for i:=0 to 7 do begin
bytetostr(tmpst2,tmpst1);Lcd_Out_Cp(tmpst1);Lcd_Out_Cp(',');
end;


on lcd i see: 43,43,43,43,43,5,43,43,

where from this "5" ????

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: string content problem

#2 Post by Dany » 19 Aug 2008 15:50

alm_lug wrote:lwhere from this "5" ????
Good question. Can we see the declaration of "tmpst1" and "tmpst2"?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

#3 Post by Dany » 19 Aug 2008 15:52

for i:=0 to 7 do begin
Question, not hing to do with your problem I assume:
If I can count right then, after all processing, "tmps2" should have a length of 13 characters. Why only showing the first 8? The original string is already 9 characters long!
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

alm_lug
Posts: 2
Joined: 18 Aug 2008 20:05

#4 Post by alm_lug » 19 Aug 2008 21:45

I found problem. Problem was with my brain )

Post Reply

Return to “mikroPascal for AVR General”