PDA

View Full Version : where is the wrong?


nahit
04-27-2007, 11:12 AM
ı want to 20+30+40 with lisbox but ı not understand where is the wrong

plz help

Worm
04-27-2007, 11:16 AM
Be sure to use String.ToNumber() when you are getting a numeric value from a label, input, etc...

Adam
04-27-2007, 11:17 AM
Not totally sure but I did notice this in your code:

result = Label.GetText("Label1");
is = result + 40
Label.SetText("Label4", is);


should be

result = Label.GetText("Label1");
is = result + 40;
Label.SetText("Label4", is);


Not sure if that is the answer but it is worth a shot. You might need to explain further.

Adam Kapilik

bule
04-27-2007, 11:34 AM
No, ; is optional in Lua.
Label.GetText("Label1") returns a string.

Adam
04-27-2007, 12:27 PM
good call.

Adam Kapilik

RizlaUK
04-27-2007, 12:33 PM
for clarification


result = Label.GetText( "Label1");
result = String.ToNumber(result);
is = result + 40
Label.SetText( "Label4", is);

output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)

nahit
04-29-2007, 07:09 AM
thanks a lot

ı could make