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

lelldorin

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • BeSly - Knowledge base
BUG Reports Haiku OS Version
« on: 04. February 2013, 22:54:36 »
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

  • Newcomer
  • *
  • Posts: 18
    • View Profile
Re: BUG Reports Haiku OS Version
« Reply #1 on: 05. February 2013, 00:01:00 »
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

  • Regular Member
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: BUG Reports Haiku OS Version
« Reply #2 on: 05. February 2013, 10:52:27 »
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

  • Regular Member
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: BUG Reports Haiku OS Version
« Reply #3 on: 05. February 2013, 11:04:15 »
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()