https://bugs.freedesktop.org/show_bug.cgi?id=87974

--- Comment #10 from rob...@familiegrosskopf.de ---
Hi Bill,

Had first problems to link the macro the right way. Was linked to
(application,Basic), must be linked to (document,Basic) in the form.

No let's have a look at the code:
--------------
Option Explicit

Global defaultDate           as string
Global defaultVendor         as string

Sub Main
defaultDate = Date
defaultVendor = "Eldons"
End Sub

Sub PriorToReset(event)
MsgBox ("defaultDate = " + defaultDate)
MsgBox ("defaultVendor = " + defaultVendor)
End Sub
-------------
Sub PriorToRest(oEvent AS OBJECT)
If there is set Option Explicit you have to declare all variables.

Where should the content of Sub Main be loaded. I haven't found any link. If
you will change the code it will work as expected:

Sub PriorToReset
Main
MsgBox ("defaultDate = " + defaultDate)
MsgBox ("defaultVendor = " + defaultVendor)
End Sub

If I understand right you think 'Main' is a keyword and will be executed by
default. I have just read the help of LibreOffice in German Language, when I
searched for "main" in LibreOffice Basic:
«Der "Sub Main"-Abschnitt wird bei der Programmausführung nicht bevorzugt
behandelt.»
Must be translated to something like this:
«"Sub Main"-procedure wouldn't be executed in preference.»
You have to start the procedure by an event or with another procedure, as shown
above.

Regards

Robert

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to