none
shapes.settext(objek, array) RRS feed

  • Question

  • GraphicsWindow.Show()
    numbers = Shapes.AddText(" ")
    For i = 0 To 10
    x[i] = i
    EndFor
    
    j = 0
    
    main_loop:
    Shapes.SetText(numbers, x[j])
    j = j + 1
    Goto main_loop
    I try to solve my problem for three days but can't found a solution.

    Logically I think this is right. Shapes numbers should change its text with the value inside: x[0], x[1], ... x[end] inside the main_loop with j as iterator variable

    But it wont. I confuse. Can you help why x[j] won't function?

    My curiosity was: because the data (the x (the array)) is outside the main_loop?



    Friday, February 7, 2014 8:52 AM

Answers

  • Your program works, but too fast for you to see.

    If you add a Program.Delay(1000) statement inside the main loop, you see that it works. Only when it reaches j=11 the shape 10 is overwritten by blank as long as j>10. If you replace the mainloop with a For j=1 to 10 , the program ends with 10.


    Jan [ WhTurner ] The Netherlands

    • Marked as answer by Totardo_Tobing Friday, February 7, 2014 10:49 AM
    Friday, February 7, 2014 10:25 AM
    Answerer

All replies

  • Your program works, but too fast for you to see.

    If you add a Program.Delay(1000) statement inside the main loop, you see that it works. Only when it reaches j=11 the shape 10 is overwritten by blank as long as j>10. If you replace the mainloop with a For j=1 to 10 , the program ends with 10.


    Jan [ WhTurner ] The Netherlands

    • Marked as answer by Totardo_Tobing Friday, February 7, 2014 10:49 AM
    Friday, February 7, 2014 10:25 AM
    Answerer
  • Thats right I should add program.delay befor goto main_loop

    Thanks


    Replied

    Friday, February 7, 2014 10:48 AM