« Return to Thread: Problems with global variables in OpenOffice.org BASIC…

Problems with global variables in OpenOffice.org BASIC…

by Johnny Rosenberg :: Rate this Message:

Reply to Author | View in Thread

<CODE>
REM  *****  BASIC  *****

Option Explicit

Dim Dlg As Object
Dim LastString As String

Sub Test
        Dim Ctl As Object
       
        DialogLibraries.LoadLibrary("Standard")
        Dlg = CreateUnoDialog(DialogLibraries.Standard.TestDlg)
       
        Ctl=Dlg.getControl("TextField")

        Ctl.SetText(LastString)
       
        Dlg.Execute()
       
        LastString=Ctl.getText()
End Sub
</CODE>

I made a simple dialogue, TestDlg. It contains a text field and an OK button.

Dlg and LastString are global, right?
Before executing the dialogue, I set the text of the textfield to
LastString. First time I run it, LastString is of course empty, but
why is it empty the second time?
I am obviously missing something, so how am I supposed to do this? I
just want the dialogue to be pre filled with the value I entered last
time, that's all…

Kind regards

Johnny Rosenberg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

 « Return to Thread: Problems with global variables in OpenOffice.org BASIC…