Author Topic: BUG Reports Haiku OS Version  (Read 4185 times)

lelldorin

  • Guest
BUG Reports Haiku OS Version
« 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?
Code: [Select]
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()

kolyamatic

  • Guest
Re: BUG Reports Haiku OS Version
« Reply #1 on: February 04, 2013, 11:01:00 PM »
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


cvirus

  • Guest
Re: BUG Reports Haiku OS Version
« Reply #2 on: February 05, 2013, 09:52:27 AM »
You have a error in the code you post, you must try this way.

Code: [Select]
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.  :)

cvirus

  • Guest
Re: BUG Reports Haiku OS Version
« Reply #3 on: February 05, 2013, 10:04:15 AM »
Another concat example that you can try

Code: [Select]
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()