Difference between revisions of "User talk:גאַנגלערי"
From Apache OpenOffice Wiki
(You can find me at ~~~) |
(// changed to \\) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
You can find me at ·‎[[User:גאַנגלערי|גאַנגלערי]]·[[User_talk:גאַנגלערי|T]]·[[wikipedia:m:user:Gangleri|m:]] [http://en.wikipedia.org/wiki/m:user_talk:Gangleri?action=history Th]·[[wikipedia:m:user talk:Gangleri|T]]·[[wikipedia:m:special:Emailuser/Gangleri|email me]]·‎ | You can find me at ·‎[[User:גאַנגלערי|גאַנגלערי]]·[[User_talk:גאַנגלערי|T]]·[[wikipedia:m:user:Gangleri|m:]] [http://en.wikipedia.org/wiki/m:user_talk:Gangleri?action=history Th]·[[wikipedia:m:user talk:Gangleri|T]]·[[wikipedia:m:special:Emailuser/Gangleri|email me]]·‎ | ||
__TOC__ | __TOC__ | ||
+ | == my first macro == | ||
+ | |||
+ | <pre> | ||
+ | sub begin_end | ||
+ | rem ---------------------------------------------------------------------- | ||
+ | rem define variables | ||
+ | dim document as object | ||
+ | dim dispatcher as object | ||
+ | rem ---------------------------------------------------------------------- | ||
+ | rem get access to the document | ||
+ | document = ThisComponent.CurrentController.Frame | ||
+ | dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") | ||
+ | |||
+ | rem Text begin ----------------------------------------------------------- | ||
+ | dim args2(0) as new com.sun.star.beans.PropertyValue | ||
+ | args2(0).Name = "Text" | ||
+ | args2(0).Value = "" | ||
+ | |||
+ | rem Text end ------------------------------------------------------------- | ||
+ | dim args4(0) as new com.sun.star.beans.PropertyValue | ||
+ | args4(0).Name = "Text" | ||
+ | args4(0).Value = "" | ||
+ | |||
+ | rem arrow down ----------------------------------------------------------- | ||
+ | dim args5(1) as new com.sun.star.beans.PropertyValue | ||
+ | args5(0).Name = "Count" | ||
+ | args5(0).Value = 1 | ||
+ | args5(1).Name = "Select" | ||
+ | args5(1).Value = false | ||
+ | |||
+ | rem line ----------------------------------------------------------------- | ||
+ | dim args11(0) as new com.sun.star.beans.PropertyValue | ||
+ | args11(0).Name = "Text" | ||
+ | args11(0).Value = createUnoService("com.sun.star.io.XTextInputStream:readLine()") | ||
+ | |||
+ | rem eof ------------------------------------------------------------------ | ||
+ | dim args12(0) as new com.sun.star.beans.PropertyValue | ||
+ | args12(0).Name = "Text" | ||
+ | args12(0).Value = createUnoService("com.sun.star.io.XTextInputStream:isEOF()") | ||
+ | |||
+ | rem OUStringBuffer aBuffer ----------------------------------------------- | ||
+ | |||
+ | rem 10 ------------------------------------------------------------------- | ||
+ | dim args13(0) as new com.sun.star.beans.PropertyValue | ||
+ | args13(0).Name = "Howmany" | ||
+ | args13(0).Value = 10 | ||
+ | |||
+ | rem Text \\ -------------------------------------------------------------- | ||
+ | dim args21(0) as new com.sun.star.beans.PropertyValue | ||
+ | args21(0).Name = "Text" | ||
+ | args21(0).Value = "\\" | ||
+ | |||
+ | rem while args13(0).Value ------------------------------------------------ | ||
+ | rem while NOT ( xTextInputStream = isEOF() ) ----------------------------- | ||
+ | while args13(0).Value | ||
+ | |||
+ | rem ---------------------------------------------------------------------- | ||
+ | dispatcher.executeDispatch(document, ".uno:GoToStartOfLine", "", 0, Array()) | ||
+ | dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args2()) | ||
+ | |||
+ | rem ---------------------------------------------------------------------- | ||
+ | dispatcher.executeDispatch(document, ".uno:GoToEndOfLine", "", 0, Array()) | ||
+ | dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args4()) | ||
+ | |||
+ | dispatcher.executeDispatch(document, ".uno:InsertPara", "", 0, Array()) | ||
+ | dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args21()) | ||
+ | |||
+ | dispatcher.executeDispatch(document, ".uno:GoToStartOfLine", "", 0, Array()) | ||
+ | dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args5()) | ||
+ | |||
+ | rem args11(0).Value = createUnoService("com.sun.star.io.XTextInputStream:readLine()") | ||
+ | rem args12(0).Value = createUnoService("com.sun.star.io.XTextInputStream:isEOF()") | ||
+ | |||
+ | rem args13(0).Value = args13(0).Value - 1 -------------------------------- | ||
+ | args13(0).Value = args13(0).Value - 1 | ||
+ | |||
+ | wend | ||
+ | |||
+ | end sub | ||
+ | </pre> | ||
+ | |||
+ | comments:‎ | ||
+ | |||
+ | : This macro should « loop » until the « end of file » is reached. | ||
+ | : Can anybody give me a hand? | ||
+ | : Thanks for all your efforts in advance. Best regards ·‎[[User:גאַנגלערי|גאַנגלערי]]·[[User_talk:גאַנגלערי|T]]·[[wikipedia:m:user:Gangleri|m:]] [http://en.wikipedia.org/wiki/m:user_talk:Gangleri?action=history Th]·[[wikipedia:m:user talk:Gangleri|T]]·[[wikipedia:m:special:Emailuser/Gangleri|email me]]·‎ 05:05, 24 November 2007 (CET) |
Latest revision as of 06:57, 24 November 2007
You can find me at ·גאַנגלערי·T·m: Th·T·email me·
Contents
my first macro
sub begin_end rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem Text begin ----------------------------------------------------------- dim args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "Text" args2(0).Value = "" rem Text end ------------------------------------------------------------- dim args4(0) as new com.sun.star.beans.PropertyValue args4(0).Name = "Text" args4(0).Value = "" rem arrow down ----------------------------------------------------------- dim args5(1) as new com.sun.star.beans.PropertyValue args5(0).Name = "Count" args5(0).Value = 1 args5(1).Name = "Select" args5(1).Value = false rem line ----------------------------------------------------------------- dim args11(0) as new com.sun.star.beans.PropertyValue args11(0).Name = "Text" args11(0).Value = createUnoService("com.sun.star.io.XTextInputStream:readLine()") rem eof ------------------------------------------------------------------ dim args12(0) as new com.sun.star.beans.PropertyValue args12(0).Name = "Text" args12(0).Value = createUnoService("com.sun.star.io.XTextInputStream:isEOF()") rem OUStringBuffer aBuffer ----------------------------------------------- rem 10 ------------------------------------------------------------------- dim args13(0) as new com.sun.star.beans.PropertyValue args13(0).Name = "Howmany" args13(0).Value = 10 rem Text \\ -------------------------------------------------------------- dim args21(0) as new com.sun.star.beans.PropertyValue args21(0).Name = "Text" args21(0).Value = "\\" rem while args13(0).Value ------------------------------------------------ rem while NOT ( xTextInputStream = isEOF() ) ----------------------------- while args13(0).Value rem ---------------------------------------------------------------------- dispatcher.executeDispatch(document, ".uno:GoToStartOfLine", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args2()) rem ---------------------------------------------------------------------- dispatcher.executeDispatch(document, ".uno:GoToEndOfLine", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args4()) dispatcher.executeDispatch(document, ".uno:InsertPara", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args21()) dispatcher.executeDispatch(document, ".uno:GoToStartOfLine", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args5()) rem args11(0).Value = createUnoService("com.sun.star.io.XTextInputStream:readLine()") rem args12(0).Value = createUnoService("com.sun.star.io.XTextInputStream:isEOF()") rem args13(0).Value = args13(0).Value - 1 -------------------------------- args13(0).Value = args13(0).Value - 1 wend end sub
comments: