Posted By: DdlV
String help - 04/22/14 16:16
Hi all. There must be something obviously wrong with this snipit, but I can't see it. Why is the value of s1 being reset after the last assignment to its value from the prior bar? Thanks.
Code:
function run() { set(LOGFILE); if (Bar>5) quit(); string s1 = "12345678901234567890"; printf("\nBar,s1=%i,%s",Bar,s1); s1 = "00"; printf("\nBar,s1=%i,%s",Bar,s1); s1 = "xx"; printf("\nBar,s1=%i,%s",Bar,s1); s1 = "**"; printf("\nBar,s1=%i,%s",Bar,s1); sprintf(s1,"%02d",3*Bar+7); printf("\nBar,s1=%i,%s",Bar,s1); }