[Gambas-user] (no subject)

ron ronstk at ...239...
Mon Sep 13 16:05:05 CEST 2004


On Monday 13 September 2004 14:11, francesco.difusco at ...69... wrote:

~~~~~~~~~~~~~

> PUBLIC SUB Button1_Click()
> DIM tablename AS String 
> DIM p2 AS Process
> IF tabelle.Index<>-1 THEN
> textbox1.text=tabelle.Current.text
> tablename=tabelle.Current.text
> EXEC ["mdb-schema", DbName, "-T", tablename] FOR READ AS p2
> ELSE
> textbox1.text="Nessun elemento selezionato"
> EXEC ["mdb-schema", DBname] FOR READ AS p2
>  Object.Attach(p2, ME, "proc2")
> ENDIF
> end
> 
> But when I execute the program and I select an item in the listbox, the program
> is blocked. If I don't select an item in the list, teh program works correctly.
> 
> Francesco
> 
~~~~~~~~~~~~
yes thats true
Try to keep it simple for yourself
Use the tab key a bit more :)

PUBLIC SUB Button1_Click()
DIM tablename AS String 
DIM p2 AS Process

  IF tabelle.Index<>-1 THEN
    textbox1.text=tabelle.Current.text
    tablename=tabelle.Current.text
    EXEC ["mdb-schema", DbName, "-T", tablename] FOR READ AS p2
  ELSE
    textbox1.text="Nessun elemento selezionato"
    EXEC ["mdb-schema", DBname] FOR READ AS p2
    Object.Attach(p2, ME, "proc2")
  ENDIF
end

I assume you want in both cases of the IF ... THEN ... ELSE ... ENDIF
the returning data is read.
You have two times the EXEC but one time the Object.Attach ????

Maybe a copy of Object.Attach(p2, ME, "proc2") in the THEN section can help.
or pull it out the IF ENDIF and put it between ENDIF an end

I think you can see it now why indent is so good to have :)

have a good time Ron 
 




More information about the User mailing list