Menu

#85 USE OF STATIC ARRAY ELEMENT IN SAY DO NOT WORK

v1.0_(example)
open
nobody
None
1
2025-02-24
2025-01-05
No

Hi all

i have this problem, i do not know if it is possible to solve, but in this way there be a runtime error:

at the beginning of the prg

STATIC o_BUTTON := { 2 }
STATIC o_LABEL := { 2 }

in main function

o_BUTTON[ 1 ] := "Open"
o_LABEL[1] := ""

after window declaration i put

@ 10, 70 BUTTON o_BUTTON[ 1 ] CAPTION "Apri 1" OF oMAINWINDOW ;
ON CLICK { || START( 1 ) } ;

then

@ 180, 75 SAY o_LABEL[1 ] SIZE 65, 30
...
...

FUNCTION START( nBUTTON )
o_LABEL[ nPOSTO ] :="Opened"
RETURN NIL

there is no problem compiling, but when i run the program. i have

Error BASE/1068 Argument error: array access
on line where is the say

why i need this solution, because when i push the button the value of the label have to change with some value

if i use two or more STATIC labels definition, all works

o_LABEL1 := ""
o_LABEL2 := ""

but in this way i have to write more code

any suggestion

Discussion

  • Wilfried Brunken

    Hello Domenico,
    see comment lines of demo program committed with r3510
    test/Ticket85.hbp test/Ticket85.prg

    I hope, this ticket can be closed.

    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Wilfried Brunken

    Hello Domenico,
    is the feature now realized, that you are pleased ?

    Please respond, if this ticket can be closed.

    With regards,
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • domenico d'oria

    domenico d'oria - 2025-02-24

    Hi Wilfried
    you can close the ticket
    many many thanks

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.