Found the answer in the built in help…
<CODE>Dim Dlg As Object
Dim LastString As String</CODE>
Should be:
<CODE>Global Dlg As Object
Global LastString As String</CODE>
Johnny Rosenberg
2009/6/9 Johnny Rosenberg <
gurus.knugum@...>:
> <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@...