[Solved] Linked message boxes

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Tommi89
Posts: 2
Joined: Sun Dec 17, 2017 5:20 pm

[Solved] Linked message boxes

Post by Tommi89 »

Hi guys, i'm new here, I'm working on my first vba test project and i'm already stuck. Everything seems to work well until i try to close the last message box, where open office displays an error message about undefined function or subs. Can you help me? :knock:
thanks
Attachments
Icecreamtest.ods
(9.43 KiB) Downloaded 204 times
Last edited by Hagar Delest on Sun Dec 17, 2017 10:24 pm, edited 1 time in total.
Reason: tagged [Solved].
Open office 4.1 on Windows 10
FJCC
Moderator
Posts: 9273
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Linked message boxes

Post by FJCC »

This is not VBA but OpenOffice Basic. Try removing the Run from the beginning of your calls of Subs.

Code: Select all

sub f1
Dim sVar as Integer
sVar = MsgBox("Do you like icecream?",35,"Icecream")
If sVar = 7 then
  f12
End if
If sVar = 6 then
  f11
End if

End Sub


sub f12
Dim sVar as Integer
sVar = MsgBox("i don't like you!",0,"Icecream test")
  
End Sub



sub f11
Dim sVar as Integer
sVar = MsgBox("Do you like it relly much?",35,"Icecream test")
If sVar = 7 then
  f112
End if
If sVar = 6 then
  f111
End if

End Sub


sub f111
Dim sVar as Integer
sVar = MsgBox("Good Boy!",0,"Icecream test")
  
End Sub

sub f112
Dim sVar as Integer
sVar = MsgBox("Ok Boy!",0,"Icecream test")
  
End Sub
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Tommi89
Posts: 2
Joined: Sun Dec 17, 2017 5:20 pm

Re: Linked message boxes

Post by Tommi89 »

That was easy. thank you very much, i lost nearly 2 hrs on that!!!! =)
Open office 4.1 on Windows 10
Post Reply