Problem with display number

hi dear
i want display number(For Ex:16 or 11 or 14 ) on screen(simulator) because i want compare two number (For Ex: 16 and 11) So, please help me…i displayed from some way but i couldn’t compare:>

1:> text1 = display.newText( “16”, 500, 700, native.systemFont, 30 )

2:> highScoreLabel = display.newText( “Number” … Number(16), 0, 0, native.systemFont, 15 )

please help me…
[import]uid: 87661 topic_id: 16995 reply_id: 316995[/import]

which device sim or you using 500,700 is off screen if using iPhone 3
and Number(16) doesn’t display the number 16 either just use 16 or before that line Number=16 then just use Number in display.newText [import]uid: 7911 topic_id: 16995 reply_id: 63775[/import]

(500, 700) just i wrote dimension for trying…but i use “16” as well as display.newText both in this way we can display only…but
i want compare (Suppose that “a = 11” and “b = 16” )like::>

if b > a then
b = a
print(b)
t.text = btime
end

So, how i can write b =16 and a = 11 on screen…please help me friend

[import]uid: 87661 topic_id: 16995 reply_id: 63794[/import]

just what Jeff said, the same in code

 local text1 = display.newText("16", 100,100, native.systemFont, 30)  
 local highScoreLabel = display.newText("Number " .. 16, 0,0,native.systemFont, 15)  

hope that helps,

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16995 reply_id: 63795[/import]

when i am comparing “16” with “highScoreLabel” simulator are giving error like::>

attempt to compare number with table…
[import]uid: 87661 topic_id: 16995 reply_id: 63802[/import]

hi dear

please help me on above problem…like

when i am comparing “16” with “highScoreLabel” simulator are giving error like::>

attempt to compare number with table…
[import]uid: 87661 topic_id: 16995 reply_id: 64863[/import]

because highScoreLabel is a table or a display object, where as highScoreLabel.text is a string.

so bear in mind that

“16” can be compared with highScoreLabel.text as both as strings, but there can be funny results if you compare strings, so it is best to convert both into numbers for conversion.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16995 reply_id: 64865[/import]