RetroBASIC
Retrogamecoding(.org) => EGSL => Topic started by: lelldorin on February 04, 2013, 09:54:36 PM
-
I have tried to do all steps by the TABLES Tutorial, but in Haiku OS i does not get Text output :-(.
Is this a bug?
openwindow(640,480,0, "Tables Part I")
tables={1,2,3,4,5,6,7,8,9}
drawtext(0,0,"Table Index 1= "..table[ 1])
sync()
inkey()
closewindow()
-
You cannot concatenate tables with "..". (at least not this way)
I have stumbled across this yestreen.
But you could just do two "drawtext"s:
drawtext(0,0,"Table Index 1= ")
drawtext(30,0,tables[1])
The "thirty" is only a placeholder. It may not be the "perfect" value for this example.
-- Kolyamatic
-
You have a error in the code you post, you must try this way.
openwindow(640,480,0, "Tables Part I")
tables={1,2,3,4,5,6,7,8,9}
drawtext(0,0,"Table Index 1= "..tables[1])
sync()
inkey()
closewindow()
you wrote table[1] and it should be tables[1], and yes you can concatenate tables, try it. :)
-
Another concat example that you can try
openwindow(640,480,0, "Tables Part I")
tables={1,2,3,4,5,6,7,8,9}
for i = 1,#tables do
print("Table Index "..i.." = "..tables[i])
end
sync()
inkey()
closewindow()