Ask Your Question
0

Run macro line by line in LO basic IDE?

asked 2016-03-31 18:48:43 +0200

docbda gravatar image

Hi folks!

Looking for a way to run my LO Basic macro line by line for debugging puroses. I know you can do this in the MS Office IDE via "F8". Is there similar functionality in the LO IDE?

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2016-03-31 20:42:45 +0200

jay Arr gravatar image

updated 2016-06-18 18:01:04 +0200

Yes The facilities are almost identical. You can use F8 to step through your code, Shift-F8 to step over, Shift-Command=F8 to step out.

You can also set (and unset) breakpoints and Enable a watch on variables All these are click on icons on the bar of the code creation/editing window.

And if you place your cursor on or in the SUB or FUNCTION deceleration line and click on the RUN BASIC (green right pointing arrow head on my Mac). You can execute the code directly.

A neat shortcut I've discovered after writing some new code. Click and insert a breakpoint anywhere and you'll get a syntax check for free.

If you are getting property not found it's possible that you are calling a function or routine that does not exist. However it's also very likely that it DOES exists and at the point of failure you have mis-spelt it's name. I would do a search through your code for the name.

edit flag offensive delete link more

Comments

Thanks Jay! I tried F8 and it didn't work, but my laptop has some funky function keys. Appreciate the info.

docbda gravatar imagedocbda ( 2016-03-31 23:16:29 +0200 )edit

Thanks for the info. I gave it a try and I couldn't get past the Base form and control calls. I kept getting "property or method not found". Do you know any way around this? Thanks in advance. docbda

docbda gravatar imagedocbda ( 2016-04-02 00:39:24 +0200 )edit
0

answered 2016-06-19 11:23:04 +0200

peterwt gravatar image

@docbda Following on from what others have said and your last comment when you get error "property or method not found". If you create a Macro that runs from an event, such as a button click, and you use the event argument in that Macro then you cannot run the Macro from the Basic IDE. For example –


Sub test(oEvent)
oForm = oEvent.Source.Model.Parent
End Sub


Is a quick way of obtaining the Form Object oForm. The oEvent Object is passed as an argument to the sub. The source of the event is the Button and the parent of the Button is the Form. If you run this directly from the IDE the Event does not occur so the Macro will fail.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-03-31 18:48:43 +0200

Seen: 125 times

Last updated: Jun 19 '16