Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 08/26/2011 03:18 PM, 20rdj04 wrote:
These four statements, and others, stand on their own:
dispatcher.executeDispatch(document, ".uno:GoToNextPara", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:InsertPara", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:GoToEndOfLine", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, Array())

Parameter 1: a reference to the documents frame object.

Parameter 2: The command.

Parameter 3: Name of the target frame. In your case, this is always an empty string, which means that it is not specified. No problem, because the first parameter receives it and finds the first contained frame that can handle the command.

Parameter 4: Indicates how to search for the named frame. You do not name a frame, so, this is zero and ignored.

Parameter 5: Arguments meant for the command.

So, when you say that these stand on their own, you mean that you send no arguments to the command that is executed.

But moving the cursor Up, Down, Left, or Right requires a DIM set of
statements.  And if I want to move Up or Down 5 lines, 5 arrays are needed,
args1, args2, args3, etc.  I recognize that I can change the Value from 1 to
5 and delete the following 4 sets, but why is it necessary?

Because move up and move down require arguments that tell them how many. Note that the macro recorder does a rather poor job. One of the initial lead developers mentioned to me one time that he thought that it might have been better if it had been removed. He also mentioned roughly how much money and work it would take to fix.

No attempt is made to simplify the generated macro. As each step is recorded, a set of lines is generated. Certainly it is crude. that said, it works fine for many quick and dirty tasks, and then fails for others.


I have a macro now (Re Arrange) which requires that I move down 3 lines to
get part of the old record, and then up 3 lines to place the part, then down
3 lines, and up...

Also, in the set

dim args38(1) as new com.sun.star.beans.PropertyValue
args38(0).Name = "Count"
args38(0).Value = 1
args38(1).Name = "Select"
args38(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args38())

what does Value = false mean; what does Value = true mean?

True and False are boolean values in basic. The "Select" argument takes a true or false, which you can think of as "should I select text as I move?" I seem to remember hearing that this was broken in LO, however, so you might not see any difference if you set it to true. I have not tested it.

In the last
line, what is "" for (a missing parameter, I expect);

I mention this above, that is for the targeted frame name if needed or desired. It is not specified.

and what is the 0 for?

Frame search options. But you did not specify the frame name.

Can the zero be replaced by another number upon occasion?

Yes. My guess is that these values are specified here:

http://api.openoffice.org/docs/common/ref/com/sun/star/frame/FrameSearchFlag.html

Thanks, bless you.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.