diff --git a/Examples/_LOWriter_CellBackColor.au3 b/Examples/_LOWriter_CellBackColor.au3 index f580bba7..db518952 100644 --- a/Examples/_LOWriter_CellBackColor.au3 +++ b/Examples/_LOWriter_CellBackColor.au3 @@ -11,57 +11,57 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Retrieve current BackGround Color and Back Transparent settings. Return will be an Array with elements in order of function parameters. $aCellBackGround = _LOWriter_CellBackColor($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now demonstrate modifying a cell's background color settings. The current Background color value is: " & $aCellBackGround[0] & _ @CRLF & " And the current Background Transparency setting is: " & $aCellBackGround[1]) ; Set the cell Background color to $LOW_COLOR_INDIGO, and BackTransparent to False. _LOWriter_CellBackColor($oCell, $LOW_COLOR_INDIGO, False) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) ; Set Table Cell's Text. _LOWriter_CellString($oCell, "Text with a colorful background.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) ; Retrieve current BackGround Color and Back Transparent settings. $aCellBackGround = _LOWriter_CellBackColor($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have set the cell's background color to $LOW_COLOR_INDIGO. The current Background color value is: " & $aCellBackGround[0] & _ @CRLF & " And the current Background Transparency setting is: " & $aCellBackGround[1]) ; Set the cell BackTransparent to True. _LOWriter_CellBackColor($oCell, Null, True) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) ; Set Table Cell's Text. _LOWriter_CellString($oCell, "Text without a colorful background.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) ; Retrieve current BackGround Color and Back Transparent settings. $aCellBackGround = _LOWriter_CellBackColor($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have set the cell's background transparent setting to True, which means the color will not be visible. " & _ "The current Background color value is: " & $aCellBackGround[0] & _ @@ -69,15 +69,15 @@ Func Example() ; Set the cell Background color to a random number, and BackTransparent to False. _LOWriter_CellBackColor($oCell, Random(0, 16777215, $iIntegerFlag), False) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) ; Set Table Cell's Text. _LOWriter_CellString($oCell, "Text with a random colorful background.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) ; Retrieve current BackGround Color and Back Transparent settings. $aCellBackGround = _LOWriter_CellBackColor($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current Text Table Cell Background settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have set the cell's background color to a random number, and the background transparent setting to False." & _ "The current Background color value is: " & $aCellBackGround[0] & _ @@ -87,7 +87,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellBorderColor.au3 b/Examples/_LOWriter_CellBorderColor.au3 index f1a8caec..1b104ea8 100644 --- a/Examples/_LOWriter_CellBorderColor.au3 +++ b/Examples/_LOWriter_CellBorderColor.au3 @@ -12,27 +12,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Border width so I can set the Border Color. _LOWriter_CellBorderWidth($oCell, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) $iColor1 = Random(0, 16777215, $iIntegerFlag) $iColor2 = Random(0, 16777215, $iIntegerFlag) @@ -41,11 +41,11 @@ Func Example() ; Set the Border Color, a Random Color on each side. _LOWriter_CellBorderColor($oCell, $iColor1, $iColor2, $iColor3, $iColor4) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border Color settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border Color settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current Border Style settings. Return will be an array, with elements in order of function parameters. $aCellBorder = _LOWriter_CellBorderColor($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Border Color settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Border Color settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Border Color settings are: " & @CRLF & "Top = " & $aCellBorder[0] & @CRLF & "Bottom = " & $aCellBorder[1] & @CRLF & _ "Left = " & $aCellBorder[2] & @CRLF & "Right = " & $aCellBorder[3]) @@ -54,7 +54,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellBorderPadding.au3 b/Examples/_LOWriter_CellBorderPadding.au3 index 0ac5cd93..a869887b 100644 --- a/Examples/_LOWriter_CellBorderPadding.au3 +++ b/Examples/_LOWriter_CellBorderPadding.au3 @@ -12,53 +12,53 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the table $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set each Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve 2nd down. 2nd over ("B2") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "B2") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Border width so I can set Border padding. _LOWriter_CellBorderWidth($oCell, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4 Inch to Micrometers. $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set cell Border padding values, 1/4 inch on all sides. _LOWriter_CellBorderPadding($oCell, $iMicrometers, $iMicrometers, $iMicrometers, $iMicrometers) ; Retrieve current Border Padding settings. Return will be an Array, with Array elements in order of function parameters. $aCellBorder = _LOWriter_CellBorderPadding($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Border Padding settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Border Padding settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Cell Border padding settings are: " & @CRLF & _ "Top = " & $aCellBorder[0] & " Micrometers" & @CRLF & _ @@ -70,7 +70,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellBorderStyle.au3 b/Examples/_LOWriter_CellBorderStyle.au3 index 74406880..d88ae4a4 100644 --- a/Examples/_LOWriter_CellBorderStyle.au3 +++ b/Examples/_LOWriter_CellBorderStyle.au3 @@ -10,39 +10,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Border width so I can set the Border Style. _LOWriter_CellBorderWidth($oCell, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) ; Set the Border Style, a different style on each side. _LOWriter_CellBorderStyle($oCell, $LOW_BORDERSTYLE_DOTTED, $LOW_BORDERSTYLE_DASHED, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_THICKTHIN_SMALLGAP) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border Style settings. Error:" & @error & " Extended:" & @extended) ; Set Table Cell's Text. _LOWriter_CellString($oCell, "Text inside the Cell's styled borders.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) ; Retrieve current Border Style settings. Return will be an Array, with elements in order of function parameters. $aCellBorder = _LOWriter_CellBorderStyle($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Border Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Border Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Border Style settings are: " & @CRLF & "Top = " & $aCellBorder[0] & @CRLF & "Bottom = " & $aCellBorder[1] & @CRLF & _ "Left = " & $aCellBorder[2] & @CRLF & "Right = " & $aCellBorder[3] & @CRLF & @CRLF & "see Constants in UDF for value meanings.") @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellBorderWidth.au3 b/Examples/_LOWriter_CellBorderWidth.au3 index 60819218..d6629708 100644 --- a/Examples/_LOWriter_CellBorderWidth.au3 +++ b/Examples/_LOWriter_CellBorderWidth.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Border width. _LOWriter_CellBorderWidth($oCell, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) ; Set Table Cell's Text. _LOWriter_CellString($oCell, "Text inside the Cell's borders.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) ; Retrieve current Border Width settings. Return will be an array with elements in order of function parameters. $aCellBorder = _LOWriter_CellBorderWidth($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Border Width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Border Width settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Border Width settings are: " & @CRLF & "Top = " & $aCellBorder[0] & @CRLF & "Bottom = " & $aCellBorder[1] & @CRLF & _ "Left = " & $aCellBorder[2] & @CRLF & "Right = " & $aCellBorder[3] & @CRLF & @CRLF & "see Constants in UDF for value meanings.") @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellCreateTextCursor.au3 b/Examples/_LOWriter_CellCreateTextCursor.au3 index a82c8dc5..4e1b2d5a 100644 --- a/Examples/_LOWriter_CellCreateTextCursor.au3 +++ b/Examples/_LOWriter_CellCreateTextCursor.au3 @@ -10,56 +10,56 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array or Cell names. $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve 2nd down. 2nd over ("B2") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "B2") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Create a Text cursor in the cell. $oTextCursor = _LOWriter_CellCreateTextCursor($oCell) - If (@error > 0) Then _ERROR("Failed to create a Text Cursor in Text Table cell. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Text Cursor in Text Table cell. Error:" & @error & " Extended:" & @extended) ; Move the text cursor to the end of the text. _LOWriter_CursorMove($oTextCursor, $LOW_TEXTCUR_GOTO_END) - If (@error > 0) Then _ERROR("Failed to move Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text using the Text Cursor. _LOWriter_DocInsertString($oDoc, $oTextCursor, @CR & "This is some new text.") - If (@error > 0) Then _ERROR("Failed to insert Text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellFormula.au3 b/Examples/_LOWriter_CellFormula.au3 index 72f673c2..448271ec 100644 --- a/Examples/_LOWriter_CellFormula.au3 +++ b/Examples/_LOWriter_CellFormula.au3 @@ -12,50 +12,50 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed To Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed To retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed To create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed To insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed To retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names. $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed To retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed To set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed To retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell Formula to (2 + 2) / 4 * 8 _LOWriter_CellFormula($oCell, "(2+2)/4*8") - If (@error > 0) Then _ERROR("Failed To set Text Table cell formula. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To set Text Table cell formula. Error:" & @error & " Extended:" & @extended) ; Retrieve the Cell Formula. $sFormula = _LOWriter_CellFormula($oCell) - If (@error > 0) Then _ERROR("Failed To retrieve Text Table cell Formula. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To retrieve Text Table cell Formula. Error:" & @error & " Extended:" & @extended) ; Retrieve the result of the formula. $nValue = _LOWriter_CellValue($oCell) - If (@error > 0) Then _ERROR("Failed To retrieve Text Table cell Value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed To retrieve Text Table cell Value. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Cell Formula is: " & $sFormula & " The result of which is: " & $nValue) @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellGetDataType.au3 b/Examples/_LOWriter_CellGetDataType.au3 index c9646d31..badbca76 100644 --- a/Examples/_LOWriter_CellGetDataType.au3 +++ b/Examples/_LOWriter_CellGetDataType.au3 @@ -11,42 +11,42 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Retrieve the Data Type. $iDataType = _LOWriter_CellGetDataType($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Data type. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Data type. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The data type contained in cell ""A1"" is " & $iDataType & @CRLF & @CRLF & _ "The possible types are as follows: " & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellGetError.au3 b/Examples/_LOWriter_CellGetError.au3 index 5be97fd8..2495567f 100644 --- a/Examples/_LOWriter_CellGetError.au3 +++ b/Examples/_LOWriter_CellGetError.au3 @@ -12,65 +12,65 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names. $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell Formula to 2 + 2 _LOWriter_CellFormula($oCell, "2+2") - If (@error > 0) Then _ERROR("Failed to set Text Table cell formula. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell formula. Error:" & @error & " Extended:" & @extended) ; Retrieve the error value $iError = _LOWriter_CellGetError($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Table Cell formula error value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Table Cell formula error value. Error:" & @error & " Extended:" & @extended) ; Retrieve the Cell Formula. $sFormula = _LOWriter_CellFormula($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Formula. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Formula. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Cell's current error value is: " & $iError & @CRLF & _ "The Cell's current formula is: " & $sFormula) ; Set the Cell Formula to 2 + 2 with some random letters to cause an error _LOWriter_CellFormula($oCell, "2+2 xdv") - If (@error > 0) Then _ERROR("Failed to set Text Table cell formula. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell formula. Error:" & @error & " Extended:" & @extended) ; Retrieve the error value again $iError = _LOWriter_CellGetError($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Table Cell formula error value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Table Cell formula error value. Error:" & @error & " Extended:" & @extended) ; Retrieve the Cell Formula again. $sFormula = _LOWriter_CellFormula($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Formula. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Formula. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Cell's current error value is: " & $iError & @CRLF & _ "The Cell's current formula is: " & $sFormula) @@ -79,7 +79,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellGetName.au3 b/Examples/_LOWriter_CellGetName.au3 index 86f54510..63e7a13b 100644 --- a/Examples/_LOWriter_CellGetName.au3 +++ b/Examples/_LOWriter_CellGetName.au3 @@ -11,42 +11,42 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve 2nd down. 2nd over ("B2") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "B2") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Retrieve the Cell's name $sCellName = _LOWriter_CellGetName($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell name. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Cell's name is: " & $sCellName) @@ -54,7 +54,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellProtect.au3 b/Examples/_LOWriter_CellProtect.au3 index 8bd124f5..5daa17c3 100644 --- a/Examples/_LOWriter_CellProtect.au3 +++ b/Examples/_LOWriter_CellProtect.au3 @@ -10,30 +10,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set A1 Table Cell's Text. _LOWriter_CellString($oCell, "Try to change this Text.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) $bCellProtected = _LOWriter_CellProtect($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell current write protection setting. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell current write protection setting. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now demonstrate modifying a cell's write protection setting. The current setting is: " & $bCellProtected & _ @CRLF & " The possible settings are: " & @CRLF & "True, which means the cell cannot be edited, or " & @CRLF & _ @@ -41,19 +41,19 @@ Func Example() ; Set the cell protection to True. _LOWriter_CellProtect($oCell, True) - If (@error > 0) Then _ERROR("Failed to set Text Table cell write protection setting. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell write protection setting. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now set the cell protection to True, attempt to edit the text, and then press ok.") ; Set the cell protection to False. _LOWriter_CellProtect($oCell, False) - If (@error > 0) Then _ERROR("Failed to set Text Table cell write protection setting. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell write protection setting. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now set the cell protection to False, now try to edit the text, and then press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellString.au3 b/Examples/_LOWriter_CellString.au3 index 3aba70f6..ea184b7b 100644 --- a/Examples/_LOWriter_CellString.au3 +++ b/Examples/_LOWriter_CellString.au3 @@ -11,42 +11,42 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Retrieve the Cell String. $sString = _LOWriter_CellString($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Cell String is: " & $sString) @@ -54,7 +54,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellValue.au3 b/Examples/_LOWriter_CellValue.au3 index d34ba501..bc92c3f1 100644 --- a/Examples/_LOWriter_CellValue.au3 +++ b/Examples/_LOWriter_CellValue.au3 @@ -11,46 +11,46 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) ; Insert Cell names For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell Value to the 1234.05 _LOWriter_CellValue($oCell, 1234.05) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Value. Error:" & @error & " Extended:" & @extended) ; Retrieve the Cell value. $nValue = _LOWriter_CellValue($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Value. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Cell value is: " & $nValue) @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CellVertOrient.au3 b/Examples/_LOWriter_CellVertOrient.au3 index 789d3920..e755f7f1 100644 --- a/Examples/_LOWriter_CellVertOrient.au3 +++ b/Examples/_LOWriter_CellVertOrient.au3 @@ -10,67 +10,67 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Retrieve top 2nd in cell ("B1" Table Cell Object $oCell2 = _LOWriter_TableGetCellObjByName($oTable, "B1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set A1 Table Cell's Text. _LOWriter_CellString($oCell, "This Test Text.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) ; Set B1 Table Cell's Text. _LOWriter_CellString($oCell2, @CR) - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) $iVertOrient = _LOWriter_CellVertOrient($oCell) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell current vertical orientation. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell current vertical orientation. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now demonstrate modifying a cell's vertical text orientation. The current setting is: " & $iVertOrient & _ @CRLF & " The possible settings are: " & @CRLF & "$LOW_ORIENT_VERT_NONE(0)," & @CRLF & "$LOW_ORIENT_VERT_TOP(1)," & @CRLF & _ "$LOW_ORIENT_VERT_CENTER(2)," & @CRLF & "$LOW_ORIENT_VERT_BOTTOM(3)") _LOWriter_CellVertOrient($oCell, $LOW_ORIENT_VERT_BOTTOM) - If (@error > 0) Then _ERROR("Failed to set Text Table cell vertical orientation. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell vertical orientation. Error:" & @error & " Extended:" & @extended) ; Set A1 Table Cell's Text. _LOWriter_CellString($oCell, "Text vertically aligned to the bottom.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now set the Vertical Orientation to $LOW_ORIENT_VERT_BOTTOM(3).") _LOWriter_CellVertOrient($oCell, $LOW_ORIENT_VERT_CENTER) - If (@error > 0) Then _ERROR("Failed to set Text Table cell vertical orientation. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell vertical orientation. Error:" & @error & " Extended:" & @extended) ; Set A1 Table Cell's Text. _LOWriter_CellString($oCell, "Text vertically aligned to the Center.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now set the Vertical Orientation to $LOW_ORIENT_VERT_CENTER(2).") _LOWriter_CellVertOrient($oCell, $LOW_ORIENT_VERT_TOP) - If (@error > 0) Then _ERROR("Failed to set Text Table cell vertical orientation. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell vertical orientation. Error:" & @error & " Extended:" & @extended) ; Set A1 Table Cell's Text. _LOWriter_CellString($oCell, "Text vertically aligned to the Top.") - If (@error > 0) Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now set the Vertical Orientation to $LOW_ORIENT_VERT_TOP(1).") @@ -78,7 +78,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleBorderColor.au3 b/Examples/_LOWriter_CharStyleBorderColor.au3 index 8199836c..3d8f98d8 100644 --- a/Examples/_LOWriter_CharStyleBorderColor.au3 +++ b/Examples/_LOWriter_CharStyleBorderColor.au3 @@ -10,47 +10,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_CharStyleBorderWidth($oCharStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border color to $LOW_COLOR_BRICK _LOWriter_CharStyleBorderColor($oCharStyle, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleBorderColor($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Border color settings are as follows: " & @CRLF & _ "Top color, in long color format: " & $avCharStyleSettings[0] & @CRLF & _ @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleBorderPadding.au3 b/Examples/_LOWriter_CharStyleBorderPadding.au3 index cad4f2de..64f9b1af 100644 --- a/Examples/_LOWriter_CharStyleBorderPadding.au3 +++ b/Examples/_LOWriter_CharStyleBorderPadding.au3 @@ -11,51 +11,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_CharStyleBorderWidth($oCharStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border padding to 1/4" _LOWriter_CharStyleBorderPadding($oCharStyle, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleBorderPadding($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Border Padding distance settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avCharStyleSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -68,15 +68,15 @@ Func Example() ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border padding to, Top and Right, 1/4", Bottom and left, 1/2". _LOWriter_CharStyleBorderPadding($oCharStyle, Null, $iMicrometers, $iMicrometers2, $iMicrometers2, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleBorderPadding($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Border Padding distance settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avCharStyleSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -90,7 +90,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleBorderStyle.au3 b/Examples/_LOWriter_CharStyleBorderStyle.au3 index 51e67a88..a456c7ab 100644 --- a/Examples/_LOWriter_CharStyleBorderStyle.au3 +++ b/Examples/_LOWriter_CharStyleBorderStyle.au3 @@ -10,48 +10,48 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_CharStyleBorderWidth($oCharStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border Style to, Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_FINE_DASHED, ; Left = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, Right = $LOW_BORDERSTYLE_SOLID _LOWriter_CharStyleBorderStyle($oCharStyle, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_FINE_DASHED, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_SOLID) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleBorderStyle($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Border Style settings are as follows: " & @CRLF & _ "Top style, (see UDF constants): " & $avCharStyleSettings[0] & @CRLF & _ @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleBorderWidth.au3 b/Examples/_LOWriter_CharStyleBorderWidth.au3 index 52fdd123..f9ba646a 100644 --- a/Examples/_LOWriter_CharStyleBorderWidth.au3 +++ b/Examples/_LOWriter_CharStyleBorderWidth.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_CharStyleBorderWidth($oCharStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleBorderWidth($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Border width settings are as follows: " & @CRLF & _ "Top width, in Micrometers: " & $avCharStyleSettings[0] & @CRLF & _ @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleCreate.au3 b/Examples/_LOWriter_CharStyleCreate.au3 index 03bc2340..2db44adb 100644 --- a/Examples/_LOWriter_CharStyleCreate.au3 +++ b/Examples/_LOWriter_CharStyleCreate.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Character Style for demonstration. _LOWriter_CharStyleCreate($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) ; Check if the Character style exists. $bExists = _LOWriter_CharStyleExists($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Character style called ""NewCharStyle"" exist in the document? True/False: " & $bExists) @@ -26,7 +26,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleDelete.au3 b/Examples/_LOWriter_CharStyleDelete.au3 index ddf7eb71..d4745582 100644 --- a/Examples/_LOWriter_CharStyleDelete.au3 +++ b/Examples/_LOWriter_CharStyleDelete.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Character Style for demonstration. $oCharStyle = _LOWriter_CharStyleCreate($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) ; Check if the Character style exists. $bExists = _LOWriter_CharStyleExists($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Character style called ""NewCharStyle"" exist in the document? True/False: " & $bExists) @@ -27,7 +27,7 @@ Func Example() ; Check if the Character style still exists. $bExists = _LOWriter_CharStyleExists($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Character style called ""NewCharStyle"" still exist in the document? True/False: " & $bExists) @@ -35,7 +35,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleEffect.au3 b/Examples/_LOWriter_CharStyleEffect.au3 index 01900d43..11909470 100644 --- a/Examples/_LOWriter_CharStyleEffect.au3 +++ b/Examples/_LOWriter_CharStyleEffect.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Font effects to $LOW_RELIEF_EMBOSSED relief type. _LOWriter_CharStyleEffect($oCharStyle, $LOW_RELIEF_EMBOSSED) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleEffect($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Font effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avCharStyleSettings[0] & @CRLF & _ @@ -58,11 +58,11 @@ Func Example() ; Set "Example" Character style Font effects to $LOW_RELIEF_NONE relief type, Case to $LOW_CASEMAP_SM_CAPS _LOWriter_CharStyleEffect($oCharStyle, $LOW_RELIEF_NONE, $LOW_CASEMAP_SM_CAPS) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleEffect($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Font effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avCharStyleSettings[0] & @CRLF & _ @@ -75,7 +75,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleEffect[2].au3 b/Examples/_LOWriter_CharStyleEffect[2].au3 index 23c8b46d..acb40a4d 100644 --- a/Examples/_LOWriter_CharStyleEffect[2].au3 +++ b/Examples/_LOWriter_CharStyleEffect[2].au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Font effects to shadow = True. _LOWriter_CharStyleEffect($oCharStyle, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleEffect($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Font effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avCharStyleSettings[0] & @CRLF & _ @@ -58,11 +58,11 @@ Func Example() ; Set "Example" Character Style Font effects to shadow = False and Outline = True. _LOWriter_CharStyleEffect($oCharStyle, Null, Null, Null, True, False) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleEffect($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Font effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avCharStyleSettings[0] & @CRLF & _ @@ -74,11 +74,11 @@ Func Example() ; Set "Example" Character Style Font effects Outline to False, and Hidden to true. _LOWriter_CharStyleEffect($oCharStyle, Null, Null, True, False, Null) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleEffect($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Font effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avCharStyleSettings[0] & @CRLF & _ @@ -91,7 +91,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleExists.au3 b/Examples/_LOWriter_CharStyleExists.au3 index 61a6bf40..bba75194 100644 --- a/Examples/_LOWriter_CharStyleExists.au3 +++ b/Examples/_LOWriter_CharStyleExists.au3 @@ -10,21 +10,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Character Style for demonstration. _LOWriter_CharStyleCreate($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) ; Check if the Character style exists. $bExists = _LOWriter_CharStyleExists($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Character style called ""NewCharStyle"" exist in the document? True/False: " & $bExists) ; Check if the a fake Character style exists. $bExists = _LOWriter_CharStyleExists($oDoc, "FakeCharStyle") - If (@error > 0) Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Character Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Character style called ""FakeCharStyle"" exist in the document? True/False: " & $bExists) @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleFont.au3 b/Examples/_LOWriter_CharStyleFont.au3 index 40572b57..3f827e1d 100644 --- a/Examples/_LOWriter_CharStyleFont.au3 +++ b/Examples/_LOWriter_CharStyleFont.au3 @@ -10,44 +10,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" Character Style object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Font to "Arial", Font size to 18,Posture (Italic) to $LOW_POSTURE_ITALIC, and weight (Bold) ; to $LOW_WEIGHT_BOLD _LOWriter_CharStyleFont($oDoc, $oCharStyle, "Arial", 18, $LOW_POSTURE_ITALIC, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleFont($oDoc, $oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Font settings are as follows: " & @CRLF & _ "Font name: " & $avCharStyleSettings[0] & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleFontColor.au3 b/Examples/_LOWriter_CharStyleFontColor.au3 index 134acd9d..03dae1e6 100644 --- a/Examples/_LOWriter_CharStyleFontColor.au3 +++ b/Examples/_LOWriter_CharStyleFontColor.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" Character Style object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style font color to $LOW_COLOR_RED, Transparency to 50%, and Highlight to $LOW_COLOR_GOLD _LOWriter_CharStyleFontColor($oCharStyle, $LOW_COLOR_RED, 50, $LOW_COLOR_GOLD) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleFontColor($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current font color settings are as follows: " & @CRLF & _ "The current Font color, in Long color format: " & $avCharStyleSettings[0] & " This value is a bit weird because transparency" & _ @@ -57,11 +57,11 @@ Func Example() ; Set "Example" Character style transparency to 0 _LOWriter_CharStyleFontColor($oCharStyle, Null, 0) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleFontColor($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current font color settings are as follows: " & @CRLF & _ "The current Font color in Long color format: " & $avCharStyleSettings[0] & @CRLF & _ @@ -72,7 +72,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleGetObj.au3 b/Examples/_LOWriter_CharStyleGetObj.au3 index 6788003a..9543f92d 100644 --- a/Examples/_LOWriter_CharStyleGetObj.au3 +++ b/Examples/_LOWriter_CharStyleGetObj.au3 @@ -9,47 +9,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate retrieving a Character style Object.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now retrieve the ""Example"" character style object, and modify some of its settings.") ; Retrieve the "Example" character style object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" character style font weight to bold. _LOWriter_CharStyleFont($oDoc, $oCharStyle, Null, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleOrganizer.au3 b/Examples/_LOWriter_CharStyleOrganizer.au3 index efaa8640..35c68150 100644 --- a/Examples/_LOWriter_CharStyleOrganizer.au3 +++ b/Examples/_LOWriter_CharStyleOrganizer.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Character Style for demonstration. $oCharStyle = _LOWriter_CharStyleCreate($oDoc, "NewCharStyle") - If (@error > 0) Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Character style. Error:" & @error & " Extended:" & @extended) ; Modify the new Character style's name to "New-Char-Name", set the parent style to "Example" Character style, and hidden to false. _LOWriter_CharStyleOrganizer($oDoc, $oCharStyle, "New-Char-Name", "Example", False) - If (@error > 0) Then _ERROR("Failed to modify Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleOrganizer($oDoc, $oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Organizer settings are as follows: " & @CRLF & _ "The Character Style's name is: " & $avCharStyleSettings[0] & @CRLF & _ @@ -33,7 +33,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleOverLine.au3 b/Examples/_LOWriter_CharStyleOverLine.au3 index c402bd1e..48cb9c1e 100644 --- a/Examples/_LOWriter_CharStyleOverLine.au3 +++ b/Examples/_LOWriter_CharStyleOverLine.au3 @@ -10,44 +10,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Overline settings to Words only = True, Overline style $LOW_UNDERLINE_BOLD_DASH_DOT, Overline has ; Color = True, and Color to $LOW_COLOR_BROWN _LOWriter_CharStyleOverLine($oCharStyle, True, $LOW_UNDERLINE_BOLD_DASH_DOT, True, $LOW_COLOR_BROWN) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleOverLine($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Overline settings are as follows: " & @CRLF & _ "Overline words only? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStylePosition.au3 b/Examples/_LOWriter_CharStylePosition.au3 index 7ddfb893..a9f542f9 100644 --- a/Examples/_LOWriter_CharStylePosition.au3 +++ b/Examples/_LOWriter_CharStylePosition.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style font position to auto Superscript, and relative size to 50%. _LOWriter_CharStylePosition($oCharStyle, True, Null, Null, Null, 50) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStylePosition($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -58,11 +58,11 @@ Func Example() ; Set "Example" Character style font position to auto Subscript _LOWriter_CharStylePosition($oCharStyle, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStylePosition($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's new position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -75,7 +75,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStylePosition[2].au3 b/Examples/_LOWriter_CharStylePosition[2].au3 index a590612b..6023aa6f 100644 --- a/Examples/_LOWriter_CharStylePosition[2].au3 +++ b/Examples/_LOWriter_CharStylePosition[2].au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style font position to 75% Superscript, and relative size to 50%. _LOWriter_CharStylePosition($oCharStyle, Null, 75, Null, Null, 50) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStylePosition($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -58,11 +58,11 @@ Func Example() ; Set "Example" Character style font position to 75% Subscript _LOWriter_CharStylePosition($oCharStyle, Null, Null, Null, 75) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStylePosition($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's new position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -75,7 +75,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleRotateScale.au3 b/Examples/_LOWriter_CharStyleRotateScale.au3 index fadd5091..83e6ba0d 100644 --- a/Examples/_LOWriter_CharStyleRotateScale.au3 +++ b/Examples/_LOWriter_CharStyleRotateScale.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style font Rotation to 90 degrees and Scale width to 75% _LOWriter_CharStyleRotateScale($oCharStyle, 90, 75) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleRotateScale($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current rotation and scale width settings are as follows: " & @CRLF & _ "Rotation, in degrees: " & $avCharStyleSettings[0] & @CRLF & _ @@ -56,7 +56,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleSet.au3 b/Examples/_LOWriter_CharStyleSet.au3 index b26112a1..0d77c442 100644 --- a/Examples/_LOWriter_CharStyleSet.au3 +++ b/Examples/_LOWriter_CharStyleSet.au3 @@ -9,31 +9,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I set the character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text before I set the Character Style to ""Emphasis"". ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now set the current character style to ""Emphasis.""") ; Set the character style to Emphasis using the ViewCursor. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Emphasis") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Insert some text after I set the character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some emphasized text.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleShadow.au3 b/Examples/_LOWriter_CharStyleShadow.au3 index 30339881..c5699d86 100644 --- a/Examples/_LOWriter_CharStyleShadow.au3 +++ b/Examples/_LOWriter_CharStyleShadow.au3 @@ -11,47 +11,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Shadow to 1/4" wide, Color to $LOW_COLOR_PURPLE, Transparent to false, and location to $LOW_SHADOW_TOP_LEFT _LOWriter_CharStyleShadow($oCharStyle, $iMicrometers, $LOW_COLOR_PURPLE, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleShadow($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current shadow settings are as follows: " & @CRLF & _ "Shadow width, in Micrometers: " & $avCharStyleSettings[0] & @CRLF & _ @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleSpacing.au3 b/Examples/_LOWriter_CharStyleSpacing.au3 index c796a835..6367636d 100644 --- a/Examples/_LOWriter_CharStyleSpacing.au3 +++ b/Examples/_LOWriter_CharStyleSpacing.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Kerning to auto _LOWriter_CharStyleSpacing($oCharStyle, True) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleSpacing($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Kerning settings are as follows: " & @CRLF & _ "Automatically adjust kerning? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -55,11 +55,11 @@ Func Example() ; Set "Example" Character style Kerning to 1.5 _LOWriter_CharStyleSpacing($oCharStyle, False, 1.5) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleSpacing($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Kerning settings are as follows: " & @CRLF & _ "Automatically adjust kerning? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -69,7 +69,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleStrikeOut.au3 b/Examples/_LOWriter_CharStyleStrikeOut.au3 index e6394188..77156e36 100644 --- a/Examples/_LOWriter_CharStyleStrikeOut.au3 +++ b/Examples/_LOWriter_CharStyleStrikeOut.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style Strikeout settings to, Words only = True, Strikeout = True, Line style = $LOW_STRIKEOUT_X _LOWriter_CharStyleStrikeOut($oCharStyle, True, True, $LOW_STRIKEOUT_X) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleStrikeOut($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current Strikeout settings are as follows: " & @CRLF & _ "Strikeout words only? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -57,7 +57,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStyleUnderLine.au3 b/Examples/_LOWriter_CharStyleUnderLine.au3 index 68136e74..20ba664d 100644 --- a/Examples/_LOWriter_CharStyleUnderLine.au3 +++ b/Examples/_LOWriter_CharStyleUnderLine.au3 @@ -10,44 +10,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Character style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a Character style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the Character style to "Example" Character style. _LOWriter_CharStyleSet($oDoc, $oViewCursor, "Example") - If (@error > 0) Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Example" object. $oCharStyle = _LOWriter_CharStyleGetObj($oDoc, "Example") - If (@error > 0) Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Character style object. Error:" & @error & " Extended:" & @extended) ; Set "Example" Character style underline settings to Words only = True, Underline style $LOW_UNDERLINE_BOLD_DASH_DOT, Underline has ; Color = True, and Color to $LOW_COLOR_BROWN _LOWriter_CharStyleUnderLine($oCharStyle, True, $LOW_UNDERLINE_BOLD_DASH_DOT, True, $LOW_COLOR_BROWN) - If (@error > 0) Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Character style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avCharStyleSettings = _LOWriter_CharStyleUnderLine($oCharStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Character style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Character style's current underline settings are as follows: " & @CRLF & _ "Underline words only? True/False: " & $avCharStyleSettings[0] & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CharStylesGetNames.au3 b/Examples/_LOWriter_CharStylesGetNames.au3 index 8ef357b2..51e3b34a 100644 --- a/Examples/_LOWriter_CharStylesGetNames.au3 +++ b/Examples/_LOWriter_CharStylesGetNames.au3 @@ -10,57 +10,57 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Character Style names. $asCharStyles = _LOWriter_CharStylesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve array of Character style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Character style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of available Character styles. There are " & @extended & " results.") ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Character Styles available in this document are:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCharStyles) -1 ; Insert the character Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asCharStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next ; Retrieve Array of Character Style names that are applied to the document $asCharStyles = _LOWriter_CharStylesGetNames($oDoc, False, True) - If (@error > 0) Then _ERROR("Failed to retrieve array of Character style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Character style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now display a list of used Character styles. There are " & @extended & " results.") ; Move the View Cursor to the end of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_End) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Character Styles currently in use in this document are:" & @CR & @CR,True) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCharStyles) -1 ; Insert the character Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asCharStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ComError_UserFunction.au3 b/Examples/_LOWriter_ComError_UserFunction.au3 index 0b9c1c37..b12f75ff 100644 --- a/Examples/_LOWriter_ComError_UserFunction.au3 +++ b/Examples/_LOWriter_ComError_UserFunction.au3 @@ -21,7 +21,7 @@ Func Example() ; Now set the User COM Error function ; The First Param is my User function I want called any time there is a COM Error. _LOWriter_ComError_UserFunction($MyFunc) - If (@error > 0) Then _ERROR("Error Assigning User COM Error Function. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error Assigning User COM Error Function. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now cause a COM Error, to demonstrate the function.") diff --git a/Examples/_LOWriter_ComError_UserFunction[2].au3 b/Examples/_LOWriter_ComError_UserFunction[2].au3 index ca899bdf..a4145a04 100644 --- a/Examples/_LOWriter_ComError_UserFunction[2].au3 +++ b/Examples/_LOWriter_ComError_UserFunction[2].au3 @@ -24,7 +24,7 @@ Func Example() ; the second function parameter is my first optional Parameter, a String, my second optional Parameter is an integer, my third ; optional parameter is a boolean, the fourth optional parameter is a String, and the fifth optional parameter is an integer. _LOWriter_ComError_UserFunction($MyFunc, "My First Param", 05, False, "Another String", 100) - If (@error > 0) Then _ERROR("Error Assigning User COM Error Function. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error Assigning User COM Error Function. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now cause a COM Error, to demonstrate the function.") @@ -33,7 +33,7 @@ Func Example() ; I will now set the function again, this time with less Parameters. _LOWriter_ComError_UserFunction($MyFunc, "My First Param", 2023, "I have only three Parameters now.") - If (@error > 0) Then _ERROR("Error Assigning User COM Error Function. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error Assigning User COM Error Function. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will cause another COM Error, to demonstrate the function.") diff --git a/Examples/_LOWriter_ConvertColorFromLong.au3 b/Examples/_LOWriter_ConvertColorFromLong.au3 index 16b484d8..245963fd 100644 --- a/Examples/_LOWriter_ConvertColorFromLong.au3 +++ b/Examples/_LOWriter_ConvertColorFromLong.au3 @@ -11,42 +11,42 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the table Background color to and set Transparent to False. _LOWriter_TableColor($oTable, $LOW_COLOR_MAGENTA, False) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to demonstrate how to convert the Long color format integer value, $LOW_COLOR_MAGENTA (12517441), into R(ed), G(reen), " & _ "B(lue) values, a Hexadecimal value, C(yan), M(agenta), Y(ellow), and K(ey) values, and H(ue), S(aturation) B(rightness) values.") ; Convert to RGB From Long Color format, the RGB values are returned as an array in their order. $aiRGB = _LOWriter_ConvertColorFromLong(Null, $LOW_COLOR_MAGENTA) - If (@error > 0) Then _ERROR("Failed to convert to RGB color value from Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to RGB color value from Long color format integer. Error:" & @error & " Extended:" & @extended) ; Convert to Hex From Long color format, Hex is returned as a string. $sHex = _LOWriter_ConvertColorFromLong($LOW_COLOR_MAGENTA) - If (@error > 0) Then _ERROR("Failed to convert to HEX color value from Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to HEX color value from Long color format integer. Error:" & @error & " Extended:" & @extended) ; Convert to CMYK From Long Color format, the CMYK values are returned as an array in their order. $aiCMYK = _LOWriter_ConvertColorFromLong(Null, Null, Null, $LOW_COLOR_MAGENTA) - If (@error > 0) Then _ERROR("Failed to convert to CMYK color value from Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to CMYK color value from Long color format integer. Error:" & @error & " Extended:" & @extended) ; Convert to HSB From Long Color format, the HSB values are returned as an array in their order. $aiHSB = _LOWriter_ConvertColorFromLong(Null, Null, $LOW_COLOR_MAGENTA) - If (@error > 0) Then _ERROR("Failed to convert to HSB color value from Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to HSB color value from Long color format integer. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The conversion results are as follows: " & @CRLF & _ "Long->RGB = " & "R, " & $aiRGB[0] & "; G, " & $aiRGB[1] & "; B, " & $aiRGB[2] & " Should be: R, 191; G, 0; B, 65" & @CRLF & _ @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ConvertColorToLong.au3 b/Examples/_LOWriter_ConvertColorToLong.au3 index af678d58..3348a986 100644 --- a/Examples/_LOWriter_ConvertColorToLong.au3 +++ b/Examples/_LOWriter_ConvertColorToLong.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the table Background color to and set Transparent to False. _LOWriter_TableColor($oTable, $LOW_COLOR_MAGENTA, False) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to demonstrate how to find the Long color format integer value from R(ed), G(reen), B(lue) values, a Hexadecimal value, " & _ " C(yan), M(agenta), Y(ellow), and K(ey) values, and H(ue), S(aturation) B(rightness) values, from the color constant $LOW_COLOR_MAGENTA. According to " & _ @@ -38,19 +38,19 @@ Func Example() ; Convert RGB to Long Color format, the RGB values are input as integers in their order. $iRGB_TO_LONG = _LOWriter_ConvertColorToLong(191, 0, 65) - If (@error > 0) Then _ERROR("Failed to convert RGB color value to Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert RGB color value to Long color format integer. Error:" & @error & " Extended:" & @extended) ; Convert Hex to Long color format, Hex is input as a string. $iHEX_TO_LONG = _LOWriter_ConvertColorToLong("bf0041") - If (@error > 0) Then _ERROR("Failed to convert HEX color value to Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert HEX color value to Long color format integer. Error:" & @error & " Extended:" & @extended) ; Convert CMYK to Long Color format, the CMYK values are input as integers in their order. $iCMYK_TO_LONG = _LOWriter_ConvertColorToLong(0, 100, 66, 25) - If (@error > 0) Then _ERROR("Failed to convert CMYK color value to Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert CMYK color value to Long color format integer. Error:" & @error & " Extended:" & @extended) ; Convert HSB to Long Color format, the HSB values are input as strings in their order. $iHSB_TO_LONG = _LOWriter_ConvertColorToLong("340", "100", "75") - If (@error > 0) Then _ERROR("Failed to convert HSB color value to Long color format integer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert HSB color value to Long color format integer. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The expected result is 12517441, the conversion results are as follows: " & @CRLF & _ "RGB->Long = " & $iRGB_TO_LONG & @CRLF & _ @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ConvertFromMicrometer.au3 b/Examples/_LOWriter_ConvertFromMicrometer.au3 index f12834cd..2776e5df 100644 --- a/Examples/_LOWriter_ConvertFromMicrometer.au3 +++ b/Examples/_LOWriter_ConvertFromMicrometer.au3 @@ -9,19 +9,19 @@ Func Example() ; Convert 2540 Micrometers to Inches. $iInch_From_MicroM = _LOWriter_ConvertFromMicrometer(2540) - If (@error > 0) Then _ERROR("Failed to convert from Micrometers to Inch. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from Micrometers to Inch. Error:" & @error & " Extended:" & @extended) ; Convert 2540 Micrometers to Centimeters. $iCM_From_MicroM = _LOWriter_ConvertFromMicrometer(Null, 2540) - If (@error > 0) Then _ERROR("Failed to convert to Micrometers from Centimeter. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to Micrometers from Centimeter. Error:" & @error & " Extended:" & @extended) ; Convert 2540 Micrometers to Millimeters. $iMM_From_MicroM = _LOWriter_ConvertFromMicrometer(Null, Null, 2540) - If (@error > 0) Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) ; Convert 2540 Micrometers to Printer's Points. $iPt_From_MicroM = _LOWriter_ConvertFromMicrometer(Null, Null, Null, 2540) - If (@error > 0) Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "2540 Micrometers converted to Inches = " & $iInch_From_MicroM & @CRLF & _ "2540 Micrometers to CM = " & $iCM_From_MicroM & @CRLF & _ diff --git a/Examples/_LOWriter_ConvertToMicrometer.au3 b/Examples/_LOWriter_ConvertToMicrometer.au3 index 5c155511..48d6c132 100644 --- a/Examples/_LOWriter_ConvertToMicrometer.au3 +++ b/Examples/_LOWriter_ConvertToMicrometer.au3 @@ -9,19 +9,19 @@ Func Example() ; Convert 1 Inch to Micrometers. $iInch_To_MicroM = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert to Micrometers from Inch. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to Micrometers from Inch. Error:" & @error & " Extended:" & @extended) ; Convert 2.54 Centimeters to Micrometers. $iCM_To_MicroM = _LOWriter_ConvertToMicrometer(Null, 2.54) - If (@error > 0) Then _ERROR("Failed to convert to Micrometers from Centimeter. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to Micrometers from Centimeter. Error:" & @error & " Extended:" & @extended) ; Convert 25.40 Millimeters to Micrometers. $iMM_To_MicroM = _LOWriter_ConvertToMicrometer(Null, Null, 25.4) - If (@error > 0) Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) ; Convert 72 Printer's Points to Micrometers. $iPt_To_MicroM = _LOWriter_ConvertToMicrometer(Null, Null, Null, 72) - If (@error > 0) Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert to Micrometers from Millimeter. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "1 Inch converted to Micrometers = " & $iInch_To_MicroM & @CRLF & _ "2.54 Cm to Micrometers = " & $iCM_To_MicroM & @CRLF & _ diff --git a/Examples/_LOWriter_CursorGetDataType.au3 b/Examples/_LOWriter_CursorGetDataType.au3 index 6b4f43c9..fbe1e45a 100644 --- a/Examples/_LOWriter_CursorGetDataType.au3 +++ b/Examples/_LOWriter_CursorGetDataType.au3 @@ -11,15 +11,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve what type of Data the cursor is presently in. $iCursorDataType = _LOWriter_CursorGetDataType($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve Cursor Data type. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Cursor Data type. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The possible cursor data type values are: " & @CRLF & _ "$LOW_CURDATA_BODY_TEXT (1)" & @CRLF & _ @@ -52,7 +52,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ + If @error Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CursorGetStatus.au3 b/Examples/_LOWriter_CursorGetStatus.au3 index ba6585cd..da4dfabf 100644 --- a/Examples/_LOWriter_CursorGetStatus.au3 +++ b/Examples/_LOWriter_CursorGetStatus.au3 @@ -11,36 +11,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text." & @CR & @CR & "Some different text" & @CR & "Another Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Check if the ViewCursor is currently at the end of a line. $bReturn = _LOWriter_CursorGetStatus($oViewCursor, $LOW_CURSOR_STAT_IS_END_OF_LINE) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the ViewCursor at the end of a line? True/False: " & $bReturn & @CRLF & @CRLF & _ "I will now move the cursor to the beginning, and test again.") ; Move the Cursor to the beginning of the document. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) ; Check if the ViewCursor is currently at the end of a line. $bReturn = _LOWriter_CursorGetStatus($oViewCursor, $LOW_CURSOR_STAT_IS_END_OF_LINE) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the ViewCursor at the end of a line? True/False: " & $bReturn) ; Retrieve the page number the Viewcursor is currently on. $iPage = _LOWriter_CursorGetStatus($oViewCursor, $LOW_CURSOR_STAT_GET_PAGE) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The ViewCursor is currently on page " & $iPage) @@ -48,7 +48,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CursorGetStatus[2].au3 b/Examples/_LOWriter_CursorGetStatus[2].au3 index 9a1053dd..b85e3eca 100644 --- a/Examples/_LOWriter_CursorGetStatus[2].au3 +++ b/Examples/_LOWriter_CursorGetStatus[2].au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Text Cursor. $oTextCursor = _LOWriter_DocCreateTextCursor($oDoc, False) - If (@error > 0) Then _ERROR("Failed to create a Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oTextCursor, "Some text." & @CR & @CR & "Some different text" & @CR & "Another Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Check if the TextCursor is currently at the end of a word. $bReturn = _LOWriter_CursorGetStatus($oTextCursor, $LOW_CURSOR_STAT_IS_END_OF_WORD) - If (@error > 0) Then _ERROR("Failed to retrieve the Text Cursor Status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Text Cursor Status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the TextCursor at the end of a Word? True/False: " & $bReturn & @CRLF & @CRLF & _ "I will now move the cursor, and test again.") ; Move the Cursor to left 3 spaces. _LOWriter_CursorMove($oTextCursor, $LOW_TEXTCUR_GO_LEFT, 3) - If (@error > 0) Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) ; Check if the TextCursor is currently at the end of a word. $bReturn = _LOWriter_CursorGetStatus($oTextCursor, $LOW_CURSOR_STAT_IS_END_OF_WORD) - If (@error > 0) Then _ERROR("Failed to retrieve the Text Cursor status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Text Cursor status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the TextCursor at the end of a Word? True/False: " & $bReturn) ; Check if the TextCursor is currently collapsed, meaning whether or not it has anything selected. $bReturn = _LOWriter_CursorGetStatus($oTextCursor, $LOW_CURSOR_STAT_IS_COLLAPSED) - If (@error > 0) Then _ERROR("Failed to retrieve the Text Cursor status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Text Cursor status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is nothing selected by the TextCursor? True/False: " & $bReturn) @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CursorGetStatus[3].au3 b/Examples/_LOWriter_CursorGetStatus[3].au3 index f92db7f4..1efc2afc 100644 --- a/Examples/_LOWriter_CursorGetStatus[3].au3 +++ b/Examples/_LOWriter_CursorGetStatus[3].au3 @@ -11,52 +11,52 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 4 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 4, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Create a Table Cursor. -- Cursor will be created in the first cell ("A1") $oTableCursor = _LOWriter_TableCreateCursor($oDoc, $oTable) - If (@error > 0) Then _ERROR("Failed to create Text Table cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table cursor. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Check what cell or cells the TableCursor is currently in. $sReturn = _LOWriter_CursorGetStatus($oTableCursor, $LOW_CURSOR_STAT_GET_RANGE_NAME) - If (@error > 0) Then _ERROR("Failed to retrieve the Text Cursor Status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Text Cursor Status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "When the Table cursor has no cells selected, the cell the Table cursor is presently in, is returned. The Table cursor is in cell: " & _ $sReturn) ; Move the TableCursor right Twice, selecting cells as I go. _LOWriter_CursorMove($oTableCursor, $LOW_TABLECUR_GO_RIGHT, 2, True) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) ; Check what cell or cells the TableCursor is currently in. $sReturn = _LOWriter_CursorGetStatus($oTableCursor, $LOW_CURSOR_STAT_GET_RANGE_NAME) - If (@error > 0) Then _ERROR("Failed to retrieve the Text Cursor Status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Text Cursor Status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "When the Table cursor has cells selected, the beginning cell and the ending cell, are returned, separated by a colon." & @CRLF & _ "The Table cursor has the following cell range selected: " & $sReturn) @@ -65,7 +65,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CursorGetType.au3 b/Examples/_LOWriter_CursorGetType.au3 index a92ce872..8b47da9b 100644 --- a/Examples/_LOWriter_CursorGetType.au3 +++ b/Examples/_LOWriter_CursorGetType.au3 @@ -11,15 +11,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Get the type of Cursor. $iCursorType = _LOWriter_CursorGetType($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve Cursor Object type. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Cursor Object type. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The possible cursor type values are: " & @CRLF & _ "$LOW_CURTYPE_TEXT_CURSOR (1)" & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ + If @error Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CursorGoToRange.au3 b/Examples/_LOWriter_CursorGoToRange.au3 index a125759a..58e40ada 100644 --- a/Examples/_LOWriter_CursorGoToRange.au3 +++ b/Examples/_LOWriter_CursorGoToRange.au3 @@ -9,37 +9,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text using the View Cursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text." & @CR & @CR & "Some different text" & @CR & "Another Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a new Text Cursor. $oTextCursor = _LOWriter_DocCreateTextCursor($oDoc, False) - If (@error > 0) Then _ERROR("Failed to create a Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text using the Text Cursor _LOWriter_DocInsertString($oDoc, $oTextCursor, ">[This is where the Text Cursor currently is.]< ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the TextCursor to where the View Cursor is, do not select text on the way. _LOWriter_CursorGoToRange($oTextCursor, $oViewCursor, False) - If (@error > 0) Then _ERROR("Failed to move Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert more text using the Text Cursor _LOWriter_DocInsertString($oDoc, $oTextCursor, " >[This is where the Text Cursor now is, after moving it to the ViewCursor's position.]<") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CursorMove.au3 b/Examples/_LOWriter_CursorMove.au3 index e23cbf52..25ce236b 100644 --- a/Examples/_LOWriter_CursorMove.au3 +++ b/Examples/_LOWriter_CursorMove.au3 @@ -9,53 +9,53 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "First Line of text" & @CR & _ "Second line of text." & @CR & _ "Third line of text." & @CR & _ "Fourth Line of Text.") - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) ; Return the cursor back to the start. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now move the cursor to the right five characters.") ; Move the View Cursor right 5 characters, without selecting them. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 5, False) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next I will move the cursor to the right five more characters, this time I will select them.") ; Move the View Cursor right 5 characters, and select them. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 5, True) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next I will move the cursor to the end of the document.") ; Move the View Cursor to the end of the document, don't select text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_END, 1, False) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next I will move the cursor to the beginning of the line, selecting the text.") ; Move the View Cursor to the start of the last line, select text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START_OF_LINE, 1, True) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_CursorMove[2].au3 b/Examples/_LOWriter_CursorMove[2].au3 index a851b8bc..fc5842eb 100644 --- a/Examples/_LOWriter_CursorMove[2].au3 +++ b/Examples/_LOWriter_CursorMove[2].au3 @@ -9,60 +9,60 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to insert enough paragraphs into the document in order to demonstrate moving the view cursor up or down a page etc.") ; Insert 150 New lines For $i = 1 To 150 _LOWriter_DocInsertString($oDoc, $oViewCursor, "Line " & $i & @CR) - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) Sleep(10) Next ; Return the cursor back to the start. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now move the cursor to the next page.") ; Move the View Cursor to the next page. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_JUMP_TO_NEXT_PAGE, 1, False) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next I will move the cursor down one screen space, the same as pressing ""Page Down"".") ; Move the View Cursor down a screen view space. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_SCREEN_DOWN, 1, False) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next I will move the cursor to the first page") ; Move the View Cursor to the first page. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_JUMP_TO_FIRST_PAGE, 1, False) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next I will move the cursor to the end of the page.") ; Move the View Cursor to the end of the same page. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_JUMP_TO_END_OF_PAGE, 1, False) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "And finally I will go to a specific page.") ; Move the View Cursor to a specific page, page 3. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_JUMP_TO_PAGE, 3, False) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DateFormatKeyCreate.au3 b/Examples/_LOWriter_DateFormatKeyCreate.au3 index fa57560d..7ad4eaea 100644 --- a/Examples/_LOWriter_DateFormatKeyCreate.au3 +++ b/Examples/_LOWriter_DateFormatKeyCreate.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new DateFormatKey H:MM:SS (Hour, Minute, Second, AM/PM, Month Day Name(Day) Year $iFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM -- M/NNN(D)/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I created a new DateTime format key, its key number is: " & $iFormatKey & " and it looks like this: " & _ _LOWriter_DateFormatKeyGetString($oDoc, $iFormatKey) & @CRLF & @CRLF & "Press Ok to insert a Date Field using this key into the document.") ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. using the DateTime Format Key I just created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, Null, Null, Null, Null, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DateFormatKeyDelete.au3 b/Examples/_LOWriter_DateFormatKeyDelete.au3 index bc9fa0b8..83b09db9 100644 --- a/Examples/_LOWriter_DateFormatKeyDelete.au3 +++ b/Examples/_LOWriter_DateFormatKeyDelete.au3 @@ -11,21 +11,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new DateFormatKey H:MM:SS (Hour, Minute, Second, AM/PM, Month Day Name(Day) Year $iFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM -- M/NNN(D)/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I created a new DateTime format key. Press Ok to delete it now.") ; Delete the newly created Format Key. _LOWriter_DateFormatKeyDelete($oDoc, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to delete a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) ; Check if the new key exists. $bExists = _LOWriter_DateFormatKeyExists($oDoc, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to search for a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) If ($bExists = True) Then MsgBox($MB_OK, "", "I failed to delete the DateTime format key.") @@ -37,7 +37,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DateFormatKeyExists.au3 b/Examples/_LOWriter_DateFormatKeyExists.au3 index d8e2b96f..9a0b3302 100644 --- a/Examples/_LOWriter_DateFormatKeyExists.au3 +++ b/Examples/_LOWriter_DateFormatKeyExists.au3 @@ -11,15 +11,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new DateFormatKey H:MM:SS (Hour, Minute, Second, AM/PM, Month Day Name(Day) Year $iFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM -- M/NNN(D)/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) ; Check if the new key exists. $bExists = _LOWriter_DateFormatKeyExists($oDoc, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to search for a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) If ($bExists = True) Then MsgBox($MB_OK, "", "I created a new DateTime format key.") @@ -29,11 +29,11 @@ Func Example() ; Delete the newly created Format Key. _LOWriter_DateFormatKeyDelete($oDoc, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to delete a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) ; Check if the new key exists now. $bExists = _LOWriter_DateFormatKeyExists($oDoc, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to search for a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) If ($bExists = True) Then MsgBox($MB_OK, "", "I failed to delete the DateTime format key.") @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DateFormatKeyGetString.au3 b/Examples/_LOWriter_DateFormatKeyGetString.au3 index ca6f58f2..79af680c 100644 --- a/Examples/_LOWriter_DateFormatKeyGetString.au3 +++ b/Examples/_LOWriter_DateFormatKeyGetString.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new DateFormatKey H:MM:SS (Hour, Minute, Second, AM/PM, Month Day Name(Day) Year $iFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM -- M/NNN(D)/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. using the DateTime Format Key I just created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, Null, Null, Null, Null, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I created a new DateTime format key, its key number is: " & $iFormatKey & " and it looks like this: " & _ _LOWriter_DateFormatKeyGetString($oDoc, $iFormatKey)) @@ -31,7 +31,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DateFormatKeyList.au3 b/Examples/_LOWriter_DateFormatKeyList.au3 index d15225b7..08878b1d 100644 --- a/Examples/_LOWriter_DateFormatKeyList.au3 +++ b/Examples/_LOWriter_DateFormatKeyList.au3 @@ -11,36 +11,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new DateFormatKey H:MM:SS (Hour, Minute, Second, AM/PM, Month Day Name(Day) Year _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM -- M/NNN(D)/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) ; Retrieve an Array of Format Keys. With Boolean value of whether each is a UserCreated key or not. $avKeys = _LOWriter_DateFormatKeyList($oDoc, True) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Date/Time Format Keys. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Date/Time Format Keys. Error:" & @error & " Extended:" & @extended) $iResults = @extended ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Format Key" & Chr(9) & Chr(9) & "Format Key String" & Chr(9) & Chr(9) & "Is User Created?" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To $iResults - 1 ; List the keys in the document, separate each column by tabs. _LOWriter_DocInsertString($oDoc, $oViewCursor, $avKeys[$i][0] & Chr(9) & Chr(9) & Chr(9) & $avKeys[$i][1] & Chr(9) & Chr(9) & Chr(9) & $avKeys[$i][2] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DateStructCreate.au3 b/Examples/_LOWriter_DateStructCreate.au3 index 7160b4c6..f81e3248 100644 --- a/Examples/_LOWriter_DateStructCreate.au3 +++ b/Examples/_LOWriter_DateStructCreate.au3 @@ -11,43 +11,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, leave it blank so it will be set to the current date/Time. $tDateStruct1 = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create a second Date Structure, Year = 1992, Month = 03, Day = 28, Hour = 15, Minute = 43, Second = 25, Nano = 765, UTC =True $tDateStruct2 = _LOWriter_DateStructCreate(1992, 03, 28, 15, 43, 25, 765, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "HH:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. Fixed = True, Set the Date to the first DateStruct I created, and set DateTime Format Key to ; the Key I created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct1, Null, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert another Date and Time text Field at the View Cursor. Fixed = True, Set the Date to the Second DateStruct I created, and set DateTime Format ; Key to the Key I created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct2, Null, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DateStructModify.au3 b/Examples/_LOWriter_DateStructModify.au3 index 331612e9..1b6d047e 100644 --- a/Examples/_LOWriter_DateStructModify.au3 +++ b/Examples/_LOWriter_DateStructModify.au3 @@ -11,43 +11,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1992, Month = 03, Day = 28, Hour = 15, Minute = 43, Second = 25, Nano = 765, UTC =True $tDateStruct = _LOWriter_DateStructCreate(1992, 03, 28, 15, 43, 25, 765, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "HH:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. Fixed = True, Set the Date to my previously created DateStruct,and set DateTime Format Key to the first ; Key I created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct, Null, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Modify the Date Structure, Year = 2023, Month = 06, Day = 16, Hour = 8, Minute = 45, Second = 55, Nano = 75, UTC = False _LOWriter_DateStructModify($tDateStruct, 2023, 06, 16, 8, 45, 55, 75, False) - If (@error > 0) Then _ERROR("Failed to modify a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Date structure. Error:" & @error & " Extended:" & @extended) ; Insert another Date and Time text Field at the View Cursor. Fixed = True, Set the Date to the DateStruct I just modified, and set DateTime ; Format Key to the Key I created previously. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct, Null, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharBorderColor.au3 b/Examples/_LOWriter_DirFrmtCharBorderColor.au3 index 9e751e2a..a599c99a 100644 --- a/Examples/_LOWriter_DirFrmtCharBorderColor.au3 +++ b/Examples/_LOWriter_DirFrmtCharBorderColor.au3 @@ -10,39 +10,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtCharBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border color to $LOW_COLOR_BRICK _LOWriter_DirFrmtCharBorderColor($oViewCursor, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharBorderColor($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Character Border color settings are as follows: " & @CRLF & _ "Top color, in Long Color Format: " & $avSettings[0] & @CRLF & _ @@ -53,13 +53,13 @@ Func Example() ; Remove direct formatting from selection. _LOWriter_DirFrmtCharBorderColor($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharBorderPadding.au3 b/Examples/_LOWriter_DirFrmtCharBorderPadding.au3 index 6b199cea..3c0f59e6 100644 --- a/Examples/_LOWriter_DirFrmtCharBorderPadding.au3 +++ b/Examples/_LOWriter_DirFrmtCharBorderPadding.au3 @@ -11,43 +11,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtCharBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border padding to 1/4" _LOWriter_DirFrmtCharBorderPadding($oViewCursor, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharBorderPadding($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Character Border padding settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -60,15 +60,15 @@ Func Example() ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border padding to, Top and Right, 1/4", Bottom and left, 1/2". _LOWriter_DirFrmtCharBorderPadding($oViewCursor, Null, $iMicrometers, $iMicrometers2, $iMicrometers2, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharBorderPadding($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Border color settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -81,13 +81,13 @@ Func Example() ; Remove Direct Formatting. _LOWriter_DirFrmtCharBorderPadding($oViewCursor, Null, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharBorderStyle.au3 b/Examples/_LOWriter_DirFrmtCharBorderStyle.au3 index 57dcb542..cfb4a963 100644 --- a/Examples/_LOWriter_DirFrmtCharBorderStyle.au3 +++ b/Examples/_LOWriter_DirFrmtCharBorderStyle.au3 @@ -10,40 +10,40 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtCharBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border Style to, Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_FINE_DASHED, ; Left = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, Right = $LOW_BORDERSTYLE_SOLID _LOWriter_DirFrmtCharBorderStyle($oViewCursor, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_FINE_DASHED, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_SOLID) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharBorderStyle($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Character Border Style settings are as follows: " & @CRLF & _ "Top Style, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -54,13 +54,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharBorderStyle($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharBorderWidth.au3 b/Examples/_LOWriter_DirFrmtCharBorderWidth.au3 index 5ae046d9..d3308e01 100644 --- a/Examples/_LOWriter_DirFrmtCharBorderWidth.au3 +++ b/Examples/_LOWriter_DirFrmtCharBorderWidth.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Character Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtCharBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharBorderWidth($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current character Border width settings are as follows: " & @CRLF & _ "Top width, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -49,13 +49,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharBorderWidth($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharEffect.au3 b/Examples/_LOWriter_DirFrmtCharEffect.au3 index 530e5e96..60c8e764 100644 --- a/Examples/_LOWriter_DirFrmtCharEffect.au3 +++ b/Examples/_LOWriter_DirFrmtCharEffect.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font effects to $LOW_RELIEF_EMBOSSED relief type. _LOWriter_DirFrmtCharEffect($oViewCursor, $LOW_RELIEF_EMBOSSED) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharEffect($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -50,11 +50,11 @@ Func Example() ; Set the selected text's Font effects to $LOW_RELIEF_NONE relief type, Case to $LOW_CASEMAP_SM_CAPS _LOWriter_DirFrmtCharEffect($oViewCursor, $LOW_RELIEF_NONE, $LOW_CASEMAP_SM_CAPS) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharEffect($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -66,13 +66,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharEffect($oViewCursor, Default, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharEffect[2].au3 b/Examples/_LOWriter_DirFrmtCharEffect[2].au3 index 9016914d..e63b51f0 100644 --- a/Examples/_LOWriter_DirFrmtCharEffect[2].au3 +++ b/Examples/_LOWriter_DirFrmtCharEffect[2].au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font effects to shadow = True. _LOWriter_DirFrmtCharEffect($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharEffect($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -50,11 +50,11 @@ Func Example() ; Set the selected text's Font effects to shadow = False and Outline = True. _LOWriter_DirFrmtCharEffect($oViewCursor, Null, Null, Null, True, False) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharEffect($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -66,11 +66,11 @@ Func Example() ; Set the selected text's Font effects Outline to False, and Hidden to true. _LOWriter_DirFrmtCharEffect($oViewCursor, Null, Null, True, False, Null) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharEffect($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -82,13 +82,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharEffect($oViewCursor, Default, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharPosition.au3 b/Examples/_LOWriter_DirFrmtCharPosition.au3 index 696e1aa5..8cd753ae 100644 --- a/Examples/_LOWriter_DirFrmtCharPosition.au3 +++ b/Examples/_LOWriter_DirFrmtCharPosition.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's font position to auto Superscript, and relative size to 50%. _LOWriter_DirFrmtCharPosition($oViewCursor, True, Null, Null, Null, 50) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharPosition($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avSettings[0] & @CRLF & _ @@ -50,11 +50,11 @@ Func Example() ; Set selected text's font position to auto Subscript _LOWriter_DirFrmtCharPosition($oViewCursor, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to set the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharPosition($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's new position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avSettings[0] & @CRLF & _ @@ -66,13 +66,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharPosition($oViewCursor, Null, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharPosition[2].au3 b/Examples/_LOWriter_DirFrmtCharPosition[2].au3 index 1c926cc4..37ff11c2 100644 --- a/Examples/_LOWriter_DirFrmtCharPosition[2].au3 +++ b/Examples/_LOWriter_DirFrmtCharPosition[2].au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's font position to 75% Superscript, and relative size to 50%. _LOWriter_DirFrmtCharPosition($oViewCursor, Null, 75, Null, Null, 50) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharPosition($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avSettings[0] & @CRLF & _ @@ -50,11 +50,11 @@ Func Example() ; Set selected text's font position to 75 Subscript _LOWriter_DirFrmtCharPosition($oViewCursor, Null, Null, Null, 75) - If (@error > 0) Then _ERROR("Failed to set the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharPosition($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's new position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avSettings[0] & @CRLF & _ @@ -66,13 +66,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharPosition($oViewCursor, Null, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharRotateScale.au3 b/Examples/_LOWriter_DirFrmtCharRotateScale.au3 index 2e8bf517..d53b40cc 100644 --- a/Examples/_LOWriter_DirFrmtCharRotateScale.au3 +++ b/Examples/_LOWriter_DirFrmtCharRotateScale.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Rotation to 90 degrees, Scale width to 75% and fit to line to True _LOWriter_DirFrmtCharRotateScale($oViewCursor, 90, 75, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharRotateScale($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current rotation and scale width settings are as follows: " & @CRLF & _ "Rotation in degrees: " & $avSettings[0] & @CRLF & _ @@ -48,13 +48,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharRotateScale($oViewCursor, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharShadow.au3 b/Examples/_LOWriter_DirFrmtCharShadow.au3 index 8dbfc12c..d76e2bb5 100644 --- a/Examples/_LOWriter_DirFrmtCharShadow.au3 +++ b/Examples/_LOWriter_DirFrmtCharShadow.au3 @@ -11,39 +11,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Shadow to 1/4" wide, Color to $LOW_COLOR_PURPLE, Transparent to false, and location to $LOW_SHADOW_TOP_LEFT _LOWriter_DirFrmtCharShadow($oViewCursor, $iMicrometers, $LOW_COLOR_PURPLE, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharShadow($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Character Shadow settings are as follows: " & @CRLF & _ "Shadow width, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -54,13 +54,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharShadow($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtCharSpacing.au3 b/Examples/_LOWriter_DirFrmtCharSpacing.au3 index 44821d7e..ff9c50b2 100644 --- a/Examples/_LOWriter_DirFrmtCharSpacing.au3 +++ b/Examples/_LOWriter_DirFrmtCharSpacing.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Kerning to auto _LOWriter_DirFrmtCharSpacing($oViewCursor, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharSpacing($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current kerning settings are as follows: " & @CRLF & _ "Automatically adjust kerning? True/False: " & $avSettings[0] & @CRLF & _ @@ -47,11 +47,11 @@ Func Example() ; Set the selected text's Kerning to 1.5 _LOWriter_DirFrmtCharSpacing($oViewCursor, False, 1.5) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtCharSpacing($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current kerning settings are as follows: " & @CRLF & _ "Automatically adjust kerning? True/False: " & $avSettings[0] & @CRLF & _ @@ -60,13 +60,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtCharSpacing($oViewCursor, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtClear.au3 b/Examples/_LOWriter_DirFrmtClear.au3 index 16fdbc6d..c33215ec 100644 --- a/Examples/_LOWriter_DirFrmtClear.au3 +++ b/Examples/_LOWriter_DirFrmtClear.au3 @@ -9,89 +9,89 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 5 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 5) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "text". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 4, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Underline settings to Words only = True, Underline style $LOW_UNDERLINE_BOLD_DASH_DOT, Underline has ; Color = True, and Color to $LOW_COLOR_BROWN _LOWriter_DirFrmtUnderLine($oViewCursor, True, $LOW_UNDERLINE_BOLD_DASH_DOT, True, $LOW_COLOR_BROWN) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 4 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 4, False) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's font color to $LOW_COLOR_RED, Transparency to 50%, and Highlight to $LOW_COLOR_GOLD _LOWriter_DirFrmtFontColor($oViewCursor, $LOW_COLOR_RED, 50, $LOW_COLOR_GOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 11 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, False) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "formatting". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 10, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtCharBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor to the end. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_END, 11, False) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "line". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_Left, 5, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font to "Arial", Font size to 18,Posture (Italic) to $LOW_POSTURE_ITALIC, and weight (Bold) ; to $LOW_WEIGHT_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, "Arial", 18, $LOW_POSTURE_ITALIC, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor to the start again _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the whole line of text _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_END_OF_LINE, 1, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to remove all direct formatting in the selection.") ; Remove the direct formatting _LOWriter_DirFrmtClear($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to remove direct formatting. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to remove direct formatting. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtFont.au3 b/Examples/_LOWriter_DirFrmtFont.au3 index 24ac72e3..64aee08e 100644 --- a/Examples/_LOWriter_DirFrmtFont.au3 +++ b/Examples/_LOWriter_DirFrmtFont.au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font to "Arial", Font size to 18,Posture (Italic) to $LOW_POSTURE_ITALIC, and weight (Bold) ; to $LOW_WEIGHT_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, "Arial", 18, $LOW_POSTURE_ITALIC, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtFont($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Font settings are as follows: " & @CRLF & _ "Font name: " & $avSettings[0] & @CRLF & _ @@ -50,13 +50,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtFont($oDoc, $oViewCursor, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtFontColor.au3 b/Examples/_LOWriter_DirFrmtFontColor.au3 index ff827c51..fb91bbfb 100644 --- a/Examples/_LOWriter_DirFrmtFontColor.au3 +++ b/Examples/_LOWriter_DirFrmtFontColor.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's font color to $LOW_COLOR_RED, Transparency to 50%, and Highlight to $LOW_COLOR_GOLD _LOWriter_DirFrmtFontColor($oViewCursor, $LOW_COLOR_RED, 50, $LOW_COLOR_GOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtFontColor($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current font color settings are as follows: " & @CRLF & _ "The current Font color, in Long color format: " & $avSettings[0] & " This value is a bit weird because transparency" & _ @@ -49,11 +49,11 @@ Func Example() ; Set the selected text's Font transparency to 0%, _LOWriter_DirFrmtFontColor($oViewCursor, Null, 0) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtFontColor($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current font color settings are as follows: " & @CRLF & _ "The current Font color, in Long color format: " & $avSettings[0] & @CRLF & _ @@ -63,13 +63,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtFontColor($oViewCursor, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtGetCurStyles.au3 b/Examples/_LOWriter_DirFrmtGetCurStyles.au3 index 14c40d3f..a8c4f8f8 100644 --- a/Examples/_LOWriter_DirFrmtGetCurStyles.au3 +++ b/Examples/_LOWriter_DirFrmtGetCurStyles.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "A Line of text to Test Direct Formatting with.") - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) ; Move the ViewCursor back to the beginning of the page. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the right 20 spaces, selecting the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 20, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Retrieve current styles contained in the selection. Will return a 4 element Array in the following order: current paragraph style, ; current Character style, current Page style, current Numbering Style (if one is active). $asStyles = _LOWriter_DirFrmtGetCurStyles($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve current styles in the text selection. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current styles in the text selection. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "These styles are currently set for the selection of text. Some may be blank, indicating no style is set for that style " & _ "type: " & @CRLF & _ @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtGetCurStyles[2].au3 b/Examples/_LOWriter_DirFrmtGetCurStyles[2].au3 index 766c94bd..77c394e7 100644 --- a/Examples/_LOWriter_DirFrmtGetCurStyles[2].au3 +++ b/Examples/_LOWriter_DirFrmtGetCurStyles[2].au3 @@ -11,24 +11,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "A Line of text to Test Direct Formatting with.") - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Paragraphs for the document $aoParagraphs = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph Objects for Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph Objects for Document. Error:" & @error & " Extended:" & @extended) ; Retrieve current styles contained in the first Paragraph. Will return a 4 element Array in the following order: current paragraph style, ; current Character style, current Page style, current Numbering Style (if one is active). $asStyles = _LOWriter_DirFrmtGetCurStyles($aoParagraphs[0]) - If (@error > 0) Then _ERROR("Failed to retrieve current styles in the text selection. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current styles in the text selection. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "These styles are currently set for the Paragraph. Some may be blank, indicating no style is set for that style " & _ "type: " & @CRLF & _ @@ -41,7 +41,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtOverLine.au3 b/Examples/_LOWriter_DirFrmtOverLine.au3 index 2834c5ab..80ff4757 100644 --- a/Examples/_LOWriter_DirFrmtOverLine.au3 +++ b/Examples/_LOWriter_DirFrmtOverLine.au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Overline settings to Words only = True, Overline style $LOW_UNDERLINE_BOLD_DASH_DOT, Overline has ; Color = True, and Color to $LOW_COLOR_BROWN _LOWriter_DirFrmtOverLine($oViewCursor, True, $LOW_UNDERLINE_BOLD_DASH_DOT, True, $LOW_COLOR_BROWN) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtOverLine($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Overline settings are as follows: " & @CRLF & _ "Overline words only? True/False: " & $avSettings[0] & @CRLF & _ @@ -50,13 +50,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtOverLine($oViewCursor, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParAlignment.au3 b/Examples/_LOWriter_DirFrmtParAlignment.au3 index 766b2a8d..06c65282 100644 --- a/Examples/_LOWriter_DirFrmtParAlignment.au3 +++ b/Examples/_LOWriter_DirFrmtParAlignment.au3 @@ -10,34 +10,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next Line" & _ @LF & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor down one line _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_DOWN, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Alignment settings to, Horizontal alignment = $LOW_PAR_ALIGN_HOR_JUSTIFIED, ; Vertical alignment = $LOW_PAR_ALIGN_VERT_CENTER, Last line alignment = $LOW_PAR_LAST_LINE_JUSTIFIED, ; Expand single word = True, Snap to grid = False, Text direction = $LOW_TXT_DIR_LR_TB _LOWriter_DirFrmtParAlignment($oViewCursor, $LOW_PAR_ALIGN_HOR_JUSTIFIED, $LOW_PAR_ALIGN_VERT_CENTER, $LOW_PAR_LAST_LINE_JUSTIFIED, True, False, $LOW_TXT_DIR_LR_TB) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParAlignment($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Alignment settings are as follows: " & @CRLF & _ "Horizontal alignment, (See UDF constants): " & $avSettings[0] & @CRLF & _ @@ -50,13 +50,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtParAlignment($oViewCursor, Default, Default, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParBackColor.au3 b/Examples/_LOWriter_DirFrmtParBackColor.au3 index 3976a49b..48b081b3 100644 --- a/Examples/_LOWriter_DirFrmtParBackColor.au3 +++ b/Examples/_LOWriter_DirFrmtParBackColor.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location background color to $LOW_COLOR_GRAY, and back transparent to false. _LOWriter_DirFrmtParBackColor($oViewCursor, $LOW_COLOR_GRAY, False) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParBackColor($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Shadow settings are as follows: " & @CRLF & _ "The current background color, in Long Color format: " & $avSettings[0] & @CRLF & _ @@ -39,13 +39,13 @@ Func Example() ; Remove Direct formatting. _LOWriter_DirFrmtParBackColor($oViewCursor, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParBorderColor.au3 b/Examples/_LOWriter_DirFrmtParBorderColor.au3 index eed48a43..31f8718d 100644 --- a/Examples/_LOWriter_DirFrmtParBorderColor.au3 +++ b/Examples/_LOWriter_DirFrmtParBorderColor.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtParBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Border color to $LOW_COLOR_BRICK _LOWriter_DirFrmtParBorderColor($oViewCursor, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParBorderColor($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Border color settings are as follows: " & @CRLF & _ "Top color, in Long Color Format: " & $avSettings[0] & @CRLF & _ @@ -45,13 +45,13 @@ Func Example() ; Remove Direct Formatting. _LOWriter_DirFrmtParBorderColor($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParBorderPadding.au3 b/Examples/_LOWriter_DirFrmtParBorderPadding.au3 index 4d070a37..3024156c 100644 --- a/Examples/_LOWriter_DirFrmtParBorderPadding.au3 +++ b/Examples/_LOWriter_DirFrmtParBorderPadding.au3 @@ -11,35 +11,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtParBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border padding to 1/4" _LOWriter_DirFrmtParBorderPadding($oViewCursor, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParBorderPadding($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Border color settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -52,15 +52,15 @@ Func Example() ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border padding to, Top and Right, 1/4", Bottom and left, 1/2". _LOWriter_DirFrmtParBorderPadding($oViewCursor, Null, $iMicrometers, $iMicrometers2, $iMicrometers2, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParBorderPadding($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current paragraph Border color settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -73,13 +73,13 @@ Func Example() ; Remove Direct Formatting. _LOWriter_DirFrmtParBorderPadding($oViewCursor, Null, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParBorderStyle.au3 b/Examples/_LOWriter_DirFrmtParBorderStyle.au3 index 493d980f..deedd6fe 100644 --- a/Examples/_LOWriter_DirFrmtParBorderStyle.au3 +++ b/Examples/_LOWriter_DirFrmtParBorderStyle.au3 @@ -10,32 +10,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_DirFrmtParBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Border Style to, Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_FINE_DASHED, ; Left = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, Right = $LOW_BORDERSTYLE_SOLID _LOWriter_DirFrmtParBorderStyle($oViewCursor, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_FINE_DASHED, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_SOLID) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParBorderStyle($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current paragraph Border Style settings are as follows: " & @CRLF & _ "Top Style, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -46,13 +46,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParBorderStyle($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParBorderWidth.au3 b/Examples/_LOWriter_DirFrmtParBorderWidth.au3 index 3a222755..e03d95a0 100644 --- a/Examples/_LOWriter_DirFrmtParBorderWidth.au3 +++ b/Examples/_LOWriter_DirFrmtParBorderWidth.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Border Width to $LOW_BORDERWIDTH_THICK., and Connect border to True _LOWriter_DirFrmtParBorderWidth($oViewCursor, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParBorderWidth($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Border width settings are as follows: " & @CRLF & _ "Top width, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -41,13 +41,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParBorderWidth($oViewCursor, Null, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParDropCaps.au3 b/Examples/_LOWriter_DirFrmtParDropCaps.au3 index 4be95b13..417e226a 100644 --- a/Examples/_LOWriter_DirFrmtParDropCaps.au3 +++ b/Examples/_LOWriter_DirFrmtParDropCaps.au3 @@ -11,33 +11,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @LF & "Next Line" & _ @LF & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Drop cap settings to, Number of Characters to DropCap, 3, Lines to drop down, 2, ; Spc To text To 1/4 ", whole word to False, and Character style to "Example". _LOWriter_DirFrmtParDropCaps($oDoc, $oViewCursor, 3, 2, $iMicrometers, False, "Example") - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParDropCaps($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph DropCap settings are as follows: " & @CRLF & _ "How many characters are included in the DropCaps?: " & $avSettings[0] & @CRLF & _ @@ -49,13 +49,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParDropCaps($oDoc, $oViewCursor, Null, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParHyphenation.au3 b/Examples/_LOWriter_DirFrmtParHyphenation.au3 index 932d11af..bff25006 100644 --- a/Examples/_LOWriter_DirFrmtParHyphenation.au3 +++ b/Examples/_LOWriter_DirFrmtParHyphenation.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next Line" & _ @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor down one line _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_DOWN, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Hyphenation settings to, AutoHyphen = True, Hyphen words in caps = False, ; Max hyphens, 20, Minimum leading characters = 3, minimum trailing = 4 _LOWriter_DirFrmtParHyphenation($oViewCursor, True, False, 20, 3, 4) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParHyphenation($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Hyphenation settings are as follows: " & @CRLF & _ "Automatic hyphenation? True/False: " & $avSettings[0] & @CRLF & _ @@ -48,13 +48,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParHyphenation($oViewCursor, Null, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParIndent.au3 b/Examples/_LOWriter_DirFrmtParIndent.au3 index 18990691..f69a5de4 100644 --- a/Examples/_LOWriter_DirFrmtParIndent.au3 +++ b/Examples/_LOWriter_DirFrmtParIndent.au3 @@ -11,45 +11,45 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next Line" & _ @LF & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor down one line _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_DOWN, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers3 = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Indent settings to, 1/4" Before paragraph, 1/2" afterparagraph, First line indent = 1", ; Auto First line = False _LOWriter_DirFrmtParIndent($oViewCursor, $iMicrometers, $iMicrometers2, $iMicrometers3, False) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParIndent($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Indent settings are as follows: " & @CRLF & _ "Indent spacing before the paragraph, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -60,13 +60,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParIndent($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParOutLineAndList.au3 b/Examples/_LOWriter_DirFrmtParOutLineAndList.au3 index 0198a6b9..d13db4c1 100644 --- a/Examples/_LOWriter_DirFrmtParOutLineAndList.au3 +++ b/Examples/_LOWriter_DirFrmtParOutLineAndList.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next Line" & _ @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Outline and List settings to, Outline level $LOW_OUTLINE_LEVEL_1, Numbering style,"Numbering 123", ; Include line in paragraph count? True, Line count value = 1. _LOWriter_DirFrmtParOutLineAndList($oDoc, $oViewCursor, $LOW_OUTLINE_LEVEL_1, "Numbering 123", True, 1) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParOutLineAndList($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Outline and List settings are as follows: " & @CRLF & _ "What Outline level is this Paragraph style set to? (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -43,13 +43,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParOutLineAndList($oDoc, $oViewCursor, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParPageBreak.au3 b/Examples/_LOWriter_DirFrmtParPageBreak.au3 index 60b2a073..bbd165fc 100644 --- a/Examples/_LOWriter_DirFrmtParPageBreak.au3 +++ b/Examples/_LOWriter_DirFrmtParPageBreak.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next Line" & _ @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor down one line _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_DOWN, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Page break settings, Break type = $LOW_BREAK_PAGE_BEFORE, Page number offset = 2, ; Page style = "Landscape". _LOWriter_DirFrmtParPageBreak($oDoc, $oViewCursor, $LOW_BREAK_PAGE_BEFORE, 2, "Landscape") - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParPageBreak($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Page break settings are as follows: " & @CRLF & _ "What type of Page break, if any is used? (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -46,13 +46,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParPageBreak($oDoc, $oViewCursor, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParShadow.au3 b/Examples/_LOWriter_DirFrmtParShadow.au3 index 85eec3b7..0319bd4b 100644 --- a/Examples/_LOWriter_DirFrmtParShadow.au3 +++ b/Examples/_LOWriter_DirFrmtParShadow.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Shadow to 1/4" wide, Color to $LOW_COLOR_PURPLE, Transparent to false, and location to ; $LOW_SHADOW_TOP_LEFT _LOWriter_DirFrmtParShadow($oViewCursor, $iMicrometers, $LOW_COLOR_PURPLE, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParShadow($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Shadow settings are as follows: " & @CRLF & _ "Shadow width, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -47,13 +47,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParShadow($oViewCursor, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParSpace.au3 b/Examples/_LOWriter_DirFrmtParSpace.au3 index 027cd8aa..2677bda5 100644 --- a/Examples/_LOWriter_DirFrmtParSpace.au3 +++ b/Examples/_LOWriter_DirFrmtParSpace.au3 @@ -11,41 +11,41 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next Line" & _ @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor down one line _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_DOWN, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location line space settings to, 1/4" above paragraph, 1/4" below paragraph, AddSpace = True, ; Line space mode = $LOW_LINE_SPC_MODE_FIX, Line space height = 1/2", and Page Line Space = False. _LOWriter_DirFrmtParSpace($oViewCursor, $iMicrometers, $iMicrometers, True, $LOW_LINE_SPC_MODE_FIX, $iMicrometers2, False) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParSpace($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Line Spacing settings are as follows: " & @CRLF & _ "Spacing above the paragraph, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -57,13 +57,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParSpace($oViewCursor, Default, Default, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParTabStopCreate.au3 b/Examples/_LOWriter_DirFrmtParTabStopCreate.au3 index 084dda58..7c53bb3a 100644 --- a/Examples/_LOWriter_DirFrmtParTabStopCreate.au3 +++ b/Examples/_LOWriter_DirFrmtParTabStopCreate.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a TabStop at 1/4" Tab Stop position, Set the fill character to Asc(~) the Tilde key ASCII Value 126. ; Set alignment To $LOW_TAB_ALIGN_DECIMAL, and the decimal character to ASC(.) a period, ASCII value 46. $iTabStop = _LOWriter_DirFrmtParTabStopCreate($oViewCursor, $iMicrometers, Asc("~"), $LOW_TAB_ALIGN_DECIMAL, Asc(".")) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The new Tab stop has the position of " & $iTabStop) @@ -39,7 +39,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParTabStopDelete.au3 b/Examples/_LOWriter_DirFrmtParTabStopDelete.au3 index ad17d5c2..2b3c990a 100644 --- a/Examples/_LOWriter_DirFrmtParTabStopDelete.au3 +++ b/Examples/_LOWriter_DirFrmtParTabStopDelete.au3 @@ -11,31 +11,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a TabStop at 1/4" Tab Stop position. $iTabStop = _LOWriter_DirFrmtParTabStopCreate($oViewCursor, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Delete the newly created tab stop. $bDeleted = _LOWriter_DirFrmtParTabStopDelete($oDoc, $oViewCursor, $iTabStop) - If (@error > 0) Then _ERROR("Failed to delete the Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete the Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Was the Tab stop successfully deleted? True/False: " & $bDeleted) @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParTabStopList.au3 b/Examples/_LOWriter_DirFrmtParTabStopList.au3 index aa4908ad..3d5eb36c 100644 --- a/Examples/_LOWriter_DirFrmtParTabStopList.au3 +++ b/Examples/_LOWriter_DirFrmtParTabStopList.au3 @@ -12,47 +12,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a Tab Stop for the demonstration. _LOWriter_DirFrmtParTabStopCreate($oViewCursor, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create another Tab Stop for the demonstration. _LOWriter_DirFrmtParTabStopCreate($oViewCursor, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create another Tab Stop for the demonstration. _LOWriter_DirFrmtParTabStopCreate($oViewCursor, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of tab stop positions. $aiTabStops = _LOWriter_DirFrmtParTabStopList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph tab stop positions. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph tab stop positions. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The number of Tabstops found is " & @extended & @CRLF & @CRLF & "I will now display the array of tab stop positions.") @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParTabStopMod.au3 b/Examples/_LOWriter_DirFrmtParTabStopMod.au3 index 523a1f69..91736636 100644 --- a/Examples/_LOWriter_DirFrmtParTabStopMod.au3 +++ b/Examples/_LOWriter_DirFrmtParTabStopMod.au3 @@ -11,42 +11,42 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a Tab Stop for the demonstration. $iTabStop = _LOWriter_DirFrmtParTabStopCreate($oViewCursor, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the TabStop from 1/4" to 1/2" Tab Stop position, Set the fill character to Asc(~) the Tilde key ASCII Value 126. ; Set alignment To $LOW_TAB_ALIGN_DECIMAL, and the decimal character to ASC(.) a period, ASCII value 46. ; Since I am modifying the TabStop position, @Extended will be my new Tab Stop position. _LOWriter_DirFrmtParTabStopMod($oViewCursor, $iTabStop, $iMicrometers, Asc("~"), $LOW_TAB_ALIGN_DECIMAL, Asc(".")) $iTabStop = @extended - If (@error > 0) Then _ERROR("Failed to modify Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avTabStop = _LOWriter_DirFrmtParTabStopMod($oViewCursor, $iTabStop) - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Tab stop, having the position of " & $iTabStop & " has the following settings: " & @CRLF & _ "The Current position is, in micrometers: " & $avTabStop[0] & @CRLF & _ @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtParTxtFlowOpt.au3 b/Examples/_LOWriter_DirFrmtParTxtFlowOpt.au3 index 1ec1e642..b76ecaab 100644 --- a/Examples/_LOWriter_DirFrmtParTxtFlowOpt.au3 +++ b/Examples/_LOWriter_DirFrmtParTxtFlowOpt.au3 @@ -10,32 +10,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly." & @CR & "Next Line" & _ @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor down one line _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_DOWN, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph at the current cursor's location Text Flow settings to, Split par, false, Keep Together, false, Orphans 3, Widows 0(off) _LOWriter_DirFrmtParTxtFlowOpt($oViewCursor, False, False, 3, 0) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtParTxtFlowOpt($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Paragraph Text Flow settings are as follows: " & @CRLF & _ "Allow the paragraph to be split between pages? True/False: " & $avSettings[0] & @CRLF & _ @@ -46,13 +46,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtParTxtFlowOpt($oViewCursor, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtStrikeOut.au3 b/Examples/_LOWriter_DirFrmtStrikeOut.au3 index 3f1a32dd..64cdf946 100644 --- a/Examples/_LOWriter_DirFrmtStrikeOut.au3 +++ b/Examples/_LOWriter_DirFrmtStrikeOut.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Strikeout settings to, Words only = True, Strikeout = True, Line style = $LOW_STRIKEOUT_X _LOWriter_DirFrmtStrikeOut($oViewCursor, True, True, $LOW_STRIKEOUT_X) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtStrikeOut($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current Strikeout settings are as follows: " & @CRLF & _ "Strikeout words only? True/False: " & $avSettings[0] & @CRLF & _ @@ -48,13 +48,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtStrikeOut($oViewCursor, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DirFrmtUnderLine.au3 b/Examples/_LOWriter_DirFrmtUnderLine.au3 index e74acd57..62884ef4 100644 --- a/Examples/_LOWriter_DirFrmtUnderLine.au3 +++ b/Examples/_LOWriter_DirFrmtUnderLine.au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the formatting settings directly. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying formatting settings directly.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 13 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "Demonstrate". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's underline settings to Words only = True, Underline style $LOW_UNDERLINE_BOLD_DASH_DOT, Underline has ; Color = True, and Color to $LOW_COLOR_BROWN _LOWriter_DirFrmtUnderLine($oViewCursor, True, $LOW_UNDERLINE_BOLD_DASH_DOT, True, $LOW_COLOR_BROWN) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avSettings = _LOWriter_DirFrmtUnderLine($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the selected text's settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The selected text's current underline settings are as follows: " & @CRLF & _ "Underline words only? True/False: " & $avSettings[0] & @CRLF & _ @@ -50,13 +50,13 @@ Func Example() ; Remove direct formatting _LOWriter_DirFrmtUnderLine($oViewCursor, Default, Default, Default, Default) - If (@error > 0) Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to clear the selected text's direct formatting settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocBookmarkDelete.au3 b/Examples/_LOWriter_DocBookmarkDelete.au3 index aee29b36..5954d213 100644 --- a/Examples/_LOWriter_DocBookmarkDelete.au3 +++ b/Examples/_LOWriter_DocBookmarkDelete.au3 @@ -9,26 +9,26 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "New Bookmark". $oBookmark = _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the document contain a Bookmark named ""New Bookmark""? True/False: " & _LOWriter_DocBookmarksHasName($oDoc, "New Bookmark") & _ @CRLF & @CRLF & "Press Ok to delete the Bookmark.") ; Delete the Bookmark. _LOWriter_DocBookmarkDelete($oDoc, $oBookmark) - If (@error > 0) Then _ERROR("Failed to delete a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a BookMark. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now does the document contain a Bookmark named ""New Bookmark""? True/False: " & _LOWriter_DocBookmarksHasName($oDoc, "New Bookmark")) @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocBookmarkGetAnchor.au3 b/Examples/_LOWriter_DocBookmarkGetAnchor.au3 index 178c7b1f..0730b0ef 100644 --- a/Examples/_LOWriter_DocBookmarkGetAnchor.au3 +++ b/Examples/_LOWriter_DocBookmarkGetAnchor.au3 @@ -9,39 +9,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Bookmark at the ViewCursor, named "New Bookmark". $oBookmark = _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will retrieve the anchor for ""New Bookmark"" and insert some text after it.") ; Retrieve the Bookmark's Anchor (Text Cursor). $oBookAnchor = _LOWriter_DocBookmarkGetAnchor($oBookmark) - If (@error > 0) Then _ERROR("Failed to Retrieve a Reference Mark anchor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Retrieve a Reference Mark anchor. Error:" & @error & " Extended:" & @extended) ; Move the Anchor (Text Cursor) _LOWriter_CursorMove($oBookAnchor, $LOW_TEXTCUR_GO_RIGHT, 1, False) - If (@error > 0) Then _ERROR("Failed to move a cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move a cursor. Error:" & @error & " Extended:" & @extended) ; Insert Some text. _LOWriter_DocInsertString($oDoc, $oBookAnchor, " Some new text") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocBookmarkGetObj.au3 b/Examples/_LOWriter_DocBookmarkGetObj.au3 index 4c49cd72..77f33457 100644 --- a/Examples/_LOWriter_DocBookmarkGetObj.au3 +++ b/Examples/_LOWriter_DocBookmarkGetObj.au3 @@ -10,47 +10,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "New Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Retrieve the Bookmark's Object. $oBookmark = _LOWriter_DocBookmarkGetObj($oDoc, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to retrieve a BookMark Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve a BookMark Object. Error:" & @error & " Extended:" & @extended) ; Modify the Bookmark name to "Old Bookmark" _LOWriter_DocBookmarkModify($oDoc, $oBookmark, "Old Bookmark") - If (@error > 0) Then _ERROR("Failed to modify a Bookmark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Bookmark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Bookmark names currently contained in this document are:" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of all Bookmarks. $asBookmarks = _LOWriter_DocBookmarksList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asBookmarks) - 1 ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asBookmarks[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocBookmarkInsert.au3 b/Examples/_LOWriter_DocBookmarkInsert.au3 index e8fbcebb..08c97974 100644 --- a/Examples/_LOWriter_DocBookmarkInsert.au3 +++ b/Examples/_LOWriter_DocBookmarkInsert.au3 @@ -10,39 +10,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "New Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of all Bookmarks. $asBookmarks = _LOWriter_DocBookmarksList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Bookmark names currently contained in this document are:" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asBookmarks) - 1 ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asBookmarks[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocBookmarkModify.au3 b/Examples/_LOWriter_DocBookmarkModify.au3 index 5f8ab428..c6bf445b 100644 --- a/Examples/_LOWriter_DocBookmarkModify.au3 +++ b/Examples/_LOWriter_DocBookmarkModify.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "New Bookmark". $oBookmark = _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Modify the Bookmark name to "Old Bookmark" _LOWriter_DocBookmarkModify($oDoc, $oBookmark, "Old Bookmark") - If (@error > 0) Then _ERROR("Failed to modify a Bookmark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Bookmark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Bookmark names currently contained in this document are:" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of all Bookmarks. $asBookmarks = _LOWriter_DocBookmarksList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asBookmarks) - 1 ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asBookmarks[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocBookmarksHasName.au3 b/Examples/_LOWriter_DocBookmarksHasName.au3 index 1b7cdb31..57c6024e 100644 --- a/Examples/_LOWriter_DocBookmarksHasName.au3 +++ b/Examples/_LOWriter_DocBookmarksHasName.au3 @@ -9,19 +9,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "New Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the document contain a Bookmark named ""New Bookmark""? True/False: " & _LOWriter_DocBookmarksHasName($oDoc, "New Bookmark")) @@ -29,7 +29,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocBookmarksList.au3 b/Examples/_LOWriter_DocBookmarksList.au3 index 0e9a8419..9a4e5c52 100644 --- a/Examples/_LOWriter_DocBookmarksList.au3 +++ b/Examples/_LOWriter_DocBookmarksList.au3 @@ -10,55 +10,55 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Bookmark at the ViewCursor, named "New Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted another Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert another Bookmark at the ViewCursor, named "Second Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "Second Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a third Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert another Bookmark at the ViewCursor, named "Third Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "Third Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Bookmark names currently contained in this document are:" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of all Bookmarks. $asBookmarks = _LOWriter_DocBookmarksList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Bookmarks. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asBookmarks) - 1 ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asBookmarks[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocClose.au3 b/Examples/_LOWriter_DocClose.au3 index 23d84d96..7e1103ef 100644 --- a/Examples/_LOWriter_DocClose.au3 +++ b/Examples/_LOWriter_DocClose.au3 @@ -8,13 +8,13 @@ Func Example() Local $oDoc ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Success", "A New Writer Document was successfully opened. Press ""OK"" to close it.") ; Close the document, don't save changes. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocClose[2].au3 b/Examples/_LOWriter_DocClose[2].au3 index 2155cf96..27852e99 100644 --- a/Examples/_LOWriter_DocClose[2].au3 +++ b/Examples/_LOWriter_DocClose[2].au3 @@ -9,7 +9,7 @@ Func Example() Local $sSaveName, $sSavepath ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Success", "A New Writer Document was successfully opened. Press OK to close and save it.") @@ -18,7 +18,7 @@ Func Example() ; Close the document, save changes. $sSavepath = _LOWriter_DocClose($oDoc, True, $sSaveName) - If (@error > 0) Then _ERROR("Failed to close and save opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close and save opened L.O. Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Success", "The Writer Document was successfully saved to the following path: " & $sSavepath & @CRLF & _ "Press OK to Delete it.") diff --git a/Examples/_LOWriter_DocConnect.au3 b/Examples/_LOWriter_DocConnect.au3 index 580c8071..95ad3a72 100644 --- a/Examples/_LOWriter_DocConnect.au3 +++ b/Examples/_LOWriter_DocConnect.au3 @@ -10,11 +10,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document's name $sDocName = _LOWriter_DocGetName($oDoc, False) - If (@error > 0) Then _ERROR("Failed to retrieve Writer Document name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Writer Document name. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created a blank L.O. Writer Doc, I will now Connect to it and use the new Object returned to close it.") @@ -24,7 +24,7 @@ Func Example() ; Close the document, don't save changes. _LOWriter_DocClose($oDoc2, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc Func _ERROR($sErrorText) diff --git a/Examples/_LOWriter_DocConnect[2].au3 b/Examples/_LOWriter_DocConnect[2].au3 index e29ecc79..5e7d55d1 100644 --- a/Examples/_LOWriter_DocConnect[2].au3 +++ b/Examples/_LOWriter_DocConnect[2].au3 @@ -11,7 +11,7 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created a blank L.O. Writer Doc, I will now Connect to it and use the new Object returned to close it.") @@ -21,7 +21,7 @@ Func Example() ; Retrieve Doc Name. $sDocName = _LOWriter_DocGetName($oDoc, False) - If (@error > 0) Then _ERROR("Failed to retrieve Writer Document name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Writer Document name. Error:" & @error & " Extended:" & @extended) $iUserChoice = MsgBox($MB_YESNO, "Close?", "I have connected to the Document with the following title: " & $sDocName & _ @CRLF & "Would you like to close it now?") @@ -29,7 +29,7 @@ Func Example() If ($iUserChoice = $IDYES) Then ; Close the document. _LOWriter_DocClose($oDoc2, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndIf EndFunc diff --git a/Examples/_LOWriter_DocConvertTableToText.au3 b/Examples/_LOWriter_DocConvertTableToText.au3 index 657aadf1..47c50af3 100644 --- a/Examples/_LOWriter_DocConvertTableToText.au3 +++ b/Examples/_LOWriter_DocConvertTableToText.au3 @@ -10,45 +10,45 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 4 rows, 4 columns $oTable = _LOWriter_TableCreate($oDoc, 4, 4) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to convert the Table to Text.") ; Convert the Text Table to Text, seperate each column with "|". _LOWriter_DocConvertTableToText($oDoc, $oTable, "|") - If (@error > 0) Then _ERROR("Failed to Convert Table to Text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Convert Table to Text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocConvertTextToTable.au3 b/Examples/_LOWriter_DocConvertTextToTable.au3 index d5172578..3a61357b 100644 --- a/Examples/_LOWriter_DocConvertTextToTable.au3 +++ b/Examples/_LOWriter_DocConvertTextToTable.au3 @@ -9,31 +9,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A1%B1%C1%D1" & @CR & "A2%B2%C2%D2" & @CR & "A3%B3%C3%D3" & @CR & "A4%B4%C4%D4") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the beginning of the document, selecting all text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START, 1, True) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to convert the Table to Text.") ; Convert the Text to a Table, seperate each column at "%", set borders to True. _LOWriter_DocConvertTextToTable($oDoc, $oViewCursor, "%", False, 0, True) - If (@error > 0) Then _ERROR("Failed to Convert Table to Text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Convert Table to Text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocCreate.au3 b/Examples/_LOWriter_DocCreate.au3 index 6744290e..8c71b6e8 100644 --- a/Examples/_LOWriter_DocCreate.au3 +++ b/Examples/_LOWriter_DocCreate.au3 @@ -8,7 +8,7 @@ Func Example() Local $oDoc ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Success", "A New Writer Document was successfully opened. Press ""OK"" to close it.") diff --git a/Examples/_LOWriter_DocCreateTextCursor.au3 b/Examples/_LOWriter_DocCreateTextCursor.au3 index 21216074..22e17617 100644 --- a/Examples/_LOWriter_DocCreateTextCursor.au3 +++ b/Examples/_LOWriter_DocCreateTextCursor.au3 @@ -9,47 +9,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "First Line of text." & @CR & _ "Second line of text." & @CR & _ "Third line of text." & @CR & _ "Fourth Line of Text.") - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will create a text cursor now.") ; Create a TextCursor, I called false for bCreateAtEnd, the cursor will be created at the beginning of the document. $oTextCursor = _LOWriter_DocCreateTextCursor($oDoc, False) - If (@error > 0) Then _ERROR("Failed to create Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now move the TextCursor right 6 spaces, not selecting any text, and then right 4 spaces selecting the word ""Line"".") ; Move the Text Cursor right 6 spaces, not selecting the text. _LOWriter_CursorMove($oTextCursor, $LOW_TEXTCUR_GO_RIGHT, 6, False) - If (@error > 0) Then _ERROR("Failed to move TextCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move TextCursor. Error:" & @error & " Extended:" & @extended) ; Move the Text Cursor right 4 spaces, selecting the text. _LOWriter_CursorMove($oTextCursor, $LOW_TEXTCUR_GO_RIGHT, 4, True) - If (@error > 0) Then _ERROR("Failed to move TextCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move TextCursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The text is selected by the Text Cursor, you won't be able to see anything though, as the TextCursor is invisible." & _ " I will now replace the word ""Line"" with the word ""Paragraph"".") ; Insert the word "Paragraph", and overwrite any text selected by the cursor. _LOWriter_DocInsertString($oDoc, $oTextCursor, "Paragraph", True) - If (@error > 0) Then _ERROR("Failed to insert text at the TextCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text at the TextCursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocDescription.au3 b/Examples/_LOWriter_DocDescription.au3 index eaa7519f..7546c0a9 100644 --- a/Examples/_LOWriter_DocDescription.au3 +++ b/Examples/_LOWriter_DocDescription.au3 @@ -12,16 +12,16 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Document's Description settings, Title = "Autoit Example", Subject = "Doc Description Demonstration", Keywords to Keywords Array, ; Comments To two lines of comments. _LOWriter_DocDescription($oDoc, "Autoit Example", "Doc Description Demonstration", $asKeywords, "This is a comment." & @CR & "This is a second comment line.") - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's description. Return will be an Array in order of function parameters. $avReturn = _LOWriter_DocDescription($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) $asReturnedKeywords = $avReturn[2] ; Convert the Keyword Array to a String, separate each element with a @CRLF @@ -39,7 +39,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocEnumPrinters.au3 b/Examples/_LOWriter_DocEnumPrinters.au3 index 5c6dfb1a..a9a2b8ec 100644 --- a/Examples/_LOWriter_DocEnumPrinters.au3 +++ b/Examples/_LOWriter_DocEnumPrinters.au3 @@ -18,7 +18,7 @@ Func Example() ; Retrieve Array of available printers. $asPrinters = _LOWriter_DocEnumPrinters() $iCount = @extended - If (@error > 0) Then _ERROR("Error retrieving array of Printers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving array of Printers. Error:" & @error & " Extended:" & @extended) ; If results, display them, else display a message and exit. If $iCount > 0 Then @@ -36,7 +36,7 @@ Func Example() ; Return default printer. $sDefault = _LOWriter_DocEnumPrinters(True) - If (@error > 0) Then _ERROR("Error retrieving Default Printer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Default Printer. Error:" & @error & " Extended:" & @extended) If ($sDefault = "") Then MsgBox($MB_OK, "", "You do not have a default printer.") diff --git a/Examples/_LOWriter_DocEnumPrintersAlt.au3 b/Examples/_LOWriter_DocEnumPrintersAlt.au3 index d1fd46e8..a593e772 100644 --- a/Examples/_LOWriter_DocEnumPrintersAlt.au3 +++ b/Examples/_LOWriter_DocEnumPrintersAlt.au3 @@ -12,7 +12,7 @@ Func Example() MsgBox($MB_OK, "", "I will list your currently available printers") $asPrinters = _LOWriter_DocEnumPrintersAlt() - If (@error > 0) Then _ERROR("Error retrieving array of Printers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving array of Printers. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "There were " & @extended & " results.") @@ -21,7 +21,7 @@ Func Example() MsgBox($MB_OK, "", "I will list your currently default printer next.") $sDefault = _LOWriter_DocEnumPrintersAlt("", True) - If (@error > 0) Then _ERROR("Error retrieving Default Printer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Default Printer. Error:" & @error & " Extended:" & @extended) If ($sDefault = "") Then MsgBox($MB_OK, "", "You do not have a default printer.") @@ -37,7 +37,7 @@ Func Example() EndIf $asPrinters = _LOWriter_DocEnumPrintersAlt($sSearch) - If (@error > 0) Then _ERROR("Error retrieving array of Printers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving array of Printers. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "There were: " & @extended & " results") diff --git a/Examples/_LOWriter_DocExecuteDispatch.au3 b/Examples/_LOWriter_DocExecuteDispatch.au3 index 0181b8bd..f6549e9a 100644 --- a/Examples/_LOWriter_DocExecuteDispatch.au3 +++ b/Examples/_LOWriter_DocExecuteDispatch.au3 @@ -12,17 +12,17 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "This is to demonstrate using _LOWriter_DocExecuteDispatch. Try clicking ""Execute"" on the small GUI " & _ "window present on your screen. You can also click the drop down and try any other command. If you press ""Execute"" with ""uno:SwBackspace"" selected " & _ "this smiley face will be backspaced.☻") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) $hExampleGUI = GUICreate("Doc Execute Example", 200, 60, -1, -1, -1, $WS_EX_TOPMOST) @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) GUIDelete($hExampleGUI) Exit @@ -53,7 +53,7 @@ Func Example() ; Perform the requested Execute command. _LOWriter_DocExecuteDispatch($oDoc, $sExecuteCommand) - If (@error > 0) Then _ERROR("Failed to execute a dispatch command. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to execute a dispatch command. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Executed Command", "The command """ & $sExecuteCommand & """ was succesfully performed.") EndSwitch diff --git a/Examples/_LOWriter_DocExport.au3 b/Examples/_LOWriter_DocExport.au3 index 309efe60..47e90f5c 100644 --- a/Examples/_LOWriter_DocExport.au3 +++ b/Examples/_LOWriter_DocExport.au3 @@ -11,7 +11,7 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now export the new Writer Document as a pdf to the desktop folder.") @@ -19,11 +19,11 @@ Func Example() ; Export The New Blank Doc To Desktop Directory as a PDF using a unique temporary name. $sPath = _LOWriter_DocExport($oDoc, $sFilePathName, False) - If (@error > 0) Then _ERROR("Failed to Export the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Export the Writer Document. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created and exported the document as a PDF to your Desktop, found at the following Path: " _ & $sPath & @CRLF & "Press Ok to delete it.") diff --git a/Examples/_LOWriter_DocFindAll.au3 b/Examples/_LOWriter_DocFindAll.au3 index b9264e0d..c5084da6 100644 --- a/Examples/_LOWriter_DocFindAll.au3 +++ b/Examples/_LOWriter_DocFindAll.au3 @@ -12,23 +12,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, seaRch." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor with all set to False. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Search all the results containing the word "search". $aoResults = _LOWriter_DocFindAll($oDoc, $oSrchDesc, "search", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" @@ -37,7 +37,7 @@ Func Example() For $i = 0 To UBound($aoResults) - 1 $sResultString &= _LOWriter_DocGetString($aoResults[$i]) & @CRLF Next - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched and found the following words: " & @CRLF & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocFindAllInRange.au3 b/Examples/_LOWriter_DocFindAllInRange.au3 index 2e49c876..85c1e011 100644 --- a/Examples/_LOWriter_DocFindAllInRange.au3 +++ b/Examples/_LOWriter_DocFindAllInRange.au3 @@ -12,35 +12,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line to searCh.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor with all set to False. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select all the words from that spot to the end of the line. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_END_OF_LINE, 1, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Search the word "search" within the viewcursor selection. $aoResults = _LOWriter_DocFindAllInRange($oDoc, $oSrchDesc, "search", $aAnEmptyArray, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" @@ -48,7 +48,7 @@ Func Example() If IsArray($aoResults) Then For $i = 0 To UBound($aoResults) - 1 $sResultString &= _LOWriter_DocGetString($aoResults[$i]) & @CRLF - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) Next EndIf @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocFindNext.au3 b/Examples/_LOWriter_DocFindNext.au3 index 7d507c3c..ea88fa12 100644 --- a/Examples/_LOWriter_DocFindNext.au3 +++ b/Examples/_LOWriter_DocFindNext.au3 @@ -11,42 +11,42 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor with all set to False. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select all the words from that spot to the end of the document. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_END, 1, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Search the word "search" within the viewcursor selection. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $aAnEmptyArray, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the string from the result. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched and found the following word within the selection: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -57,12 +57,12 @@ Func Example() ; Search for the word "Search" using the search descriptor I just created. Starting from my last result. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Search", $aAnEmptyArray, $oViewCursor, $oResult) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched, and found the following word within the selection: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -74,7 +74,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocFindNext[2].au3 b/Examples/_LOWriter_DocFindNext[2].au3 index 432be805..ea6159fe 100644 --- a/Examples/_LOWriter_DocFindNext[2].au3 +++ b/Examples/_LOWriter_DocFindNext[2].au3 @@ -11,62 +11,62 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line to searCh.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor with all set to False. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 44 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 44) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Insert a footnote. $oFootNote = _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a footnote. Error:" & @error & " Extended:" & @extended) ; Get a TextCursor for the footnote $oFootTextCursor = _LOWriter_FootnoteGetTextCursor($oFootNote) - If (@error > 0) Then _ERROR("Failed to create a footnote Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a footnote Text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text in the footnote. _LOWriter_DocInsertString($oDoc, $oFootTextCursor, "Some text to in the footnote with the word SEarCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select all the words from that spot to the end of the line. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_END_OF_LINE, 1, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Search the word "search" within the viewcursor selection. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $aAnEmptyArray, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the string for the result. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) & @CRLF - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) EndIf ; Search for all matching results in this document, one at a time. @@ -74,12 +74,12 @@ Func Example() ; Search for the word "Search" using the search descriptor I just created. Starting from my last result. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Search", $aAnEmptyArray, $oViewCursor, $oResult) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString &= _LOWriter_DocGetString($oResult) & @CRLF - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) EndIf WEnd @@ -89,12 +89,12 @@ Func Example() ; Search the word "search" within the viewcursor selection exhaustively. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $aAnEmptyArray, $oViewCursor, Null, True) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the string for the result. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) & @CRLF - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) EndIf ; Search for all matching results in this document, one at a time. @@ -102,12 +102,12 @@ Func Example() ; Search for the word "Search" using the search descriptor I just created. Starting from my last result. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Search", $aAnEmptyArray, $oViewCursor, $oResult, True) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString &= _LOWriter_DocGetString($oResult) & @CRLF - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) EndIf WEnd @@ -118,7 +118,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocFooterGetTextCursor.au3 b/Examples/_LOWriter_DocFooterGetTextCursor.au3 index cdefcc88..85be081e 100644 --- a/Examples/_LOWriter_DocFooterGetTextCursor.au3 +++ b/Examples/_LOWriter_DocFooterGetTextCursor.au3 @@ -9,37 +9,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text for demonstration purposes. Scroll down and look in the footer." & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footers on for this page style. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn footers on for this Page Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn footers on for this Page Style. Error:" & @error & " Extended:" & @extended) ; Create a text cursor for the page style footer. $oFooterTextCursor = _LOWriter_DocFooterGetTextCursor($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to create a TextCursor in the Page Style's Footer. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a TextCursor in the Page Style's Footer. Error:" & @error & " Extended:" & @extended) ; Insert some text in the Text Cursor. _LOWriter_DocInsertString($oDoc, $oFooterTextCursor, "Some text in the Page's Footer." & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGenProp.au3 b/Examples/_LOWriter_DocGenProp.au3 index 4d08a388..d9239966 100644 --- a/Examples/_LOWriter_DocGenProp.au3 +++ b/Examples/_LOWriter_DocGenProp.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Document's general properties settings to: NewAuthor = "Daniel, Revisions = 8, Editing time = 840 seconds, Apply User Data = True) _LOWriter_DocGenProp($oDoc, "Daniel", 8, 840, True) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's General properties. Return will be an Array in order of function parameters. $avReturn = _LOWriter_DocGenProp($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The document's author is: " & $avReturn[0] & @CRLF & _ "This document has been revised " & $avReturn[1] & " times." & @CRLF & _ @@ -28,11 +28,11 @@ Func Example() ; reset the Document's general properties settings _LOWriter_DocGenProp($oDoc, "Someone", Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's General properties again. $avReturn = _LOWriter_DocGenProp($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The document's new author is: " & $avReturn[0] & @CRLF & _ "This document has been revised " & $avReturn[1] & " times." & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGenPropCreation.au3 b/Examples/_LOWriter_DocGenPropCreation.au3 index 84a2655e..fbfcd0fd 100644 --- a/Examples/_LOWriter_DocGenPropCreation.au3 +++ b/Examples/_LOWriter_DocGenPropCreation.au3 @@ -12,23 +12,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Created by settings to, Created by = "Daniel", Date to the previously created Day Structure. _LOWriter_DocGenPropCreation($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's Last Printed by properties. Return will be an Array in order of function parameters. $avReturn = _LOWriter_DocGenPropCreation($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) ; convert the Date Struct to an Array, and then into a String. $avDate = _LOWriter_DateStructModify($avReturn[1]) - If (@error > 0) Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($avDate) - 1 If IsBool($avDate[$i]) Then @@ -49,7 +49,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGenPropModification.au3 b/Examples/_LOWriter_DocGenPropModification.au3 index 2f66d6cf..cedb75d3 100644 --- a/Examples/_LOWriter_DocGenPropModification.au3 +++ b/Examples/_LOWriter_DocGenPropModification.au3 @@ -12,23 +12,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Modification settings to, Modified by = "Daniel", Date to the previously created Day Structure. _LOWriter_DocGenPropModification($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's description. Return will be an Array in order of function parameters. $avReturn = _LOWriter_DocGenPropModification($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) ; convert the Date Struct to an Array, and then into a String. $avDate = _LOWriter_DateStructModify($avReturn[1]) - If (@error > 0) Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($avDate) - 1 If IsBool($avDate[$i]) Then @@ -49,7 +49,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGenPropPrint.au3 b/Examples/_LOWriter_DocGenPropPrint.au3 index fa66e30e..37da4c95 100644 --- a/Examples/_LOWriter_DocGenPropPrint.au3 +++ b/Examples/_LOWriter_DocGenPropPrint.au3 @@ -12,23 +12,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Last Printed by settings to, Printed by = "Daniel", Date to the previously created Day Structure. _LOWriter_DocGenPropPrint($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's Last Printed by properties. Return will be an Array in order of function parameters. $avReturn = _LOWriter_DocGenPropPrint($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) ; convert the Date Struct to an Array, and then into a String. $avDate = _LOWriter_DateStructModify($avReturn[1]) - If (@error > 0) Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($avDate) - 1 If IsBool($avDate[$i]) Then @@ -49,7 +49,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGenPropTemplate.au3 b/Examples/_LOWriter_DocGenPropTemplate.au3 index 48fd5a33..4bb76f27 100644 --- a/Examples/_LOWriter_DocGenPropTemplate.au3 +++ b/Examples/_LOWriter_DocGenPropTemplate.au3 @@ -12,24 +12,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's template settings to, Template name = "AutoIt", Template URL to a fake Path, C:\Folder1\Folder2\Test.ott ; Date to the previously created Day Structure. _LOWriter_DocGenPropTemplate($oDoc, "AutoIt", "C:\Folder1\Folder2\Test.ott", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's description. Return will be an Array in order of function parameters. $avReturn = _LOWriter_DocGenPropTemplate($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) ; convert the Date Struct to an Array, and then into a String. $avDate = _LOWriter_DateStructModify($avReturn[2]) - If (@error > 0) Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($avDate) - 1 If IsBool($avDate[$i]) Then @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGetCounts.au3 b/Examples/_LOWriter_DocGetCounts.au3 index 98493fc8..0f3d0582 100644 --- a/Examples/_LOWriter_DocGetCounts.au3 +++ b/Examples/_LOWriter_DocGetCounts.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text." & @CR & @CR & "Some different text" & @CR & "Another Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of statistical counts of the following, in this order: Page count; Line Count; Paragraph Count; ; Word Count; Character Count; NonWhiteSpace Character Count; Table Count; Image Count; Object Count. $aiCounts = _LOWriter_DocGetCounts($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document counts. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document counts. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The document counts are as follows: " & @CRLF & _ "Number of Pages: " & $aiCounts[0] & @CRLF & _ @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGetName.au3 b/Examples/_LOWriter_DocGetName.au3 index 47f02fa9..ae5f64c7 100644 --- a/Examples/_LOWriter_DocGetName.au3 +++ b/Examples/_LOWriter_DocGetName.au3 @@ -10,17 +10,17 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document's Name. $sName = _LOWriter_DocGetName($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document's name is: " & $sName) ; Retrieve the full name this time. $sName = _LOWriter_DocGetName($oDoc, True) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The document's full name is: " & $sName & @CRLF & @CRLF & _ "This is the name you would use for Autoit Window functions, such as WinMove etc." & @CRLF & @CRLF & _ @@ -30,7 +30,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGetPath.au3 b/Examples/_LOWriter_DocGetPath.au3 index af565317..d093fc2d 100644 --- a/Examples/_LOWriter_DocGetPath.au3 +++ b/Examples/_LOWriter_DocGetPath.au3 @@ -11,14 +11,14 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a unique file name $sSavePath = _TempFile(@TempDir & "\", "DocTestFile_", ".odt") ; Save The New Blank Doc To Desktop Directory. $sPath = _LOWriter_DocSaveAs($oDoc, $sSavePath, "", True) - If (@error > 0) Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Document's Save Path if it has one, the return will be a string, and the path will be like a computer path. If _LOWriter_DocHasPath($oDoc) Then $sReturn = _LOWriter_DocGetPath($oDoc, False) @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) ; Delete the file. FileDelete($sPath) diff --git a/Examples/_LOWriter_DocGetString.au3 b/Examples/_LOWriter_DocGetString.au3 index faa4618e..e422f5e7 100644 --- a/Examples/_LOWriter_DocGetString.au3 +++ b/Examples/_LOWriter_DocGetString.au3 @@ -10,37 +10,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate retrieving text from a document.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Right 13 spaces, don't seelect text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 13) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Right 11 spaces, selecting the word "Demonstrate" _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 11, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) $sString = _LOWriter_DocGetString($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The text selected by the View Cursor was: " & $sString & @CRLF & @CRLF & _ "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocGetViewCursor.au3 b/Examples/_LOWriter_DocGetViewCursor.au3 index d6e95c55..7e1adb18 100644 --- a/Examples/_LOWriter_DocGetViewCursor.au3 +++ b/Examples/_LOWriter_DocGetViewCursor.au3 @@ -9,21 +9,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the View Cursor for later use $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve ViewCursor object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve ViewCursor object. Error:" & @error & " Extended:" & @extended) ; Insert some text at the View Cursor's position. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I inserted text where the ViewCursor was.") - If (@error > 0) Then _ERROR("Failed to insert text at the ViewCursor's position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text at the ViewCursor's position. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocHasFrameName.au3 b/Examples/_LOWriter_DocHasFrameName.au3 index 475a674e..dcb6b804 100644 --- a/Examples/_LOWriter_DocHasFrameName.au3 +++ b/Examples/_LOWriter_DocHasFrameName.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, "AutoitTest", 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Check if the document has a Frame by the name of "AutoitTest" $bReturn = _LOWriter_DocHasFrameName($oDoc, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to look for Text Frame name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to look for Text Frame name. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does this document contain a Frame named ""AutoitTest""? True/ False. " & $bReturn) ; Delete the Frame. _LOWriter_FrameDelete($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to delete Text Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Text Frame. Error:" & @error & " Extended:" & @extended) ; Check again, if the document has a Frame by the name of "AutoitTest" $bReturn = _LOWriter_DocHasFrameName($oDoc, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to look for Text Frame name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to look for Text Frame name. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now does this document contain a Frame named ""AutoitTest""? True/ False. " & $bReturn) @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocHasPath.au3 b/Examples/_LOWriter_DocHasPath.au3 index 8812a684..7504cfd0 100644 --- a/Examples/_LOWriter_DocHasPath.au3 +++ b/Examples/_LOWriter_DocHasPath.au3 @@ -12,11 +12,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Test if the document has a save location/Path. $bReturn = _LOWriter_DocHasPath($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does this document have a Save location/Path? True/False: " & $bReturn) @@ -25,11 +25,11 @@ Func Example() ; Save The New Blank Doc To Desktop Directory. $sPath = _LOWriter_DocSaveAs($oDoc, $sSavePath, "", True) - If (@error > 0) Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) ; Test again if the document has a save location/Path. $bReturn = _LOWriter_DocHasPath($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document information. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does this document have a Save location/Path? True/False: " & $bReturn) @@ -37,7 +37,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) ; Delete the file. FileDelete($sPath) diff --git a/Examples/_LOWriter_DocHasTableName.au3 b/Examples/_LOWriter_DocHasTableName.au3 index 7c788aaf..2477d087 100644 --- a/Examples/_LOWriter_DocHasTableName.au3 +++ b/Examples/_LOWriter_DocHasTableName.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2, Null, Null, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Check if the document has a table by the name of "AutoitTest" $bReturn = _LOWriter_DocHasTableName($oDoc, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to look for Text Table name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to look for Text Table name. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does this document contain a Table named ""AutoitTest""? True/ False. " & $bReturn) ; Delete the table. _LOWriter_TableDelete($oDoc, $oTable) - If (@error > 0) Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) ; Check again, if the document has a table by the name of "AutoitTest" $bReturn = _LOWriter_DocHasTableName($oDoc, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to look for Text Table name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to look for Text Table name. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now does this document contain a Table named ""AutoitTest""? True/ False. " & $bReturn) @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocHeaderGetTextCursor.au3 b/Examples/_LOWriter_DocHeaderGetTextCursor.au3 index 6703a396..7ee278df 100644 --- a/Examples/_LOWriter_DocHeaderGetTextCursor.au3 +++ b/Examples/_LOWriter_DocHeaderGetTextCursor.au3 @@ -9,37 +9,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text for demonstration purposes." & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Headers on for this page style. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Headers on for this Page Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Headers on for this Page Style. Error:" & @error & " Extended:" & @extended) ; Create a text cursor for the page style headerer. $oHeaderTextCursor = _LOWriter_DocHeaderGetTextCursor($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to create a TextCursor in the Page Style's Header. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a TextCursor in the Page Style's Header. Error:" & @error & " Extended:" & @extended) ; Insert some text in the Text Cursor. _LOWriter_DocInsertString($oDoc, $oHeaderTextCursor, "Some text in the Page's Header." & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocHyperlinkInsert.au3 b/Examples/_LOWriter_DocHyperlinkInsert.au3 index f7905078..3c6b579f 100644 --- a/Examples/_LOWriter_DocHyperlinkInsert.au3 +++ b/Examples/_LOWriter_DocHyperlinkInsert.au3 @@ -10,25 +10,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "This (U)ser-(D)efined-(F)unction was created using ") - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a hyperlink. Set the display text to "Autoit v3©.", and the website URL to "http://www.autoitscript.com/site/autoit/" _LOWriter_DocHyperlinkInsert($oDoc, $oViewCursor, "Autoit v3©.", "http://www.autoitscript.com/site/autoit/") - If (@error > 0) Then _ERROR("Failed to insert a hyperlink into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a hyperlink into the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have inserted a hyperlink into the document. Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ + If @error Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocInsertControlChar.au3 b/Examples/_LOWriter_DocInsertControlChar.au3 index 64dda3ba..65a8d9b5 100644 --- a/Examples/_LOWriter_DocInsertControlChar.au3 +++ b/Examples/_LOWriter_DocInsertControlChar.au3 @@ -9,68 +9,68 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate inserting control characters into a document." & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, "This is a $LOW_CON_CHAR_PAR_BREAK --> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a control Character, a Paragraph break. _LOWriter_DocInsertControlChar($oDoc, $oViewCursor, $LOW_CON_CHAR_PAR_BREAK) - If (@error > 0) Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "This is a $LOW_CON_CHAR_LINE_BREAK --> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a control Character, a Line break. _LOWriter_DocInsertControlChar($oDoc, $oViewCursor, $LOW_CON_CHAR_LINE_BREAK) - If (@error > 0) Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "This is a $LOW_CON_CHAR_HARD_HYPHEN --> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a control Character, a hard hyphen. _LOWriter_DocInsertControlChar($oDoc, $oViewCursor, $LOW_CON_CHAR_HARD_HYPHEN) - If (@error > 0) Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "This is a $LOW_CON_CHAR_SOFT_HYPHEN --> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a control Character, a Soft Hyphen. _LOWriter_DocInsertControlChar($oDoc, $oViewCursor, $LOW_CON_CHAR_SOFT_HYPHEN) - If (@error > 0) Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "This is a $LOW_CON_CHAR_HARD_SPACE --> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a control Character, a Hard Space. _LOWriter_DocInsertControlChar($oDoc, $oViewCursor, $LOW_CON_CHAR_HARD_SPACE) - If (@error > 0) Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "This is a $LOW_CON_CHAR_APPEND_PAR --> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) _LOWriter_DocInsertControlChar($oDoc, $oViewCursor, $LOW_CON_CHAR_APPEND_PAR) - If (@error > 0) Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Control character. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocInsertString.au3 b/Examples/_LOWriter_DocInsertString.au3 index 42bfa294..f5ada762 100644 --- a/Examples/_LOWriter_DocInsertString.au3 +++ b/Examples/_LOWriter_DocInsertString.au3 @@ -9,11 +9,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Viewcursor. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate inserting text into a document." & @CR & "This is a New line. Note:" & _ @@ -21,13 +21,13 @@ Func Example() "and @LF is used for a Line break, Such as when you press Shift + Enter. If you use the standard Autoit @CRLF," & @CRLF & _ " this double space, with a paragraph break and a line break results. Try turning on Formatting marks to see the difference, normally " & _ "done by pressing CTRL + F10.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocIsActive.au3 b/Examples/_LOWriter_DocIsActive.au3 index 53063312..3d1f84b1 100644 --- a/Examples/_LOWriter_DocIsActive.au3 +++ b/Examples/_LOWriter_DocIsActive.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create another New, visible, Blank Libre Office Document. $oDoc2 = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $bReturn = _LOWriter_DocIsActive($oDoc) - If (@error > 0) Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is Document 1 the active document? True/False: " & $bReturn) $bReturn = _LOWriter_DocIsActive($oDoc2) - If (@error > 0) Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is Document 2 the active document? True/False: " & $bReturn) @@ -30,11 +30,11 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) ; Close the second document. _LOWriter_DocClose($oDoc2, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocIsModified.au3 b/Examples/_LOWriter_DocIsModified.au3 index e24c353e..9dc24bbe 100644 --- a/Examples/_LOWriter_DocIsModified.au3 +++ b/Examples/_LOWriter_DocIsModified.au3 @@ -10,25 +10,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Check if the document has been modified since being saved or created. $bReturn = _LOWriter_DocIsModified($oDoc) - If (@error > 0) Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Has the document been modified since being created or saved? True/False: " & $bReturn) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text for demonstration.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Check if the document has been modified since being saved or created. $bReturn = _LOWriter_DocIsModified($oDoc) - If (@error > 0) Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now has the document been modified since being created or saved? True/False: " & $bReturn) @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocIsReadOnly.au3 b/Examples/_LOWriter_DocIsReadOnly.au3 index 674861a6..489d613b 100644 --- a/Examples/_LOWriter_DocIsReadOnly.au3 +++ b/Examples/_LOWriter_DocIsReadOnly.au3 @@ -10,11 +10,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Test if the document is Read-Only $bReturn = _LOWriter_DocIsReadOnly($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the document currently ""Read-Only""? True/False: " & $bReturn) @@ -22,7 +22,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocMaximize.au3 b/Examples/_LOWriter_DocMaximize.au3 index 537cb105..85cfc67e 100644 --- a/Examples/_LOWriter_DocMaximize.au3 +++ b/Examples/_LOWriter_DocMaximize.au3 @@ -10,30 +10,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to Maximize the document.") ; Maximize the document. _LOWriter_DocMaximize($oDoc, True) - If (@error > 0) Then _ERROR("Failed to Maximize Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Maximize Document. Error:" & @error & " Extended:" & @extended) ; Test If document is currently maximized. $bReturn = _LOWriter_DocMaximize($oDoc) - If (@error > 0) Then _ERROR("Failed to query Document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query Document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the document currently maximized? True/False: " & $bReturn & @CRLF & _ "Press Ok to restore the document to its previous size and position.") ; Restore the document to its previous size. _LOWriter_DocMaximize($oDoc, False) - If (@error > 0) Then _ERROR("Failed to restore Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to restore Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocMinimize.au3 b/Examples/_LOWriter_DocMinimize.au3 index edcf1c62..44c22a77 100644 --- a/Examples/_LOWriter_DocMinimize.au3 +++ b/Examples/_LOWriter_DocMinimize.au3 @@ -10,30 +10,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to minimize the document.") ; Minimize the document. _LOWriter_DocMinimize($oDoc, True) - If (@error > 0) Then _ERROR("Failed to Minimize Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Minimize Document. Error:" & @error & " Extended:" & @extended) ; Test If document is currently minimized. $bReturn = _LOWriter_DocMinimize($oDoc) - If (@error > 0) Then _ERROR("Failed to query Document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query Document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the document currently minimized? True/False: " & $bReturn & @CRLF & _ "Press Ok to restore the document to its previous position.") ; Restore the document to its original size. _LOWriter_DocMinimize($oDoc, False) - If (@error > 0) Then _ERROR("Failed to restore Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to restore Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocOpen.au3 b/Examples/_LOWriter_DocOpen.au3 index 5cb9a83f..2c86762f 100644 --- a/Examples/_LOWriter_DocOpen.au3 +++ b/Examples/_LOWriter_DocOpen.au3 @@ -13,31 +13,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a unique temporary name. $sSavePath = _TempFile(@TempDir & "\", "DocOpenTestFile_", ".odt") ; Save The New Blank Doc To Temp Directory. $sPath = _LOWriter_DocSaveAs($oDoc, $sSavePath, "", True) - If (@error > 0) Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created and saved a blank L.O. Writer Doc to your Temporary Directory, found at the following Path: " _ & $sPath & @CRLF & "I will now open it.") ; Open the document. $oDoc = _LOWriter_DocOpen($sPath) - If (@error > 0) Then _ERROR("Failed to open Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to open Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document was succesfully opened. Press OK to close and delete it.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ + If @error Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ @error & " Extended:" & @extended) ; Delete the file. diff --git a/Examples/_LOWriter_DocPosAndSize.au3 b/Examples/_LOWriter_DocPosAndSize.au3 index f7f640ee..ac60b567 100644 --- a/Examples/_LOWriter_DocPosAndSize.au3 +++ b/Examples/_LOWriter_DocPosAndSize.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the X coordinate to 50, Y coordinate to 150, Width to 500, Height to 600 _LOWriter_DocPosAndSize($oDoc, 50, 150, 500, 600) - If (@error > 0) Then _ERROR("Failed to set document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current document coordinates. Return will be an array in order of function parameters. $aiReturn = _LOWriter_DocPosAndSize($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document position. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The document's current position and size is as follows: " & @CRLF & _ "X Coordinate = " & $aiReturn[0] & @CRLF & _ @@ -30,7 +30,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocPrint.au3 b/Examples/_LOWriter_DocPrint.au3 index 5d1f4e54..b0aa8bea 100644 --- a/Examples/_LOWriter_DocPrint.au3 +++ b/Examples/_LOWriter_DocPrint.au3 @@ -9,18 +9,18 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now print the new Writer Document. I suggest turning off your printer so you can cancel " & _ "the print job without wasting paper.") ; Print the document, 1 copy, Collate = True, "ALL" Pages, Wait = True, Duplex = Off _LOWriter_DocPrint($oDoc, 1, True, "ALL", True, $LOW_DUPLEX_OFF) - If (@error > 0) Then _ERROR("Failed to print the L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to print the L.O. Document. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now printed the document and then closed it.") EndFunc diff --git a/Examples/_LOWriter_DocPrintIncludedSettings.au3 b/Examples/_LOWriter_DocPrintIncludedSettings.au3 index 9d879586..c50f9fcb 100644 --- a/Examples/_LOWriter_DocPrintIncludedSettings.au3 +++ b/Examples/_LOWriter_DocPrintIncludedSettings.au3 @@ -9,13 +9,13 @@ Func Example() Local $avSettings, $avSettingsNew ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now show your current print Include settings.") ; Call the function with all optional settings left as Null to retrieve the current settings. $avSettings = _LOWriter_DocPrintIncludedSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Print include settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Print include settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Current Settings", "Your current print include settings are as follows: " & @CRLF & @CRLF & _ "Print Graphics? True/False:— " & $avSettings[0] & @CRLF & @CRLF & _ @@ -27,11 +27,11 @@ Func Example() ; Changes the print settings to all false. _LOWriter_DocPrintIncludedSettings($oDoc, False, False, False, False, False) - If (@error > 0) Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Now retrieve the settings again. $avSettingsNew = _LOWriter_DocPrintIncludedSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Display the new settings. MsgBox($MB_OK, "Current Settings", "Your new print include settings are as follows: " & @CRLF & @CRLF & _ @@ -43,11 +43,11 @@ Func Example() "I will now return the settings to their original values, and close the document.") _LOWriter_DocPrintIncludedSettings($oDoc, $avSettings[0], $avSettings[1], $avSettings[2], $avSettings[3], $avSettings[4]) - If (@error > 0) Then _ERROR("Error restoring Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error restoring Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocPrintMiscSettings.au3 b/Examples/_LOWriter_DocPrintMiscSettings.au3 index 0f18cd54..de52fdf7 100644 --- a/Examples/_LOWriter_DocPrintMiscSettings.au3 +++ b/Examples/_LOWriter_DocPrintMiscSettings.au3 @@ -9,13 +9,13 @@ Func Example() Local $avSettings, $avSettingsNew ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now show your current miscellaneous print settings.") ; Call the function with all optional settings left as Null to retrieve the current settings. $avSettings = _LOWriter_DocPrintMiscSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Current Settings", "Your current miscellaneous print settings are as follows: " & @CRLF & @CRLF & _ "Paper Orientation:— " & $avSettings[0] & @CRLF & " 0 = $LOW_PAPER_ORIENT_PORTRAIT, 1 = $LOW_PAPER_ORIENT_LANDSCAPE" & @CRLF & @CRLF & _ @@ -30,11 +30,11 @@ Func Example() ; Changes the print settings to Landscape, Skip the printer setting, Print comments Only, Print in brochure, ; print Brochure in Right to Left mode, and print in reverse. _LOWriter_DocPrintMiscSettings($oDoc, $LOW_PAPER_ORIENT_LANDSCAPE, Null, $LOW_PRINT_NOTES_ONLY, True, True, True) - If (@error > 0) Then _ERROR("Error setting Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error setting Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) ; Now retrieve the settings again. $avSettingsNew = _LOWriter_DocPrintMiscSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) ; Display the new settings. MsgBox($MB_OK, "Current Settings", "Your new miscellaneous print settings are as follows: " & @CRLF & @CRLF & _ @@ -49,11 +49,11 @@ Func Example() ; Return the settings to their original values by using the previous array of settings I retrieved. _LOWriter_DocPrintMiscSettings($oDoc, $avSettings[0], Null, $avSettings[2], $avSettings[3], $avSettings[4], $avSettings[5]) - If (@error > 0) Then _ERROR("Error restoring Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error restoring Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocPrintMiscSettings[2].au3 b/Examples/_LOWriter_DocPrintMiscSettings[2].au3 index 206eb632..3f9469c0 100644 --- a/Examples/_LOWriter_DocPrintMiscSettings[2].au3 +++ b/Examples/_LOWriter_DocPrintMiscSettings[2].au3 @@ -10,13 +10,13 @@ Func Example() Local $aPrinters ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now show the currently set Printer.") ; Call the function with all optional settings left as Null to retrieve the current settings. $avSettings = _LOWriter_DocPrintMiscSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Current Printer Setting", "Your currently set printer name is: " & $avSettings[1] & @CRLF & @CRLF & _ "I will now modify the setting and show the result.") @@ -29,11 +29,11 @@ Func Example() ; Changes the printer Name setting to another Printer. _LOWriter_DocPrintMiscSettings($oDoc, Null, $aPrinters[2]) - If (@error > 0) Then _ERROR("Error setting Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error setting Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) ; Now retrieve the settings again. $avSettingsNew = _LOWriter_DocPrintMiscSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) ; Display the new settings. MsgBox($MB_OK, "Current Printer Setting", "Your new set printer name is: " & $avSettingsNew[1] & @CRLF & @CRLF & _ @@ -41,11 +41,11 @@ Func Example() ; Return the setting to its original value by using the previous array of settings I retrieved. _LOWriter_DocPrintMiscSettings($oDoc, Null, $avSettings[1]) - If (@error > 0) Then _ERROR("Error restoring Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error restoring Writer Document Misc Print settings. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocPrintPageSettings.au3 b/Examples/_LOWriter_DocPrintPageSettings.au3 index cedb60b8..31011483 100644 --- a/Examples/_LOWriter_DocPrintPageSettings.au3 +++ b/Examples/_LOWriter_DocPrintPageSettings.au3 @@ -9,13 +9,13 @@ Func Example() Local $avSettings, $avSettingsNew ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now show your current print Page settings.") ; Call the function with all optional settings left as Null to retrieve the current settings. $avSettings = _LOWriter_DocPrintPageSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Print page settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Print page settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Current Settings", "Your current print page settings are as follows: " & @CRLF & @CRLF & _ "Print in Black only? True/False:— " & $avSettings[0] & @CRLF & @CRLF & _ @@ -27,11 +27,11 @@ Func Example() ; Changes the print settings to all false. _LOWriter_DocPrintPageSettings($oDoc, True, False, False, False, False) - If (@error > 0) Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Now retrieve the settings again. $avSettingsNew = _LOWriter_DocPrintPageSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Display the new settings. MsgBox($MB_OK, "Current Settings", "Your new print page settings are as follows: " & @CRLF & @CRLF & _ @@ -44,11 +44,11 @@ Func Example() ; Restore the original print settings. _LOWriter_DocPrintPageSettings($oDoc, $avSettings[0], $avSettings[1], $avSettings[2], $avSettings[3], $avSettings[4]) - If (@error > 0) Then _ERROR("Error restoring Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error restoring Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocPrintSizeSettings.au3 b/Examples/_LOWriter_DocPrintSizeSettings.au3 index fba28316..4feed1fd 100644 --- a/Examples/_LOWriter_DocPrintSizeSettings.au3 +++ b/Examples/_LOWriter_DocPrintSizeSettings.au3 @@ -9,13 +9,13 @@ Func Example() Local $avSettings, $avSettingsNew ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now show your current print Size settings.") ; Call the function with all optional settings left as Null to retrieve the current settings. $avSettings = _LOWriter_DocPrintSizeSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "Current Settings", "Your current print size settings are as follows: " & @CRLF & @CRLF & _ "Paper format:— " & $avSettings[0] & @CRLF & _ @@ -31,11 +31,11 @@ Func Example() ; Changes the print settings to all false. _LOWriter_DocPrintSizeSettings($oDoc, $LOW_PAPER_TABLOID) ; ,False,False,False,False) - If (@error > 0) Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Now retrieve the settings again. $avSettingsNew = _LOWriter_DocPrintSizeSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Display the new settings. MsgBox($MB_OK, "Current Settings", "Your new print size settings are as follows: " & @CRLF & @CRLF & _ @@ -52,11 +52,11 @@ Func Example() ; Changes the print settings to all false. _LOWriter_DocPrintSizeSettings($oDoc, Null, $LOW_PAPER_WIDTH_TABLOID, $LOW_PAPER_HEIGHT_JAP_POSTCARD) - If (@error > 0) Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error setting Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Now retrieve the settings again. $avSettingsNew = _LOWriter_DocPrintSizeSettings($oDoc) - If (@error > 0) Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error retrieving Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Display the new settings. MsgBox($MB_OK, "Current Settings", "Your new print size settings are as follows: " & @CRLF & @CRLF & _ @@ -73,11 +73,11 @@ Func Example() ; Restore the original settings _LOWriter_DocPrintSizeSettings($oDoc, $avSettings[0], $avSettings[1], $avSettings[2]) - If (@error > 0) Then _ERROR("Error restoring Writer Document Print settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error restoring Writer Document Print settings. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocRedo.au3 b/Examples/_LOWriter_DocRedo.au3 index 89158299..e64541b6 100644 --- a/Examples/_LOWriter_DocRedo.au3 +++ b/Examples/_LOWriter_DocRedo.au3 @@ -9,35 +9,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo and redo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Redo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to perform a redo action once.") ; Perform one redo action. _LOWriter_DocRedo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform a redo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform a redo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocRedoCurActionTitle.au3 b/Examples/_LOWriter_DocRedoCurActionTitle.au3 index 3d966274..1b59c2eb 100644 --- a/Examples/_LOWriter_DocRedoCurActionTitle.au3 +++ b/Examples/_LOWriter_DocRedoCurActionTitle.au3 @@ -10,39 +10,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo and redo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Redo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) ; Retrieve the next available Redo action title. $sRedo = _LOWriter_DocRedoCurActionTitle($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve next Redo action title. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve next Redo action title. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The next Redo action title is: " & $sRedo & " Press ok to perform it.") ; Perform one Redo action. _LOWriter_DocRedo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an Redo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an Redo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocRedoGetAllActionTitles.au3 b/Examples/_LOWriter_DocRedoGetAllActionTitles.au3 index 08e60f28..9e0679b5 100644 --- a/Examples/_LOWriter_DocRedoGetAllActionTitles.au3 +++ b/Examples/_LOWriter_DocRedoGetAllActionTitles.au3 @@ -11,31 +11,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo and redo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Redo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) ; Perform another undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of available redo action titles. $asRedo = _LOWriter_DocRedoGetAllActionTitles($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve array of redo action titles. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of redo action titles. Error:" & @error & " Extended:" & @extended) ; Display the available Redo action titles. _ArrayDisplay($asRedo) @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocRedoIsPossible.au3 b/Examples/_LOWriter_DocRedoIsPossible.au3 index 8d98c750..84d38cc7 100644 --- a/Examples/_LOWriter_DocRedoIsPossible.au3 +++ b/Examples/_LOWriter_DocRedoIsPossible.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo and redo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Redo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is a Redo operation possible? True/False: " & _LOWriter_DocRedoIsPossible($oDoc)) ; Perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now is a Redo operation possible? True/False: " & _LOWriter_DocRedoIsPossible($oDoc)) @@ -35,7 +35,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocReplaceAll.au3 b/Examples/_LOWriter_DocReplaceAll.au3 index 8a901dc2..46f4a67c 100644 --- a/Examples/_LOWriter_DocReplaceAll.au3 +++ b/Examples/_LOWriter_DocReplaceAll.au3 @@ -10,44 +10,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search as an example." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 35 spaces, selecting as I go. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 35, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font weight to (Bold) $LOW_WEIGHT_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, Null, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Bold font. _LOWriter_FindFormatModifyFont($oDoc, $atFindFormat, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Create a Replace Format Search Array for Italic font. _LOWriter_FindFormatModifyFont($oDoc, $atReplaceFormat, Null, Null, Null, $LOW_POSTURE_ITALIC) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search and replace all bold letter "a"'s with Italic "@". _LOWriter_DocReplaceAll($oDoc, $oSrchDesc, "a", "@", $atFindFormat, $atReplaceFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ConsoleWrite(@extended & @CRLF) @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocReplaceAllInRange.au3 b/Examples/_LOWriter_DocReplaceAllInRange.au3 index dfee87e4..d9a7ca03 100644 --- a/Examples/_LOWriter_DocReplaceAllInRange.au3 +++ b/Examples/_LOWriter_DocReplaceAllInRange.au3 @@ -10,48 +10,48 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search as an example." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 35 spaces, selecting as I go. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 35, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font weight to (Bold) $LOW_WEIGHT_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, Null, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor left 15 spaces, unselecting as I go. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_LEFT, 15, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Bold font. _LOWriter_FindFormatModifyFont($oDoc, $atFindFormat, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Create a Replace Format Search Array for Italic font. _LOWriter_FindFormatModifyFont($oDoc, $atReplaceFormat, Null, Null, Null, $LOW_POSTURE_ITALIC) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search and replace all bold letter "a"'s with Italic "@" that are selected by the view cursor. _LOWriter_DocReplaceAllInRange($oDoc, $oSrchDesc, $oViewCursor, "a", "@", $atFindFormat, $atReplaceFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ConsoleWrite(@extended & @CRLF) @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocSave.au3 b/Examples/_LOWriter_DocSave.au3 index f3ecdade..a3e458c1 100644 --- a/Examples/_LOWriter_DocSave.au3 +++ b/Examples/_LOWriter_DocSave.au3 @@ -11,7 +11,7 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now save the new Writer Document to the desktop folder.") @@ -19,38 +19,38 @@ Func Example() ; save The New Blank Doc To Desktop Directory using a unique temporary name. $sPath = _LOWriter_DocSaveAs($oDoc, $sFilePathName) - If (@error > 0) Then _ERROR("Failed to Save the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Save the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created and saved the document to your Desktop, found at the following Path: " _ & $sPath & @CRLF & "Press Ok to write some data to it and then save the changes and close the document.") ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve View Cursor for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve View Cursor for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "This is some text to test saving a document.") - If (@error > 0) Then _ERROR("Failed to insert a String into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a String into the Writer Document. Error:" & @error & " Extended:" & @extended) ; Save the changes to the document. _LOWriter_DocSave($oDoc) - If (@error > 0) Then _ERROR("Failed to Save the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Save the Writer Document. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have written and saved the data, and closed the document. I will now open it up again to show it worked.") ; Open the document. $oDoc = _LOWriter_DocOpen($sPath) - If (@error > 0) Then _ERROR("Failed to open Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to open Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document was succesfully opened. Press OK to close and delete it.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ + If @error Then _ERROR("Failed to close opened L.O. Document. Following Error codes returned: Error:" & _ @error & " Extended:" & @extended) ; Delete the file. diff --git a/Examples/_LOWriter_DocSaveAs.au3 b/Examples/_LOWriter_DocSaveAs.au3 index 43f5b8ca..764c97a6 100644 --- a/Examples/_LOWriter_DocSaveAs.au3 +++ b/Examples/_LOWriter_DocSaveAs.au3 @@ -14,18 +14,18 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a unique file name $sSavePath = _TempFile(@DesktopDir & "\", "DocOpenTestFile_", ".odt") ; Save The New Blank Doc To Desktop Directory. $sPath = _LOWriter_DocSaveAs($oDoc, $sSavePath, "", True) - If (@error > 0) Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to save the Writer Document. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created and saved a blank L.O. Writer Doc to your Desktop, found at the following Path: " _ & $sPath & @CRLF & "Press Ok to delete it.") diff --git a/Examples/_LOWriter_DocToFront.au3 b/Examples/_LOWriter_DocToFront.au3 index 70167749..0e565718 100644 --- a/Examples/_LOWriter_DocToFront.au3 +++ b/Examples/_LOWriter_DocToFront.au3 @@ -9,22 +9,22 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Minimize the document _LOWriter_DocMinimize($oDoc, True) - If (@error > 0) Then _ERROR("Failed to Minimize Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Minimize Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to bring the document to the front.") _LOWriter_DocToFront($oDoc) - If (@error > 0) Then _ERROR("Failed to bring document to the front. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to bring document to the front. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocUndo.au3 b/Examples/_LOWriter_DocUndo.au3 index 6cc48296..3b3996c9 100644 --- a/Examples/_LOWriter_DocUndo.au3 +++ b/Examples/_LOWriter_DocUndo.au3 @@ -9,31 +9,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "undo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to perform an undo action once.") ; perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocUndoCurActionTitle.au3 b/Examples/_LOWriter_DocUndoCurActionTitle.au3 index 8bd3959b..e6e3bc19 100644 --- a/Examples/_LOWriter_DocUndoCurActionTitle.au3 +++ b/Examples/_LOWriter_DocUndoCurActionTitle.au3 @@ -10,39 +10,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo and redo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Redo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) ; Retrieve the next available Undo action title. $sUndo = _LOWriter_DocUndoCurActionTitle($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve next undo action title. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve next undo action title. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The next undo action title is: " & $sUndo & " Press ok to perform it.") ; Perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocUndoGetAllActionTitles.au3 b/Examples/_LOWriter_DocUndoGetAllActionTitles.au3 index c31b9cf6..68a30572 100644 --- a/Examples/_LOWriter_DocUndoGetAllActionTitles.au3 +++ b/Examples/_LOWriter_DocUndoGetAllActionTitles.au3 @@ -11,23 +11,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo and redo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Redo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of available undo action titles. $asUndo = _LOWriter_DocUndoGetAllActionTitles($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve array of undo action titles. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of undo action titles. Error:" & @error & " Extended:" & @extended) ; Display the available Undo action titles. _ArrayDisplay($asUndo) @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocUndoIsPossible.au3 b/Examples/_LOWriter_DocUndoIsPossible.au3 index edb4fe85..b8360a28 100644 --- a/Examples/_LOWriter_DocUndoIsPossible.au3 +++ b/Examples/_LOWriter_DocUndoIsPossible.au3 @@ -9,29 +9,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "A word to undo and redo: ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Redo") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Perform one undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is an Undo operation possible? True/False: " & _LOWriter_DocUndoIsPossible($oDoc)) ; Perform another undo action. _LOWriter_DocUndo($oDoc) - If (@error > 0) Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform an undo action. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now is an Undo operation possible? True/False: " & _LOWriter_DocUndoIsPossible($oDoc)) @@ -39,7 +39,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocViewCursorGetPosition.au3 b/Examples/_LOWriter_DocViewCursorGetPosition.au3 index 034832c3..994eb8fd 100644 --- a/Examples/_LOWriter_DocViewCursorGetPosition.au3 +++ b/Examples/_LOWriter_DocViewCursorGetPosition.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text." & @CR & @CR & "Some different text" & @CR & "Another Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the beginning of the document. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) ; Retrieve the current View cursor position, Return will be the Vertical (Y) coordinate, @Extended is the Horizontal (X) coordinate. $iReturn = _LOWriter_DocViewCursorGetPosition($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor position. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The ViewCursor is located at the following positions:" & @CRLF & _ "Horizontal, measured in Micrometers: " & $iReturn & @CRLF & _ @@ -35,11 +35,11 @@ Func Example() ; Move the Cursor to the beginning of the document. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_END) - If (@error > 0) Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move cursor. Error:" & @error & " Extended:" & @extended) ; Retrieve the View cursor position again. $iReturn = _LOWriter_DocViewCursorGetPosition($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor position. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The ViewCursor's is now located at the following positions:" & @CRLF & _ "Horizontal, measured in Micrometers: " & $iReturn & @CRLF & _ @@ -49,7 +49,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocVisible.au3 b/Examples/_LOWriter_DocVisible.au3 index d4244123..dbe7d738 100644 --- a/Examples/_LOWriter_DocVisible.au3 +++ b/Examples/_LOWriter_DocVisible.au3 @@ -10,7 +10,7 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok and I will make the new document I just opened invisible.") @@ -23,7 +23,7 @@ Func Example() ; Test if the document is Visible $bReturn = _LOWriter_DocVisible($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the document currently visible? True/False: " & $bReturn & @CRLF & @CRLF & _ "Press Ok to make the document visible again.") @@ -37,7 +37,7 @@ Func Example() ; Test if the document is Visible $bReturn = _LOWriter_DocVisible($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve document status. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve document status. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Is the document now visible? True/False: " & $bReturn) @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_DocZoom.au3 b/Examples/_LOWriter_DocZoom.au3 index 0ed8f29f..6bb2e8c2 100644 --- a/Examples/_LOWriter_DocZoom.au3 +++ b/Examples/_LOWriter_DocZoom.au3 @@ -10,11 +10,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the current zoom value $iReturn = _LOWriter_DocZoom($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve current zoom value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current zoom value. Error:" & @error & " Extended:" & @extended) $iZoom = Int($iReturn * .75) ; Set my new zoom value to 75% of the current zoom value. @@ -25,11 +25,11 @@ Func Example() ; Set the zoom to my new value. _LOWriter_DocZoom($oDoc, $iZoom) - If (@error > 0) Then _ERROR("Failed to set zoom value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set zoom value. Error:" & @error & " Extended:" & @extended) ; Retrieve the current zoom value again. $iReturn = _LOWriter_DocZoom($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve current zoom value. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve current zoom value. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Your new zoom value is: " & $iReturn & "%.") @@ -37,7 +37,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnoteDelete.au3 b/Examples/_LOWriter_EndnoteDelete.au3 index ddce8e1d..4ff6a753 100644 --- a/Examples/_LOWriter_EndnoteDelete.au3 +++ b/Examples/_LOWriter_EndnoteDelete.au3 @@ -9,31 +9,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor $oEndnote = _LOWriter_EndnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the Endnote.") ; Delete the Endnote. _LOWriter_EndnoteDelete($oEndnote) - If (@error > 0) Then _ERROR("Failed to delete a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Endnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnoteGetAnchor.au3 b/Examples/_LOWriter_EndnoteGetAnchor.au3 index e07e7c15..9c443545 100644 --- a/Examples/_LOWriter_EndnoteGetAnchor.au3 +++ b/Examples/_LOWriter_EndnoteGetAnchor.au3 @@ -9,37 +9,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor $oEndnote = _LOWriter_EndnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, " More text after the Endnote.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Text Cursor at the Anchor location. $oAnchorTextCursor = _LOWriter_EndnoteGetAnchor($oEndnote) - If (@error > 0) Then _ERROR("Failed to create a text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text before the Endnote anchor location. _LOWriter_DocInsertString($oDoc, $oAnchorTextCursor, "(NEW TEXT INSERTED USING THE ANCHOR CURSOR.) ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnoteGetTextCursor.au3 b/Examples/_LOWriter_EndnoteGetTextCursor.au3 index bb445577..96bda685 100644 --- a/Examples/_LOWriter_EndnoteGetTextCursor.au3 +++ b/Examples/_LOWriter_EndnoteGetTextCursor.au3 @@ -9,33 +9,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor $oEndnote = _LOWriter_EndnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) ; Retrieve a Text cursor for the Endnote $oTextCursor = _LOWriter_EndnoteGetTextCursor($oEndnote) - If (@error > 0) Then _ERROR("Failed to create a Endnote Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Endnote Text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text in the Endnote. _LOWriter_DocInsertString($oDoc, $oTextCursor, "I inserted some text inside of the Endnote.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnoteInsert.au3 b/Examples/_LOWriter_EndnoteInsert.au3 index cb8b2a03..65b2cca8 100644 --- a/Examples/_LOWriter_EndnoteInsert.au3 +++ b/Examples/_LOWriter_EndnoteInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor, and set a custom label, "E". _LOWriter_EndnoteInsert($oDoc, $oViewCursor, False, "E") - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnoteModifyAnchor.au3 b/Examples/_LOWriter_EndnoteModifyAnchor.au3 index a36c831b..ce055866 100644 --- a/Examples/_LOWriter_EndnoteModifyAnchor.au3 +++ b/Examples/_LOWriter_EndnoteModifyAnchor.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor, and set a custom label, "E". $oEndNote = _LOWriter_EndnoteInsert($oDoc, $oViewCursor, False, "E") - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Endnote Label.") ; Change the Endnote Label to AutoNumbering. _LOWriter_EndnoteModifyAnchor($oEndNote, "") - If (@error > 0) Then _ERROR("Failed to modify Endnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Endnote settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Endnote Label. $sLabel = _LOWriter_EndnoteModifyAnchor($oEndNote) - If (@error > 0) Then _ERROR("Failed to Retrieve Endnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Retrieve Endnote settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Endnote's current label is: " & $sLabel) @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnoteSettingsAutoNumber.au3 b/Examples/_LOWriter_EndnoteSettingsAutoNumber.au3 index a99c5772..c6b31b93 100644 --- a/Examples/_LOWriter_EndnoteSettingsAutoNumber.au3 +++ b/Examples/_LOWriter_EndnoteSettingsAutoNumber.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor _LOWriter_EndnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) ; Modify the Document's Endnote settings to: Number format = $LOW_NUM_STYLE_ROMAN_UPPER, Start Numbering at 5, Before the Endnote label, Place ; a Emdash and after the Endnote label place a Colon _LOWriter_EndnoteSettingsAutoNumber($oDoc, $LOW_NUM_STYLE_ROMAN_UPPER, 5, "—", ":") - If (@error > 0) Then _ERROR("Failed to modify Endnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Endnote settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Endnote settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_EndnoteSettingsAutoNumber($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve Endnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Endnote settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document's current Endnote Auto Numbering settings are as follows: " & @CRLF & _ "The Auto Numbering Number Style used for Endnotes is, (see UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnoteSettingsStyles.au3 b/Examples/_LOWriter_EndnoteSettingsStyles.au3 index 8bd5e2a2..f624346f 100644 --- a/Examples/_LOWriter_EndnoteSettingsStyles.au3 +++ b/Examples/_LOWriter_EndnoteSettingsStyles.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor _LOWriter_EndnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) ; Modify the Document's Endnote Style settings to: Paragraph Style to use = "Marginalia", Page style = "HTML", Text area = "Definition" Character style ; Endnote Area = "Source Text" _LOWriter_EndnoteSettingsStyles($oDoc, "Marginalia", "HTML", "Definition", "Source Text") - If (@error > 0) Then _ERROR("Failed to modify Endnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Endnote settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Endnote settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_EndnoteSettingsStyles($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve Endnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Endnote settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document's current Endnote Style settings are as follows: " & @CRLF & _ "The Paragraph Style to use for Endnote content is: " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_EndnotesGetList.au3 b/Examples/_LOWriter_EndnotesGetList.au3 index 3be0c13e..e5724b9c 100644 --- a/Examples/_LOWriter_EndnotesGetList.au3 +++ b/Examples/_LOWriter_EndnotesGetList.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Endnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor _LOWriter_EndnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, " More Text.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert another Endnote at the ViewCursor. _LOWriter_EndnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Endnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to delete the first Endnote.") ; Retrieve an array of Endnote Objects. $aoEndnotes = _LOWriter_EndnotesGetList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Endnote objects. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Endnote objects. Error:" & @error & " Extended:" & @extended) ; Delete the first Endnote returned _LOWriter_EndnoteDelete($aoEndnotes[0]) - If (@error > 0) Then _ERROR("Failed to delete a Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Endnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldAuthorInsert.au3 b/Examples/_LOWriter_FieldAuthorInsert.au3 index bd5c1ed2..50d244de 100644 --- a/Examples/_LOWriter_FieldAuthorInsert.au3 +++ b/Examples/_LOWriter_FieldAuthorInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Author Field at the View Cursor. Fixed = True, Set the Author to "Auto It", Full name = True. _LOWriter_FieldAuthorInsert($oDoc, $oViewCursor, False, True, "Auto It", True) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldAuthorModify.au3 b/Examples/_LOWriter_FieldAuthorModify.au3 index f0bfb6f4..5a5a8cc8 100644 --- a/Examples/_LOWriter_FieldAuthorModify.au3 +++ b/Examples/_LOWriter_FieldAuthorModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Author Field at the View Cursor. Fixed = True, Set the Author to "Auto It", Full name = True, . $oField = _LOWriter_FieldAuthorInsert($oDoc, $oViewCursor, False, True, "Auto It", True) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Author Field.") ; Modify the Author Field settings. Set Is Fixed to False. _LOWriter_FieldAuthorModify($oField, False) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldAuthorModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Author Field's content fixed? True/False: " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldChapterInsert.au3 b/Examples/_LOWriter_FieldChapterInsert.au3 index fb2f4f42..89150075 100644 --- a/Examples/_LOWriter_FieldChapterInsert.au3 +++ b/Examples/_LOWriter_FieldChapterInsert.au3 @@ -9,29 +9,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Chapter Field at the View Cursor. Set the Chapter Format to $LOW_FIELD_CHAP_FRMT_NAME_NUMBER, and Level to: 5 _LOWriter_FieldChapterInsert($oDoc, $oViewCursor, False, $LOW_FIELD_CHAP_FRMT_NAME_NUMBER, 5) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, " <-- This is blank because Chapter Headers are not present, and Chapter Numbering is not set up.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldChapterModify.au3 b/Examples/_LOWriter_FieldChapterModify.au3 index 5827c094..c2796f20 100644 --- a/Examples/_LOWriter_FieldChapterModify.au3 +++ b/Examples/_LOWriter_FieldChapterModify.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Chapter Field at the View Cursor. Set the Chapter Format to $LOW_FIELD_CHAP_FRMT_NAME_NUMBER, and Level to: 5 $oField = _LOWriter_FieldChapterInsert($oDoc, $oViewCursor, False, $LOW_FIELD_CHAP_FRMT_NAME_NUMBER, 5) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Modify the Chapter Field settings. Set Chapter Format to $LOW_FIELD_CHAP_FRMT_DIGIT, and level to 3. _LOWriter_FieldChapterModify($oField, $LOW_FIELD_CHAP_FRMT_DIGIT, 3) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. $avSettings = _LOWriter_FieldChapterModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Chapter Display format is, (see UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldCombCharInsert.au3 b/Examples/_LOWriter_FieldCombCharInsert.au3 index 38f20861..093a2519 100644 --- a/Examples/_LOWriter_FieldCombCharInsert.au3 +++ b/Examples/_LOWriter_FieldCombCharInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Combined character Field at the View Cursor. Insert the Characters "ABCDEF _LOWriter_FieldCombCharInsert($oDoc, $oViewCursor, False, "ABCDEF") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldCombCharModify.au3 b/Examples/_LOWriter_FieldCombCharModify.au3 index 803b6923..182d2f04 100644 --- a/Examples/_LOWriter_FieldCombCharModify.au3 +++ b/Examples/_LOWriter_FieldCombCharModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Combined character Field at the View Cursor. Insert the Characters "ABCDEF $oField = _LOWriter_FieldCombCharInsert($oDoc, $oViewCursor, False, "ABCDEF") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Combined Character Field.") ; Modify the COmbined Character Field settings. Set the characters to "XYZ*" _LOWriter_FieldCombCharModify($oField, "XYZ*") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be a string. $sSetting = _LOWriter_FieldCombCharModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Combined Character Field constains the following characters: " & $sSetting) @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldCommentInsert.au3 b/Examples/_LOWriter_FieldCommentInsert.au3 index e7d3d473..130a07cf 100644 --- a/Examples/_LOWriter_FieldCommentInsert.au3 +++ b/Examples/_LOWriter_FieldCommentInsert.au3 @@ -10,30 +10,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Insert a Comment Field at the View Cursor. Set content to "This is a note", Author to "Daniel", Date to my previouse Date Structure I created. ; Initials to "D.", Author to "A Name", Resolved = False _LOWriter_FieldCommentInsert($oDoc, $oViewCursor, False, "This is a note", "Daniel", $tDateStruct, "D.", "A Name", False) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldCommentModify.au3 b/Examples/_LOWriter_FieldCommentModify.au3 index 62de7404..52ac2f3f 100644 --- a/Examples/_LOWriter_FieldCommentModify.au3 +++ b/Examples/_LOWriter_FieldCommentModify.au3 @@ -12,43 +12,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Insert a Comment Field at the View Cursor. Set content to "This is a note", Author to "Daniel", Date to my previouse Date Structure I created. ; Initials to "D.", Author to "A Name", Resolved = True $oField = _LOWriter_FieldCommentInsert($oDoc, $oViewCursor, False, "This is a note", "Daniel", $tDateStruct, "D.", "A Name", True) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the comment Field.") ; Create a new Date Structure, leaving all blank will create a Date Structure with today's date. $tDateStruct = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Modify the Comment Field settings. Set content to "New Content", Author to "Anon", Date to my new Date Structure I created. ; Initials to "A.", Author to "A-Non-Mouse", Resolved = False _LOWriter_FieldCommentModify($oDoc, $oField, "New Content", "Anon", $tDateStruct, "A.", "A-Non-Mouse", False) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. $avSettings = _LOWriter_FieldCommentModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) ; convert the Date Struct to an Array, and then into a String. $avDate = _LOWriter_DateStructModify($avSettings[2]) - If (@error > 0) Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($avDate) - 1 If IsBool($avDate[$i]) Then @@ -74,7 +74,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldCondTextInsert.au3 b/Examples/_LOWriter_FieldCondTextInsert.au3 index b2e47d51..43128d3c 100644 --- a/Examples/_LOWriter_FieldCondTextInsert.au3 +++ b/Examples/_LOWriter_FieldCondTextInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Conditional text Field at the View Cursor. The Condition will be if (1+1) > [is greater than] 2 If so display "Yes", If not, Display "NO!" _LOWriter_FieldCondTextInsert($oDoc, $oViewCursor, False, "(1+1) > 2", "Yes", "No!") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldCondTextModify.au3 b/Examples/_LOWriter_FieldCondTextModify.au3 index 4f80eac1..a6aafa6f 100644 --- a/Examples/_LOWriter_FieldCondTextModify.au3 +++ b/Examples/_LOWriter_FieldCondTextModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Conditional text Field at the View Cursor. The Condition will be if (1+1) > [is greater than] 2 If so display "Yes", If not, Display "NO!" $oField = _LOWriter_FieldCondTextInsert($oDoc, $oViewCursor, False, "(1+1) > 2", "Yes", "No!") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Conditional Text Field.") ; Modify the Conditional Text Field settings. Set the New condition to If the Page Count = 1 Then display "There is 1 Page" , else display "There are many pages" _LOWriter_FieldCondTextModify($oField, "PAGE == 1", "There is 1 Page", "There are many pages") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. $avSettings = _LOWriter_FieldCondTextModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Conditional Text Field's Condition to evaluate is: " & $avSettings[0] & @CRLF & _ @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldCurrentDisplayGet.au3 b/Examples/_LOWriter_FieldCurrentDisplayGet.au3 index a0169f20..6a860981 100644 --- a/Examples/_LOWriter_FieldCurrentDisplayGet.au3 +++ b/Examples/_LOWriter_FieldCurrentDisplayGet.au3 @@ -10,49 +10,49 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Conditional text Field at the View Cursor. The Condition will be if (1+1) > [is greater than] 2 If so display "Yes", If not, Display "NO!" $oCondTextField = _LOWriter_FieldCondTextInsert($oDoc, $oViewCursor, False, "(1+1) > 2", "Yes", "No!") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Author Field at the View Cursor. Fixed = True, Set the Author to "Auto It", Full name = True. $oAuthorField = _LOWriter_FieldAuthorInsert($oDoc, $oViewCursor, False, True, "Auto It", True) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use the new MasterField's name, set the Value to 2300 $oSetVarField = _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "2300", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Show Variable Field and use the new SetVar name, which is also the MasterField's name. $oShowVarField = _LOWriter_FieldShowVarInsert($oDoc, $oViewCursor, $sMasterFieldName, False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Current displayed text of the Conditional Text Field is: " & _LOWriter_FieldCurrentDisplayGet($oCondTextField) & @CRLF & _ "The Current displayed text of the Author Field is: " & _LOWriter_FieldCurrentDisplayGet($oAuthorField) & @CRLF & _ @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDateTimeInsert.au3 b/Examples/_LOWriter_FieldDateTimeInsert.au3 index 65e38c00..41e812cd 100644 --- a/Examples/_LOWriter_FieldDateTimeInsert.au3 +++ b/Examples/_LOWriter_FieldDateTimeInsert.au3 @@ -11,34 +11,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, leave it blank so it will be set to the current date/Time. $tDateStruct = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. Fixed = True, Set the Date to my previously created DateStruct, Is Date = True, ; Offset (In Days since I set Date to True) = -1 meaning minus one day, and set DateTime Format Key to the Key I just created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct, True, -1, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDateTimeModify.au3 b/Examples/_LOWriter_FieldDateTimeModify.au3 index 0123f7b9..6aea626d 100644 --- a/Examples/_LOWriter_FieldDateTimeModify.au3 +++ b/Examples/_LOWriter_FieldDateTimeModify.au3 @@ -13,51 +13,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, leave it blank so it will be set to the current date/Time. $tDateStruct = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor., Fixed = False, Set the Date to my previously created DateStruct, Is Date = True, ; Offset (In Days since I set Date to True) = -1 meaning minus one day, and set DateTime Format Key to the Key I just created. $oField = _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, False, $tDateStruct, True, -1, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Date/Time Field.") ; Create a new Date Structure, Year = 1992, Month = 4, Day = 28, Hour = 12, Minute == 00 , Sec == 00. $tDateStruct = _LOWriter_DateStructCreate(1992, 04, 28, 12, 00, 00) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Month Day Year Hour, Minute, Second, AM/PM $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "MM/DD/YYYY H:MM:SS AM/PM") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Modify the Date/Time Field settings. Fixed= True, Modify the Date to the one just created, Is Date = False, Off set (in minutes) = 20, Use my new ; DateFormat Key. _LOWriter_FieldDateTimeModify($oDoc, $oField, True, $tDateStruct, False, 20, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldDateTimeModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) ; convert the Date Struct to an Array, and then into a String. $avDate = _LOWriter_DateStructModify($avSettings[1]) - If (@error > 0) Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Date structure properties. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($avDate) - 1 If IsBool($avDate[$i]) Then @@ -82,7 +82,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDelete.au3 b/Examples/_LOWriter_FieldDelete.au3 index d3453d63..cdc42825 100644 --- a/Examples/_LOWriter_FieldDelete.au3 +++ b/Examples/_LOWriter_FieldDelete.au3 @@ -9,32 +9,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Page Number Field at the View Cursor. Use $LOW_NUM_STYLE_ARABIC numbering style, skip offset, and make the Page Number for the ; current page. $oField = _LOWriter_FieldPageNumberInsert($oDoc, $oViewCursor, False, $LOW_NUM_STYLE_ARABIC, Null, $LOW_PAGE_NUM_TYPE_CURRENT) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the Page Number Field.") ; Delete the Field. _LOWriter_FieldDelete($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to delete a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDelete[2].au3 b/Examples/_LOWriter_FieldDelete[2].au3 index 9be45bad..3c2b3520 100644 --- a/Examples/_LOWriter_FieldDelete[2].au3 +++ b/Examples/_LOWriter_FieldDelete[2].au3 @@ -12,51 +12,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use the new MasterField's name., set the Value to 2300 $oField = _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "2300", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the Set Variable Field.") ; Delete the Field and its MasterField. _LOWriter_FieldDelete($oDoc, $oField, True) - If (@error > 0) Then _ERROR("Failed to delete a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a field. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Set Variable Master Field names. $asMasters = _LOWriter_FieldSetVarMasterList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) $iResults = @extended _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "Field Master Names currently in this Document: (Notice my newly created Master Field is not listed." & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To $iResults - 1 ; Write each Master Field name in the document. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asMasters[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoCommentsInsert.au3 b/Examples/_LOWriter_FieldDocInfoCommentsInsert.au3 index 0f0d057a..64a76a8e 100644 --- a/Examples/_LOWriter_FieldDocInfoCommentsInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoCommentsInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Comments Field at the View Cursor. Set is Fixed = True, comments = "This is a comment." _LOWriter_FieldDocInfoCommentsInsert($oDoc, $oViewCursor, False, True, "This is a comment.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoCommentsModify.au3 b/Examples/_LOWriter_FieldDocInfoCommentsModify.au3 index 42658b78..a895d144 100644 --- a/Examples/_LOWriter_FieldDocInfoCommentsModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoCommentsModify.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Comments Field at the View Cursor. Set is Fixed = True, comments = "This is a comment." $oField = _LOWriter_FieldDocInfoCommentsInsert($oDoc, $oViewCursor, False, True, "This is a comment.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Set the Document's Description settings, Comments To two lines of comments. _LOWriter_DocDescription($oDoc, Null, Null, Null, "A comment." & @CR & "This is a second comment line.") - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Comments Field settings. Set Fixed to False. _LOWriter_FieldDocInfoCommentsModify($oField, False) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoCommentsModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoCreateAuthInsert.au3 b/Examples/_LOWriter_FieldDocInfoCreateAuthInsert.au3 index 998c512c..c9469390 100644 --- a/Examples/_LOWriter_FieldDocInfoCreateAuthInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoCreateAuthInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Create Author Field at the View Cursor. Set is Fixed = True, and Author to "Me". _LOWriter_FieldDocInfoCreateAuthInsert($oDoc, $oViewCursor, False, True, "Me") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoCreateAuthModify.au3 b/Examples/_LOWriter_FieldDocInfoCreateAuthModify.au3 index fc52e6f3..8ae6abaf 100644 --- a/Examples/_LOWriter_FieldDocInfoCreateAuthModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoCreateAuthModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Create Author Field at the View Cursor. Set is Fixed = False $oField = _LOWriter_FieldDocInfoCreateAuthInsert($oDoc, $oViewCursor, False, False) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Modify the Doc Info Create Author Field settings. Set Fixed to True, Set author to "You". _LOWriter_FieldDocInfoCreateAuthModify($oField, True, "You") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoCreateAuthModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoCreateDateTimeInsert.au3 b/Examples/_LOWriter_FieldDocInfoCreateDateTimeInsert.au3 index 92a49d55..e9ee24ca 100644 --- a/Examples/_LOWriter_FieldDocInfoCreateDateTimeInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoCreateDateTimeInsert.au3 @@ -11,37 +11,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, will return the current date/Time $tDateStruct = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's creation settings to, Created by = "Daniel", Date to the previously created Day Structure, for this Field demonstration. _LOWriter_DocGenPropCreation($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information creation Date/Time Field at the View Cursor. Set is Fixed = True, and Date Format Key to the one I just created. _LOWriter_FieldDocInfoCreateDateTimeInsert($oDoc, $oViewCursor, False, True, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoCreateDateTimeModify.au3 b/Examples/_LOWriter_FieldDocInfoCreateDateTimeModify.au3 index 5a134834..ba2ca79e 100644 --- a/Examples/_LOWriter_FieldDocInfoCreateDateTimeModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoCreateDateTimeModify.au3 @@ -12,45 +12,45 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, set the Date to Year, 1992, 03, 28, 12:00 $tDateStruct = _LOWriter_DateStructCreate(1992, 03, 28, 12, 00) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Created by settings to, Created by = "Nik", Date to the previously created Day Structure. _LOWriter_DocGenPropCreation($oDoc, "Nik", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Creation Date/Time Field at the View Cursor. Set is Fixed = True, and Date Format Key to the one I just created. $oField = _LOWriter_FieldDocInfoCreateDateTimeInsert($oDoc, $oViewCursor, False, True, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Create or retrieve a different DateFormat Key, two-digit year, Day, Month, Hour Minute, Second. $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "YY/DDD/MMM HH:MM:SS") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Creation Date/Time Field settings. Set Fixed to False, Set the Date/TIme Format to the new Key I just created. _LOWriter_FieldDocInfoCreateDateTimeModify($oDoc, $oField, False, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoCreateDateTimeModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -61,7 +61,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoEditTimeInsert.au3 b/Examples/_LOWriter_FieldDocInfoEditTimeInsert.au3 index 0f7c2133..01b8974f 100644 --- a/Examples/_LOWriter_FieldDocInfoEditTimeInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoEditTimeInsert.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second $iTimeFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "HH:MM:SS") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Set the Document's General Property settings, Set total editing time to 5137 seconds (1:25:37) _LOWriter_DocGenProp($oDoc, Null, Null, 5137) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Editing Time Field at the View Cursor. Set is Fixed = True, Time format key to the one I just created. _LOWriter_FieldDocInfoEditTimeInsert($oDoc, $oViewCursor, False, True, $iTimeFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoEditTimeModify.au3 b/Examples/_LOWriter_FieldDocInfoEditTimeModify.au3 index 17f21128..77d1344f 100644 --- a/Examples/_LOWriter_FieldDocInfoEditTimeModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoEditTimeModify.au3 @@ -11,41 +11,41 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second $iTimeFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "HH:MM:SS") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Set the Document's General Property settings, Set total editing time to 5137 seconds (1:25:37) _LOWriter_DocGenProp($oDoc, Null, Null, 5137) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Editing Time Field at the View Cursor. Set is Fixed = True, Time format key to the one I just created. $oField = _LOWriter_FieldDocInfoEditTimeInsert($oDoc, $oViewCursor, False, True, $iTimeFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Create or retrieve a different DateFormat Key, Hour, Minute $iTimeFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Editing time Field settings. Set Fixed to False, and set the new Time Format key to be used. _LOWriter_FieldDocInfoEditTimeModify($oDoc, $oField, False, $iTimeFormatKey) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoEditTimeModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -56,7 +56,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoKeywordsInsert.au3 b/Examples/_LOWriter_FieldDocInfoKeywordsInsert.au3 index ac50c793..b39058d7 100644 --- a/Examples/_LOWriter_FieldDocInfoKeywordsInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoKeywordsInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Keywords Field at the View Cursor. Set is Fixed = True, Keywords = "This is a Keyword Field." _LOWriter_FieldDocInfoKeywordsInsert($oDoc, $oViewCursor, False, True, "This is a Keyword Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoKeywordsModify.au3 b/Examples/_LOWriter_FieldDocInfoKeywordsModify.au3 index b92a8076..304222c1 100644 --- a/Examples/_LOWriter_FieldDocInfoKeywordsModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoKeywordsModify.au3 @@ -11,19 +11,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Keywords Field at the View Cursor. Set is Fixed = True, Keywords = "This is a Keyword Field." $oField = _LOWriter_FieldDocInfoKeywordsInsert($oDoc, $oViewCursor, False, True, "This is a Keyword Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") @@ -33,15 +33,15 @@ Func Example() ; Set the Document's Description settings, Set Keywords to the ones I just created. _LOWriter_DocDescription($oDoc, Null, Null, $asKeywords) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Keywords Field settings. Set Fixed to False. _LOWriter_FieldDocInfoKeywordsModify($oField, False) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoKeywordsModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoModAuthInsert.au3 b/Examples/_LOWriter_FieldDocInfoModAuthInsert.au3 index 4528abce..3a5bac56 100644 --- a/Examples/_LOWriter_FieldDocInfoModAuthInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoModAuthInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Modification Author Field at the View Cursor. Set is Fixed = True, and Author to "Me". _LOWriter_FieldDocInfoModAuthInsert($oDoc, $oViewCursor, False, True, "Me") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoModAuthModify.au3 b/Examples/_LOWriter_FieldDocInfoModAuthModify.au3 index 5dade91a..b6d5cb86 100644 --- a/Examples/_LOWriter_FieldDocInfoModAuthModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoModAuthModify.au3 @@ -11,37 +11,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Modification settings to, Modified by = "Daniel", Date to the previously created Day Structure, for this Field demonstration. _LOWriter_DocGenPropModification($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Modification Author Field at the View Cursor. Set is Fixed = False $oField = _LOWriter_FieldDocInfoModAuthInsert($oDoc, $oViewCursor, False, False) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Modify the Doc Info Modification Author Field settings. Set Fixed to True, Set author to "Me". _LOWriter_FieldDocInfoModAuthModify($oField, True, "Me") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoModAuthModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoModDateTimeInsert.au3 b/Examples/_LOWriter_FieldDocInfoModDateTimeInsert.au3 index f04b7931..36673a0b 100644 --- a/Examples/_LOWriter_FieldDocInfoModDateTimeInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoModDateTimeInsert.au3 @@ -11,37 +11,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, will return the current date/Time $tDateStruct = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Modification settings to, Modified by = "Daniel", Date to the previously created Day Structure, for this Field demonstration. _LOWriter_DocGenPropModification($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Modification Date/Time Field at the View Cursor. Set is Fixed = True, and Date Format Key to the one I just created. _LOWriter_FieldDocInfoModDateTimeInsert($oDoc, $oViewCursor, False, True, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoModDateTimeModify.au3 b/Examples/_LOWriter_FieldDocInfoModDateTimeModify.au3 index cb20cb51..14690709 100644 --- a/Examples/_LOWriter_FieldDocInfoModDateTimeModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoModDateTimeModify.au3 @@ -12,45 +12,45 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, set the Date to Year, 1992, 03, 28, 12:00 $tDateStruct = _LOWriter_DateStructCreate(1992, 03, 28, 12, 00) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Last modified by settings to, modified by = "Nik", Date to the previously created Day Structure. _LOWriter_DocGenPropModification($oDoc, "Nik", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Modification Date/Time Field at the View Cursor. Set is Fixed = True, and Date Format Key to the one I just created. $oField = _LOWriter_FieldDocInfoModDateTimeInsert($oDoc, $oViewCursor, False, True, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Create or retrieve a different DateFormat Key, two-digit year, Day, Month, Hour Minute, Second. $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "YY/DDD/MMM HH:MM:SS") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Modification Date/Time Field settings. Set Fixed to False, Set the Date/TIme Format to the new Key I just created. _LOWriter_FieldDocInfoModDateTimeModify($oDoc, $oField, False, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoModDateTimeModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -61,7 +61,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoPrintAuthInsert.au3 b/Examples/_LOWriter_FieldDocInfoPrintAuthInsert.au3 index d8ce0b30..0e1c7eb4 100644 --- a/Examples/_LOWriter_FieldDocInfoPrintAuthInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoPrintAuthInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Print Author Field at the View Cursor. Set is Fixed = True, and Author to "Me". _LOWriter_FieldDocInfoPrintAuthInsert($oDoc, $oViewCursor, False, True, "Me") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoPrintAuthModify.au3 b/Examples/_LOWriter_FieldDocInfoPrintAuthModify.au3 index ec6e6da2..7b65db60 100644 --- a/Examples/_LOWriter_FieldDocInfoPrintAuthModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoPrintAuthModify.au3 @@ -11,37 +11,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1844, Month = 10, Day = 22, Hour = 8, minutes = 14, Seconds = 0 , NanoSeconds = 0, UTC= True. $tDateStruct = _LOWriter_DateStructCreate(1844, 10, 22, 8, 14, 0, 0, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Last Printed by settings to, Printed by = "Daniel", Date to the previously created Day Structure. _LOWriter_DocGenPropPrint($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Print Author Field at the View Cursor. Set is Fixed = False $oField = _LOWriter_FieldDocInfoPrintAuthInsert($oDoc, $oViewCursor, False, False) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Modify the Doc Info Print Author Field settings. Set Fixed to True, Set author to "You". _LOWriter_FieldDocInfoPrintAuthModify($oField, True, "You") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoPrintAuthModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoPrintDateTimeInsert.au3 b/Examples/_LOWriter_FieldDocInfoPrintDateTimeInsert.au3 index 95445b7b..b4ac7756 100644 --- a/Examples/_LOWriter_FieldDocInfoPrintDateTimeInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoPrintDateTimeInsert.au3 @@ -11,37 +11,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, will return the current date/Time $tDateStruct = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Printed By settings to, Printed by = "Daniel", Date to the previously created Day Structure, for this Field demonstration. _LOWriter_DocGenPropPrint($oDoc, "Daniel", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Printed by Date/Time Field at the View Cursor. Set is Fixed = True, and Date Format Key to the one I just created. _LOWriter_FieldDocInfoPrintDateTimeInsert($oDoc, $oViewCursor, False, True, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoPrintDateTimeModify.au3 b/Examples/_LOWriter_FieldDocInfoPrintDateTimeModify.au3 index 0047a05b..926c332a 100644 --- a/Examples/_LOWriter_FieldDocInfoPrintDateTimeModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoPrintDateTimeModify.au3 @@ -12,45 +12,45 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, set the Date to Year, 1992, 03, 28, 12:00 $tDateStruct = _LOWriter_DateStructCreate(1992, 03, 28, 12, 00) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Set the Document's Created by settings to, Created by = "Nik", Date to the previously created Day Structure. _LOWriter_DocGenPropPrint($oDoc, "Nik", $tDateStruct) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Printed By Date/Time Field at the View Cursor. Set is Fixed = True, and Date Format Key to the one I just created. $oField = _LOWriter_FieldDocInfoPrintDateTimeInsert($oDoc, $oViewCursor, False, True, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Create or retrieve a different DateFormat Key, two-digit year, Day, Month, Hour Minute, Second. $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "YY/DDD/MMM HH:MM:SS") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Printed by Date/Time Field settings. Set Fixed to False, Set the Date/TIme Format to the new Key I just created. _LOWriter_FieldDocInfoPrintDateTimeModify($oDoc, $oField, False, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoPrintDateTimeModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -61,7 +61,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoRevNumInsert.au3 b/Examples/_LOWriter_FieldDocInfoRevNumInsert.au3 index d9cc320c..4f0bd8f8 100644 --- a/Examples/_LOWriter_FieldDocInfoRevNumInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoRevNumInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Revision Number Field at the View Cursor. Set is Fixed = True, Revision Number = 25 _LOWriter_FieldDocInfoRevNumInsert($oDoc, $oViewCursor, False, True, 25) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoRevNumModify.au3 b/Examples/_LOWriter_FieldDocInfoRevNumModify.au3 index b207a1b8..4c7e9807 100644 --- a/Examples/_LOWriter_FieldDocInfoRevNumModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoRevNumModify.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Revision Number Field at the View Cursor. Set is Fixed = True, Revision Number = 25 $oField = _LOWriter_FieldDocInfoRevNumInsert($oDoc, $oViewCursor, False, True, 25) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Set the Document's General Property settings, Set the Revision Number to 75 _LOWriter_DocGenProp($oDoc, Null, 75) - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Number of Revisions Field settings. Set Fixed to False. _LOWriter_FieldDocInfoRevNumModify($oField, False) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoRevNumModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoSubjectInsert.au3 b/Examples/_LOWriter_FieldDocInfoSubjectInsert.au3 index 95dd8fa9..aff22bc9 100644 --- a/Examples/_LOWriter_FieldDocInfoSubjectInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoSubjectInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Subject Field at the View Cursor. Set is Fixed = True, Subject = "This is a Subject Field." _LOWriter_FieldDocInfoSubjectInsert($oDoc, $oViewCursor, False, True, "This is a Subject Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoSubjectModify.au3 b/Examples/_LOWriter_FieldDocInfoSubjectModify.au3 index 3153efc0..e947a64f 100644 --- a/Examples/_LOWriter_FieldDocInfoSubjectModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoSubjectModify.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Subject Field at the View Cursor. Set is Fixed = True, Subject = "This is a Subject Field." $oField = _LOWriter_FieldDocInfoSubjectInsert($oDoc, $oViewCursor, False, True, "This is a Subject Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Set the Document's Description settings, Set the subject to, "Autoit Automation." _LOWriter_DocDescription($oDoc, Null, "Autoit Automation.") - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Subject Field settings. Set Fixed to False. _LOWriter_FieldDocInfoSubjectModify($oField, False) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoSubjectModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoTitleInsert.au3 b/Examples/_LOWriter_FieldDocInfoTitleInsert.au3 index b59c65c7..9103068c 100644 --- a/Examples/_LOWriter_FieldDocInfoTitleInsert.au3 +++ b/Examples/_LOWriter_FieldDocInfoTitleInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Title Field at the View Cursor. Set is Fixed = True, Title = "This is a Title Field." _LOWriter_FieldDocInfoTitleInsert($oDoc, $oViewCursor, False, True, "This is a Title Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldDocInfoTitleModify.au3 b/Examples/_LOWriter_FieldDocInfoTitleModify.au3 index 4f47092f..2172f5c3 100644 --- a/Examples/_LOWriter_FieldDocInfoTitleModify.au3 +++ b/Examples/_LOWriter_FieldDocInfoTitleModify.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Title Field at the View Cursor. Set is Fixed = True, Title = "This is a Title Field." $oField = _LOWriter_FieldDocInfoTitleInsert($oDoc, $oViewCursor, False, True, "This is a Title Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Doc Info Field settings.") ; Set the Document's Description settings, Set the Title to, "Autoit-Demonstration." _LOWriter_DocDescription($oDoc, "Autoit-Demonstration.") - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Modify the Doc Info Title Field settings. Set Fixed to False. _LOWriter_FieldDocInfoTitleModify($oField, False) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldDocInfoTitleModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Doc Info Field settings are: " & @CRLF & _ "Is the content of this field fixed? True/ False: " & $avSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFileNameInsert.au3 b/Examples/_LOWriter_FieldFileNameInsert.au3 index f3aa106a..35566266 100644 --- a/Examples/_LOWriter_FieldFileNameInsert.au3 +++ b/Examples/_LOWriter_FieldFileNameInsert.au3 @@ -11,7 +11,7 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a unique file name $sSavePath = _TempFile(@TempDir & "\", "ATemporaryDoc_", ".odt") @@ -21,21 +21,21 @@ Func Example() ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Sender Field at the View Cursor. Fixed =False, format = $LOW_FIELD_FILENAME_NAME _LOWriter_FieldFileNameInsert($oDoc, $oViewCursor, False, False, $LOW_FIELD_FILENAME_NAME) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) ; Delete the file. FileDelete($sPath) diff --git a/Examples/_LOWriter_FieldFileNameModify.au3 b/Examples/_LOWriter_FieldFileNameModify.au3 index 04359b80..4c34bbfe 100644 --- a/Examples/_LOWriter_FieldFileNameModify.au3 +++ b/Examples/_LOWriter_FieldFileNameModify.au3 @@ -12,7 +12,7 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a unique file name $sSavePath = _TempFile(@TempDir & "\", "ATemporaryDoc_", ".odt") @@ -22,25 +22,25 @@ Func Example() ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Sender Field at the View Cursor. Fixed =False, format = $LOW_FIELD_FILENAME_NAME $oField = _LOWriter_FieldFileNameInsert($oDoc, $oViewCursor, False, False, $LOW_FIELD_FILENAME_NAME) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the File Name Field.") ; Modify the File Name Field settings. Skip Fixed, File Name Format = $LOW_FIELD_FILENAME_FULL_PATH _LOWriter_FieldFileNameModify($oField, Null, $LOW_FIELD_FILENAME_FULL_PATH) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldFileNameModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "Is the File Name Field's content fixed? True/False: " & $avSettings[0] & @CRLF & _ @@ -50,7 +50,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) ; Delete the file. FileDelete($sPath) diff --git a/Examples/_LOWriter_FieldFuncHiddenParInsert.au3 b/Examples/_LOWriter_FieldFuncHiddenParInsert.au3 index 328347f9..c48be2a9 100644 --- a/Examples/_LOWriter_FieldFuncHiddenParInsert.au3 +++ b/Examples/_LOWriter_FieldFuncHiddenParInsert.au3 @@ -9,30 +9,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Hidden Paragraph Field at the View Cursor. Set the Condition to "(1+1) == 2" _LOWriter_FieldFuncHiddenParInsert($oDoc, $oViewCursor, False, "(1+1) == 2") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "If the above paragraph is still visible, in your toolbar go to View, and uncheck:" & _ """Field Hidden Paragraphs""") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFuncHiddenParModify.au3 b/Examples/_LOWriter_FieldFuncHiddenParModify.au3 index 4e12e3db..49c0c502 100644 --- a/Examples/_LOWriter_FieldFuncHiddenParModify.au3 +++ b/Examples/_LOWriter_FieldFuncHiddenParModify.au3 @@ -11,34 +11,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Hidden Paragraph Field at the View Cursor. Set the Condition to "(1+1) == 3" $oField = _LOWriter_FieldFuncHiddenParInsert($oDoc, $oViewCursor, False, "(1+1) == 3") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "If the above paragraph is still visible when the condition is True, in your toolbar go to View, and uncheck:" & _ """Field Hidden Paragraphs""") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) $sNewCondition = InputBox("Modify the Field.", "Enter a new condition to set the field to.", "(2*2+4) == 8") ; Modify the Hidden Paragraph Field settings. Set the condition to the user set condition. _LOWriter_FieldFuncHiddenParModify($oField, $sNewCondition) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldFuncHiddenParModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Hidden Paragraph Field's condition to evaluate is: " & $avSettings[0] & @CRLF & _ @@ -48,7 +48,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFuncHiddenTextInsert.au3 b/Examples/_LOWriter_FieldFuncHiddenTextInsert.au3 index 82559806..40f46fde 100644 --- a/Examples/_LOWriter_FieldFuncHiddenTextInsert.au3 +++ b/Examples/_LOWriter_FieldFuncHiddenTextInsert.au3 @@ -9,30 +9,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Hidden Text Field at the View Cursor. Set the Condition to "(1+1) == 2" _LOWriter_FieldFuncHiddenTextInsert($oDoc, $oViewCursor, False, "(1+1) == 2", "Some Hidden Text") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "If the above Text is still visible, in your toolbar go to Tools, Options, LibreOffice Writer," & _ " view, and under ""Display Fields"" heading, uncheck:""Hidden Text""") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFuncHiddenTextModify.au3 b/Examples/_LOWriter_FieldFuncHiddenTextModify.au3 index 2702ca2f..6e55ddbf 100644 --- a/Examples/_LOWriter_FieldFuncHiddenTextModify.au3 +++ b/Examples/_LOWriter_FieldFuncHiddenTextModify.au3 @@ -11,24 +11,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Hidden Text Field at the View Cursor. Set the Condition to "(1+1) == 3" $oField = _LOWriter_FieldFuncHiddenTextInsert($oDoc, $oViewCursor, False, "(1+1) == 3", "Some Hidden Text") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "If the above Text is still visible, in your toolbar go to Tools, Options, LibreOffice Writer," & _ " view, and under ""Display Fields"" heading, uncheck:""Hidden Text""") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) $sNewCondition = InputBox("Modify the Field.", "Enter a new condition to set the field to.", "(2*2+4) == 8") @@ -36,11 +36,11 @@ Func Example() ; Modify the Hidden Text Field settings. Set the condition to the user set condition, and the Text to the New User Text. _LOWriter_FieldFuncHiddenTextModify($oField, $sNewCondition, $sNewText) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldFuncHiddenTextModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Hidden Text Field's condition to evaluate is: " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFuncInputInsert.au3 b/Examples/_LOWriter_FieldFuncInputInsert.au3 index 4a69db9d..9c50ca3f 100644 --- a/Examples/_LOWriter_FieldFuncInputInsert.au3 +++ b/Examples/_LOWriter_FieldFuncInputInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Input Field at the View Cursor. Set the Reference to "New Input", and Text to "Some Text" _LOWriter_FieldFuncInputInsert($oDoc, $oViewCursor, False, "New Input", "Some Text") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFuncInputModify.au3 b/Examples/_LOWriter_FieldFuncInputModify.au3 index 78d551e9..48d76927 100644 --- a/Examples/_LOWriter_FieldFuncInputModify.au3 +++ b/Examples/_LOWriter_FieldFuncInputModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Input Field at the View Cursor. Set the Reference to "New Input", and Text to "Some Text" $oField = _LOWriter_FieldFuncInputInsert($oDoc, $oViewCursor, False, "New Input", "Some Text") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Input Field settings.") ; Modify the Input Field settings. Set the Reference to "An Input", and Text to "Different Text" _LOWriter_FieldFuncInputModify($oField, "An Input", "Different Text") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldFuncInputModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Input Field's Reference is: " & $avSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFuncPlaceholderInsert.au3 b/Examples/_LOWriter_FieldFuncPlaceholderInsert.au3 index 13641a7f..32b26ae7 100644 --- a/Examples/_LOWriter_FieldFuncPlaceholderInsert.au3 +++ b/Examples/_LOWriter_FieldFuncPlaceholderInsert.au3 @@ -9,26 +9,26 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Placeholder Field at the View Cursor. Set the PlaceHolder type to $LOW_FIELD_PLACEHOLD_TYPE_GRAPHIC, Name = "A Graphic PlaceHolder.", ; Reference = "Click Me" _LOWriter_FieldFuncPlaceholderInsert($oDoc, $oViewCursor, False, $LOW_FIELD_PLACEHOLD_TYPE_GRAPHIC, "A Graphic PlaceHolder.", "Click Me") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldFuncPlaceholderModify.au3 b/Examples/_LOWriter_FieldFuncPlaceholderModify.au3 index 8309f2b6..5b53054e 100644 --- a/Examples/_LOWriter_FieldFuncPlaceholderModify.au3 +++ b/Examples/_LOWriter_FieldFuncPlaceholderModify.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Placeholder Field at the View Cursor. Set the PlaceHolder type to $LOW_FIELD_PLACEHOLD_TYPE_GRAPHIC, Name = "A Graphic PlaceHolder.", ; Reference = "Click Me" $oField = _LOWriter_FieldFuncPlaceholderInsert($oDoc, $oViewCursor, False, $LOW_FIELD_PLACEHOLD_TYPE_GRAPHIC, "A Graphic PlaceHolder.", "Click Me") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the PlaceHolder Field settings.") ; Modify the PlaceHolder Field settings. Set the PlaceHolder type to $LOW_FIELD_PLACEHOLD_TYPE_TABLE, Set the Name to "A Table PlaceHolder", ; And Reference to "Hover Me" _LOWriter_FieldFuncPlaceholderModify($oField, $LOW_FIELD_PLACEHOLD_TYPE_TABLE, "A Table PlaceHolder", "Hover Me") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldFuncPlaceholderModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The PlaceHolder Field Type is, (see UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldGetAnchor.au3 b/Examples/_LOWriter_FieldGetAnchor.au3 index d8e5b51c..5d9b5dae 100644 --- a/Examples/_LOWriter_FieldGetAnchor.au3 +++ b/Examples/_LOWriter_FieldGetAnchor.au3 @@ -9,38 +9,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Count Field at the View Cursor. Set count type to $LOW_FIELD_COUNT_TYPE_WORDS, Overwrite to False, and Number format to ; $LOW_NUM_STYLE_CHARS_LOWER_LETTER $oField = _LOWriter_FieldStatCountInsert($oDoc, $oViewCursor, $LOW_FIELD_COUNT_TYPE_WORDS, False, $LOW_NUM_STYLE_ARABIC) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Retrieve the Field's anchor (Text Cursor) $oFieldAnchor = _LOWriter_FieldGetAnchor($oField) - If (@error > 0) Then _ERROR("Failed to retrieve a Field Anchor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve a Field Anchor. Error:" & @error & " Extended:" & @extended) ; Move the Anchor (Text Cursor) _LOWriter_CursorMove($oFieldAnchor, $LOW_TEXTCUR_GO_RIGHT, 1, False) - If (@error > 0) Then _ERROR("Failed to move a cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move a cursor. Error:" & @error & " Extended:" & @extended) ; Insert Some text. _LOWriter_DocInsertString($oDoc, $oFieldAnchor, " Some new text") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldInputListInsert.au3 b/Examples/_LOWriter_FieldInputListInsert.au3 index b8f39375..b25ad8dc 100644 --- a/Examples/_LOWriter_FieldInputListInsert.au3 +++ b/Examples/_LOWriter_FieldInputListInsert.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Fill the Array with Strings for our List Items. $asItems[0] = "Option 1" @@ -30,13 +30,13 @@ Func Example() ; Insert a Input List Field at the View Cursor. Use the Array created above to fill the List, Set the name to "Pick One", Set the selected item ; to be "Option 3". _LOWriter_FieldInputListInsert($oDoc, $oViewCursor, False, $asItems, "Pick One", "Option 3") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldInputListModify.au3 b/Examples/_LOWriter_FieldInputListModify.au3 index cd7f6fae..c044535f 100644 --- a/Examples/_LOWriter_FieldInputListModify.au3 +++ b/Examples/_LOWriter_FieldInputListModify.au3 @@ -12,15 +12,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Fill the Array with Strings for our List Items. $asItems[0] = "Option 1" @@ -32,7 +32,7 @@ Func Example() ; Insert a Input List Field at the View Cursor. Use the Array created above to fill the List, Set the name to "Pick One", Set the selected item ; to be "Option 3". $oField = _LOWriter_FieldInputListInsert($oDoc, $oViewCursor, False, $asItems, "Pick One", "Option 3") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Input List Field.") @@ -44,13 +44,13 @@ Func Example() ; Modify the Input List Field settings. Change our input List to contain our new array of options. The New Name is: "Three Choices", and ; the selected item is "Choice 2" _LOWriter_FieldInputListModify($oField, $asNewItems, "Three Choices", "Choice 2") - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Pick an Option in the INput List and then press ok.") ; Retrieve current Field settings. $avSettings = _LOWriter_FieldInputListModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) ; convert the Array into a String. For $i = 0 To UBound($avSettings[0]) - 1 @@ -66,7 +66,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldPageNumberInsert.au3 b/Examples/_LOWriter_FieldPageNumberInsert.au3 index 7e9ae6fd..60bfc3f2 100644 --- a/Examples/_LOWriter_FieldPageNumberInsert.au3 +++ b/Examples/_LOWriter_FieldPageNumberInsert.au3 @@ -9,30 +9,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Page Number Field at the View Cursor. Use $LOW_NUM_STYLE_ARABIC numbering style, skip offset, and make the Page Number for the ; current page. _LOWriter_FieldPageNumberInsert($oDoc, $oViewCursor, False, $LOW_NUM_STYLE_ARABIC, Null, $LOW_PAGE_NUM_TYPE_CURRENT) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, " <--- This is a Page Number Field.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldPageNumberModify.au3 b/Examples/_LOWriter_FieldPageNumberModify.au3 index 06d36335..af77fc5a 100644 --- a/Examples/_LOWriter_FieldPageNumberModify.au3 +++ b/Examples/_LOWriter_FieldPageNumberModify.au3 @@ -10,40 +10,40 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a 50 Paragraphs to create a second page. For $i = 0 To 50 ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Page Number Field at the View Cursor. $oField = _LOWriter_FieldPageNumberInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, " <--- This is a Page Number Field.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Page Number Field.") ; Modify the Page Number Field settings. Number format = $LOW_NUM_STYLE_TEXT_CARDINAL, Offset = -1, _LOWriter_FieldPageNumberModify($oDoc, $oField, $LOW_NUM_STYLE_TEXT_CARDINAL, -1) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldPageNumberModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Page Number's numbering format is, (See UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -55,7 +55,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefBookMarkInsert.au3 b/Examples/_LOWriter_FieldRefBookMarkInsert.au3 index 419a25de..49263f27 100644 --- a/Examples/_LOWriter_FieldRefBookMarkInsert.au3 +++ b/Examples/_LOWriter_FieldRefBookMarkInsert.au3 @@ -9,23 +9,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "New Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Bookmark Reference Field. "New Bookmark" Bookmark, do not overwrite any content selected by the cursor, and refer using ; $LOW_FIELD_REF_USING_ABOVE_BELOW @@ -35,7 +35,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefBookMarkModify.au3 b/Examples/_LOWriter_FieldRefBookMarkModify.au3 index cf25e827..a8796e1d 100644 --- a/Examples/_LOWriter_FieldRefBookMarkModify.au3 +++ b/Examples/_LOWriter_FieldRefBookMarkModify.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "New Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "New Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Bookmark Reference Field. "New Bookmark" Bookmark, do not overwrite any content selected by the cursor, and refer using ; $LOW_FIELD_REF_USING_REF_TEXT @@ -34,21 +34,21 @@ Func Example() ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a Bookmark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a BookMark at the ViewCursor, named "Second Bookmark". _LOWriter_DocBookmarkInsert($oDoc, $oViewCursor, False, "Second Bookmark") - If (@error > 0) Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a BookMark. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Reference Field.") ; Modify the Bookmark Reference Field settings. Set the Referenced Bookmark to "Second Bookmark", and Refer using $LOW_FIELD_REF_USING_ABOVE_BELOW _LOWriter_FieldRefBookMarkModify($oDoc, $oField, "Second Bookmark", $LOW_FIELD_REF_USING_ABOVE_BELOW) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldRefBookMarkModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Bookmark name being referenced is: " & $avSettings[0] & @CRLF & _ @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefEndnoteInsert.au3 b/Examples/_LOWriter_FieldRefEndnoteInsert.au3 index f82af70f..d3fe3fb6 100644 --- a/Examples/_LOWriter_FieldRefEndnoteInsert.au3 +++ b/Examples/_LOWriter_FieldRefEndnoteInsert.au3 @@ -9,34 +9,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted an Endnote at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor. $oEndnote = _LOWriter_EndnoteInsert($oDoc, $oViewCursor, False) - If (@error > 0) Then _ERROR("Failed to insert an Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert an Endnote. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote Reference Field. Reference the Endnote I inserted using its Object, do not overwrite any content selected by the cursor, ; and refer using $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED _LOWriter_FieldRefEndnoteInsert($oDoc, $oViewCursor, $oEndnote, False, $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefEndnoteModify.au3 b/Examples/_LOWriter_FieldRefEndnoteModify.au3 index d9ce81f8..8294915a 100644 --- a/Examples/_LOWriter_FieldRefEndnoteModify.au3 +++ b/Examples/_LOWriter_FieldRefEndnoteModify.au3 @@ -10,46 +10,46 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted an Endnote at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor. $oEndnote = _LOWriter_EndnoteInsert($oDoc, $oViewCursor, False) - If (@error > 0) Then _ERROR("Failed to insert an Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert an Endnote. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote Reference Field. Reference the Endnote I inserted using its Object, do not overwrite any content selected by the cursor, ; and refer using $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED $oField = _LOWriter_FieldRefEndnoteInsert($oDoc, $oViewCursor, $oEndnote, False, $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a 2nd Endnote at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Endnote at the ViewCursor. $oEndnote2 = _LOWriter_EndnoteInsert($oDoc, $oViewCursor, False) - If (@error > 0) Then _ERROR("Failed to insert an Endnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert an Endnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Endnote Reference Field.") ; Modify the Endnote Reference Field settings. Set the Referenced Endnote to Second Endnote, and Refer using $LOW_FIELD_REF_USING_ABOVE_BELOW _LOWriter_FieldRefEndnoteModify($oDoc, $oField, $oEndnote2, $LOW_FIELD_REF_USING_REF_TEXT) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldRefEndnoteModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Endnote's Label this is being referenced is: " & _LOWriter_EndnoteModifyAnchor($avSettings[0]) & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefFootnoteInsert.au3 b/Examples/_LOWriter_FieldRefFootnoteInsert.au3 index 70f4bb5d..3f82b387 100644 --- a/Examples/_LOWriter_FieldRefFootnoteInsert.au3 +++ b/Examples/_LOWriter_FieldRefFootnoteInsert.au3 @@ -9,34 +9,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. $oFootNote = _LOWriter_FootnoteInsert($oDoc, $oViewCursor, False) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote Reference Field. Reference the Footnote I inserted using its Object, do not overwrite any content selected by the cursor, ; and refer using $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED _LOWriter_FieldRefFootnoteInsert($oDoc, $oViewCursor, $oFootNote, False, $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefFootnoteModify.au3 b/Examples/_LOWriter_FieldRefFootnoteModify.au3 index 0c129e60..497c93fb 100644 --- a/Examples/_LOWriter_FieldRefFootnoteModify.au3 +++ b/Examples/_LOWriter_FieldRefFootnoteModify.au3 @@ -10,46 +10,46 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. $oFootNote = _LOWriter_FootnoteInsert($oDoc, $oViewCursor, False) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote Reference Field. Reference the Footnote I inserted using its Object, do not overwrite any content selected by the cursor, ; and refer using $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED $oField = _LOWriter_FieldRefFootnoteInsert($oDoc, $oViewCursor, $oFootNote, False, $LOW_FIELD_REF_USING_PAGE_NUM_UNSTYLED) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a 2nd Footnote at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. $oFootNote2 = _LOWriter_FootnoteInsert($oDoc, $oViewCursor, False) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Footnote Reference Field.") ; Modify the Footnote Reference Field settings. Set the Referenced Footnote to Second Footnote, and Refer using $LOW_FIELD_REF_USING_ABOVE_BELOW _LOWriter_FieldRefFootnoteModify($oDoc, $oField, $oFootNote2, $LOW_FIELD_REF_USING_REF_TEXT) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldRefFootnoteModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Footnote's Label this is being referenced is: " & _LOWriter_FootnoteModifyAnchor($avSettings[0]) & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefGetType.au3 b/Examples/_LOWriter_FieldRefGetType.au3 index 65721a04..68be40e7 100644 --- a/Examples/_LOWriter_FieldRefGetType.au3 +++ b/Examples/_LOWriter_FieldRefGetType.au3 @@ -9,28 +9,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 1". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 1", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Field at the View Cursor. Reference Ref. 1 Reference mark, do not overwrite any content selected by the cursor, and refer using ; $LOW_FIELD_REF_USING_PAGE_NUM_STYLED $oField = _LOWriter_FieldRefInsert($oDoc, $oViewCursor, "Ref. 1", False, $LOW_FIELD_REF_USING_PAGE_NUM_STYLED) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Reference Field is referencing following type: " & _LOWriter_FieldRefGetType($oField) & @CRLF & @CRLF & _ "The Possible types are: " & @CRLF & "$LOW_FIELD_REF_TYPE_REF_MARK(0)" & @CRLF & "$LOW_FIELD_REF_TYPE_SEQ_FIELD(1)" & @CRLF & _ @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefInsert.au3 b/Examples/_LOWriter_FieldRefInsert.au3 index 2bd21745..9a0fbb6f 100644 --- a/Examples/_LOWriter_FieldRefInsert.au3 +++ b/Examples/_LOWriter_FieldRefInsert.au3 @@ -9,54 +9,54 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 1". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 1", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 2". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 2", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 3". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 3", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert 2 new Lines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Field at the View Cursor. Reference Ref. 1 Reference mark, do not overwrite any content selected by the cursor, and refer using ; $LOW_FIELD_REF_USING_ABOVE_BELOW _LOWriter_FieldRefInsert($oDoc, $oViewCursor, "Ref. 1", False, $LOW_FIELD_REF_USING_ABOVE_BELOW) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefMarkDelete.au3 b/Examples/_LOWriter_FieldRefMarkDelete.au3 index dab62b5a..475d616e 100644 --- a/Examples/_LOWriter_FieldRefMarkDelete.au3 +++ b/Examples/_LOWriter_FieldRefMarkDelete.au3 @@ -10,61 +10,61 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 1". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 1", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 2". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 2", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 3". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 3", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert a new Line. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Reference Mark names contained in this document are: " & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to delete Reference Mark 2") ; Delete Ref. 2 _LOWriter_FieldRefMarkDelete($oDoc, "Ref. 2") - If (@error > 0) Then _ERROR("Failed to delete a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Retrieve an Array of Reference Mark Names. $asRefs = _LOWriter_FieldRefMarkList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an Array of Reference Marks. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an Array of Reference Marks. Error:" & @error & " Extended:" & @extended) For $i = 0 To @extended - 1 ; Insert the Reference Mark Names. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & $asRefs[$i]) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefMarkGetAnchor.au3 b/Examples/_LOWriter_FieldRefMarkGetAnchor.au3 index 19532be3..5632b289 100644 --- a/Examples/_LOWriter_FieldRefMarkGetAnchor.au3 +++ b/Examples/_LOWriter_FieldRefMarkGetAnchor.au3 @@ -9,59 +9,59 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 1". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 1", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 2". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 2", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 3". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 3", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert a new Line. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Reference Mark names contained in this document are: " & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will retrieve the anchor for Ref. 2 and insert some text after it.") ; Retrieve the Reference Mark's Anchor (Text Cursor). $oRefAnchor = _LOWriter_FieldRefMarkGetAnchor($oDoc, "Ref. 2") - If (@error > 0) Then _ERROR("Failed to Retrieve a Reference Mark anchor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Retrieve a Reference Mark anchor. Error:" & @error & " Extended:" & @extended) ; Move the Anchor (Text Cursor) _LOWriter_CursorMove($oRefAnchor, $LOW_TEXTCUR_GO_RIGHT, 1, False) - If (@error > 0) Then _ERROR("Failed to move a cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move a cursor. Error:" & @error & " Extended:" & @extended) ; Insert Some text. _LOWriter_DocInsertString($oDoc, $oRefAnchor, " Some new text") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefMarkList.au3 b/Examples/_LOWriter_FieldRefMarkList.au3 index 2086f44e..b9b31e2a 100644 --- a/Examples/_LOWriter_FieldRefMarkList.au3 +++ b/Examples/_LOWriter_FieldRefMarkList.au3 @@ -10,55 +10,55 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 1". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 1", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 2". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 2", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 3". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 3", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert a new Line. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Reference Mark names contained in this document are: " & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve an Array of Reference Mark Names. $asRefs = _LOWriter_FieldRefMarkList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an Array of Reference Marks. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an Array of Reference Marks. Error:" & @error & " Extended:" & @extended) For $i = 0 To @extended - 1 ; Insert the Reference Mark Names. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & $asRefs[$i]) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefMarkSet.au3 b/Examples/_LOWriter_FieldRefMarkSet.au3 index 2086f44e..b9b31e2a 100644 --- a/Examples/_LOWriter_FieldRefMarkSet.au3 +++ b/Examples/_LOWriter_FieldRefMarkSet.au3 @@ -10,55 +10,55 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 1". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 1", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 2". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 2", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 3". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 3", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert a new Line. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "The Reference Mark names contained in this document are: " & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve an Array of Reference Mark Names. $asRefs = _LOWriter_FieldRefMarkList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an Array of Reference Marks. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an Array of Reference Marks. Error:" & @error & " Extended:" & @extended) For $i = 0 To @extended - 1 ; Insert the Reference Mark Names. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & $asRefs[$i]) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldRefModify.au3 b/Examples/_LOWriter_FieldRefModify.au3 index c16e99b4..c0944f26 100644 --- a/Examples/_LOWriter_FieldRefModify.au3 +++ b/Examples/_LOWriter_FieldRefModify.au3 @@ -10,54 +10,54 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 1". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 1", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Field at the View Cursor. Reference Ref. 1 Reference mark, do not overwrite any content selected by the cursor, and refer using ; $LOW_FIELD_REF_USING_PAGE_NUM_STYLED $oField = _LOWriter_FieldRefInsert($oDoc, $oViewCursor, "Ref. 1", False, $LOW_FIELD_REF_USING_PAGE_NUM_STYLED) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 2". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 2", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a reference Mark at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Reference Mark at the ViewCursor, named "Ref. 3". _LOWriter_FieldRefMarkSet($oDoc, $oViewCursor, "Ref. 3", False) - If (@error > 0) Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Reference Mark. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Reference Field.") ; Modify the Reference Field settings. Set the Referenced Mark to "Ref. 2", and Refer using $LOW_FIELD_REF_USING_ABOVE_BELOW _LOWriter_FieldRefModify($oDoc, $oField, "Ref. 2", $LOW_FIELD_REF_USING_ABOVE_BELOW) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldRefModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Reference Mark name being referenced is: " & $avSettings[0] & @CRLF & _ @@ -67,7 +67,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSenderInsert.au3 b/Examples/_LOWriter_FieldSenderInsert.au3 index 5c822602..5aeea961 100644 --- a/Examples/_LOWriter_FieldSenderInsert.au3 +++ b/Examples/_LOWriter_FieldSenderInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Sender Field at the View Cursor. Fixed =True, Content = "AutoIt©", Data Type to $LOW_FIELD_USER_DATA_COMPANY _LOWriter_FieldSenderInsert($oDoc, $oViewCursor, False, True, "AutoIt©", $LOW_FIELD_USER_DATA_COMPANY) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSenderModify.au3 b/Examples/_LOWriter_FieldSenderModify.au3 index 0c157267..35213499 100644 --- a/Examples/_LOWriter_FieldSenderModify.au3 +++ b/Examples/_LOWriter_FieldSenderModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Sender Field at the View Cursor. Fixed =True, Content = "AutoIt©", Data Type to $LOW_FIELD_USER_DATA_COMPANY $oField = _LOWriter_FieldSenderInsert($oDoc, $oViewCursor, False, True, "AutoIt©", $LOW_FIELD_USER_DATA_COMPANY) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Sender Field.") ; Modify the Sender Field settings. Fixed = False, Skip Content, User data = $LOW_FIELD_USER_DATA_FIRST_NAME _LOWriter_FieldSenderModify($oField, False, Null, $LOW_FIELD_USER_DATA_FIRST_NAME) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldSenderModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "Is the Sender Field's content fixed? True/False: " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarInsert.au3 b/Examples/_LOWriter_FieldSetVarInsert.au3 index 63935ad5..27d46ed6 100644 --- a/Examples/_LOWriter_FieldSetVarInsert.au3 +++ b/Examples/_LOWriter_FieldSetVarInsert.au3 @@ -11,48 +11,48 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use the new MasterField's name., set the Value to 2300 _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "2300", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert 2 new lines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve this Number Format key, #,##0 $iFormatKey = _LOWriter_FormatKeyCreate($oDoc, "#,##0") - If (@error > 0) Then _ERROR("Failed to retrieve Number Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Number Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use a new name, and allow the function to create a Master Field for me., set the Value to 1260, Number format key = ; #,##0, Visible = True. _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "1260", False, $iFormatKey, True) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarMasterCreate.au3 b/Examples/_LOWriter_FieldSetVarMasterCreate.au3 index f69dcb37..9feb446f 100644 --- a/Examples/_LOWriter_FieldSetVarMasterCreate.au3 +++ b/Examples/_LOWriter_FieldSetVarMasterCreate.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, "TestMaster") - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Set Variable Master Field names. $asMasters = _LOWriter_FieldSetVarMasterList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) $iResults = @extended ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) For $i = 0 To $iResults - 1 ; Write each Master Field name in the document. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asMasters[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarMasterDelete.au3 b/Examples/_LOWriter_FieldSetVarMasterDelete.au3 index 3abd88ef..a50a116d 100644 --- a/Examples/_LOWriter_FieldSetVarMasterDelete.au3 +++ b/Examples/_LOWriter_FieldSetVarMasterDelete.au3 @@ -12,22 +12,22 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". $oMaster = _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Set Variable Master Field names. $asMasters = _LOWriter_FieldSetVarMasterList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) $iResults = @extended ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) For $i = 0 To $iResults - 1 ; Write each Master Field name in the document. @@ -38,7 +38,7 @@ Func Example() ; Delete the Set Var. MasterField. _LOWriter_FieldSetVarMasterDelete($oDoc, $oMaster) - If (@error > 0) Then _ERROR("Failed to delete Master Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Master Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the Set Var Master Field still exist? True/False: " & _LOWriter_FieldSetVarMasterExists($oDoc, $sMasterFieldName)) @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarMasterExists.au3 b/Examples/_LOWriter_FieldSetVarMasterExists.au3 index 40b89bc9..54da9515 100644 --- a/Examples/_LOWriter_FieldSetVarMasterExists.au3 +++ b/Examples/_LOWriter_FieldSetVarMasterExists.au3 @@ -10,13 +10,13 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". $oMaster = _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the Set Var Master Field exist in the Document? True/False: " & _LOWriter_FieldSetVarMasterExists($oDoc, $sMasterFieldName)) @@ -24,7 +24,7 @@ Func Example() ; Delete the Set Var. MasterField. _LOWriter_FieldSetVarMasterDelete($oDoc, $oMaster) - If (@error > 0) Then _ERROR("Failed to delete Master Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Master Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the Set Var Master Field still exist? True/False: " & _LOWriter_FieldSetVarMasterExists($oDoc, $sMasterFieldName)) @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarMasterGetObj.au3 b/Examples/_LOWriter_FieldSetVarMasterGetObj.au3 index 03534d5f..db335ad2 100644 --- a/Examples/_LOWriter_FieldSetVarMasterGetObj.au3 +++ b/Examples/_LOWriter_FieldSetVarMasterGetObj.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the newly created Set Variable Master Field.") ; Retrieve the Set Var. MasterField Object to use for deleteing it. $oMaster = _LOWriter_FieldSetVarMasterGetObj($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to retrieve a Set Variable Master Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve a Set Variable Master Object. Error:" & @error & " Extended:" & @extended) ; Delete the Set Var. MasterField. _LOWriter_FieldSetVarMasterDelete($oDoc, $oMaster) - If (@error > 0) Then _ERROR("Failed to delete Master Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Master Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the Set Var Master Field still exist? True/False: " & _LOWriter_FieldSetVarMasterExists($oDoc, $sMasterFieldName)) @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarMasterList.au3 b/Examples/_LOWriter_FieldSetVarMasterList.au3 index f69dcb37..9feb446f 100644 --- a/Examples/_LOWriter_FieldSetVarMasterList.au3 +++ b/Examples/_LOWriter_FieldSetVarMasterList.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, "TestMaster") - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Set Variable Master Field names. $asMasters = _LOWriter_FieldSetVarMasterList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Set Variable Masters. Error:" & @error & " Extended:" & @extended) $iResults = @extended ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) For $i = 0 To $iResults - 1 ; Write each Master Field name in the document. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asMasters[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarMasterListFields.au3 b/Examples/_LOWriter_FieldSetVarMasterListFields.au3 index f36c3db3..15915205 100644 --- a/Examples/_LOWriter_FieldSetVarMasterListFields.au3 +++ b/Examples/_LOWriter_FieldSetVarMasterListFields.au3 @@ -12,29 +12,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". $oMasterfield = _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use the new MasterField's name., set the Value to 2300 _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "2300", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of dependent fields for the Master Field. Dependent fields are Set Variable fields that reference the Master. $aoFields = _LOWriter_FieldSetVarMasterListFields($oDoc, $oMasterfield) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Dependent fields. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Dependent fields. Error:" & @error & " Extended:" & @extended) $iResults = @extended @@ -42,13 +42,13 @@ Func Example() ; Delete the last Field result. _LOWriter_FieldDelete($oDoc, $aoFields[$iResults - 1]) - If (@error > 0) Then _ERROR("Failed to delete a Dependent field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Dependent field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldSetVarModify.au3 b/Examples/_LOWriter_FieldSetVarModify.au3 index 44d5bfa1..5a9484bf 100644 --- a/Examples/_LOWriter_FieldSetVarModify.au3 +++ b/Examples/_LOWriter_FieldSetVarModify.au3 @@ -12,25 +12,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use the new MasterField's name., set the Value to 2300 $oSetVarField = _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "2300", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Set Variable Field.") @@ -39,11 +39,11 @@ Func Example() ; Modify the Set Variable Field settings, Change the Value to 1260, Set the Number format Key to the one just retrieved _LOWriter_FieldSetVarModify($oDoc, $oSetVarField, "1260", $iFormatKey) - If (@error > 0) Then _ERROR("Failed to modify Text Field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Text Field settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the Set Variable Field's settings. $avSettings = _LOWriter_FieldSetVarModify($oDoc, $oSetVarField) - If (@error > 0) Then _ERROR("Failed to retrieve Text Field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Set Variable Field's current value is: " & $avSettings[0] & @CRLF & _ @@ -54,7 +54,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldShowVarInsert.au3 b/Examples/_LOWriter_FieldShowVarInsert.au3 index f6329955..7b9f5d56 100644 --- a/Examples/_LOWriter_FieldShowVarInsert.au3 +++ b/Examples/_LOWriter_FieldShowVarInsert.au3 @@ -11,59 +11,59 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use the new MasterField's name., set the Value to 2300 _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "2300", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert a new line mark. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert 3 Show Variable Fields and use the new SetVar name, which is also the MasterField's name. _LOWriter_FieldShowVarInsert($oDoc, $oViewCursor, $sMasterFieldName, False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert a new line mark. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Make this field show the Master Field's name instead of its value. _LOWriter_FieldShowVarInsert($oDoc, $oViewCursor, $sMasterFieldName, False, Null, True) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert a new line mark. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve this Number Format key, #,##0 $iFormatKey = _LOWriter_FormatKeyCreate($oDoc, "#,##0") - If (@error > 0) Then _ERROR("Failed to retrieve Number Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Number Format Key. Error:" & @error & " Extended:" & @extended) ; Set Number format to the one I just retrieved. _LOWriter_FieldShowVarInsert($oDoc, $oViewCursor, $sMasterFieldName, False, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldShowVarModify.au3 b/Examples/_LOWriter_FieldShowVarModify.au3 index abe97981..77181169 100644 --- a/Examples/_LOWriter_FieldShowVarModify.au3 +++ b/Examples/_LOWriter_FieldShowVarModify.au3 @@ -12,69 +12,69 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sMasterFieldName = "TestMaster" ; Create a new Set Variable Master Field named "TestMaster". _LOWriter_FieldSetVarMasterCreate($oDoc, $sMasterFieldName) - If (@error > 0) Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Set Variable Master. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Variable Field and use the new MasterField's name., set the Value to 2300 _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, $sMasterFieldName, "2300", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert another Set Variable Field and using a different name, and allowing the function to create the MasterField, set the Value to 1260 _LOWriter_FieldSetVarInsert($oDoc, $oViewCursor, "ADifferentName", "1260", False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert a new line mark. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert 3 Show Variable Fields and use the new SetVar name, which is also the MasterField's name. _LOWriter_FieldShowVarInsert($oDoc, $oViewCursor, $sMasterFieldName, False) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert a new line mark. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Make this field show the Master Field's name instead of its value. $oShowVarField2 = _LOWriter_FieldShowVarInsert($oDoc, $oViewCursor, $sMasterFieldName, False, Null, True) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Insert a new line mark. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve this Number Format key, #,##0 $iFormatKey = _LOWriter_FormatKeyCreate($oDoc, "#,##0") - If (@error > 0) Then _ERROR("Failed to retrieve Number Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Number Format Key. Error:" & @error & " Extended:" & @extended) ; Set Number format to the one I just retrieved. $oShowVarField3 = _LOWriter_FieldShowVarInsert($oDoc, $oViewCursor, $sMasterFieldName, False, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a text field. Error:" & @error & " Extended:" & @extended) ; Modify the third Show Variable Field, set the SetVar Name to "ADifferentName". _LOWriter_FieldShowVarModify($oDoc, $oShowVarField3, "ADifferentName") - If (@error > 0) Then _ERROR("Failed to modify a text field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a text field. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings for the second Show Var Field. Return will be an Array with elements in order of function parameters. $avSettings = _LOWriter_FieldShowVarModify($oDoc, $oShowVarField2) - If (@error > 0) Then _ERROR("Failed to retrieve text field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve text field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Set Variable Field name referenced is: " & $avSettings[0] & @CRLF & _ @@ -85,7 +85,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldStatCountInsert.au3 b/Examples/_LOWriter_FieldStatCountInsert.au3 index 5ea3d180..bdd90010 100644 --- a/Examples/_LOWriter_FieldStatCountInsert.au3 +++ b/Examples/_LOWriter_FieldStatCountInsert.au3 @@ -9,37 +9,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Count Field at the View Cursor. Set count type to $LOW_FIELD_COUNT_TYPE_WORDS, Overwrite to False, and Number format to ; $LOW_NUM_STYLE_ARABIC $oField = _LOWriter_FieldStatCountInsert($oDoc, $oViewCursor, $LOW_FIELD_COUNT_TYPE_WORDS, False, $LOW_NUM_STYLE_ARABIC) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & "You may need to update Fields to make this display. Go to Tools, Update, Fields. Or press F9.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Wait 2 seconds Sleep(2000) ; Update the field to make the value appear. _LOWriter_FieldUpdate($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to update field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to update field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldStatCountModify.au3 b/Examples/_LOWriter_FieldStatCountModify.au3 index 11db6d68..7775a6f7 100644 --- a/Examples/_LOWriter_FieldStatCountModify.au3 +++ b/Examples/_LOWriter_FieldStatCountModify.au3 @@ -10,30 +10,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Count Field at the View Cursor. Set count type to $LOW_FIELD_COUNT_TYPE_WORDS, Overwrite to False, and Number format to ; $LOW_NUM_STYLE_CHARS_LOWER_LETTER $oField = _LOWriter_FieldStatCountInsert($oDoc, $oViewCursor, $LOW_FIELD_COUNT_TYPE_WORDS, False, $LOW_NUM_STYLE_CHARS_LOWER_LETTER) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Count Field settings.") ; Modify the Count Field settings. Set the Count type to $LOW_FIELD_COUNT_TYPE_PARAGRAPHS, set Numbering format to $LOW_NUM_STYLE_ARABIC _LOWriter_FieldStatCountModify($oDoc, $oField, $LOW_FIELD_COUNT_TYPE_PARAGRAPHS, $LOW_NUM_STYLE_ARABIC) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an array, with elements in order of function parameters. $avSettings = _LOWriter_FieldStatCountModify($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "The Count Field's type is, (see UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldStatTemplateInsert.au3 b/Examples/_LOWriter_FieldStatTemplateInsert.au3 index 6604aa37..e75d90cd 100644 --- a/Examples/_LOWriter_FieldStatTemplateInsert.au3 +++ b/Examples/_LOWriter_FieldStatTemplateInsert.au3 @@ -9,29 +9,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Document's template settings for use in this demonstration to, Template name = "AutoIt", Template URL to a fake Path, @TempDir\Folder2\AutoIt.ott _LOWriter_DocGenPropTemplate($oDoc, "AutoIt", @TempDir & "\Folder2\AutoIt.ott") - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Show Template at the View Cursor. Set display format to $LOW_FIELD_FILENAME_FULL_PATH _LOWriter_FieldStatTemplateInsert($oDoc, $oViewCursor, False, $LOW_FIELD_FILENAME_FULL_PATH) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldStatTemplateModify.au3 b/Examples/_LOWriter_FieldStatTemplateModify.au3 index ac150387..79391b39 100644 --- a/Examples/_LOWriter_FieldStatTemplateModify.au3 +++ b/Examples/_LOWriter_FieldStatTemplateModify.au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Document's template settings for use in this demonstration to, Template name = "AutoIt", Template URL to a fake Path, @TempDir\Folder2\AutoIt.ott _LOWriter_DocGenPropTemplate($oDoc, "AutoIt", @TempDir & "\Folder2\AutoIt.ott") - If (@error > 0) Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Document settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Show Template at the View Cursor. Set display format to $LOW_FIELD_FILENAME_FULL_PATH $oField = _LOWriter_FieldStatTemplateInsert($oDoc, $oViewCursor, False, $LOW_FIELD_FILENAME_FULL_PATH) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Template Field settings.") ; Modify the Template Field settings. Set the display format to $LOW_FIELD_FILENAME_NAME_AND_EXT _LOWriter_FieldStatTemplateModify($oField, $LOW_FIELD_FILENAME_NAME_AND_EXT) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an integer. $iSetting = _LOWriter_FieldStatTemplateModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Template Field display format setting is, (see UDF Constants): " & $iSetting) @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldUpdate.au3 b/Examples/_LOWriter_FieldUpdate.au3 index 7b43d103..d9a90c61 100644 --- a/Examples/_LOWriter_FieldUpdate.au3 +++ b/Examples/_LOWriter_FieldUpdate.au3 @@ -11,40 +11,40 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, leave it blank so it will be set to the current date/Time. $tDateStruct = _LOWriter_DateStructCreate() - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. Fixed = False, Set the Date to my previously created DateStruct, Is Date = True, ; , and set DateTime Format Key to the Key I just created. $oField = _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, False, $tDateStruct, True, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to update the Field.") ; Update the field. _LOWriter_FieldUpdate($oDoc, $oField) - If (@error > 0) Then _ERROR("Failed to update a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to update a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldVarSetPageInsert.au3 b/Examples/_LOWriter_FieldVarSetPageInsert.au3 index 673f33c7..653ecde3 100644 --- a/Examples/_LOWriter_FieldVarSetPageInsert.au3 +++ b/Examples/_LOWriter_FieldVarSetPageInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Page Field at the View Cursor. Set Reference to True, and Offset to 5. _LOWriter_FieldVarSetPageInsert($oDoc, $oViewCursor, False, True, 5) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldVarSetPageModify.au3 b/Examples/_LOWriter_FieldVarSetPageModify.au3 index aa89645b..f1fa8d42 100644 --- a/Examples/_LOWriter_FieldVarSetPageModify.au3 +++ b/Examples/_LOWriter_FieldVarSetPageModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Set Page Field at the View Cursor. Set Reference to True, and Offset to 5. $oField = _LOWriter_FieldVarSetPageInsert($oDoc, $oViewCursor, False, True, 5) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Set Page Field settings.") ; Modify the Set Page Field settings. Set Reference to False, and Offset to 2. _LOWriter_FieldVarSetPageModify($oField, False, 2) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an Array with elements in the order of function parameters. $avSettings = _LOWriter_FieldVarSetPageModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Field settings are: " & @CRLF & _ "Is the Set Page Reference Point enabled? True/False: " & $avSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldVarShowPageInsert.au3 b/Examples/_LOWriter_FieldVarShowPageInsert.au3 index d32ec243..c661c7c0 100644 --- a/Examples/_LOWriter_FieldVarShowPageInsert.au3 +++ b/Examples/_LOWriter_FieldVarShowPageInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Show Page Field at the View Cursor. Set NumberFormat to: $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N _LOWriter_FieldVarShowPageInsert($oDoc, $oViewCursor, False, $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldVarShowPageModify.au3 b/Examples/_LOWriter_FieldVarShowPageModify.au3 index d22eddb3..abcfde74 100644 --- a/Examples/_LOWriter_FieldVarShowPageModify.au3 +++ b/Examples/_LOWriter_FieldVarShowPageModify.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Show Page Field at the View Cursor. Set NumberFormat to: $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N $oField = _LOWriter_FieldVarShowPageInsert($oDoc, $oViewCursor, False, $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Show Page Field settings.") ; Modify the Show Page Field settings. Set the Number format to $LOW_NUM_STYLE_ROMAN_UPPER _LOWriter_FieldVarShowPageModify($oField, $LOW_NUM_STYLE_ROMAN_UPPER) - If (@error > 0) Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modfiy field. Error:" & @error & " Extended:" & @extended) ; Retrieve current Field settings. Return will be an integer. $iSetting = _LOWriter_FieldVarShowPageModify($oField) - If (@error > 0) Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve field settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Show Page Field number format setting is, (see UDF Constants): " & $iSetting) @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldsAdvGetList.au3 b/Examples/_LOWriter_FieldsAdvGetList.au3 index 93c2058f..e5e8cc27 100644 --- a/Examples/_LOWriter_FieldsAdvGetList.au3 +++ b/Examples/_LOWriter_FieldsAdvGetList.au3 @@ -13,108 +13,108 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Regular field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1992, Month = 03, Day = 28, Hour = 15, Minute = 43, Second = 25, Nano = 765, UTC =True $tDateStruct = _LOWriter_DateStructCreate(1992, 03, 28, 15, 43, 25, 765, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "HH:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. Fixed = True, Set the Date to my previously created DateStruct,and set DateTime Format Key to the first ; Key I created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct, Null, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Regular field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Count Field at the View Cursor. Set count type to $LOW_FIELD_COUNT_TYPE_WORDS, Overwrite to False, and Number format to ; $LOW_NUM_STYLE_CHARS_LOWER_LETTER _LOWriter_FieldStatCountInsert($oDoc, $oViewCursor, $LOW_FIELD_COUNT_TYPE_WORDS, False, $LOW_NUM_STYLE_ARABIC) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Regular field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Combined character Field at the View Cursor. Insert the Characters "ABCDEF _LOWriter_FieldCombCharInsert($oDoc, $oViewCursor, False, "ABCDEF") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Doc info field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Title Field at the View Cursor. Set is Fixed = True, Title = "This is a Title Field." _LOWriter_FieldDocInfoTitleInsert($oDoc, $oViewCursor, False, True, "Title Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Please insert a User Field here.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have no functions currently that insert any ""Advanced"" Fields, if you would like a demonstration, please follow to prompts, First go to: " & @CRLF & _ "Insert, Field, More Fields, Variables, Click on ""User Field"" and enter ""Test"" as ""name"", and 1234 as value, then click insert. Press Ok on this MsgBox.") ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Please insert a DDE Field here.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next go to: " & @CRLF & _ "Insert, Field, More Fields, Variables, Click on ""DDE Field"" and enter ""Test"" as ""name"", and 1234 as value, then click insert. Press Ok on this MsgBox.") ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Please insert a Database Name Field here.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Next go to: " & @CRLF & _ "Insert, Field, More Fields, Database, Click on ""Database Name"" and drop down ""Bibliography"", select ""Biblio"", then click insert. Press Ok on this MsgBox.") ; Retrieve an array of Advanced Fields. The Doc Info Field, and regular fields, wont be listed in this array. $avFields = _LOWriter_FieldsAdvGetList($oDoc, $LOW_FIELDADV_TYPE_ALL) - If (@error > 0) Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avFields) ; Retrieve an array of Advanced Fields again, this time only list $LOW_FIELDADV_TYPE_USER and $LOW_FIELDADV_TYPE_DATABASE_NAME type fields. $avFields = _LOWriter_FieldsAdvGetList($oDoc, BitOR($LOW_FIELDADV_TYPE_DATABASE_NAME, $LOW_FIELDADV_TYPE_USER)) - If (@error > 0) Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avFields) @@ -122,7 +122,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldsDocInfoGetList.au3 b/Examples/_LOWriter_FieldsDocInfoGetList.au3 index dc6eaa1d..0470e278 100644 --- a/Examples/_LOWriter_FieldsDocInfoGetList.au3 +++ b/Examples/_LOWriter_FieldsDocInfoGetList.au3 @@ -13,99 +13,99 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Regular field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1992, Month = 03, Day = 28, Hour = 15, Minute = 43, Second = 25, Nano = 765, UTC =True $tDateStruct = _LOWriter_DateStructCreate(1992, 03, 28, 15, 43, 25, 765, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "HH:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. Fixed = True, Set the Date to my previously created DateStruct,and set DateTime Format Key to the first ; Key I created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct, Null, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Regular field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Count Field at the View Cursor. Set count type to $LOW_FIELD_COUNT_TYPE_WORDS, Overwrite to False, and Number format to ; $LOW_NUM_STYLE_CHARS_LOWER_LETTER _LOWriter_FieldStatCountInsert($oDoc, $oViewCursor, $LOW_FIELD_COUNT_TYPE_WORDS, False, $LOW_NUM_STYLE_ARABIC) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Regular field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Combined character Field at the View Cursor. Insert the Characters "ABCDEF _LOWriter_FieldCombCharInsert($oDoc, $oViewCursor, False, "ABCDEF") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Doc info field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Title Field at the View Cursor. Set is Fixed = True, Title = "This is a Title Field." _LOWriter_FieldDocInfoTitleInsert($oDoc, $oViewCursor, False, True, "Title Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Doc info field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Create Author Field at the View Cursor. Set is Fixed = False _LOWriter_FieldDocInfoCreateAuthInsert($oDoc, $oViewCursor, False, False) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Doc info field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Document Information Creation Date/Time Field at the View Cursor. Set is Fixed = True, and Date Format Key to the one I just created. _LOWriter_FieldDocInfoCreateDateTimeInsert($oDoc, $oViewCursor, False, True, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Doc Info Fields. The Doc Info Field wont be listedin this array. $avFields = _LOWriter_FieldsDocInfoGetList($oDoc, $LOW_FIELD_DOCINFO_TYPE_ALL) - If (@error > 0) Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avFields) ; Retrieve an array of Doc info Fields again, this time only list $LOW_FIELD_DOCINFO_TYPE_CREATE_AUTH and $LOW_FIELD_DOCINFO_TYPE_TITLE type fields. $avFields = _LOWriter_FieldsDocInfoGetList($oDoc, BitOR($LOW_FIELD_DOCINFO_TYPE_CREATE_AUTH, $LOW_FIELD_DOCINFO_TYPE_TITLE)) - If (@error > 0) Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avFields) @@ -113,7 +113,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FieldsGetList.au3 b/Examples/_LOWriter_FieldsGetList.au3 index 88040890..15e73655 100644 --- a/Examples/_LOWriter_FieldsGetList.au3 +++ b/Examples/_LOWriter_FieldsGetList.au3 @@ -13,75 +13,75 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Date Structure, Year = 1992, Month = 03, Day = 28, Hour = 15, Minute = 43, Second = 25, Nano = 765, UTC =True $tDateStruct = _LOWriter_DateStructCreate(1992, 03, 28, 15, 43, 25, 765, True) - If (@error > 0) Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date structure. Error:" & @error & " Extended:" & @extended) ; Create or retrieve a DateFormat Key, Hour, Minute, Second, AM/PM, Month Day Year $iDateFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "HH:MM:SS AM/PM MM/DD/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date Format Key. Error:" & @error & " Extended:" & @extended) ; Insert a Date and Time text Field at the View Cursor. Fixed = True, Set the Date to my previously created DateStruct,and set DateTime Format Key to the first ; Key I created. _LOWriter_FieldDateTimeInsert($oDoc, $oViewCursor, False, True, $tDateStruct, Null, Null, $iDateFormatKey) - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Count Field at the View Cursor. Set count type to $LOW_FIELD_COUNT_TYPE_WORDS, Overwrite to False, and Number format to ; $LOW_NUM_STYLE_CHARS_LOWER_LETTER _LOWriter_FieldStatCountInsert($oDoc, $oViewCursor, $LOW_FIELD_COUNT_TYPE_WORDS, False, $LOW_NUM_STYLE_ARABIC) - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a field at the end of this line.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Combined character Field at the View Cursor. Insert the Characters "ABCDEF _LOWriter_FieldCombCharInsert($oDoc, $oViewCursor, False, "ABCDEF") - If (@error > 0) Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a field. Error:" & @error & " Extended:" & @extended) ; Insert 2 newlines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Doc info field at the end of this line, it wont be listed.--> ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Doc Info Title Field at the View Cursor. Set is Fixed = True, Title = "This is a Title Field." _LOWriter_FieldDocInfoTitleInsert($oDoc, $oViewCursor, False, True, "Title Field.") - If (@error > 0) Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Field. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Regular Fields. The Doc Info Field wont be listed in this array. $avFields = _LOWriter_FieldsGetList($oDoc, $LOW_FIELD_TYPE_ALL) - If (@error > 0) Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avFields) ; Retrieve an array of Regular Fields again, this time only list $LOW_FIELD_TYPE_DATE_TIME and $LOW_FIELD_TYPE_COMBINED_CHAR type fields. $avFields = _LOWriter_FieldsGetList($oDoc, BitOR($LOW_FIELD_TYPE_DATE_TIME, $LOW_FIELD_TYPE_COMBINED_CHAR)) - If (@error > 0) Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for Fields. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avFields) @@ -89,7 +89,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyAlignment.au3 b/Examples/_LOWriter_FindFormatModifyAlignment.au3 index 757a5fbd..38eb7112 100644 --- a/Examples/_LOWriter_FindFormatModifyAlignment.au3 +++ b/Examples/_LOWriter_FindFormatModifyAlignment.au3 @@ -11,47 +11,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Down once _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_Down, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph to Align center _LOWriter_DirFrmtParAlignment($oViewCursor, $LOW_PAR_ALIGN_HOR_CENTER) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for center alignment _LOWriter_FindFormatModifyAlignment($atFindFormat, $LOW_PAR_ALIGN_HOR_CENTER) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any paragraphs that are center aligned, " & _ "containing the word ""Search"", and found the following: " & $sResultString) Else @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyEffects.au3 b/Examples/_LOWriter_FindFormatModifyEffects.au3 index 973f69e5..83c1fe26 100644 --- a/Examples/_LOWriter_FindFormatModifyEffects.au3 +++ b/Examples/_LOWriter_FindFormatModifyEffects.au3 @@ -11,51 +11,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text to Small Caps _LOWriter_DirFrmtCharEffect($oViewCursor, Null, $LOW_CASEMAP_SM_CAPS) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for any Small Caps case words _LOWriter_FindFormatModifyEffects($atFindFormat, Null, $LOW_CASEMAP_SM_CAPS) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any words in Small Caps, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -65,7 +65,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyFont.au3 b/Examples/_LOWriter_FindFormatModifyFont.au3 index 2436d0a5..92dee7f3 100644 --- a/Examples/_LOWriter_FindFormatModifyFont.au3 +++ b/Examples/_LOWriter_FindFormatModifyFont.au3 @@ -11,51 +11,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font weight to (Bold) $LOW_WEIGHT_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, Null, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Bold font. _LOWriter_FindFormatModifyFont($oDoc, $atFindFormat, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search" that is bold. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for a boldened word, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -65,7 +65,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyHyphenation.au3 b/Examples/_LOWriter_FindFormatModifyHyphenation.au3 index 560371f4..0726ca4f 100644 --- a/Examples/_LOWriter_FindFormatModifyHyphenation.au3 +++ b/Examples/_LOWriter_FindFormatModifyHyphenation.au3 @@ -12,43 +12,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Down once _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_Down, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph to Automatic hyphenation. _LOWriter_DirFrmtParHyphenation($oViewCursor, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Auto hyphenation. _LOWriter_FindFormatModifyHyphenation($atFindFormat, True) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "As of May 27th 2023, searching for any of these attribute will fail. If you watch closely, once you click ok, and I perform the " & _ "search, all instances of ""Search"" will disappear. Libre Office is aware of the bug, but haven't decided how to fix it yet.") ; Search for the word "search". $aoResults = _LOWriter_DocFindAll($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" @@ -68,7 +68,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyIndent.au3 b/Examples/_LOWriter_FindFormatModifyIndent.au3 index e4ddf79b..e077cef3 100644 --- a/Examples/_LOWriter_FindFormatModifyIndent.au3 +++ b/Examples/_LOWriter_FindFormatModifyIndent.au3 @@ -11,47 +11,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Down once _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_Down, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph to Auto Indent first line _LOWriter_DirFrmtParIndent($oViewCursor, 0, 0, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for auto first line Indent _LOWriter_FindFormatModifyIndent($atFindFormat, 0, 0, Null, True) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any paragraphs that have the first line Auto Indent, " & _ "containing the word ""Search"", and found the following: " & $sResultString) Else @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyOverline.au3 b/Examples/_LOWriter_FindFormatModifyOverline.au3 index 231fd5c7..b698e961 100644 --- a/Examples/_LOWriter_FindFormatModifyOverline.au3 +++ b/Examples/_LOWriter_FindFormatModifyOverline.au3 @@ -11,63 +11,63 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's underline style to $LOW_UNDERLINE_WAVE _LOWriter_DirFrmtOverLine($oViewCursor, Null, $LOW_UNDERLINE_WAVE) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 10 spaces, without selecting _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 10, False) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SearcHing". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 9, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's underline style to $LOW_UNDERLINE_BOLD_DASH _LOWriter_DirFrmtOverLine($oViewCursor, Null, $LOW_UNDERLINE_BOLD_DASH) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for $LOW_UNDERLINE_BOLD_DASH overline style. _LOWriter_FindFormatModifyOverline($atFindFormat, $LOW_UNDERLINE_BOLD_DASH) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search" that is overlined using $LOW_UNDERLINE_BOLD_DASH line style. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for a overlined word, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -77,7 +77,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyPageBreak.au3 b/Examples/_LOWriter_FindFormatModifyPageBreak.au3 index 236163ab..1f1044da 100644 --- a/Examples/_LOWriter_FindFormatModifyPageBreak.au3 +++ b/Examples/_LOWriter_FindFormatModifyPageBreak.au3 @@ -11,47 +11,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Down once _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_Down, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph to Page Break Before this paragraph. _LOWriter_DirFrmtParPageBreak($oDoc, $oViewCursor, $LOW_BREAK_PAGE_BEFORE) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Page Break before paragraph. _LOWriter_FindFormatModifyPageBreak($oDoc, $atFindFormat, $LOW_BREAK_PAGE_BEFORE) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any paragraphs that have a Page Break, " & _ "containing the word ""Search"", and found the following: " & $sResultString) Else @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyPosition.au3 b/Examples/_LOWriter_FindFormatModifyPosition.au3 index 2d0a6628..5f28011b 100644 --- a/Examples/_LOWriter_FindFormatModifyPosition.au3 +++ b/Examples/_LOWriter_FindFormatModifyPosition.au3 @@ -11,51 +11,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text to SubScript, 50%, and Relative size to 85% _LOWriter_DirFrmtCharPosition($oViewCursor, Null, Null, Null, 50, 85) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for any 50% subScript, at 85% relative font _LOWriter_FindFormatModifyPosition($atFindFormat, Null, Null, Null, 50, 85) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any Subscript words, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -65,7 +65,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyRotateScaleSpace.au3 b/Examples/_LOWriter_FindFormatModifyRotateScaleSpace.au3 index ccd89b0d..e058e8a7 100644 --- a/Examples/_LOWriter_FindFormatModifyRotateScaleSpace.au3 +++ b/Examples/_LOWriter_FindFormatModifyRotateScaleSpace.au3 @@ -11,51 +11,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text to Auto Kerning = True _LOWriter_DirFrmtCharSpacing($oViewCursor, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for auto Kerning _LOWriter_FindFormatModifyRotateScaleSpace($atFindFormat, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any Subscript words, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -65,7 +65,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifySpacing.au3 b/Examples/_LOWriter_FindFormatModifySpacing.au3 index 1bc23b79..1346e781 100644 --- a/Examples/_LOWriter_FindFormatModifySpacing.au3 +++ b/Examples/_LOWriter_FindFormatModifySpacing.au3 @@ -11,47 +11,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Down once _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_Down, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph to Line Space Mode $LOW_LINE_SPC_MODE_PROP, Height to 115% _LOWriter_DirFrmtParSpace($oViewCursor, Null, Null, Null, $LOW_LINE_SPC_MODE_PROP, 115) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for proportional line spacing, at 115% _LOWriter_FindFormatModifySpacing($atFindFormat, Null, Null, Null, $LOW_LINE_SPC_MODE_PROP, 115) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any paragraphs that have the Proportional line spacing, " & _ "containing the word ""Search"", and found the following: " & $sResultString) Else @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyStrikeout.au3 b/Examples/_LOWriter_FindFormatModifyStrikeout.au3 index 04b13db9..5468cdf5 100644 --- a/Examples/_LOWriter_FindFormatModifyStrikeout.au3 +++ b/Examples/_LOWriter_FindFormatModifyStrikeout.au3 @@ -11,51 +11,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Strike out the selected text _LOWriter_DirFrmtStrikeOut($oViewCursor, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for any struck out text _LOWriter_FindFormatModifyStrikeout($atFindFormat, Null, True) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search" that is struck out. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for a struck out word, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -65,7 +65,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyTxtFlowOpt.au3 b/Examples/_LOWriter_FindFormatModifyTxtFlowOpt.au3 index 32f8fdf8..75c96a7a 100644 --- a/Examples/_LOWriter_FindFormatModifyTxtFlowOpt.au3 +++ b/Examples/_LOWriter_FindFormatModifyTxtFlowOpt.au3 @@ -11,47 +11,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search." & @CR & "A New Line to SEARCH.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor Down once _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_Down, 1) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the paragraph to Keep Together = True _LOWriter_DirFrmtParTxtFlowOpt($oViewCursor, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Keep Together Paragraph attribute. _LOWriter_FindFormatModifyTxtFlowOpt($atFindFormat, Null, True) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search". $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for any paragraphs that are center aligned, " & _ "containing the word ""Search"", and found the following: " & $sResultString) Else @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FindFormatModifyUnderline.au3 b/Examples/_LOWriter_FindFormatModifyUnderline.au3 index 743b06db..883b17c7 100644 --- a/Examples/_LOWriter_FindFormatModifyUnderline.au3 +++ b/Examples/_LOWriter_FindFormatModifyUnderline.au3 @@ -11,63 +11,63 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's underline style to $LOW_UNDERLINE_WAVE _LOWriter_DirFrmtUnderLine($oViewCursor, Null, $LOW_UNDERLINE_WAVE) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 10 spaces, without selecting _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 10, False) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SearcHing". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 9, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's underline style to $LOW_UNDERLINE_BOLD_DASH _LOWriter_DirFrmtUnderLine($oViewCursor, Null, $LOW_UNDERLINE_BOLD_DASH) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for $LOW_UNDERLINE_BOLD_DASH underline style. _LOWriter_FindFormatModifyUnderline($atFindFormat, $LOW_UNDERLINE_BOLD_DASH) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search" that is underlined using $LOW_UNDERLINE_BOLD_DASH line style. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for a underlined word, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -77,7 +77,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FontExists.au3 b/Examples/_LOWriter_FontExists.au3 index 07864d9e..7861db85 100644 --- a/Examples/_LOWriter_FontExists.au3 +++ b/Examples/_LOWriter_FontExists.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Test for a font called "Times New Roman" $bResult1 = _LOWriter_FontExists($oDoc, "Times New Roman") - If (@error > 0) Then _ERROR("Failed to check for font name existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to check for font name existing in document. Error:" & @error & " Extended:" & @extended) ; Test for a font called "Fake Font" $bResult2 = _LOWriter_FontExists($oDoc, "Fake Font") - If (@error > 0) Then _ERROR("Failed to check for font name existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to check for font name existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the document have a font called ""Times New Roman"" ? True/False: " & $bResult1 & @CRLF & @CRLF & _ "Does the document have a font called ""Fake Font"" ? True/False: " & $bResult2) @@ -28,7 +28,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FontsList.au3 b/Examples/_LOWriter_FontsList.au3 index e684c5da..5e0423ff 100644 --- a/Examples/_LOWriter_FontsList.au3 +++ b/Examples/_LOWriter_FontsList.au3 @@ -11,11 +11,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Array list of font names $asFonts = _LOWriter_FontsList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve Array of font names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Array of font names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "There were " & @extended & " fonts found. I will now display the array of the results. The Array will have four " & _ "columns, " & @CRLF & _ @@ -30,7 +30,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteDelete.au3 b/Examples/_LOWriter_FootnoteDelete.au3 index 9365f709..56d7409b 100644 --- a/Examples/_LOWriter_FootnoteDelete.au3 +++ b/Examples/_LOWriter_FootnoteDelete.au3 @@ -9,31 +9,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. $oFootNote = _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the Footnote.") ; Delete the footnote. _LOWriter_FootnoteDelete($oFootNote) - If (@error > 0) Then _ERROR("Failed to delete a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Footnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteGetAnchor.au3 b/Examples/_LOWriter_FootnoteGetAnchor.au3 index da87ab6f..20a2361e 100644 --- a/Examples/_LOWriter_FootnoteGetAnchor.au3 +++ b/Examples/_LOWriter_FootnoteGetAnchor.au3 @@ -9,37 +9,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. $oFootNote = _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, " More text after the Footnote.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Text Cursor at the Anchor location. $oAnchorTextCursor = _LOWriter_FootnoteGetAnchor($oFootNote) - If (@error > 0) Then _ERROR("Failed to create a text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text before the Footnote anchor location. _LOWriter_DocInsertString($oDoc, $oAnchorTextCursor, "(NEW TEXT INSERTED USING THE ANCHOR CURSOR.) ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteGetTextCursor.au3 b/Examples/_LOWriter_FootnoteGetTextCursor.au3 index 5b8d6dbc..3c0cc535 100644 --- a/Examples/_LOWriter_FootnoteGetTextCursor.au3 +++ b/Examples/_LOWriter_FootnoteGetTextCursor.au3 @@ -9,33 +9,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. $oFootNote = _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Retrieve a Text cursor for the Footnote $oTextCursor = _LOWriter_FootnoteGetTextCursor($oFootNote) - If (@error > 0) Then _ERROR("Failed to create a Footnote Text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Footnote Text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text in the Footnote. _LOWriter_DocInsertString($oDoc, $oTextCursor, "I inserted some text inside of the footnote.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteInsert.au3 b/Examples/_LOWriter_FootnoteInsert.au3 index 327846d4..a3ad80c8 100644 --- a/Examples/_LOWriter_FootnoteInsert.au3 +++ b/Examples/_LOWriter_FootnoteInsert.au3 @@ -9,25 +9,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor, and set a custom label, "A". _LOWriter_FootnoteInsert($oDoc, $oViewCursor, False, "A") - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteModifyAnchor.au3 b/Examples/_LOWriter_FootnoteModifyAnchor.au3 index d8441fa6..eaadadc7 100644 --- a/Examples/_LOWriter_FootnoteModifyAnchor.au3 +++ b/Examples/_LOWriter_FootnoteModifyAnchor.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor, and set a custom label, "A". $oFootNote = _LOWriter_FootnoteInsert($oDoc, $oViewCursor, False, "A") - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to modify the Footnote Label.") ; Change the Footnote Label to AutoNumbering. _LOWriter_FootnoteModifyAnchor($oFootNote, "") - If (@error > 0) Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Footnote Label. $sLabel = _LOWriter_FootnoteModifyAnchor($oFootNote) - If (@error > 0) Then _ERROR("Failed to Retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Footnote's current label is: " & $sLabel) @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteSettingsAutoNumber.au3 b/Examples/_LOWriter_FootnoteSettingsAutoNumber.au3 index 949ed4b8..27de33b1 100644 --- a/Examples/_LOWriter_FootnoteSettingsAutoNumber.au3 +++ b/Examples/_LOWriter_FootnoteSettingsAutoNumber.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Modify the Document's Footnote settings to: Number format = $LOW_NUM_STYLE_ROMAN_UPPER, Start Numbering at 5, Before the Footnote label, Place ; a Emdash and after the footnote label place a Colon, Counting type = $LOW_FOOTNOTE_COUNT_PER_DOC _LOWriter_FootnoteSettingsAutoNumber($oDoc, $LOW_NUM_STYLE_ROMAN_UPPER, 5, "—", ":", $LOW_FOOTNOTE_COUNT_PER_DOC) - If (@error > 0) Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Footnote settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FootnoteSettingsAutoNumber($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document's current Footnote Auto Numbering settings are as follows: " & @CRLF & _ "The Auto Numbering Number Style used for Footnotes is, (see UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteSettingsContinuation.au3 b/Examples/_LOWriter_FootnoteSettingsContinuation.au3 index 75a6f90f..10ba7548 100644 --- a/Examples/_LOWriter_FootnoteSettingsContinuation.au3 +++ b/Examples/_LOWriter_FootnoteSettingsContinuation.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Modify the Document's Footnote continuation settings to: End of Footnote continuation notice = "Cont. On Page ", Next Page Continuation notice = ; "Cont. from Page " _LOWriter_FootnoteSettingsContinuation($oDoc, "Cont. On Page ", "Cont. from Page ") - If (@error > 0) Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Footnote settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FootnoteSettingsContinuation($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document's current Footnote Continuation settings are as follows: " & @CRLF & _ "The text that appears at the end of a Footnote to indicate it is continued is: " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnoteSettingsStyles.au3 b/Examples/_LOWriter_FootnoteSettingsStyles.au3 index 801935e7..066fffe5 100644 --- a/Examples/_LOWriter_FootnoteSettingsStyles.au3 +++ b/Examples/_LOWriter_FootnoteSettingsStyles.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Modify the Document's Footnote Style settings to: Paragraph Style to use = "Marginalia",Skip Page style, Text area = "Definition" Character style ; Footnote Area = "Source Text" _LOWriter_FootnoteSettingsStyles($oDoc, "Marginalia", Null, "Definition", "Source Text") - If (@error > 0) Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Footnote settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Footnote settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FootnoteSettingsStyles($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Footnote settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Document's current Footnote Style settings are as follows: " & @CRLF & _ "The Paragraph Style to use for Footnote content is: " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FootnotesGetList.au3 b/Examples/_LOWriter_FootnotesGetList.au3 index 50850d46..086def78 100644 --- a/Examples/_LOWriter_FootnotesGetList.au3 +++ b/Examples/_LOWriter_FootnotesGetList.au3 @@ -10,43 +10,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "I have inserted a Footnote at the end of this line. ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert a Footnote at the ViewCursor. _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) ; Insert some more text. _LOWriter_DocInsertString($oDoc, $oViewCursor, " More Text.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert another Footnote at the ViewCursor. _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Footnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to delete the first Footnote.") ; Retrieve an array of Footnote Objects. $aoFootnotes = _LOWriter_FootnotesGetList($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Footnote objects. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Footnote objects. Error:" & @error & " Extended:" & @extended) ; Delete the first Footnote returned _LOWriter_FootnoteDelete($aoFootnotes[0]) - If (@error > 0) Then _ERROR("Failed to delete a Footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Footnote. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FormatKeyCreate.au3 b/Examples/_LOWriter_FormatKeyCreate.au3 index fb13e615..a6363f41 100644 --- a/Examples/_LOWriter_FormatKeyCreate.au3 +++ b/Examples/_LOWriter_FormatKeyCreate.au3 @@ -10,11 +10,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a New Number Format Key. $iFormatKey = _LOWriter_FormatKeyCreate($oDoc, "#,##0.000") - If (@error > 0) Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I created a new Number format key. Its Format Key number is: " & $iFormatKey & " It looks like this: " & _ _LOWriter_FormatKeyGetString($oDoc, $iFormatKey)) @@ -23,7 +23,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FormatKeyDelete.au3 b/Examples/_LOWriter_FormatKeyDelete.au3 index a5deaa38..68ffc902 100644 --- a/Examples/_LOWriter_FormatKeyDelete.au3 +++ b/Examples/_LOWriter_FormatKeyDelete.au3 @@ -10,18 +10,18 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a New Number Format Key. $iFormatKey = _LOWriter_FormatKeyCreate($oDoc, "#,##0.000") - If (@error > 0) Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I created a new Number format key. Its Format Key number is: " & $iFormatKey & " It looks like this: " & _ _LOWriter_FormatKeyGetString($oDoc, $iFormatKey) & @CRLF & @CRLF & "Press Ok to delete it.") ; Delete the Format Key. _LOWriter_FormatKeyDelete($oDoc, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to delete a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Format Key. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does the document still have the Number format I created? True/False: " & _LOWriter_FormatKeyExists($oDoc, $iFormatKey)) @@ -29,7 +29,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FormatKeyExists.au3 b/Examples/_LOWriter_FormatKeyExists.au3 index 084ac182..298d7b59 100644 --- a/Examples/_LOWriter_FormatKeyExists.au3 +++ b/Examples/_LOWriter_FormatKeyExists.au3 @@ -12,14 +12,14 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new DateFormatKey H:MM:SS (Hour, Minute, Second, AM/PM, Month Day Name(Day) Year $iFormatKey = _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM -- M/NNN(D)/YYYY") ; Check if the new key exists. $bExists = _LOWriter_FormatKeyExists($oDoc, $iFormatKey) - If (@error > 0) Then _ERROR("Failed to search for a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for a Format Key. Error:" & @error & " Extended:" & @extended) If ($bExists = True) Then MsgBox($MB_OK, "", "I created a new DateTime format key.") @@ -29,11 +29,11 @@ Func Example() ; Create a New Number Format Key. $i2ndFormatKey = _LOWriter_FormatKeyCreate($oDoc, "#,##0.000") - If (@error > 0) Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) ; Check if the new key exists, searching in Number Format Keys only. $bExists = _LOWriter_FormatKeyExists($oDoc, $i2ndFormatKey, $LOW_FORMAT_KEYS_NUMBER) - If (@error > 0) Then _ERROR("Failed to search for a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to search for a Format Key. Error:" & @error & " Extended:" & @extended) If ($bExists = True) Then MsgBox($MB_OK, "", "I created a new Number format key.") @@ -43,28 +43,28 @@ Func Example() ; Retrieve an Array of Format Keys. User created ones only. $avKeys = _LOWriter_FormatKeyList($oDoc, False, True) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Date/Time Format Keys. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Date/Time Format Keys. Error:" & @error & " Extended:" & @extended) $iResults = @extended ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Format Key" & Chr(9) & Chr(9) & "Format Key String" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To $iResults - 1 ; List the keys in the document, separate each column by tabs. _LOWriter_DocInsertString($oDoc, $oViewCursor, $avKeys[$i][0] & Chr(9) & Chr(9) & Chr(9) & $avKeys[$i][1] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FormatKeyGetString.au3 b/Examples/_LOWriter_FormatKeyGetString.au3 index fb13e615..a6363f41 100644 --- a/Examples/_LOWriter_FormatKeyGetString.au3 +++ b/Examples/_LOWriter_FormatKeyGetString.au3 @@ -10,11 +10,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a New Number Format Key. $iFormatKey = _LOWriter_FormatKeyCreate($oDoc, "#,##0.000") - If (@error > 0) Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I created a new Number format key. Its Format Key number is: " & $iFormatKey & " It looks like this: " & _ _LOWriter_FormatKeyGetString($oDoc, $iFormatKey)) @@ -23,7 +23,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FormatKeyList.au3 b/Examples/_LOWriter_FormatKeyList.au3 index 797d7625..a09a0463 100644 --- a/Examples/_LOWriter_FormatKeyList.au3 +++ b/Examples/_LOWriter_FormatKeyList.au3 @@ -11,40 +11,40 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new DateFormatKey H:MM:SS (Hour, Minute, Second, AM/PM, Month Day Name(Day) Year _LOWriter_DateFormatKeyCreate($oDoc, "H:MM:SS AM/PM -- M/NNN(D)/YYYY") - If (@error > 0) Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Date/Time Format Key. Error:" & @error & " Extended:" & @extended) ; Create a New Number Format Key. _LOWriter_FormatKeyCreate($oDoc, "#,##0.000") - If (@error > 0) Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Format Key. Error:" & @error & " Extended:" & @extended) ; Retrieve an Array of Format Keys. With Boolean value of whether each is a UserCreated key or not., search for all Format Key types. $avKeys = _LOWriter_FormatKeyList($oDoc, True, False, $LOW_FORMAT_KEYS_ALL) - If (@error > 0) Then _ERROR("Failed to retrieve an array of Date/Time Format Keys. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve an array of Date/Time Format Keys. Error:" & @error & " Extended:" & @extended) $iResults = @extended ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Format Key" & Chr(9) & Chr(9) & "Format Key String" & Chr(9) & Chr(9) & "Is User Created?" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To $iResults - 1 ; List the keys in the document, separate each column by tabs. _LOWriter_DocInsertString($oDoc, $oViewCursor, $avKeys[$i][0] & Chr(9) & Chr(9) & Chr(9) & $avKeys[$i][1] & Chr(9) & Chr(9) & Chr(9) & $avKeys[$i][2] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameAreaColor.au3 b/Examples/_LOWriter_FrameAreaColor.au3 index 8e0a3b62..24551d65 100644 --- a/Examples/_LOWriter_FrameAreaColor.au3 +++ b/Examples/_LOWriter_FrameAreaColor.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Background Color settings. Background color = $LOW_COLOR_TEAL, Background color is transparent = False _LOWriter_FrameAreaColor($oFrame, $LOW_COLOR_TEAL, False) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameAreaColor($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Background color settings are as follows: " & @CRLF & _ "The Frame Style's Background color is, in Long color format: " & $avSettings[0] & @CRLF & _ @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameAreaGradient.au3 b/Examples/_LOWriter_FrameAreaGradient.au3 index 77db5f22..ae367346 100644 --- a/Examples/_LOWriter_FrameAreaGradient.au3 +++ b/Examples/_LOWriter_FrameAreaGradient.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Gradient settings to: Preset Gradient name = $LOW_GRAD_NAME_TEAL_TO_BLUE _LOWriter_FrameAreaGradient($oDoc, $oFrame, $LOW_GRAD_NAME_TEAL_TO_BLUE) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameAreaGradient($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avSettings[0] & @CRLF & _ @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameAreaGradient[2].au3 b/Examples/_LOWriter_FrameAreaGradient[2].au3 index ed5637e8..cb1fba3b 100644 --- a/Examples/_LOWriter_FrameAreaGradient[2].au3 +++ b/Examples/_LOWriter_FrameAreaGradient[2].au3 @@ -10,25 +10,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Gradient settings to: skip pre-set gradient name, Gradient type = $LOW_GRAD_TYPE_SQUARE, increment steps = 150, ; horizontal (X) offset = 25%, vertical offset (Y) = 56%, rotational angle = 135 degrees, percentage not covered by "From" color = 50% ; Starting color = $LOW_COLOR_ORANGE, Ending color = $LOW_COLOR_TEAL,Starting color intensity = 100%, ending color intensity = 68% _LOWriter_FrameAreaGradient($oDoc, $oFrame, Null, $LOW_GRAD_TYPE_SQUARE, 150, 25, 56, 135, 50, $LOW_COLOR_ORANGE, $LOW_COLOR_TEAL, 100, 68) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameAreaGradient($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avSettings[0] & @CRLF & _ @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameBorderColor.au3 b/Examples/_LOWriter_FrameBorderColor.au3 index 5ac4b1f4..22c07d67 100644 --- a/Examples/_LOWriter_FrameBorderColor.au3 +++ b/Examples/_LOWriter_FrameBorderColor.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameBorderWidth($oFrame, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Border Color settings to: Top, $LOW_COLOR_ORANGE, Bottom $LOW_COLOR_BLUE, Left, $LOW_COLOR_LGRAY, Right $LOW_COLOR_BLACK _LOWriter_FrameBorderColor($oFrame, $LOW_COLOR_ORANGE, $LOW_COLOR_BLUE, $LOW_COLOR_LGRAY, $LOW_COLOR_BLACK) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameBorderColor($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Border Color settings are as follows: " & @CRLF & _ "The Top Border Color is, in Long Color Format: " & $avSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameBorderPadding.au3 b/Examples/_LOWriter_FrameBorderPadding.au3 index 5c2dda11..a63b2cc8 100644 --- a/Examples/_LOWriter_FrameBorderPadding.au3 +++ b/Examples/_LOWriter_FrameBorderPadding.au3 @@ -11,35 +11,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameBorderWidth($oFrame, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Border Padding Width settings to: 1/8" in all sides, and then 1/4" on the bottom. _LOWriter_FrameBorderPadding($oFrame, $iMicrometers, Null, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameBorderPadding($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Border Padding Width settings are as follows: " & @CRLF & _ "The ""All"" Border Padding Width is, in Micrometers, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -52,7 +52,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameBorderStyle.au3 b/Examples/_LOWriter_FrameBorderStyle.au3 index e742819f..e4bb778c 100644 --- a/Examples/_LOWriter_FrameBorderStyle.au3 +++ b/Examples/_LOWriter_FrameBorderStyle.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameBorderWidth($oFrame, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Border Style settings to: Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP ; Left = $LOW_BORDERSTYLE_DOUBLE, Right = $LOW_BORDERSTYLE_DASHED _LOWriter_FrameBorderStyle($oFrame, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_DOUBLE, $LOW_BORDERSTYLE_DASHED) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameBorderStyle($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Border Style settings are as follows: " & @CRLF & _ "The Top Border Style is, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameBorderWidth.au3 b/Examples/_LOWriter_FrameBorderWidth.au3 index fae0843e..7bf839a1 100644 --- a/Examples/_LOWriter_FrameBorderWidth.au3 +++ b/Examples/_LOWriter_FrameBorderWidth.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameBorderWidth($oFrame, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameBorderWidth($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Border Width settings are as follows: " & @CRLF & _ "The Top Border Width is, in Micrometers, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameColumnSeparator.au3 b/Examples/_LOWriter_FrameColumnSeparator.au3 index 09802504..0b0339f1 100644 --- a/Examples/_LOWriter_FrameColumnSeparator.au3 +++ b/Examples/_LOWriter_FrameColumnSeparator.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 6000x6000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 6000, 6000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Column count to 4. _LOWriter_FrameColumnSettings($oFrame, 4) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/16" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.0625) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Frame Column Separator line settings to: Seperator on (True), Line Style = $LOW_LINE_STYLE_SOLID, Line width to 1/16" ; Line Color to $LOW_COLOR_RED, Height to 75%, Line Position to $LOW_ALIGN_VERT_MIDDLE _LOWriter_FrameColumnSeparator($oFrame, True, $LOW_LINE_STYLE_SOLID, $iMicrometers, $LOW_COLOR_RED, 75, $LOW_ALIGN_VERT_MIDDLE) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameColumnSeparator($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's current Column Seperator Line settings are as follows: " & @CRLF & _ "Is Column seperated by a line? True/False: " & $avSettings[0] & @CRLF & _ @@ -50,7 +50,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameColumnSettings.au3 b/Examples/_LOWriter_FrameColumnSettings.au3 index ce670cc0..d0c731ae 100644 --- a/Examples/_LOWriter_FrameColumnSettings.au3 +++ b/Examples/_LOWriter_FrameColumnSettings.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Column count to 4. _LOWriter_FrameColumnSettings($oFrame, 4) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an Integer $iColumns = _LOWriter_FrameColumnSettings($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's current number of columns is: " & $iColumns) @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameColumnSize.au3 b/Examples/_LOWriter_FrameColumnSize.au3 index 21b369a5..b3c321af 100644 --- a/Examples/_LOWriter_FrameColumnSize.au3 +++ b/Examples/_LOWriter_FrameColumnSize.au3 @@ -11,31 +11,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Column count to 4. _LOWriter_FrameColumnSettings($oFrame, 4) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Frame Column size settings for column 2, set auto width to True, and Global spacing to 1/4". _LOWriter_FrameColumnSize($oFrame, 2, True, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameColumnSize($oFrame, 2) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's current Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avSettings[0] & @CRLF & _ @@ -48,11 +48,11 @@ Func Example() ; Set the Frame Column size settings for column 2, set auto width to False. _LOWriter_FrameColumnSize($oFrame, 2, False) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameColumnSize($oFrame, 2) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's new Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avSettings[0] & @CRLF & _ @@ -66,7 +66,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameColumnSize[2].au3 b/Examples/_LOWriter_FrameColumnSize[2].au3 index e9897720..bc4e48e8 100644 --- a/Examples/_LOWriter_FrameColumnSize[2].au3 +++ b/Examples/_LOWriter_FrameColumnSize[2].au3 @@ -11,31 +11,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set Frame Column count to 4. _LOWriter_FrameColumnSettings($oFrame, 4) - If (@error > 0) Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Frame Column size settings for column 3, set auto width to False, and spacing for this specific column to 1/4" _LOWriter_FrameColumnSize($oFrame, 3, True, Null, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameColumnSize($oFrame, 3) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's current Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avSettings[0] & @CRLF & _ @@ -49,7 +49,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameCreate.au3 b/Examples/_LOWriter_FrameCreate.au3 index 14cd76a6..eece3d1b 100644 --- a/Examples/_LOWriter_FrameCreate.au3 +++ b/Examples/_LOWriter_FrameCreate.au3 @@ -9,21 +9,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, Named "AutoitTest", and 3000x3000 Micrometers wide. _LOWriter_FrameCreate($oDoc, $oViewCursor, "AutoitTest", 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameCreateTextCursor.au3 b/Examples/_LOWriter_FrameCreateTextCursor.au3 index d13f75bd..e4e2060e 100644 --- a/Examples/_LOWriter_FrameCreateTextCursor.au3 +++ b/Examples/_LOWriter_FrameCreateTextCursor.au3 @@ -9,30 +9,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 5000x5000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 5000, 5000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Create a Text Cursor in the frame. $oTextCursor = _LOWriter_FrameCreateTextCursor($oFrame) - If (@error > 0) Then _ERROR("Failed to create a text Cursor Object for the Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a text Cursor Object for the Frame. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oTextCursor, "First Line of text." & @CR & _ "Second line of text.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameDelete.au3 b/Examples/_LOWriter_FrameDelete.au3 index 2fbfb74c..5b86d2cc 100644 --- a/Examples/_LOWriter_FrameDelete.au3 +++ b/Examples/_LOWriter_FrameDelete.au3 @@ -9,27 +9,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, Named "AutoitTest", and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, "AutoitTest", 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the Text Frame.") ; Delete the frame. _LOWriter_FrameDelete($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to delete a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Frame. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameGetAnchor.au3 b/Examples/_LOWriter_FrameGetAnchor.au3 index a02555ca..39a53a55 100644 --- a/Examples/_LOWriter_FrameGetAnchor.au3 +++ b/Examples/_LOWriter_FrameGetAnchor.au3 @@ -9,29 +9,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, Named "AutoitTest", and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, "AutoitTest", 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Create a Text Cursor at the Anchor location. $oAnchorTextCursor = _LOWriter_FrameGetAnchor($oFrame) - If (@error > 0) Then _ERROR("Failed to create a text Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a text Cursor. Error:" & @error & " Extended:" & @extended) ; Insert some text at the Frame anchor location. _LOWriter_DocInsertString($oDoc, $oAnchorTextCursor, "(NEW TEXT INSERTED USING THE ANCHOR CURSOR.) ") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameGetObjByCursor.au3 b/Examples/_LOWriter_FrameGetObjByCursor.au3 index 70999a03..a6bc4616 100644 --- a/Examples/_LOWriter_FrameGetObjByCursor.au3 +++ b/Examples/_LOWriter_FrameGetObjByCursor.au3 @@ -9,39 +9,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Create a Text Cursor in the frame. $oTextCursor = _LOWriter_FrameCreateTextCursor($oFrame) - If (@error > 0) Then _ERROR("Failed to create a text Cursor Object for the Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a text Cursor Object for the Frame. Error:" & @error & " Extended:" & @extended) ; Move the View Curosr into the frame. _LOWriter_CursorGoToRange($oViewCursor, $oTextCursor) - If (@error > 0) Then _ERROR("Failed to move a Cursor Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move a Cursor Object. Error:" & @error & " Extended:" & @extended) ; Retrieve the Frame Object by the ViewCursor (which is located in the Frame.) $oFrameNew = _LOWriter_FrameGetObjByCursor($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to Retrieve a Frame Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Retrieve a Frame Object. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to delete the Frame, using the newly retrieved Object.") ; Delete the frame using the new Frame Object. _LOWriter_FrameDelete($oDoc, $oFrameNew) - If (@error > 0) Then _ERROR("Failed to delete the Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete the Frame. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameGetObjByName.au3 b/Examples/_LOWriter_FrameGetObjByName.au3 index 1a4b93f9..437b7619 100644 --- a/Examples/_LOWriter_FrameGetObjByName.au3 +++ b/Examples/_LOWriter_FrameGetObjByName.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document. _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Frame names currently in the document. $asFrames = _LOWriter_FramesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve a list of Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve a list of Frame. Error:" & @error & " Extended:" & @extended) If (UBound($asFrames) > 0) Then ; Retrieve the object for the first frame listed in the Array. $oFrame = _LOWriter_FrameGetObjByName($oDoc, $asFrames[0]) - If (@error > 0) Then _ERROR("Failed to retrieve a frame Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve a frame Object. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the Text Frame.") ; Delete the Frame. _LOWriter_FrameDelete($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to delete a frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a frame. Error:" & @error & " Extended:" & @extended) Else _ERROR("Something went wrong, and no frames were found.") @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameHyperlink.au3 b/Examples/_LOWriter_FrameHyperlink.au3 index cca075d9..9fae234c 100644 --- a/Examples/_LOWriter_FrameHyperlink.au3 +++ b/Examples/_LOWriter_FrameHyperlink.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Hyperlink settings. Set the URL to "https://www.autoitscript.com/site/autoit/", set the name to Autoit© _LOWriter_FrameHyperlink($oFrame, "https://www.autoitscript.com/site/autoit/", "Autoit©") - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Hyperlink settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameHyperlink($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Hyperlink settings are as follows: " & @CRLF & _ "The Hyperlink URL is, (if there is one): " & $avSettings[0] & @CRLF & _ @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameHyperlink[2].au3 b/Examples/_LOWriter_FrameHyperlink[2].au3 index efff01d5..ef46c0d1 100644 --- a/Examples/_LOWriter_FrameHyperlink[2].au3 +++ b/Examples/_LOWriter_FrameHyperlink[2].au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Hyperlink settings. Set the URL to @ScriptFullPath, set the name to "Current Script" _LOWriter_FrameHyperlink($oFrame, @ScriptFullPath, "Current Script") - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Hyperlink settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameHyperlink($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Hyperlink settings are as follows: " & @CRLF & _ "The Hyperlink URL is, (if there is one): " & $avSettings[0] & @CRLF & _ @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameOptions.au3 b/Examples/_LOWriter_FrameOptions.au3 index 6040af5b..e1ffb9d6 100644 --- a/Examples/_LOWriter_FrameOptions.au3 +++ b/Examples/_LOWriter_FrameOptions.au3 @@ -10,24 +10,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Option settings. Set Protect content to True, Protect Position to True, Protect size to True, Vertical alignment to ; $LOW_TXT_ADJ_VERT_CENTER, Edit in Read-Only to True, Print to False, Text direction to $LOW_TXT_DIR_TB_LR _LOWriter_FrameOptions($oFrame, True, True, True, $LOW_TXT_ADJ_VERT_CENTER, True, False, $LOW_TXT_DIR_TB_LR) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameOptions($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's option settings are as follows: " & @CRLF & _ "Protect the Frame's contents from changes? True/False: " & $avSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameOptionsName.au3 b/Examples/_LOWriter_FrameOptionsName.au3 index 46ae7e7a..c5e09949 100644 --- a/Examples/_LOWriter_FrameOptionsName.au3 +++ b/Examples/_LOWriter_FrameOptionsName.au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Insert some @CR's to move the Viewcursor down a few lines. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & @CR & @CR & @CR & @CR & @CR & @CR & @CR & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Return the cursor back to the start. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Error performing cursor Move. Error:" & @error & " Extended:" & @extended) ; Insert another Frame into the document at the Viewcursor position, Named "AutoitTest", and 3000x3000 Micrometers wide. _LOWriter_FrameCreate($oDoc, $oViewCursor, "AutoitTest", 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Name Option settings. Set the Lower Frame name to "AutoitTest2", Set the description to ; "This is a Frame to demonstrate _LOWriter_FrameOptionsName.", set Previous link to the upper Frame's name, _LOWriter_FrameOptionsName($oDoc, $oFrame, "AutoitTest2", "This is a Frame to demonstrate _LOWriter_FrameOptionsName.", "AutoitTest") - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameOptionsName($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Name Option settings are as follows: " & @CRLF & _ "The Frame's name is: " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameShadow.au3 b/Examples/_LOWriter_FrameShadow.au3 index 4392fc0b..04f19430 100644 --- a/Examples/_LOWriter_FrameShadow.au3 +++ b/Examples/_LOWriter_FrameShadow.au3 @@ -11,27 +11,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 6000x6000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 6000, 6000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Frame Shadow settings to: Width = 1/8", Color = $LOW_COLOR_RED, Transparent = False, Location = $LOW_SHADOW_TOP_LEFT _LOWriter_FrameShadow($oFrame, $iMicrometers, $LOW_COLOR_RED, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameShadow($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Shadow settings are as follows: " & @CRLF & _ "The shadow width is, is Micrometers: " & $avSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleAreaColor.au3 b/Examples/_LOWriter_FrameStyleAreaColor.au3 index 86474f16..45252a6d 100644 --- a/Examples/_LOWriter_FrameStyleAreaColor.au3 +++ b/Examples/_LOWriter_FrameStyleAreaColor.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Background Color settings. Background color = $LOW_COLOR_TEAL, Background color is transparent = False _LOWriter_FrameStyleAreaColor($oFrameStyle, $LOW_COLOR_TEAL, False) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleAreaColor($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's Background color settings are as follows: " & @CRLF & _ "The Frame Style's Background color is, in Long color format: " & $avSettings[0] & @CRLF & _ @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleAreaGradient.au3 b/Examples/_LOWriter_FrameStyleAreaGradient.au3 index 354e740f..0565c704 100644 --- a/Examples/_LOWriter_FrameStyleAreaGradient.au3 +++ b/Examples/_LOWriter_FrameStyleAreaGradient.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Gradient settings to: Preset Gradient name = $LOW_GRAD_NAME_TEAL_TO_BLUE _LOWriter_FrameStyleAreaGradient($oDoc, $oFrameStyle, $LOW_GRAD_NAME_TEAL_TO_BLUE) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleAreaGradient($oDoc, $oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avSettings[0] & @CRLF & _ @@ -53,7 +53,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleAreaGradient[2].au3 b/Examples/_LOWriter_FrameStyleAreaGradient[2].au3 index 0b6838a0..5e3525ea 100644 --- a/Examples/_LOWriter_FrameStyleAreaGradient[2].au3 +++ b/Examples/_LOWriter_FrameStyleAreaGradient[2].au3 @@ -10,33 +10,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Gradient settings to: skip pre-set gradient name, Gradient type = $LOW_GRAD_TYPE_SQUARE, increment steps = 150, ; horizontal (X) offset = 25%, vertical offset (Y) = 56%, rotational angle = 135 degrees, percentage not covered by "From" color = 50% ; Starting color = $LOW_COLOR_ORANGE, Ending color = $LOW_COLOR_TEAL,Starting color intensity = 100%, ending color intensity = 68% _LOWriter_FrameStyleAreaGradient($oDoc, $oFrameStyle, Null, $LOW_GRAD_TYPE_SQUARE, 150, 25, 56, 135, 50, $LOW_COLOR_ORANGE, $LOW_COLOR_TEAL, 100, 68) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleAreaGradient($oDoc, $oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avSettings[0] & @CRLF & _ @@ -55,7 +55,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleBorderColor.au3 b/Examples/_LOWriter_FrameStyleBorderColor.au3 index 320d3b4d..831d4572 100644 --- a/Examples/_LOWriter_FrameStyleBorderColor.au3 +++ b/Examples/_LOWriter_FrameStyleBorderColor.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Set Frame style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameStyleBorderWidth($oFrameStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Border Color settings to: Top, $LOW_COLOR_ORANGE, Bottom $LOW_COLOR_BLUE, Left, $LOW_COLOR_LGRAY, Right $LOW_COLOR_BLACK _LOWriter_FrameStyleBorderColor($oFrameStyle, $LOW_COLOR_ORANGE, $LOW_COLOR_BLUE, $LOW_COLOR_LGRAY, $LOW_COLOR_BLACK) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleBorderColor($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Border Color settings are as follows: " & @CRLF & _ "The Top Border Color is, in Long Color Format: " & $avSettings[0] & @CRLF & _ @@ -50,7 +50,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleBorderPadding.au3 b/Examples/_LOWriter_FrameStyleBorderPadding.au3 index 43df5ddc..30b92ba1 100644 --- a/Examples/_LOWriter_FrameStyleBorderPadding.au3 +++ b/Examples/_LOWriter_FrameStyleBorderPadding.au3 @@ -11,43 +11,43 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Set Frame style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameStyleBorderWidth($oFrameStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Border Padding Width settings to: 1/8" in all sides, and then 1/4" on the bottom. _LOWriter_FrameStyleBorderPadding($oFrameStyle, $iMicrometers, Null, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleBorderPadding($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Border Padding Width settings are as follows: " & @CRLF & _ "The ""All"" Border Padding Width is, in Micrometers, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -60,7 +60,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleBorderStyle.au3 b/Examples/_LOWriter_FrameStyleBorderStyle.au3 index 86fca493..b74dbd03 100644 --- a/Examples/_LOWriter_FrameStyleBorderStyle.au3 +++ b/Examples/_LOWriter_FrameStyleBorderStyle.au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Set Frame style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameStyleBorderWidth($oFrameStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Border Style settings to: Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP ; Left = $LOW_BORDERSTYLE_DOUBLE, Right = $LOW_BORDERSTYLE_DASHED _LOWriter_FrameStyleBorderStyle($oFrameStyle, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_DOUBLE, $LOW_BORDERSTYLE_DASHED) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleBorderStyle($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Border Style settings are as follows: " & @CRLF & _ "The Top Border Style is, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleBorderWidth.au3 b/Examples/_LOWriter_FrameStyleBorderWidth.au3 index 27714845..558ce83e 100644 --- a/Examples/_LOWriter_FrameStyleBorderWidth.au3 +++ b/Examples/_LOWriter_FrameStyleBorderWidth.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Set Frame style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_FrameStyleBorderWidth($oFrameStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleBorderWidth($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Border Width settings are as follows: " & @CRLF & _ "The Top Border Width is, in Micrometers, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleColumnSeparator.au3 b/Examples/_LOWriter_FrameStyleColumnSeparator.au3 index d3ceb1fb..aa73cc82 100644 --- a/Examples/_LOWriter_FrameStyleColumnSeparator.au3 +++ b/Examples/_LOWriter_FrameStyleColumnSeparator.au3 @@ -11,40 +11,40 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Column count to 4. _LOWriter_FrameStyleColumnSettings($oFrameStyle, 4) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/16" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.0625) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style Column Separator line settings to: Seperator on (True), Line Style = $LOW_LINE_STYLE_SOLID, Line width to 1/16" ; Line Color to $LOW_COLOR_RED, Height to 75%, Line Position to $LOW_ALIGN_VERT_MIDDLE _LOWriter_FrameStyleColumnSeparator($oFrameStyle, True, $LOW_LINE_STYLE_SOLID, $iMicrometers, $LOW_COLOR_RED, 75, $LOW_ALIGN_VERT_MIDDLE) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleColumnSeparator($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Column Seperator Line settings are as follows: " & @CRLF & _ "Is Column seperated by a line? True/False: " & $avSettings[0] & @CRLF & _ @@ -58,7 +58,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleColumnSettings.au3 b/Examples/_LOWriter_FrameStyleColumnSettings.au3 index 0704cdeb..49a6951d 100644 --- a/Examples/_LOWriter_FrameStyleColumnSettings.au3 +++ b/Examples/_LOWriter_FrameStyleColumnSettings.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Column count to 4. _LOWriter_FrameStyleColumnSettings($oFrameStyle, 4) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an Integer. $iColumns = _LOWriter_FrameStyleColumnSettings($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current number of columns is: " & $iColumns) @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleColumnSize.au3 b/Examples/_LOWriter_FrameStyleColumnSize.au3 index 1fab8a2f..9551bbb7 100644 --- a/Examples/_LOWriter_FrameStyleColumnSize.au3 +++ b/Examples/_LOWriter_FrameStyleColumnSize.au3 @@ -11,39 +11,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Column count to 4. _LOWriter_FrameStyleColumnSettings($oFrameStyle, 4) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style Column size settings for column 2, set auto width to True, and Global spacing to 1/4". _LOWriter_FrameStyleColumnSize($oFrameStyle, 2, True, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleColumnSize($oFrameStyle, 2) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avSettings[0] & @CRLF & _ @@ -56,11 +56,11 @@ Func Example() ; Set the Frame Style Column size settings for column 2, set auto width to False. _LOWriter_FrameStyleColumnSize($oFrameStyle, 2, False) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleColumnSize($oFrameStyle, 2) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's new Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avSettings[0] & @CRLF & _ @@ -74,7 +74,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleColumnSize[2].au3 b/Examples/_LOWriter_FrameStyleColumnSize[2].au3 index 5c49480e..c7cbb253 100644 --- a/Examples/_LOWriter_FrameStyleColumnSize[2].au3 +++ b/Examples/_LOWriter_FrameStyleColumnSize[2].au3 @@ -11,39 +11,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Column count to 4. _LOWriter_FrameStyleColumnSettings($oFrameStyle, 4) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style Column size settings for column 3, set auto width to False, and spacing for this specific column to 1/4" _LOWriter_FrameStyleColumnSize($oFrameStyle, 3, True, Null, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleColumnSize($oFrameStyle, 3) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avSettings[0] & @CRLF & _ @@ -57,7 +57,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleCreate.au3 b/Examples/_LOWriter_FrameStyleCreate.au3 index e9f05246..44e102d4 100644 --- a/Examples/_LOWriter_FrameStyleCreate.au3 +++ b/Examples/_LOWriter_FrameStyleCreate.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; See if a Frame Style called "Test Style" exists. $bReturn = _LOWriter_FrameStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a frame style called ""Test Style"" exist for this document? True/False: " & $bReturn) @@ -26,7 +26,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleDelete.au3 b/Examples/_LOWriter_FrameStyleDelete.au3 index 0a69a1b2..8b80fff3 100644 --- a/Examples/_LOWriter_FrameStyleDelete.au3 +++ b/Examples/_LOWriter_FrameStyleDelete.au3 @@ -10,41 +10,41 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert a Frame with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to insert a Text Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Text Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style to "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set the Text Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Text Frame style. Error:" & @error & " Extended:" & @extended) ; Set "Test Style" frame Style background color to $LOW_COLOR_RED _LOWriter_FrameStyleAreaColor($oFrameStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to set the Frame style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Frame style settings. Error:" & @error & " Extended:" & @extended) ; See if a Frame Style called "Test Style" exists. $bReturn = _LOWriter_FrameStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a frame style called ""Test Style"" exist for this document? True/False: " & $bReturn) ; Delete the newly created Frame Style, set Force delete to True, setting the replacement style to "Labels" _LOWriter_FrameStyleDelete($oDoc, $oFrameStyle, True, "Labels") - If (@error > 0) Then _ERROR("Failed to delete a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Frame Style. Error:" & @error & " Extended:" & @extended) ; See if a Frame Style called "Test Style" exists. $bReturn = _LOWriter_FrameStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a frame style called ""Test Style"" exist for this document? True/False: " & $bReturn) @@ -52,7 +52,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleExists.au3 b/Examples/_LOWriter_FrameStyleExists.au3 index 80e1f5c7..3cee34b0 100644 --- a/Examples/_LOWriter_FrameStyleExists.au3 +++ b/Examples/_LOWriter_FrameStyleExists.au3 @@ -10,11 +10,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; See if a Frame Style called "Labels" exists. $bReturn = _LOWriter_FrameStyleExists($oDoc, "Labels") - If (@error > 0) Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Frame Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a frame style called ""Labels"" exist for this document? True/False: " & $bReturn) @@ -22,7 +22,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleGetObj.au3 b/Examples/_LOWriter_FrameStyleGetObj.au3 index 68f2de58..9d6d8e66 100644 --- a/Examples/_LOWriter_FrameStyleGetObj.au3 +++ b/Examples/_LOWriter_FrameStyleGetObj.au3 @@ -9,35 +9,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert a Frame with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to insert a Text Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Text Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style to "Labels" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Labels") - If (@error > 0) Then _ERROR("Failed to set the Text Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Text Frame style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now retrieve the Labels Frame style object, and modify some of its settings.") ; Retrieve the "Labels" frame Style object. $oFrameStyle = _LOWriter_FrameStyleGetObj($oDoc, "Labels") - If (@error > 0) Then _ERROR("Failed to retrieve Frame style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame style object. Error:" & @error & " Extended:" & @extended) ; Set "Labels" frame Style background color to $LOW_COLOR_RED _LOWriter_FrameStyleAreaColor($oFrameStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to set the Frame style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Frame style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleOptions.au3 b/Examples/_LOWriter_FrameStyleOptions.au3 index 8474a3f6..12173f76 100644 --- a/Examples/_LOWriter_FrameStyleOptions.au3 +++ b/Examples/_LOWriter_FrameStyleOptions.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style options. Set Protect content to True, Protect Position to True, Protect size to True, Vertical alignment to ; $LOW_TXT_ADJ_VERT_CENTER, Edit in Read-Only to True, Print to False, Text direction to $LOW_TXT_DIR_TB_LR _LOWriter_FrameStyleOptions($oFrameStyle, True, True, True, $LOW_TXT_ADJ_VERT_CENTER, True, False, $LOW_TXT_DIR_TB_LR) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleOptions($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's option settings are as follows: " & @CRLF & _ "Protect the Frame's contents from changes? True/False: " & $avSettings[0] & @CRLF & _ @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleOrganizer.au3 b/Examples/_LOWriter_FrameStyleOrganizer.au3 index bfae3a7a..185712b0 100644 --- a/Examples/_LOWriter_FrameStyleOrganizer.au3 +++ b/Examples/_LOWriter_FrameStyleOrganizer.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Organizer settings. Change the name to "New Frame Name", set the parent style to "OLE", and auto update to True. _LOWriter_FrameStyleOrganizer($oDoc, $oFrameStyle, "New Frame Name", "OLE", True) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleOrganizer($oDoc, $oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's organizer settings are as follows: " & @CRLF & _ "The Frame Style's name is: " & $avSettings[0] & @CRLF & _ @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleSet.au3 b/Examples/_LOWriter_FrameStyleSet.au3 index 3420033b..93274d09 100644 --- a/Examples/_LOWriter_FrameStyleSet.au3 +++ b/Examples/_LOWriter_FrameStyleSet.au3 @@ -9,35 +9,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style Background Color to $LOW_COLOR_TEAL, Background color is transparent = False _LOWriter_FrameStyleAreaColor($oFrameStyle, $LOW_COLOR_TEAL, False) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now set the Frame's Frame style to my custom Frame Style with a Teal background.") ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleShadow.au3 b/Examples/_LOWriter_FrameStyleShadow.au3 index 6be4a9d2..7d93ce4b 100644 --- a/Examples/_LOWriter_FrameStyleShadow.au3 +++ b/Examples/_LOWriter_FrameStyleShadow.au3 @@ -11,35 +11,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style Shadow settings to: Width = 1/8", Color = $LOW_COLOR_RED, Transparent = False, Location = $LOW_SHADOW_TOP_LEFT _LOWriter_FrameStyleShadow($oFrameStyle, $iMicrometers, $LOW_COLOR_RED, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleShadow($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Shadow settings are as follows: " & @CRLF & _ "The shadow width is, is Micrometers: " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleTransparency.au3 b/Examples/_LOWriter_FrameStyleTransparency.au3 index c7f1c30e..4a49e2fd 100644 --- a/Examples/_LOWriter_FrameStyleTransparency.au3 +++ b/Examples/_LOWriter_FrameStyleTransparency.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Background Color settings. Background color = $LOW_COLOR_TEAL, Background color is transparent = False _LOWriter_FrameStyleAreaColor($oFrameStyle, $LOW_COLOR_TEAL, False) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Transparency settings to 55% transparent _LOWriter_FrameStyleTransparency($oFrameStyle, 55) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an integer. $iTransparency = _LOWriter_FrameStyleTransparency($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Transparecny percentage is: " & $iTransparency) @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleTransparencyGradient.au3 b/Examples/_LOWriter_FrameStyleTransparencyGradient.au3 index b6668553..eec4c3c6 100644 --- a/Examples/_LOWriter_FrameStyleTransparencyGradient.au3 +++ b/Examples/_LOWriter_FrameStyleTransparencyGradient.au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document for demonstration. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame's style to my created style, "Test Style" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Test Style") - If (@error > 0) Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Background Color settings. Background color = $LOW_COLOR_TEAL, Background color is transparent = False _LOWriter_FrameStyleAreaColor($oFrameStyle, $LOW_COLOR_TEAL, False) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Transparency Gradient settings to: Gradient Type = $LOW_GRAD_TYPE_ELLIPTICAL, XCenter to 75%, YCenter to 45%, Angle to 180 degrees ; Border to 16%, Start transparency to 10%, End Transparency to 62% _LOWriter_FrameStyleTransparencyGradient($oDoc, $oFrameStyle, $LOW_GRAD_TYPE_ELLIPTICAL, 75, 45, 180, 16, 10, 62) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleTransparencyGradient($oDoc, $oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's current Transparency Gradient settings are as follows: " & @CRLF & _ "The type of Gradient is, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -54,7 +54,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleTypePosition.au3 b/Examples/_LOWriter_FrameStyleTypePosition.au3 index f3aa085a..9649a21f 100644 --- a/Examples/_LOWriter_FrameStyleTypePosition.au3 +++ b/Examples/_LOWriter_FrameStyleTypePosition.au3 @@ -11,26 +11,26 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style position settings. Horizontal Alignment = $LOW_ORIENT_HORI_CENTER, Skip Horizontal position, ; Horizontal relation = $LOW_RELATIVE_PAGE, Mirror = True, Vertical align = $LOW_ORIENT_VERT_NONE, Vertical position = 1", ; Vertical relation = $LOW_RELATIVE_PAGE_PRINT, Keep inside = True, Anchor = $LOW_ANCHOR_AT_PAGE _LOWriter_FrameStyleTypePosition($oFrameStyle, $LOW_ORIENT_HORI_CENTER, Null, $LOW_RELATIVE_PAGE, True, $LOW_ORIENT_VERT_NONE, $iMicrometers, _ $LOW_RELATIVE_PAGE_PRINT, True, $LOW_ANCHOR_AT_PAGE) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleTypePosition($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's position settings are as follows: " & @CRLF & _ "The Frame style' Horizontal alignment setting is (see UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleTypeSize.au3 b/Examples/_LOWriter_FrameStyleTypeSize.au3 index bd5b6f7b..e18c8932 100644 --- a/Examples/_LOWriter_FrameStyleTypeSize.au3 +++ b/Examples/_LOWriter_FrameStyleTypeSize.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style Size settings. Skip Width, set relative width to 50%, Relative to = $LOW_RELATIVE_PARAGRAPH, ; AutoWidth = False, Skip height, Relative height = 70%, Relative to = $LOW_RELATIVE_PARAGRAPH, AutoHeight = False, Keep Ratio = False _LOWriter_FrameStyleTypeSize($oDoc, $oFrameStyle, Null, 50, $LOW_RELATIVE_PARAGRAPH, Null, Null, 70, $LOW_RELATIVE_PARAGRAPH, False, False) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleTypeSize($oDoc, $oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's size settings are as follows: " & @CRLF & _ "The Frame style width is, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleWrap.au3 b/Examples/_LOWriter_FrameStyleWrap.au3 index 8e9de0ac..2c50956a 100644 --- a/Examples/_LOWriter_FrameStyleWrap.au3 +++ b/Examples/_LOWriter_FrameStyleWrap.au3 @@ -11,27 +11,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style wrap type settings. Set wrap type to $LOW_WRAP_MODE_LEFT, Left and Right Spacing to 1/2", and Top and Bottom spacing to 1" _LOWriter_FrameStyleWrap($oFrameStyle, $LOW_WRAP_MODE_LEFT, $iMicrometers, $iMicrometers, $iMicrometers2, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleWrap($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's wrap settings are as follows: " & @CRLF & _ "The Wrap style is, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStyleWrapOptions.au3 b/Examples/_LOWriter_FrameStyleWrapOptions.au3 index 1a79546b..981f2abc 100644 --- a/Examples/_LOWriter_FrameStyleWrapOptions.au3 +++ b/Examples/_LOWriter_FrameStyleWrapOptions.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" $oFrameStyle = _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Style wrap option settings. First Paragraph = True, Skip InBackground,, Allow overlap = False _LOWriter_FrameStyleWrapOptions($oFrameStyle, True, Null, False) - If (@error > 0) Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameStyleWrapOptions($oFrameStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame style's wrap option settings are as follows: " & @CRLF & _ "Create a new paragrpah below the frame? True/False: " & $avSettings[0] & @CRLF & _ @@ -33,7 +33,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameStylesGetNames.au3 b/Examples/_LOWriter_FrameStylesGetNames.au3 index c43a2684..8baf416e 100644 --- a/Examples/_LOWriter_FrameStylesGetNames.au3 +++ b/Examples/_LOWriter_FrameStylesGetNames.au3 @@ -10,101 +10,101 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new FrameStyle named "Test Style" _LOWriter_FrameStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert a Frame with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to insert a Text Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a Text Frame. Error:" & @error & " Extended:" & @extended) ; Set the Frame Style to "Labels" _LOWriter_FrameStyleSet($oDoc, $oFrame, "Labels") - If (@error > 0) Then _ERROR("Failed to set the Text Frame style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Text Frame style. Error:" & @error & " Extended:" & @extended) ; Retrieve an Array of all available Frame Style Names. $asNames = _LOWriter_FrameStylesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve Frame style list. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame style list. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of all available Frame styles. There are " & @extended & " results.") ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The available Frame Styles in this document are:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asNames) -1 ; Insert the Frame Style names. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asNames[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next ; Retrieve an Array of all user-created Frame Style Names. $asNames = _LOWriter_FrameStylesGetNames($oDoc, True) - If (@error > 0) Then _ERROR("Failed to retrieve Frame style list. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame style list. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of all user-created Frame styles. There are " & @extended & " results.") ; Move the View Cursor to the end of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_End) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the right once, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Frame Styles that are user-created are:" & @CR & @CR,True) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asNames) -1 ; Insert the Frame Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asNames[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next ; Retrieve an Array of all applied Frame Style Names. $asNames = _LOWriter_FrameStylesGetNames($oDoc, False, True) - If (@error > 0) Then _ERROR("Failed to retrieve Frame style list. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame style list. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of all Frame styles used in this document. There are " & @extended & " results.") ; Move the View Cursor to the end of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_End) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the right once, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Frame Styles currently in use in this document are:" & @CR & @CR,True) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asNames) -1 ; Insert the Frame Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asNames[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameTransparency.au3 b/Examples/_LOWriter_FrameTransparency.au3 index 02fe609f..b2b22ee0 100644 --- a/Examples/_LOWriter_FrameTransparency.au3 +++ b/Examples/_LOWriter_FrameTransparency.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Background Color settings. Background color = $LOW_COLOR_TEAL, Background color is transparent = False _LOWriter_FrameAreaColor($oFrame, $LOW_COLOR_TEAL, False) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Transparency settings to 55% transparent _LOWriter_FrameTransparency($oFrame, 55) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame Transparency. Return will be an Integer. $iTransparency = _LOWriter_FrameTransparency($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's current Transparecny percentage is: " & $iTransparency) @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameTransparencyGradient.au3 b/Examples/_LOWriter_FrameTransparencyGradient.au3 index 05568cef..f2bab270 100644 --- a/Examples/_LOWriter_FrameTransparencyGradient.au3 +++ b/Examples/_LOWriter_FrameTransparencyGradient.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Background Color settings. Background color = $LOW_COLOR_TEAL, Background color is transparent = False _LOWriter_FrameAreaColor($oFrame, $LOW_COLOR_TEAL, False) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Transparency Gradient settings to: Gradient Type = $LOW_GRAD_TYPE_ELLIPTICAL, XCenter to 75%, YCenter to 45%, Angle to 180 degrees ; Border to 16%, Start transparency to 10%, End Transparency to 62% _LOWriter_FrameTransparencyGradient($oDoc, $oFrame, $LOW_GRAD_TYPE_ELLIPTICAL, 75, 45, 180, 16, 10, 62) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameTransparencyGradient($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's Transparency Gradient settings are as follows: " & @CRLF & _ "The type of Gradient is, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameTypePosition.au3 b/Examples/_LOWriter_FrameTypePosition.au3 index 0f726ccf..2f389549 100644 --- a/Examples/_LOWriter_FrameTypePosition.au3 +++ b/Examples/_LOWriter_FrameTypePosition.au3 @@ -11,30 +11,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the Frame position settings. Horizontal Alignment = $LOW_ORIENT_HORI_CENTER, Skip Horizontal position, ; Horizontal relation = $LOW_RELATIVE_PAGE, Mirror = True, Vertical align = $LOW_ORIENT_VERT_NONE, Vertical position = 1", ; Vertical relation = $LOW_RELATIVE_PAGE_PRINT, Keep inside = True, Anchor = $LOW_ANCHOR_AT_PAGE _LOWriter_FrameTypePosition($oFrame, $LOW_ORIENT_HORI_CENTER, Null, $LOW_RELATIVE_PAGE, True, $LOW_ORIENT_VERT_NONE, $iMicrometers, _ $LOW_RELATIVE_PAGE_PRINT, True, $LOW_ANCHOR_AT_PAGE) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameTypePosition($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's position settings are as follows: " & @CRLF & _ "The Frame style' Horizontal alignment setting is (see UDF Constants): " & $avSettings[0] & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameTypeSize.au3 b/Examples/_LOWriter_FrameTypeSize.au3 index 08dfe240..a5e8fc12 100644 --- a/Examples/_LOWriter_FrameTypeSize.au3 +++ b/Examples/_LOWriter_FrameTypeSize.au3 @@ -10,24 +10,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame Size settings. Skip Width, set relative width to 50%, Relative to = $LOW_RELATIVE_PARAGRAPH, ; AutoWidth = False, Skip height, Relative height = 70%, Relative to = $LOW_RELATIVE_PARAGRAPH, AutoHeight = False, Keep Ratio = False _LOWriter_FrameTypeSize($oDoc, $oFrame, Null, 50, $LOW_RELATIVE_PARAGRAPH, Null, Null, 70, $LOW_RELATIVE_PARAGRAPH, False, False) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameTypeSize($oDoc, $oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's size settings are as follows: " & @CRLF & _ "The Frame style width is, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameWrap.au3 b/Examples/_LOWriter_FrameWrap.au3 index 38cde478..72897bfd 100644 --- a/Examples/_LOWriter_FrameWrap.au3 +++ b/Examples/_LOWriter_FrameWrap.au3 @@ -11,31 +11,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the Frame wrap type settings. Set wrap type to $LOW_WRAP_MODE_LEFT, Left and Right Spacing to 1/2", and Top and Bottom spacing to 1" _LOWriter_FrameWrap($oFrame, $LOW_WRAP_MODE_LEFT, $iMicrometers, $iMicrometers, $iMicrometers2, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameWrap($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's wrap settings are as follows: " & @CRLF & _ "The Wrap style is, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -48,7 +48,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FrameWrapOptions.au3 b/Examples/_LOWriter_FrameWrapOptions.au3 index cce1a3e2..ec3ae7ec 100644 --- a/Examples/_LOWriter_FrameWrapOptions.au3 +++ b/Examples/_LOWriter_FrameWrapOptions.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document at the Viewcursor position, and 3000x3000 Micrometers wide. $oFrame = _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Modify the Frame wrap option settings. First Paragraph = True, Skip InBackground, Allow overlap = False _LOWriter_FrameWrapOptions($oFrame, True, Null, False) - If (@error > 0) Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Frame settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Frame settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_FrameWrapOptions($oFrame) - If (@error > 0) Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Frame settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Frame's wrap option settings are as follows: " & @CRLF & _ "Create a new paragrpah below the frame? True/False: " & $avSettings[0] & @CRLF & _ @@ -37,7 +37,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_FramesGetNames.au3 b/Examples/_LOWriter_FramesGetNames.au3 index d8e2510b..fa866904 100644 --- a/Examples/_LOWriter_FramesGetNames.au3 +++ b/Examples/_LOWriter_FramesGetNames.au3 @@ -10,35 +10,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document. _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Frame names currently in the document. $asFrames = _LOWriter_FramesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve a list of Frames. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve a list of Frames. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The document's Frame names are:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asFrames) -1 ; Insert the Frame names. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asFrames[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleCreate.au3 b/Examples/_LOWriter_NumStyleCreate.au3 index ab2577a3..d0ece2d3 100644 --- a/Examples/_LOWriter_NumStyleCreate.au3 +++ b/Examples/_LOWriter_NumStyleCreate.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new NumberingStyle named "Test Style" _LOWriter_NumStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) ; See if a Numbering Style called "Test Style" exists. $bReturn = _LOWriter_NumStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Numbering style called ""Test Style"" exist for this document? True/False: " & $bReturn) @@ -26,7 +26,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleCustomize.au3 b/Examples/_LOWriter_NumStyleCustomize.au3 index 3e795689..ba731255 100644 --- a/Examples/_LOWriter_NumStyleCustomize.au3 +++ b/Examples/_LOWriter_NumStyleCustomize.au3 @@ -10,49 +10,49 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new NumberingStyle named "Test Style" $oNumStyle = _LOWriter_NumStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style at the View Cursor to the new style. _LOWriter_NumStyleSet($oDoc, $oViewCursor, "Test Style") - If (@error > 0) Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Line 1" & @LF & "Line 1.1" & @LF & "Line 1.2" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 2. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 2) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 2" & @LF & "Line 2.1" & @LF & "Line 2.2" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 3. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 3) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Line 3" & @LF & "Line 3.1" & @LF & "Line 3.2") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Modify the Numbering Style Customization settings: Modify Level 2, Numbering format = $LOW_NUM_STYLE_ARABIC, Start at 3, Char Style = "Emphasis", ; Sub levels = 2, Seperator before = ~ , Seperator after = #, Consecutive Num = False. _LOWriter_NumStyleCustomize($oDoc, $oNumStyle, 2, $LOW_NUM_STYLE_ARABIC, 4, "Emphasis", 2, "~", "#", False) - If (@error > 0) Then _ERROR("Failed to set Numbering Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Numbering Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Numbering Style settings for level 2. Return will be an array in order of function parameters, Return will only have ; seven elements, because Numbering Style is not set to special, so there will not be a Bullet or Char Decimal value. $avSettings = _LOWriter_NumStyleCustomize($oDoc, $oNumStyle, 2) - If (@error > 0) Then _ERROR("Failed to retrieve Numbering Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Numbering Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Numbering style's current Customization settings for level 2 are as follows: " & @CRLF & _ "The Number format used is, (see UDF constants): " & $avSettings[0] & @CRLF & _ @@ -67,7 +67,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleDelete.au3 b/Examples/_LOWriter_NumStyleDelete.au3 index ac41aaa2..136cd1a9 100644 --- a/Examples/_LOWriter_NumStyleDelete.au3 +++ b/Examples/_LOWriter_NumStyleDelete.au3 @@ -10,26 +10,26 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new NumberingStyle named "Test Style" $oNumStyle = _LOWriter_NumStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) ; See if a Numbering Style called "Test Style" exists. $bReturn = _LOWriter_NumStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Numbering style called ""Test Style"" exist for this document? True/False: " & $bReturn & @CRLF & @CRLF & _ "Press Ok to delete the newly created Numbering Style.") ; Delete the newly created Numbering Style. _LOWriter_NumStyleDelete($oDoc, $oNumStyle) - If (@error > 0) Then _ERROR("Failed to delete a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Numbering Style. Error:" & @error & " Extended:" & @extended) ; See if a Numbering Style called "Test Style" exists. $bReturn = _LOWriter_NumStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Numbering style called ""Test Style"" exist for this document? True/False: " & $bReturn) @@ -37,7 +37,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleExists.au3 b/Examples/_LOWriter_NumStyleExists.au3 index d4745259..20535936 100644 --- a/Examples/_LOWriter_NumStyleExists.au3 +++ b/Examples/_LOWriter_NumStyleExists.au3 @@ -10,21 +10,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Numbering Style to use for demonstration. _LOWriter_NumStyleCreate($oDoc, "NewNumberingStyle") - If (@error > 0) Then _ERROR("Failed to Create a new Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Numbering Style. Error:" & @error & " Extended:" & @extended) ; Check if the Numbering style exists. $bExists = _LOWriter_NumStyleExists($oDoc, "NewNumberingStyle") - If (@error > 0) Then _ERROR("Failed to test for Numbering Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Numbering Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Numbering style called ""NewNumberingStyle"" exist in the document? True/False: " & $bExists) ; Check if a fake Numbering style exists. $bExists = _LOWriter_NumStyleExists($oDoc, "FakeNumberingStyle") - If (@error > 0) Then _ERROR("Failed to test for Numbering Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Numbering Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Numbering style called ""FakeNumberingStyle"" exist in the document? True/False: " & $bExists) @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleGetObj.au3 b/Examples/_LOWriter_NumStyleGetObj.au3 index b9b9be16..a4ea912a 100644 --- a/Examples/_LOWriter_NumStyleGetObj.au3 +++ b/Examples/_LOWriter_NumStyleGetObj.au3 @@ -10,30 +10,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new NumberingStyle named "Test Style" _LOWriter_NumStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) ; See if a Numbering Style called "Test Style" exists. $bReturn = _LOWriter_NumStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Numbering style called ""Test Style"" exist for this document? True/False: " & $bReturn & @CRLF & @CRLF & _ "Press Ok to retrieve the Numbering Style's Object and then delete the Numbering Style.") ; Retrieve the "Test Style" Numbering Style object. $oNumStyle = _LOWriter_NumStyleGetObj($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to retrieve Numbering style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Numbering style object. Error:" & @error & " Extended:" & @extended) ; Delete the newly created Numbering Style. _LOWriter_NumStyleDelete($oDoc, $oNumStyle) - If (@error > 0) Then _ERROR("Failed to delete a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a Numbering Style. Error:" & @error & " Extended:" & @extended) ; See if a Numbering Style called "Test Style" exists. $bReturn = _LOWriter_NumStyleExists($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to query for Numbering Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Numbering style called ""Test Style"" exist for this document? True/False: " & $bReturn) @@ -41,7 +41,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleOrganizer.au3 b/Examples/_LOWriter_NumStyleOrganizer.au3 index 67636ac5..28108cd5 100644 --- a/Examples/_LOWriter_NumStyleOrganizer.au3 +++ b/Examples/_LOWriter_NumStyleOrganizer.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new NumberingStyle named "Test Style" $oNumbStyle = _LOWriter_NumStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) ; Modify the Numbering Style Organizer settings. Change the name to "New Numbering Name", and hidden to False _LOWriter_NumStyleOrganizer($oDoc, $oNumbStyle, "New Numbering Name", False) - If (@error > 0) Then _ERROR("Failed to set Numbering Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Numbering Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Numbering Style settings. Return will be an array in order of function parameters. $avSettings = _LOWriter_NumStyleOrganizer($oDoc, $oNumbStyle) - If (@error > 0) Then _ERROR("Failed to retrieve Numbering Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Numbering Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Numbering style's organizer settings are as follows: " & @CRLF & _ "The Numbering Style's name is: " & $avSettings[0] & @CRLF & _ @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStylePosition.au3 b/Examples/_LOWriter_NumStylePosition.au3 index d2efe9d5..788ff742 100644 --- a/Examples/_LOWriter_NumStylePosition.au3 +++ b/Examples/_LOWriter_NumStylePosition.au3 @@ -11,45 +11,45 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new NumberingStyle named "Test Style" $oNumStyle = _LOWriter_NumStyleCreate($oDoc, "Test Style") - If (@error > 0) Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Numbering Style. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style at the View Cursor to the new style. _LOWriter_NumStyleSet($oDoc, $oViewCursor, "Test Style") - If (@error > 0) Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Line 1" & @LF & "Line 1.1" & @LF & "Line 1.2" & @CR & _ "Line 2" & @LF & "Line 2.1" & @LF & "Line 2.2" & @CR & "Line 3" & @LF & "Line 3.1" & @LF & "Line 3.2") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 3/4" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.75) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers3 = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the Numbering Style position settings: Modify all Levels (0), Aligned at = 1/2", Numbering Align = $LOW_ORIENT_HORI_CENTER, ; Followed by = $LOW_FOLLOW_BY_TABSTOP, TabStop = 3/4", Indent = 1" _LOWriter_NumStylePosition($oDoc, $oNumStyle, 0, $iMicrometers, $LOW_ORIENT_HORI_CENTER, $LOW_FOLLOW_BY_TABSTOP, $iMicrometers2, $iMicrometers3) - If (@error > 0) Then _ERROR("Failed to set Numbering Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Numbering Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current Numbering Style settings for level 2. Return will be an array in order of function parameters. $avSettings = _LOWriter_NumStylePosition($oDoc, $oNumStyle, 2) - If (@error > 0) Then _ERROR("Failed to retrieve Numbering Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Numbering Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Numbering style's current Position settings for level 2 are as follows: " & @CRLF & _ "The First line indent is, in Micrometers: " & $avSettings[0] & @CRLF & _ @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleSet.au3 b/Examples/_LOWriter_NumStyleSet.au3 index e4cbc9d3..0f14ae35 100644 --- a/Examples/_LOWriter_NumStyleSet.au3 +++ b/Examples/_LOWriter_NumStyleSet.au3 @@ -9,23 +9,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now set the current numbering style to ""Numbering 123.""") ; Set the numbering style to Numbering 123 using the ViewCursor. _LOWriter_NumStyleSet($oDoc, $oViewCursor, "Numbering 123") - If (@error > 0) Then _ERROR("Failed to set the Numbering style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleSetLevel.au3 b/Examples/_LOWriter_NumStyleSetLevel.au3 index 2f52937e..9407dc6d 100644 --- a/Examples/_LOWriter_NumStyleSetLevel.au3 +++ b/Examples/_LOWriter_NumStyleSetLevel.au3 @@ -9,109 +9,109 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style at the View Cursor to Numbering 123. _LOWriter_NumStyleSet($oDoc, $oViewCursor, "Numbering 123") - If (@error > 0) Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press Ok to insert 5 lines and set each to a different level of Numbering.") ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 1" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 2. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 2) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 2" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 3. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 3) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 3" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 4. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 4) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 4" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 5. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 5) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 5" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I could also insert the text first and then set the level.") ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 6") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 6. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 6) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "Level 7") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 7. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 7) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "Level 8") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 8. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 8) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "Level 9") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 9. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 9) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "Level 10") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 10. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 10) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR & "Level 3 again") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style Level for This Paragraph to 3. _LOWriter_NumStyleSetLevel($oDoc, $oViewCursor, 3) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStyleSetLevel[2].au3 b/Examples/_LOWriter_NumStyleSetLevel[2].au3 index 1be667a7..00bd9d8b 100644 --- a/Examples/_LOWriter_NumStyleSetLevel[2].au3 +++ b/Examples/_LOWriter_NumStyleSetLevel[2].au3 @@ -10,75 +10,75 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Set the Numbering Style at the View Cursor to Numbering 123. _LOWriter_NumStyleSet($oDoc, $oViewCursor, "Numbering 123") - If (@error > 0) Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Set the Numbering Style. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 1" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 2" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 3" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 4" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 5" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 6" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 7" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 8" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 9" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Level 10") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now I will retrieve Paragraph Objects for all of these paragraphs and set the Numbering level using a For Next loop.") ; Retrieve Array of Paragraph Objects. $aoPars = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph Objects. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph Objects. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($aoPars) - 1 $oPar = $aoPars[$i] ; Set the Numbering Style Level for This Paragraph to 2. _LOWriter_NumStyleSetLevel($oDoc, $oPar, $i + 1) - If (@error > 0) Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Numbering Style level. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_NumStylesGetNames.au3 b/Examples/_LOWriter_NumStylesGetNames.au3 index 81f4a6e9..456a57e9 100644 --- a/Examples/_LOWriter_NumStylesGetNames.au3 +++ b/Examples/_LOWriter_NumStylesGetNames.au3 @@ -10,57 +10,57 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Numbering Style names. $asNumStyles = _LOWriter_NumStylesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve array of Numbering style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Numbering style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of available Numbering styles. There are " & @extended & " results.") ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The available Numbering Styles in this document are:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asNumStyles) -1 ; Insert the Numbering Style names. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asNumStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next ; Retrieve Array of Numbering Style names that are applied to the document $asNumStyles = _LOWriter_NumStylesGetNames($oDoc, False, True) - If (@error > 0) Then _ERROR("Failed to retrieve array of Numbering style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Numbering style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of used Numbering styles, if any. There are " & @extended & " results.") ; Move the View Cursor to the end of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_End) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Numbering Styles currently in use in this document are:" & @CR & @CR,True) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asNumStyles) -1 ; Insert the Numbering Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asNumStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleAreaColor.au3 b/Examples/_LOWriter_PageStyleAreaColor.au3 index 1fc12aff..c68bab04 100644 --- a/Examples/_LOWriter_PageStyleAreaColor.au3 +++ b/Examples/_LOWriter_PageStyleAreaColor.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Background color to $LOW_COLOR_LIME, Background color transparent = False _LOWriter_PageStyleAreaColor($oPageStyle, $LOW_COLOR_LIME, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleAreaColor($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Background color settings are as follows: " & @CRLF & _ "The Background color is, in Long Color format: " & $avPageStyleSettings[0] & @CRLF & _ @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleAreaGradient.au3 b/Examples/_LOWriter_PageStyleAreaGradient.au3 index adeddf7b..b591c13a 100644 --- a/Examples/_LOWriter_PageStyleAreaGradient.au3 +++ b/Examples/_LOWriter_PageStyleAreaGradient.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Gradient settings to: Preset Gradient name = $LOW_GRAD_NAME_TEAL_TO_BLUE _LOWriter_PageStyleAreaGradient($oDoc, $oPageStyle, $LOW_GRAD_NAME_TEAL_TO_BLUE) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleAreaGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -41,7 +41,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleAreaGradient[2].au3 b/Examples/_LOWriter_PageStyleAreaGradient[2].au3 index 7d854cd3..f9539765 100644 --- a/Examples/_LOWriter_PageStyleAreaGradient[2].au3 +++ b/Examples/_LOWriter_PageStyleAreaGradient[2].au3 @@ -10,21 +10,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Gradient settings to: skip pre-set gradient name,, Gradient type = $LOW_GRAD_TYPE_SQUARE, increment steps = 150, ; horizontal (X) offset = 25%, vertical offset (Y) = 56%, rotational angle = 135 degrees, percentage not covered by "From" color = 50% ; Starting color = $LOW_COLOR_ORANGE, Ending color = $LOW_COLOR_TEAL,Starting color intensity = 100%, ending color intensity = 68% _LOWriter_PageStyleAreaGradient($oDoc, $oPageStyle, Null, $LOW_GRAD_TYPE_SQUARE, 150, 25, 56, 135, 50, $LOW_COLOR_ORANGE, $LOW_COLOR_TEAL, 100, 68) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleAreaGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleBorderColor.au3 b/Examples/_LOWriter_PageStyleBorderColor.au3 index 067ec0fc..4d8f6cd1 100644 --- a/Examples/_LOWriter_PageStyleBorderColor.au3 +++ b/Examples/_LOWriter_PageStyleBorderColor.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Border Width (all four sides) to $LOW_BORDERWIDTH_MEDIUM _LOWriter_PageStyleBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Border Color settings to: Top, $LOW_COLOR_ORANGE, Bottom $LOW_COLOR_BLUE, Left, $LOW_COLOR_LGRAY, Right $LOW_COLOR_BLACK _LOWriter_PageStyleBorderColor($oPageStyle, $LOW_COLOR_ORANGE, $LOW_COLOR_BLUE, $LOW_COLOR_LGRAY, $LOW_COLOR_BLACK) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleBorderColor($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Border Color settings are as follows: " & @CRLF & _ "The Top Border Color is, in Long Color Format: " & $avPageStyleSettings[0] & @CRLF & _ @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleBorderPadding.au3 b/Examples/_LOWriter_PageStyleBorderPadding.au3 index 3ce8c145..ee7c638e 100644 --- a/Examples/_LOWriter_PageStyleBorderPadding.au3 +++ b/Examples/_LOWriter_PageStyleBorderPadding.au3 @@ -11,31 +11,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Border Padding Width settings to: 1/8" in all sides, and then 1/4" on the bottom. _LOWriter_PageStyleBorderPadding($oPageStyle, $iMicrometers, Null, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleBorderPadding($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Border Padding Width settings are as follows: " & @CRLF & _ "The ""All"" Border Padding Width is, in Micrometers, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -48,7 +48,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleBorderStyle.au3 b/Examples/_LOWriter_PageStyleBorderStyle.au3 index ceb3b986..06607fed 100644 --- a/Examples/_LOWriter_PageStyleBorderStyle.au3 +++ b/Examples/_LOWriter_PageStyleBorderStyle.au3 @@ -10,24 +10,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Border Width (all four sides) to $LOW_BORDERWIDTH_MEDIUM _LOWriter_PageStyleBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Border Style settings to: Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP ; Left = $LOW_BORDERSTYLE_DOUBLE, Right = $LOW_BORDERSTYLE_DASHED _LOWriter_PageStyleBorderStyle($oPageStyle, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_DOUBLE, $LOW_BORDERSTYLE_DASHED) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleBorderStyle($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Border Style settings are as follows: " & @CRLF & _ "The Top Border Style is, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -39,7 +39,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleBorderWidth.au3 b/Examples/_LOWriter_PageStyleBorderWidth.au3 index acdc343d..9a60fc14 100644 --- a/Examples/_LOWriter_PageStyleBorderWidth.au3 +++ b/Examples/_LOWriter_PageStyleBorderWidth.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleBorderWidth($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Border Width settings are as follows: " & @CRLF & _ "The Top Border Width is, in Micrometers, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleColumnSeparator.au3 b/Examples/_LOWriter_PageStyleColumnSeparator.au3 index 05de1f2b..65b6a351 100644 --- a/Examples/_LOWriter_PageStyleColumnSeparator.au3 +++ b/Examples/_LOWriter_PageStyleColumnSeparator.au3 @@ -11,28 +11,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/16" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.0625) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Column count to 4. _LOWriter_PageStyleColumnSettings($oPageStyle, 4) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Column Separator line settings to: Seperator on (True), Line Style = $LOW_LINE_STYLE_SOLID, Line width to 1/16" ; Line Color to $LOW_COLOR_RED, Height to 75%, Line Position to $LOW_ALIGN_VERT_MIDDLE _LOWriter_PageStyleColumnSeparator($oPageStyle, True, $LOW_LINE_STYLE_SOLID, $iMicrometers, $LOW_COLOR_RED, 75, $LOW_ALIGN_VERT_MIDDLE) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleColumnSeparator($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Column Seperator Line settings are as follows: " & @CRLF & _ "Is Column seperated by a line? True/False: " & $avPageStyleSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleColumnSettings.au3 b/Examples/_LOWriter_PageStyleColumnSettings.au3 index fea1fa40..09337351 100644 --- a/Examples/_LOWriter_PageStyleColumnSettings.au3 +++ b/Examples/_LOWriter_PageStyleColumnSettings.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Column count to 4. _LOWriter_PageStyleColumnSettings($oPageStyle, 4) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an integer. $iColumns = _LOWriter_PageStyleColumnSettings($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current number of columns is: " & $iColumns) @@ -30,7 +30,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleColumnSize.au3 b/Examples/_LOWriter_PageStyleColumnSize.au3 index 9f3fede1..eaa9f5ce 100644 --- a/Examples/_LOWriter_PageStyleColumnSize.au3 +++ b/Examples/_LOWriter_PageStyleColumnSize.au3 @@ -11,27 +11,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Column count to 4. _LOWriter_PageStyleColumnSettings($oPageStyle, 4) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Column size settings for column 2, set auto width to True, and Global spacing to 1/4". _LOWriter_PageStyleColumnSize($oPageStyle, 2, True, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleColumnSize($oPageStyle, 2) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avPageStyleSettings[0] & @CRLF & _ @@ -44,11 +44,11 @@ Func Example() ; Set Page style Column size settings for column 2, set auto width to False. _LOWriter_PageStyleColumnSize($oPageStyle, 2, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleColumnSize($oPageStyle, 2) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's new Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avPageStyleSettings[0] & @CRLF & _ @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleColumnSize[2].au3 b/Examples/_LOWriter_PageStyleColumnSize[2].au3 index 996c15af..4c0adf8a 100644 --- a/Examples/_LOWriter_PageStyleColumnSize[2].au3 +++ b/Examples/_LOWriter_PageStyleColumnSize[2].au3 @@ -11,27 +11,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Column count to 4. _LOWriter_PageStyleColumnSettings($oPageStyle, 4) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Column size settings for column 3, set auto width to False, and spacing for this specific column to 1/4" _LOWriter_PageStyleColumnSize($oPageStyle, 3, True, Null, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleColumnSize($oPageStyle, 3) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Column size settings are as follows: " & @CRLF & _ "Is Column width automatically adjusted? True/False: " & $avPageStyleSettings[0] & @CRLF & _ @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleCreate.au3 b/Examples/_LOWriter_PageStyleCreate.au3 index 1f5191ec..bf47dac3 100644 --- a/Examples/_LOWriter_PageStyleCreate.au3 +++ b/Examples/_LOWriter_PageStyleCreate.au3 @@ -10,7 +10,7 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sPageStyleName = "NewPageStyle" @@ -19,7 +19,7 @@ Func Example() ; Create a New Page Style. _LOWriter_PageStyleCreate($oDoc, $sPageStyleName) - If (@error > 0) Then _ERROR("Failed to create a new Page Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a new Page Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now does a Page Style Named """ & $sPageStyleName & """exist in the document? True/False: " & _ _LOWriter_PageStyleExists($oDoc, $sPageStyleName)) @@ -28,7 +28,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleDelete.au3 b/Examples/_LOWriter_PageStyleDelete.au3 index e9259d00..63e3b115 100644 --- a/Examples/_LOWriter_PageStyleDelete.au3 +++ b/Examples/_LOWriter_PageStyleDelete.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) $sPageStyleName = "NewPageStyle" ; Create a New Page Style. $oPageStyle = _LOWriter_PageStyleCreate($oDoc, $sPageStyleName) - If (@error > 0) Then _ERROR("Failed to create a new Page Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a new Page Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Page Style Named """ & $sPageStyleName & """ exist in the document? True/False: " & _ _LOWriter_PageStyleExists($oDoc, $sPageStyleName)) ; Delete the Page Style _LOWriter_PageStyleDelete($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to delete the Page Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete the Page Style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Now does a Page Style Named """ & $sPageStyleName & """exist in the document? True/False: " & _ _LOWriter_PageStyleExists($oDoc, $sPageStyleName)) @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleExists.au3 b/Examples/_LOWriter_PageStyleExists.au3 index 12345d9c..a74eef58 100644 --- a/Examples/_LOWriter_PageStyleExists.au3 +++ b/Examples/_LOWriter_PageStyleExists.au3 @@ -10,21 +10,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Page Style to use for demonstration. _LOWriter_PageStyleCreate($oDoc, "NewPageStyle") - If (@error > 0) Then _ERROR("Failed to Create a new Page Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Page Style. Error:" & @error & " Extended:" & @extended) ; Check if the page style exists. $bExists = _LOWriter_PageStyleExists($oDoc, "NewPageStyle") - If (@error > 0) Then _ERROR("Failed to test for Page Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Page Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Page style called ""NewPageStyle"" exist in the document? True/False: " & $bExists) ; Check if a fake page style exists. $bExists = _LOWriter_PageStyleExists($oDoc, "FakePageStyle") - If (@error > 0) Then _ERROR("Failed to test for Page Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Page Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Page style called ""FakePageStyle"" exist in the document? True/False: " & $bExists) @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooter.au3 b/Examples/_LOWriter_PageStyleFooter.au3 index 0061e8d9..3aeb28e1 100644 --- a/Examples/_LOWriter_PageStyleFooter.au3 +++ b/Examples/_LOWriter_PageStyleFooter.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer settings to: Footer on = True, Same content on left and right pages = False, Same content on the first page = Ture, ; Left & Right margins = 1/4", Spacing between Footer content and Page content = 1/2", Dynamic spacing = False, Skip Height and set AutoHeight to True. _LOWriter_PageStyleFooter($oPageStyle, True, False, True, $iMicrometers, $iMicrometers, $iMicrometers2, False, Null, True) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooter($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer settings are as follows: " & @CRLF & _ "Is the Footer on for this PageStyle? True/False: " & $avPageStyleSettings[0] & @CRLF & _ @@ -53,7 +53,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterAreaColor.au3 b/Examples/_LOWriter_PageStyleFooterAreaColor.au3 index 9f8c05e0..397e774a 100644 --- a/Examples/_LOWriter_PageStyleFooterAreaColor.au3 +++ b/Examples/_LOWriter_PageStyleFooterAreaColor.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Background color to $LOW_COLOR_LIME, Background color transparent = False _LOWriter_PageStyleFooterAreaColor($oPageStyle, $LOW_COLOR_LIME, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterAreaColor($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Background color settings are as follows: " & @CRLF & _ "The Background color is, in Long Color format: " & $avPageStyleSettings[0] & @CRLF & _ @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterAreaGradient.au3 b/Examples/_LOWriter_PageStyleFooterAreaGradient.au3 index def013ff..8574ae89 100644 --- a/Examples/_LOWriter_PageStyleFooterAreaGradient.au3 +++ b/Examples/_LOWriter_PageStyleFooterAreaGradient.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Gradient settings to: Preset Gradient name = $LOW_GRAD_NAME_TEAL_TO_BLUE _LOWriter_PageStyleFooterAreaGradient($oDoc, $oPageStyle, $LOW_GRAD_NAME_TEAL_TO_BLUE) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterAreaGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterAreaGradient[2].au3 b/Examples/_LOWriter_PageStyleFooterAreaGradient[2].au3 index 388cdf92..7970c9d6 100644 --- a/Examples/_LOWriter_PageStyleFooterAreaGradient[2].au3 +++ b/Examples/_LOWriter_PageStyleFooterAreaGradient[2].au3 @@ -10,25 +10,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Gradient settings to: skip pre-set gradient name,, Gradient type = $LOW_GRAD_TYPE_SQUARE, increment steps = 150, ; horizontal (X) offset = 25%, vertical offset (Y) = 56%, rotational angle = 135 degrees, percentage not covered by "From" color = 50% ; Starting color = $LOW_COLOR_ORANGE, Ending color = $LOW_COLOR_TEAL,Starting color intensity = 100%, ending color intensity = 68% _LOWriter_PageStyleFooterAreaGradient($oDoc, $oPageStyle, Null, $LOW_GRAD_TYPE_SQUARE, 150, 25, 56, 135, 50, $LOW_COLOR_ORANGE, $LOW_COLOR_TEAL, 100, 68) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterAreaGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterBorderColor.au3 b/Examples/_LOWriter_PageStyleFooterBorderColor.au3 index b7e1dfae..43682ced 100644 --- a/Examples/_LOWriter_PageStyleFooterBorderColor.au3 +++ b/Examples/_LOWriter_PageStyleFooterBorderColor.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Footer Border Width (all four sides) to $LOW_BORDERWIDTH_MEDIUM _LOWriter_PageStyleFooterBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Border Color settings to: Top, $LOW_COLOR_ORANGE, Bottom $LOW_COLOR_BLUE, Left, $LOW_COLOR_LGRAY, Right $LOW_COLOR_BLACK _LOWriter_PageStyleFooterBorderColor($oPageStyle, $LOW_COLOR_ORANGE, $LOW_COLOR_BLUE, $LOW_COLOR_LGRAY, $LOW_COLOR_BLACK) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterBorderColor($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Border Color settings are as follows: " & @CRLF & _ "The Top Border Color is, in Long Color Format: " & $avPageStyleSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterBorderPadding.au3 b/Examples/_LOWriter_PageStyleFooterBorderPadding.au3 index 851c27d8..04965d1b 100644 --- a/Examples/_LOWriter_PageStyleFooterBorderPadding.au3 +++ b/Examples/_LOWriter_PageStyleFooterBorderPadding.au3 @@ -11,35 +11,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleFooterBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Border Padding Width settings to: 1/8" on all four sides, and 1/4" on the bottom. _LOWriter_PageStyleFooterBorderPadding($oPageStyle, $iMicrometers, Null, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterBorderPadding($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Border Padding Width settings are as follows: " & @CRLF & _ "The ""All"" Border Padding Width is, in Micrometers: " & $avPageStyleSettings[0] & @CRLF & _ @@ -52,7 +52,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterBorderStyle.au3 b/Examples/_LOWriter_PageStyleFooterBorderStyle.au3 index eb5b8363..32756711 100644 --- a/Examples/_LOWriter_PageStyleFooterBorderStyle.au3 +++ b/Examples/_LOWriter_PageStyleFooterBorderStyle.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Footer Border Width (all four sides) to $LOW_BORDERWIDTH_MEDIUM _LOWriter_PageStyleFooterBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Border Style settings to: Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP ; Left = $LOW_BORDERSTYLE_DOUBLE, RIght = $LOW_BORDERSTYLE_DASHED _LOWriter_PageStyleFooterBorderStyle($oPageStyle, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_DOUBLE, $LOW_BORDERSTYLE_DASHED) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterBorderStyle($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Border Style settings are as follows: " & @CRLF & _ "The Top Border Style is, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterBorderWidth.au3 b/Examples/_LOWriter_PageStyleFooterBorderWidth.au3 index 1f237909..b9025e62 100644 --- a/Examples/_LOWriter_PageStyleFooterBorderWidth.au3 +++ b/Examples/_LOWriter_PageStyleFooterBorderWidth.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleFooterBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterBorderWidth($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Border Width settings are as follows: " & @CRLF & _ "The Top Border Width is, in Micrometers, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterShadow.au3 b/Examples/_LOWriter_PageStyleFooterShadow.au3 index ae65306f..0cf8cd39 100644 --- a/Examples/_LOWriter_PageStyleFooterShadow.au3 +++ b/Examples/_LOWriter_PageStyleFooterShadow.au3 @@ -11,27 +11,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Shadow settings to: Width = 1/8", Color = $LOW_COLOR_RED, Transparent = False, Location = $LOW_SHADOW_TOP_LEFT _LOWriter_PageStyleFooterShadow($oPageStyle, $iMicrometers, $LOW_COLOR_RED, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterShadow($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Shadow settings are as follows: " & @CRLF & _ "The shadow width is, is Micrometers: " & $avPageStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterTransparency.au3 b/Examples/_LOWriter_PageStyleFooterTransparency.au3 index cac1d2f0..da4332c9 100644 --- a/Examples/_LOWriter_PageStyleFooterTransparency.au3 +++ b/Examples/_LOWriter_PageStyleFooterTransparency.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Footer Background Color to $LOW_COLOR_RED, Color transparent to False. _LOWriter_PageStyleFooterAreaColor($oPageStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Transparency settings to 55% transparent _LOWriter_PageStyleFooterTransparency($oPageStyle, 55) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an integer. $iPageStyleSettings = _LOWriter_PageStyleFooterTransparency($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Transparency percentage is: " & $iPageStyleSettings) @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFooterTransparencyGradient.au3 b/Examples/_LOWriter_PageStyleFooterTransparencyGradient.au3 index e067c4b3..fa2768cd 100644 --- a/Examples/_LOWriter_PageStyleFooterTransparencyGradient.au3 +++ b/Examples/_LOWriter_PageStyleFooterTransparencyGradient.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Footer on. _LOWriter_PageStyleFooter($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style footers on. Error:" & @error & " Extended:" & @extended) ; Set Footer Background Color to $LOW_COLOR_RED, Color transparent to False. _LOWriter_PageStyleFooterAreaColor($oPageStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Footer Transparency Gradient settings to: Gradient Type = $LOW_GRAD_TYPE_ELLIPTICAL, XCenter to 75%, YCenter to 45%, Angle to 180 degrees ; Border to 16%, Start transparency to 10%, End Transparency to 62% _LOWriter_PageStyleFooterTransparencyGradient($oDoc, $oPageStyle, $LOW_GRAD_TYPE_ELLIPTICAL, 75, 45, 180, 16, 10, 62) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleFooterTransparencyGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footer Transparency Gradient settings are as follows: " & @CRLF & _ "The type of Gradient is, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFootnoteArea.au3 b/Examples/_LOWriter_PageStyleFootnoteArea.au3 index 6f929943..e6083b16 100644 --- a/Examples/_LOWriter_PageStyleFootnoteArea.au3 +++ b/Examples/_LOWriter_PageStyleFootnoteArea.au3 @@ -11,23 +11,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Footnote area settings to Footnote height = 0, which is "Not larger than Page area", and Space to text to 1/4" _LOWriter_PageStyleFootnoteArea($oPageStyle, 0, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avPageStyleSettings = _LOWriter_PageStyleFootnoteArea($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footnote area settings are as follows: " & @CRLF & _ "The current maximum Footnote area height, in Micrometers, is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -37,7 +37,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleFootnoteLine.au3 b/Examples/_LOWriter_PageStyleFootnoteLine.au3 index e4b6aa18..fc1d3243 100644 --- a/Examples/_LOWriter_PageStyleFootnoteLine.au3 +++ b/Examples/_LOWriter_PageStyleFootnoteLine.au3 @@ -11,24 +11,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Footnote separator line settings to: Position = $LOW_ALIGN_HORI_CENTER, Line style = $LOW_LINE_STYLE_DOTTED, ; Thickness = 1.25 Printer's Points, Color = $LOW_COLOR_BLACK, Length = 75%, Spacing to 1/4". _LOWriter_PageStyleFootnoteLine($oPageStyle, $LOW_ALIGN_HORI_CENTER, $LOW_LINE_STYLE_DOTTED, 1.25, $LOW_COLOR_BLACK, 75, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avPageStyleSettings = _LOWriter_PageStyleFootnoteLine($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Footnote separator line settings are as follows: " & @CRLF & _ "The Separator line Position is, (see UDF Constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleGetObj.au3 b/Examples/_LOWriter_PageStyleGetObj.au3 index 0b786acb..4d3bc00b 100644 --- a/Examples/_LOWriter_PageStyleGetObj.au3 +++ b/Examples/_LOWriter_PageStyleGetObj.au3 @@ -9,21 +9,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set the Page Background color to $LOW_COLOR_GREEN, to demonstrate that I retrieved the Page Style's Object. _LOWriter_PageStyleAreaColor($oPageStyle, $LOW_COLOR_GREEN, False) - If (@error > 0) Then _ERROR("Failed to set Page Style Background color. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Page Style Background color. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeader.au3 b/Examples/_LOWriter_PageStyleHeader.au3 index fbd6eebb..2ea2d8ec 100644 --- a/Examples/_LOWriter_PageStyleHeader.au3 +++ b/Examples/_LOWriter_PageStyleHeader.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Page style Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Header settings to: Header on = True, Same content on left and right pages = False, Same content on the first page = Ture, ; Left & Right margins = 1/4", Spacing between Header content and Page content = 1/2", Dynamic spacing = False, Skip Height and set AutoHeight to True. _LOWriter_PageStyleHeader($oPageStyle, True, False, True, $iMicrometers, $iMicrometers, $iMicrometers2, False, Null, True) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleHeader($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header settings are as follows: " & @CRLF & _ "Is the Header on for this PageStyle? True/False: " & $avPageStyleSettings[0] & @CRLF & _ @@ -53,7 +53,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderAreaColor.au3 b/Examples/_LOWriter_PageStyleHeaderAreaColor.au3 index 9519571a..d0d7128f 100644 --- a/Examples/_LOWriter_PageStyleHeaderAreaColor.au3 +++ b/Examples/_LOWriter_PageStyleHeaderAreaColor.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Background color to $LOW_COLOR_LIME, Background color transparent = False _LOWriter_PageStyleHeaderAreaColor($oPageStyle, $LOW_COLOR_LIME, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an integer. $avPageStyleSettings = _LOWriter_PageStyleHeaderAreaColor($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Background color settings are as follows: " & @CRLF & _ "The Background color is, in Long Color format: " & $avPageStyleSettings[0] & @CRLF & _ @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderAreaGradient.au3 b/Examples/_LOWriter_PageStyleHeaderAreaGradient.au3 index dac08bd5..365a7e01 100644 --- a/Examples/_LOWriter_PageStyleHeaderAreaGradient.au3 +++ b/Examples/_LOWriter_PageStyleHeaderAreaGradient.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Gradient settings to: Preset Gradient name = $LOW_GRAD_NAME_TEAL_TO_BLUE _LOWriter_PageStyleHeaderAreaGradient($oDoc, $oPageStyle, $LOW_GRAD_NAME_TEAL_TO_BLUE) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an integer. $avPageStyleSettings = _LOWriter_PageStyleHeaderAreaGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderAreaGradient[2].au3 b/Examples/_LOWriter_PageStyleHeaderAreaGradient[2].au3 index 69263538..8680dead 100644 --- a/Examples/_LOWriter_PageStyleHeaderAreaGradient[2].au3 +++ b/Examples/_LOWriter_PageStyleHeaderAreaGradient[2].au3 @@ -10,25 +10,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Gradient settings to: skip pre-set gradient name,, Gradient type = $LOW_GRAD_TYPE_SQUARE, increment steps = 150, ; horizontal (X) offset = 25%, vertical offset (Y) = 56%, rotational angle = 135 degrees, percentage not covered by "From" color = 50% ; Starting color = $LOW_COLOR_ORANGE, Ending color = $LOW_COLOR_TEAL,Starting color intensity = 100%, ending color intensity = 68% _LOWriter_PageStyleHeaderAreaGradient($oDoc, $oPageStyle, Null, $LOW_GRAD_TYPE_SQUARE, 150, 25, 56, 135, 50, $LOW_COLOR_ORANGE, $LOW_COLOR_TEAL, 100, 68) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an integer. $avPageStyleSettings = _LOWriter_PageStyleHeaderAreaGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Gradient settings are as follows: " & @CRLF & _ "The Gradient name is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderBorderColor.au3 b/Examples/_LOWriter_PageStyleHeaderBorderColor.au3 index b9ba3b05..cb14b7bb 100644 --- a/Examples/_LOWriter_PageStyleHeaderBorderColor.au3 +++ b/Examples/_LOWriter_PageStyleHeaderBorderColor.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Header Border Width (all four sides) to $LOW_BORDERWIDTH_MEDIUM _LOWriter_PageStyleHeaderBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Border Color settings to: Top, $LOW_COLOR_ORANGE, Bottom $LOW_COLOR_BLUE, Left, $LOW_COLOR_LGRAY, Right $LOW_COLOR_BLACK _LOWriter_PageStyleHeaderBorderColor($oPageStyle, $LOW_COLOR_ORANGE, $LOW_COLOR_BLUE, $LOW_COLOR_LGRAY, $LOW_COLOR_BLACK) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleHeaderBorderColor($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Border Color settings are as follows: " & @CRLF & _ "The Top Border Color is, in Long Color Format: " & $avPageStyleSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderBorderPadding.au3 b/Examples/_LOWriter_PageStyleHeaderBorderPadding.au3 index b07b8420..0547ccf3 100644 --- a/Examples/_LOWriter_PageStyleHeaderBorderPadding.au3 +++ b/Examples/_LOWriter_PageStyleHeaderBorderPadding.au3 @@ -11,35 +11,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleHeaderBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Border Padding Width settings to: 1/8" on all sides, and then 1/4" on the bottom. _LOWriter_PageStyleHeaderBorderPadding($oPageStyle, $iMicrometers, Null, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleHeaderBorderPadding($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Border Padding Width settings are as follows: " & @CRLF & _ "The ""All"" Border Padding Width is, in Micrometers: " & $avPageStyleSettings[0] & @CRLF & _ @@ -52,7 +52,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderBorderStyle.au3 b/Examples/_LOWriter_PageStyleHeaderBorderStyle.au3 index eb455c37..d4776ac0 100644 --- a/Examples/_LOWriter_PageStyleHeaderBorderStyle.au3 +++ b/Examples/_LOWriter_PageStyleHeaderBorderStyle.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Header Border Width (all four sides) to $LOW_BORDERWIDTH_MEDIUM _LOWriter_PageStyleHeaderBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Border Style settings to: Top = $LOW_BORDERSTYLE_DASH_DOT_DOT, Bottom = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP ; Left = $LOW_BORDERSTYLE_DOUBLE, RIght = $LOW_BORDERSTYLE_DASHED _LOWriter_PageStyleHeaderBorderStyle($oPageStyle, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_DOUBLE, $LOW_BORDERSTYLE_DASHED) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleHeaderBorderStyle($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Border Style settings are as follows: " & @CRLF & _ "The Top Border Style is, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderBorderWidth.au3 b/Examples/_LOWriter_PageStyleHeaderBorderWidth.au3 index 90c6d8a9..26d2e1b9 100644 --- a/Examples/_LOWriter_PageStyleHeaderBorderWidth.au3 +++ b/Examples/_LOWriter_PageStyleHeaderBorderWidth.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Border Width settings to: $LOW_BORDERWIDTH_MEDIUM on all four sides. _LOWriter_PageStyleHeaderBorderWidth($oPageStyle, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleHeaderBorderWidth($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Border Width settings are as follows: " & @CRLF & _ "The Top Border Width is, in Micrometers, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderShadow.au3 b/Examples/_LOWriter_PageStyleHeaderShadow.au3 index c090fba0..499b58b5 100644 --- a/Examples/_LOWriter_PageStyleHeaderShadow.au3 +++ b/Examples/_LOWriter_PageStyleHeaderShadow.au3 @@ -11,27 +11,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Shadow settings to: Width = 1/8", Color = $LOW_COLOR_RED, Transparent = False, Location = $LOW_SHADOW_TOP_LEFT _LOWriter_PageStyleHeaderShadow($oPageStyle, $iMicrometers, $LOW_COLOR_RED, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleHeaderShadow($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Shadow settings are as follows: " & @CRLF & _ "The shadow width is, is Micrometers: " & $avPageStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderTransparency.au3 b/Examples/_LOWriter_PageStyleHeaderTransparency.au3 index 61cadb71..906325ad 100644 --- a/Examples/_LOWriter_PageStyleHeaderTransparency.au3 +++ b/Examples/_LOWriter_PageStyleHeaderTransparency.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Header Background Color to $LOW_COLOR_RED, Color transparent to False. _LOWriter_PageStyleHeaderAreaColor($oPageStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Transparency settings to 55% transparent _LOWriter_PageStyleHeaderTransparency($oPageStyle, 55) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an integer. $iPageStyleSettings = _LOWriter_PageStyleHeaderTransparency($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Transparecny percentage is: " & $iPageStyleSettings) @@ -38,7 +38,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleHeaderTransparencyGradient.au3 b/Examples/_LOWriter_PageStyleHeaderTransparencyGradient.au3 index 17a53665..17d3591f 100644 --- a/Examples/_LOWriter_PageStyleHeaderTransparencyGradient.au3 +++ b/Examples/_LOWriter_PageStyleHeaderTransparencyGradient.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Turn Header on. _LOWriter_PageStyleHeader($oPageStyle, True) - If (@error > 0) Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to turn Page Style headers on. Error:" & @error & " Extended:" & @extended) ; Set Header Background Color to $LOW_COLOR_RED, Color transparent to False. _LOWriter_PageStyleHeaderAreaColor($oPageStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Header Transparency Gradient settings to: Gradient Type = $LOW_GRAD_TYPE_ELLIPTICAL, XCenter to 75%, YCenter to 45%, Angle to 180 degrees ; Border to 16%, Start transparency to 10%, End Transparency to 62% _LOWriter_PageStyleHeaderTransparencyGradient($oDoc, $oPageStyle, $LOW_GRAD_TYPE_ELLIPTICAL, 75, 45, 180, 16, 10, 62) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an integer. $avPageStyleSettings = _LOWriter_PageStyleHeaderTransparencyGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Transparency Gradient settings are as follows: " & @CRLF & _ "The type of Gradient is, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleLayout.au3 b/Examples/_LOWriter_PageStyleLayout.au3 index fead9f17..3871d3ca 100644 --- a/Examples/_LOWriter_PageStyleLayout.au3 +++ b/Examples/_LOWriter_PageStyleLayout.au3 @@ -10,11 +10,11 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; If Libre Office version is higher or equal to 7.2 then set Gutter settings. If (_LOWriter_VersionGet(True) >= 7.2) Then @@ -22,18 +22,18 @@ Func Example() ; Set Page layout to, $LOW_PAGE_LAYOUT_MIRRORED, Numbering format to $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N, Reference Paragraph style to ; "Default Paragraph Style", Gutter on Right to False, Gutter At top to False, Background covers margins to True. _LOWriter_PageStyleLayout($oDoc, $oPageStyle, $LOW_PAGE_LAYOUT_MIRRORED, $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N, "Default Paragraph Style", False, False, True) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) Else ;Set all other settins, except the Gutter settings. ; Set layout to, $LOW_PAGE_LAYOUT_MIRRORED, Numbering format to $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N, Reference Paragraph style to ; "Default Paragraph Style", Background covers margins to True. _LOWriter_PageStyleLayout($oDoc, $oPageStyle, $LOW_PAGE_LAYOUT_MIRRORED, $LOW_NUM_STYLE_CHARS_UPPER_LETTER_N, "Default Paragraph Style", Null, Null, True) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) EndIf ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avPageStyleSettings = _LOWriter_PageStyleLayout($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) ; If Libre Office version is higher or equal to 7.2 then display the Gutter margin setting. If (_LOWriter_VersionGet(True) >= 7.2) Then @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleMargins.au3 b/Examples/_LOWriter_PageStyleMargins.au3 index 5b898c9d..60fb293d 100644 --- a/Examples/_LOWriter_PageStyleMargins.au3 +++ b/Examples/_LOWriter_PageStyleMargins.au3 @@ -11,39 +11,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers3 = _LOWriter_ConvertToMicrometer(.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; If Libre Office version is higher or equal to 7.2 then set Gutter margin. If (_LOWriter_VersionGet(True) >= 7.2) Then ; Set Left and Right margins to 1", Top and Bottom Margins to 1/2" and Gutter Margin to 1/4". _LOWriter_PageStyleMargins($oPageStyle, $iMicrometers, $iMicrometers, $iMicrometers2, $iMicrometers2, $iMicrometers3) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) Else ;Set all other margins, except the Gutter margin. ; Set Left and Right margins to 1", Top and Bottom Margins to 1/2". _LOWriter_PageStyleMargins($oPageStyle, $iMicrometers, $iMicrometers, $iMicrometers2, $iMicrometers2) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) EndIf ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avPageStyleSettings = _LOWriter_PageStyleMargins($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) ; If Libre Office version is higher or equal to 7.2 then display the Gutter margin setting. If (_LOWriter_VersionGet(True) >= 7.2) Then @@ -66,7 +66,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleOrganizer.au3 b/Examples/_LOWriter_PageStyleOrganizer.au3 index b1fa23fb..6ff28f05 100644 --- a/Examples/_LOWriter_PageStyleOrganizer.au3 +++ b/Examples/_LOWriter_PageStyleOrganizer.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a New Page Style. $oPageStyle = _LOWriter_PageStyleCreate($oDoc, "NewPageStyle") - If (@error > 0) Then _ERROR("Failed to create a new Page Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a new Page Style. Error:" & @error & " Extended:" & @extended) ; Change the Page Style's name to "New-PageStyle-Name", hidden to False, Set the follow style to "HTML", the parent style to ; "Default Page Style". _LOWriter_PageStyleOrganizer($oDoc, $oPageStyle, "New-PageStyle-Name", False, "HTML") - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avPageStyleSettings = _LOWriter_PageStyleOrganizer($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Organizer settings are as follows: " & @CRLF & _ "The Page Style's name is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStylePaperFormat.au3 b/Examples/_LOWriter_PageStylePaperFormat.au3 index 9bcacfc5..78c8dac8 100644 --- a/Examples/_LOWriter_PageStylePaperFormat.au3 +++ b/Examples/_LOWriter_PageStylePaperFormat.au3 @@ -10,19 +10,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Width to $LOW_PAPER_WIDTH_10ENVELOPE, and Height to $LOW_PAPER_HEIGHT_TABLOID, Landscape to false _LOWriter_PageStylePaperFormat($oPageStyle, $LOW_PAPER_WIDTH_10ENVELOPE, $LOW_PAPER_HEIGHT_TABLOID, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avPageStyleSettings = _LOWriter_PageStylePaperFormat($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Paper Format settings are as follows: " & @CRLF & _ "The paper width, in Micrometers, is: " & $avPageStyleSettings[0] & @CRLF & _ @@ -33,7 +33,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleSet.au3 b/Examples/_LOWriter_PageStyleSet.au3 index ea047586..32d8d292 100644 --- a/Examples/_LOWriter_PageStyleSet.au3 +++ b/Examples/_LOWriter_PageStyleSet.au3 @@ -9,23 +9,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now change the current page style to ""Landscape.""") ; Set the Page style to Landscape using the ViewCursor. _LOWriter_PageStyleSet($oDoc, $oViewCursor, "Landscape") - If (@error > 0) Then _ERROR("Failed to set the page style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the page style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleShadow.au3 b/Examples/_LOWriter_PageStyleShadow.au3 index 20441a78..7dc0f980 100644 --- a/Examples/_LOWriter_PageStyleShadow.au3 +++ b/Examples/_LOWriter_PageStyleShadow.au3 @@ -11,23 +11,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Convert 1/8" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(.125) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set Page style Shadow settings to: Width = 1/8", Color = $LOW_COLOR_RED, Transparent = False, Location = $LOW_SHADOW_TOP_LEFT _LOWriter_PageStyleShadow($oPageStyle, $iMicrometers, $LOW_COLOR_RED, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleShadow($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Shadow settings are as follows: " & @CRLF & _ "The shadow width is, is Micrometers: " & $avPageStyleSettings[0] & @CRLF & _ @@ -39,7 +39,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleTransparency.au3 b/Examples/_LOWriter_PageStyleTransparency.au3 index ed086243..d5ae354c 100644 --- a/Examples/_LOWriter_PageStyleTransparency.au3 +++ b/Examples/_LOWriter_PageStyleTransparency.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Background Color to $LOW_COLOR_RED, Color transparent to False. _LOWriter_PageStyleAreaColor($oPageStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Transparency settings to 55% transparent _LOWriter_PageStyleTransparency($oPageStyle, 55) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an Integer. $iTransparency = _LOWriter_PageStyleTransparency($oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Header Transparecny percentage is: " & $iTransparency) @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStyleTransparencyGradient.au3 b/Examples/_LOWriter_PageStyleTransparencyGradient.au3 index f070090d..c13d6e0e 100644 --- a/Examples/_LOWriter_PageStyleTransparencyGradient.au3 +++ b/Examples/_LOWriter_PageStyleTransparencyGradient.au3 @@ -10,24 +10,24 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Default Page Style's Object, to modify its settings. $oPageStyle = _LOWriter_PageStyleGetObj($oDoc, "Default Page Style") - If (@error > 0) Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Page Style Object. Error:" & @error & " Extended:" & @extended) ; Set Background Color to $LOW_COLOR_RED, Color transparent to False. _LOWriter_PageStyleAreaColor($oPageStyle, $LOW_COLOR_RED, False) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Set Page style Transparency Gradient settings to: Gradient Type = $LOW_GRAD_TYPE_ELLIPTICAL, XCenter to 75%, YCenter to 45%, Angle to 180 degrees ; Border to 16%, Start transparency to 10%, End Transparency to 62% _LOWriter_PageStyleTransparencyGradient($oDoc, $oPageStyle, $LOW_GRAD_TYPE_ELLIPTICAL, 75, 45, 180, 16, 10, 62) - If (@error > 0) Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Page Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with elements in order of function parameters. $avPageStyleSettings = _LOWriter_PageStyleTransparencyGradient($oDoc, $oPageStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Page style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Page Style's current Transparency Gradient settings are as follows: " & @CRLF & _ "The type of Gradient is, (see UDF constants): " & $avPageStyleSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_PageStylesGetNames.au3 b/Examples/_LOWriter_PageStylesGetNames.au3 index f5963c35..d8513a99 100644 --- a/Examples/_LOWriter_PageStylesGetNames.au3 +++ b/Examples/_LOWriter_PageStylesGetNames.au3 @@ -10,57 +10,57 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Page Style names. $asPageStyles = _LOWriter_PageStylesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve array of page style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of page style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of available Page styles. There are " & @extended & " results.") ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The available Page Styles in this document are:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asPageStyles) -1 ; Insert the Page Style names. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asPageStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next ; Retrieve Array of Page Style names that are applied to the document $asPageStyles = _LOWriter_PageStylesGetNames($oDoc, False, True) - If (@error > 0) Then _ERROR("Failed to retrieve array of page style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of page style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of used Page styles. There is " & @extended & " result.") ; Move the View Cursor to the end of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_End) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Page Styles currently in use in this document are:" & @CR & @CR,True) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asPageStyles) -1 ; Insert the Page Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asPageStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParObjCopy.au3 b/Examples/_LOWriter_ParObjCopy.au3 index 76325a5b..b6660fc7 100644 --- a/Examples/_LOWriter_ParObjCopy.au3 +++ b/Examples/_LOWriter_ParObjCopy.au3 @@ -10,73 +10,73 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "This Paragraph Contains some direct formatting that would normally be lost when copying it, unless" & _ " I used the clipboard." & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the beginning of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START, 1, False) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the right 4 spaces and select. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 4, True) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Set the font color to $LOW_COLOR_ORANGE, and highlight to $LOW_COLOR_PURPLE _LOWriter_DirFrmtFontColor($oViewCursor, $LOW_COLOR_ORANGE, Null, $LOW_COLOR_PURPLE) - If (@error > 0) Then _ERROR("Failed to set Font Color. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Font Color. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the right 43 spaces. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 43, False) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the right 45 spaces. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 45, True) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Underline the selected portion in red. _LOWriter_DirFrmtUnderLine($oViewCursor, True, $LOW_UNDERLINE_BOLD_DASH_DOT_DOT, True, $LOW_COLOR_RED) - If (@error > 0) Then _ERROR("Failed to set underline settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set underline settings. Error:" & @error & " Extended:" & @extended) ; Create a list of Paragraph Objects $aoPars = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) ; Select the first Paragraph _LOWriter_ParObjSelect($oDoc, $aoPars[0]) - If (@error > 0) Then _ERROR("Failed to select the paragraph. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to select the paragraph. Error:" & @error & " Extended:" & @extended) ; Copy the Paragraph. $oPar = _LOWriter_ParObjCopy($oDoc) - If (@error > 0) Then _ERROR("Failed to copy the paragraphs. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to copy the paragraphs. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now copied the paragraph, and the object pointing to this copy is stored in $oPar." & _ " I will now open a second document and paste the paragraph in there, and it will have preserved its formatting.") ; Create a New, visible, Blank Libre Office Document. $oDoc2 = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; "Paste" the paragraph object into the new document. _LOWriter_ParObjPaste($oDoc2, $oPar) - If (@error > 0) Then _ERROR("Failed to paste the paragraph object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to paste the paragraph object. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the documents.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc2, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParObjCreateList.au3 b/Examples/_LOWriter_ParObjCreateList.au3 index 171dc052..c557fa81 100644 --- a/Examples/_LOWriter_ParObjCreateList.au3 +++ b/Examples/_LOWriter_ParObjCreateList.au3 @@ -10,36 +10,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "First Line of text" & @CR & _ "Second line of text." & @CR & _ "Third line of text." & @CR & _ "Fourth Line of Text.") - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Paragraphs for the document $aoParagraphs = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph Objects for Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph Objects for Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "There were " & @extended & " paragraph objects returned." & _ " As an example of what a paragraph Object can be used for, I will change the font size of the first paragraph to 22 point.") ; An example of what I can do with a paragraph Object. Set the first paragraph's font size to 22 point. _LOWriter_DirFrmtFont($oDoc, $aoParagraphs[0], Null, 22) - If (@error > 0) Then _ERROR("Failed to direct format Paragraph Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to direct format Paragraph Object. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParObjDelete.au3 b/Examples/_LOWriter_ParObjDelete.au3 index 551e20da..47884fd0 100644 --- a/Examples/_LOWriter_ParObjDelete.au3 +++ b/Examples/_LOWriter_ParObjDelete.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The First Paragraph" & @CR & "I'm going to delete this paragraph." & @CR & _ "A Third Paragraph." & @CR & " A Fourth Paragraph.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a list of Paragraph Objects $aoPars = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the second paragraph.") @@ -31,13 +31,13 @@ Func Example() ; Delete the second paragraph. _LOWriter_ParObjDelete($oPar) - If (@error > 0) Then _ERROR("Failed to delete the paragraph. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete the paragraph. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParObjPaste.au3 b/Examples/_LOWriter_ParObjPaste.au3 index 428070b5..97799f0e 100644 --- a/Examples/_LOWriter_ParObjPaste.au3 +++ b/Examples/_LOWriter_ParObjPaste.au3 @@ -10,87 +10,87 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "This Paragraph Contains some direct formatting that would normally be lost when copying it, unless" & _ " I used the clipboard." & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the beginning of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START, 1, False) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the right 4 spaces and select. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 4, True) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Set the font color to $LOW_COLOR_ORANGE, and highlight to $LOW_COLOR_PURPLE _LOWriter_DirFrmtFontColor($oViewCursor, $LOW_COLOR_ORANGE, Null, $LOW_COLOR_PURPLE) - If (@error > 0) Then _ERROR("Failed to set Font Color. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Font Color. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the right 43 spaces. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 43, False) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to the right 45 spaces. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 45, True) - If (@error > 0) Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move the View Cursor. Error:" & @error & " Extended:" & @extended) ; Underline the selected portion in red. _LOWriter_DirFrmtUnderLine($oViewCursor, True, $LOW_UNDERLINE_BOLD_DASH_DOT_DOT, True, $LOW_COLOR_RED) - If (@error > 0) Then _ERROR("Failed to set underline settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set underline settings. Error:" & @error & " Extended:" & @extended) ; Create a list of Paragraph Objects $aoPars = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) ; Select the first Paragraph _LOWriter_ParObjSelect($oDoc, $aoPars[0]) - If (@error > 0) Then _ERROR("Failed to select the paragraph. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to select the paragraph. Error:" & @error & " Extended:" & @extended) ; Copy the Paragraph. $oPar = _LOWriter_ParObjCopy($oDoc) - If (@error > 0) Then _ERROR("Failed to copy the paragraphs. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to copy the paragraphs. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have now copied the paragraph, and the object pointing to this copy is stored in $oPar." & _ " I will now open a second document and paste the paragraph in there, and it will have preserved its formatting.") ; Create a New, visible, Blank Libre Office Document. $oDoc2 = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; "Paste" the paragraph object into the new document. _LOWriter_ParObjPaste($oDoc2, $oPar) - If (@error > 0) Then _ERROR("Failed to paste the paragraph object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to paste the paragraph object. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I can even paste the same paragraph several times if I want.") ; Retrieve the document view cursor to insert text with. $oViewCursor2 = _LOWriter_DocGetViewCursor($oDoc2) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert 3 new paragraphs. _LOWriter_DocInsertString($oDoc2, $oViewCursor2, @CR & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; "Paste" the paragraph object into the new document. _LOWriter_ParObjPaste($oDoc2, $oPar) - If (@error > 0) Then _ERROR("Failed to paste the paragraph object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to paste the paragraph object. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the documents.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) ; Close the document. _LOWriter_DocClose($oDoc2, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParObjSectionsGet.au3 b/Examples/_LOWriter_ParObjSectionsGet.au3 index 5ddb2956..a3063499 100644 --- a/Examples/_LOWriter_ParObjSectionsGet.au3 +++ b/Examples/_LOWriter_ParObjSectionsGet.au3 @@ -11,38 +11,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text _LOWriter_DocInsertString($oDoc, $oViewCursor, "First Line of text" & @CR & _ "Second line of text." & @CR & _ "Third line of text." & @CR & _ "Fourth Line of Text.") - If (@error > 0) Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text into the Writer Document. Error:" & @error & " Extended:" & @extended) ; Move the Cursor to start of document. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) ; Move cursor right 10 spaces. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 10) - If (@error > 0) Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) ; Insert a footnote to demonstrate a different section type. _LOWriter_FootnoteInsert($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to insert a footnote. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert a footnote. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Paragraphs for the document $aoParagraphs = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph Objects for Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph Objects for Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Paragraph sections for the first paragraph. $aoSections = _LOWriter_ParObjSectionsGet($aoParagraphs[0]) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph Object sections. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph Object sections. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "There were " & @extended & " paragraph sections returned." & _ " As an example of what a paragraph section can be used for, I will change the font size of the first paragraph section to 22 point.") @@ -50,7 +50,7 @@ Func Example() ; An example of what I can do with a paragraph section Object. Set the first paragraph section's font size to 22 point. The Object ; is stored in the first column [0] of the array. _LOWriter_DirFrmtFont($oDoc, $aoSections[0][0], Null, 22) - If (@error > 0) Then _ERROR("Failed to direct format Paragraph Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to direct format Paragraph Object. Error:" & @error & " Extended:" & @extended) ; Display the paragraph sections. _ArrayDisplay($aoSections) @@ -60,7 +60,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParObjSelect.au3 b/Examples/_LOWriter_ParObjSelect.au3 index 18009a85..c44b3a06 100644 --- a/Examples/_LOWriter_ParObjSelect.au3 +++ b/Examples/_LOWriter_ParObjSelect.au3 @@ -10,38 +10,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "First Paragraph" & @CR & "Second Paragraph" & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a Table, 3 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 2) - If (@error > 0) Then _ERROR("Failed to create a Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert the table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert the table. Error:" & @error & " Extended:" & @extended) ; Create a list of Paragraph Objects $aoPars = _LOWriter_ParObjCreateList($oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of paragraphs. Error:" & @error & " Extended:" & @extended) ; Select the second Paragraph _LOWriter_ParObjSelect($oDoc, $aoPars[1]) - If (@error > 0) Then _ERROR("Failed to select the paragraph. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to select the paragraph. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have selected the second paragraph. I could go forward and use _LOWriter_ParObjCopy to copy it, or I could " & _ "apply direct formatting if I wanted to. But I will now demonstrate selecting a Table using the object returned by creating it.") ; Select the Table _LOWriter_ParObjSelect($oDoc, $oTable) - If (@error > 0) Then _ERROR("Failed to select the table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to select the table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have selected the Table. I could go forward and use _LOWriter_ParObjCopy to copy it, etc." & _ " I could also use ViewCursor moves, such as GoTo_Start to locate the viewcursor at the beginning of the Table. But " & _ @@ -51,28 +51,28 @@ Func Example() MsgBox(0, "", "") ; Create a TextCursor. $oTextCursor = _LOWriter_DocCreateTextCursor($oDoc, False) - If (@error > 0) Then _ERROR("Failed to create a text cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a text cursor. Error:" & @error & " Extended:" & @extended) ; Move the TextCursor right 1 word. _LOWriter_CursorMove($oTextCursor, $LOW_TEXTCUR_GOTO_NEXT_WORD, 1, False) - If (@error > 0) Then _ERROR("Failed to move a text cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move a text cursor. Error:" & @error & " Extended:" & @extended) ; Move the TextCursor right 1 word and select it. _LOWriter_CursorMove($oTextCursor, $LOW_TEXTCUR_GOTO_END_OF_WORD, 1, True) - If (@error > 0) Then _ERROR("Failed to move a text cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move a text cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The text cursor currently has data selected, but you can't see it because only selections made with the ViewCursor" & _ " are visible. I will now select the data the TextCursor has selected.") ; Select the data the TextCursor has selected _LOWriter_ParObjSelect($oDoc, $oTextCursor) - If (@error > 0) Then _ERROR("Failed to select the TextCursor Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to select the TextCursor Data. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleAlignment.au3 b/Examples/_LOWriter_ParStyleAlignment.au3 index ba90e154..2694fef4 100644 --- a/Examples/_LOWriter_ParStyleAlignment.au3 +++ b/Examples/_LOWriter_ParStyleAlignment.au3 @@ -10,29 +10,29 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @LF & "Next Line" & @CR & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Alignment settings to, Horizontal alignment = $LOW_PAR_ALIGN_HOR_JUSTIFIED, ; Vertical alignment = $LOW_PAR_ALIGN_VERT_CENTER, Last line alignment = $LOW_PAR_LAST_LINE_JUSTIFIED, ; Expand single word = True, Snap to grid = False, Text direction = $LOW_TXT_DIR_LR_TB _LOWriter_ParStyleAlignment($oParStyle, $LOW_PAR_ALIGN_HOR_JUSTIFIED, $LOW_PAR_ALIGN_VERT_CENTER, $LOW_PAR_LAST_LINE_JUSTIFIED, True, False, $LOW_TXT_DIR_LR_TB) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleAlignment($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Alignment settings are as follows: " & @CRLF & _ "Horizontal alignment, (See UDF constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleBackColor.au3 b/Examples/_LOWriter_ParStyleBackColor.au3 index 4ea18eee..711a391f 100644 --- a/Examples/_LOWriter_ParStyleBackColor.au3 +++ b/Examples/_LOWriter_ParStyleBackColor.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" background color to $LOW_COLOR_GRAY, and back transparent to false. _LOWriter_ParStyleBackColor($oParStyle, $LOW_COLOR_GRAY, False) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleBackColor($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Background color settings are as follows: " & @CRLF & _ "The current background color, in Long Color format: " & $avParStyleSettings[0] & @CRLF & _ @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleBorderColor.au3 b/Examples/_LOWriter_ParStyleBorderColor.au3 index cfc4e8b9..e326d354 100644 --- a/Examples/_LOWriter_ParStyleBorderColor.au3 +++ b/Examples/_LOWriter_ParStyleBorderColor.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_ParStyleBorderWidth($oParStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border color to $LOW_COLOR_BRICK _LOWriter_ParStyleBorderColor($oParStyle, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK, $LOW_COLOR_BRICK) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleBorderColor($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Border color settings are as follows: " & @CRLF & _ "Top color, in Long Color format: " & $avParStyleSettings[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleBorderPadding.au3 b/Examples/_LOWriter_ParStyleBorderPadding.au3 index 5ce5cf1e..6e7ec2c1 100644 --- a/Examples/_LOWriter_ParStyleBorderPadding.au3 +++ b/Examples/_LOWriter_ParStyleBorderPadding.au3 @@ -11,35 +11,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_ParStyleBorderWidth($oParStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border padding to 1/4" _LOWriter_ParStyleBorderPadding($oParStyle, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleBorderPadding($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Border padding distance settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avParStyleSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -52,15 +52,15 @@ Func Example() ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border padding to, Top and Right, 1/4", Bottom and left, 1/2". _LOWriter_ParStyleBorderPadding($oParStyle, Null, $iMicrometers, $iMicrometers2, $iMicrometers2, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleBorderPadding($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Border padding distance settings are as follows: " & @CRLF & _ "All Padding distance, in Micrometers: " & $avParStyleSettings[0] & " This setting is best only used to set the distance, as" & _ @@ -74,7 +74,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleBorderStyle.au3 b/Examples/_LOWriter_ParStyleBorderStyle.au3 index d7b3df40..3310e7bd 100644 --- a/Examples/_LOWriter_ParStyleBorderStyle.au3 +++ b/Examples/_LOWriter_ParStyleBorderStyle.au3 @@ -10,32 +10,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border Width to $LOW_BORDERWIDTH_THICK. _LOWriter_ParStyleBorderWidth($oParStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border Style to, Top = $LOW_BORDERSTYLE_DASH_DOT_DOT. Bottom = $LOW_BORDERSTYLE_FINE_DASHED, ; Left = $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP Right = $LOW_BORDERSTYLE_SOLID _LOWriter_ParStyleBorderStyle($oParStyle, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_FINE_DASHED, $LOW_BORDERSTYLE_THICKTHIN_MEDIUMGAP, $LOW_BORDERSTYLE_SOLID) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleBorderStyle($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Border Style settings are as follows: " & @CRLF & _ "Top Style, (see UDF constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleBorderWidth.au3 b/Examples/_LOWriter_ParStyleBorderWidth.au3 index 58406531..f3c3d51b 100644 --- a/Examples/_LOWriter_ParStyleBorderWidth.au3 +++ b/Examples/_LOWriter_ParStyleBorderWidth.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Border Width to $LOW_BORDERWIDTH_THICK, And Connect border to True. _LOWriter_ParStyleBorderWidth($oParStyle, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, True) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleBorderWidth($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Border width settings are as follows: " & @CRLF & _ "Top width, in Micrometers: " & $avParStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleCreate.au3 b/Examples/_LOWriter_ParStyleCreate.au3 index b29851fe..c35d5659 100644 --- a/Examples/_LOWriter_ParStyleCreate.au3 +++ b/Examples/_LOWriter_ParStyleCreate.au3 @@ -10,15 +10,15 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Paragraph Style to use for demonstration. _LOWriter_ParStyleCreate($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) ; Check if the paragraph style exists. $bExists = _LOWriter_ParStyleExists($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Paragraph style called ""NewParStyle"" exist in the document? True/False: " & $bExists) @@ -26,7 +26,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleDelete.au3 b/Examples/_LOWriter_ParStyleDelete.au3 index 53964542..ad03587d 100644 --- a/Examples/_LOWriter_ParStyleDelete.au3 +++ b/Examples/_LOWriter_ParStyleDelete.au3 @@ -10,25 +10,25 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Paragraph Style to use for demonstration. $oParStyle = _LOWriter_ParStyleCreate($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) ; Check if the paragraph style exists. $bExists = _LOWriter_ParStyleExists($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Paragraph style called ""NewParStyle"" exist in the document? True/False: " & $bExists) ; Delete the paragraph style, Force delete it, if it is in use, and Replacement it with paragraph style, "Default Paragraph Style" _LOWriter_ParStyleDelete($oDoc, $oParStyle, True, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to delete the Paragraph Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete the Paragraph Style. Error:" & @error & " Extended:" & @extended) ; Check if the paragraph style still exists. $bExists = _LOWriter_ParStyleExists($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Paragraph style called ""NewParStyle"" still exist in the document? True/False: " & $bExists) @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleDropCaps.au3 b/Examples/_LOWriter_ParStyleDropCaps.au3 index 0cca0685..e30e6718 100644 --- a/Examples/_LOWriter_ParStyleDropCaps.au3 +++ b/Examples/_LOWriter_ParStyleDropCaps.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @LF & "Next Line" & @LF & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Drop cap settings to, Number of Characters to DropCap, 3, Lines to drop down, 2, ; Spc To text To 1/4 ", whole word to False, and Character style to "Example". _LOWriter_ParStyleDropCaps($oDoc, $oParStyle, 3, 2, $iMicrometers, False, "Example") - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleDropCaps($oDoc, $oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Drop cap settings are as follows: " & @CRLF & _ "How many characters are included in the DropCaps?: " & $avParStyleSettings[0] & @CRLF & _ @@ -49,7 +49,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleEffect.au3 b/Examples/_LOWriter_ParStyleEffect.au3 index 7f0d5f91..0a517949 100644 --- a/Examples/_LOWriter_ParStyleEffect.au3 +++ b/Examples/_LOWriter_ParStyleEffect.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Font effects to $LOW_RELIEF_EMBOSSED relief type. _LOWriter_ParStyleEffect($oParStyle, $LOW_RELIEF_EMBOSSED) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleEffect($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -42,11 +42,11 @@ Func Example() ; Set "Default Paragraph Style" Font effects to $LOW_RELIEF_NONE relief type, Case to $LOW_CASEMAP_SM_CAPS _LOWriter_ParStyleEffect($oParStyle, $LOW_RELIEF_NONE, $LOW_CASEMAP_SM_CAPS) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleEffect($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's new font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleEffect[2].au3 b/Examples/_LOWriter_ParStyleEffect[2].au3 index dd93f05a..f6576108 100644 --- a/Examples/_LOWriter_ParStyleEffect[2].au3 +++ b/Examples/_LOWriter_ParStyleEffect[2].au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Font effects to shadow = True. _LOWriter_ParStyleEffect($oParStyle, Null, Null, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleEffect($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -42,11 +42,11 @@ Func Example() ; Set "Default Paragraph Style" Font effects to shadow = False and Outline = True. _LOWriter_ParStyleEffect($oParStyle, Null, Null, Null, True, False) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleEffect($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's new font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -58,11 +58,11 @@ Func Example() ; Set "Default Paragraph Style" Font effects Outline to False, and Hidden to true. _LOWriter_ParStyleEffect($oParStyle, Null, Null, True, False, Null) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleEffect($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's new font Effects settings are as follows: " & @CRLF & _ "Relief style (See UDF Constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -75,7 +75,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleExists.au3 b/Examples/_LOWriter_ParStyleExists.au3 index 72812fa4..9fa42275 100644 --- a/Examples/_LOWriter_ParStyleExists.au3 +++ b/Examples/_LOWriter_ParStyleExists.au3 @@ -10,21 +10,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Paragraph Style to use for demonstration. _LOWriter_ParStyleCreate($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) ; Check if the paragraph style exists. $bExists = _LOWriter_ParStyleExists($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Paragraph style called ""NewParStyle"" exist in the document? True/False: " & $bExists) ; Check if a fake paragraph style exists. $bExists = _LOWriter_ParStyleExists($oDoc, "FakeParStyle") - If (@error > 0) Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to test for Paragraph Style existing in document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Does a Paragraph style called ""FakeParStyle"" exist in the document? True/False: " & $bExists) @@ -32,7 +32,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleFont.au3 b/Examples/_LOWriter_ParStyleFont.au3 index 51afc1f2..06608b54 100644 --- a/Examples/_LOWriter_ParStyleFont.au3 +++ b/Examples/_LOWriter_ParStyleFont.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Font to "Arial", Font size to 18,Posture (Italic) to $LOW_POSTURE_ITALIC, and weight (Bold) ; to $LOW_WEIGHT_BOLD _LOWriter_ParStyleFont($oDoc, $oParStyle, "Arial", 18, $LOW_POSTURE_ITALIC, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleFont($oDoc, $oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current font settings are as follows: " & @CRLF & _ "Font name: " & $avParStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleFontColor.au3 b/Examples/_LOWriter_ParStyleFontColor.au3 index 606beb57..1032ffdd 100644 --- a/Examples/_LOWriter_ParStyleFontColor.au3 +++ b/Examples/_LOWriter_ParStyleFontColor.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" font color to $LOW_COLOR_RED, Transparency to 50%, and Highlight to $LOW_COLOR_GOLD _LOWriter_ParStyleFontColor($oParStyle, $LOW_COLOR_RED, 50, $LOW_COLOR_GOLD) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleFontColor($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Font Color settings are as follows: " & @CRLF & _ "The current Font color is, in Long color format: " & $avParStyleSettings[0] & " This value is a bit weird because transparency" & _ @@ -41,11 +41,11 @@ Func Example() ; Set "Default Paragraph Style" font Transparency to 100% _LOWriter_ParStyleFontColor($oParStyle, Null, 0) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleFontColor($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Font Color settings are as follows: " & @CRLF & _ "The current Font color is, in Long color format: " & $avParStyleSettings[0] & @CRLF & _ @@ -56,7 +56,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleGetObj.au3 b/Examples/_LOWriter_ParStyleGetObj.au3 index 6cfe3df0..24e129d9 100644 --- a/Examples/_LOWriter_ParStyleGetObj.au3 +++ b/Examples/_LOWriter_ParStyleGetObj.au3 @@ -9,31 +9,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate getting the paragraph style object.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now retrieve the default paragraph style object, and modify some of its settings.") ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" font weight to bold. _LOWriter_ParStyleFont($oDoc, $oParStyle, Null, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleHyphenation.au3 b/Examples/_LOWriter_ParStyleHyphenation.au3 index 102c16fa..c22d79ae 100644 --- a/Examples/_LOWriter_ParStyleHyphenation.au3 +++ b/Examples/_LOWriter_ParStyleHyphenation.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line" & @CR & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Hyphenation settings to, AutoHyphen = True, Hyphen words in caps = False, Max hyphens, 20, ; Minimum leading characters = 3, minimum trailing = 4 _LOWriter_ParStyleHyphenation($oParStyle, True, False, 20, 3, 4) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleHyphenation($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Hyphenation settings are as follows: " & @CRLF & _ "Automatic hyphenation? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleIndent.au3 b/Examples/_LOWriter_ParStyleIndent.au3 index d396d02a..d6dc6d23 100644 --- a/Examples/_LOWriter_ParStyleIndent.au3 +++ b/Examples/_LOWriter_ParStyleIndent.au3 @@ -11,40 +11,40 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @LF & "Next Line" & @CR & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers3 = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Indent settings to, 1/4" Before paragraph, 1/2" afterparagraph, First line indent = 1", ; Auto First line = False _LOWriter_ParStyleIndent($oParStyle, $iMicrometers, $iMicrometers2, $iMicrometers3, False) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleIndent($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Indent settings are as follows: " & @CRLF & _ "Indent spacing before the paragraph, in Micrometers: " & $avParStyleSettings[0] & @CRLF & _ @@ -56,7 +56,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleOrganizer.au3 b/Examples/_LOWriter_ParStyleOrganizer.au3 index 3aa44e4d..b2485519 100644 --- a/Examples/_LOWriter_ParStyleOrganizer.au3 +++ b/Examples/_LOWriter_ParStyleOrganizer.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a new Paragraph Style to use for demonstration. $oParStyle = _LOWriter_ParStyleCreate($oDoc, "NewParStyle") - If (@error > 0) Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Paragraph Style. Error:" & @error & " Extended:" & @extended) ; Change the paragraph Style's name to "New-Par-Name", Set the follow style to "List", the parent style to "Default Paragraph Style", ; And Auto update To True, and hidden to False _LOWriter_ParStyleOrganizer($oDoc, $oParStyle, "New-Par-Name", "List", "Default Paragraph Style", True, False) - If (@error > 0) Then _ERROR("Failed to modify Paragraph Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Paragraph Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleOrganizer($oDoc, $oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Organizer settings are as follows: " & @CRLF & _ "The Paragraph Style's name is: " & $avParStyleSettings[0] & @CRLF & _ @@ -36,7 +36,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleOutLineAndList.au3 b/Examples/_LOWriter_ParStyleOutLineAndList.au3 index 9a16b727..32de6e0b 100644 --- a/Examples/_LOWriter_ParStyleOutLineAndList.au3 +++ b/Examples/_LOWriter_ParStyleOutLineAndList.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line" & @CR & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Outline and List settings to, Outline level $LOW_OUTLINE_LEVEL_1, Numbering style,"Numbering 123", ; Include line in paragraph count? True, Line count value = 1. _LOWriter_ParStyleOutLineAndList($oDoc, $oParStyle, $LOW_OUTLINE_LEVEL_1, "Numbering 123", True, 1) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleOutLineAndList($oDoc, $oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Outline and List settings are as follows: " & @CRLF & _ "What Outline level is this Paragraph style set to? (see UDF constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleOverLine.au3 b/Examples/_LOWriter_ParStyleOverLine.au3 index 901e81e7..0bf82013 100644 --- a/Examples/_LOWriter_ParStyleOverLine.au3 +++ b/Examples/_LOWriter_ParStyleOverLine.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Overline settings to Words only = True, Overline style $LOW_UNDERLINE_BOLD_DASH_DOT, Overline has ; Color = True, and Color to $LOW_COLOR_BROWN _LOWriter_ParStyleOverLine($oParStyle, True, $LOW_UNDERLINE_BOLD_DASH_DOT, True, $LOW_COLOR_BROWN) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleOverLine($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Overline settings are as follows: " & @CRLF & _ "Overline words only? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStylePageBreak.au3 b/Examples/_LOWriter_ParStylePageBreak.au3 index 384a8907..561ee7e1 100644 --- a/Examples/_LOWriter_ParStylePageBreak.au3 +++ b/Examples/_LOWriter_ParStylePageBreak.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line" & @CR & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Page break settings, Break type = $LOW_BREAK_PAGE_BEFORE, Page number offset = 2, Page style = "Landscape". _LOWriter_ParStylePageBreak($oDoc, $oParStyle, $LOW_BREAK_PAGE_BEFORE, 2, "Landscape") - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStylePageBreak($oDoc, $oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Page break settings are as follows: " & @CRLF & _ "What type of Page break, if any is used? (see UDF constants): " & $avParStyleSettings[0] & @CRLF & _ @@ -41,7 +41,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStylePosition.au3 b/Examples/_LOWriter_ParStylePosition.au3 index 801c7e22..0eec0b07 100644 --- a/Examples/_LOWriter_ParStylePosition.au3 +++ b/Examples/_LOWriter_ParStylePosition.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" font position to auto Superscript, and relative size to 50%. _LOWriter_ParStylePosition($oParStyle, True, Null, Null, Null, 50) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStylePosition($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -42,11 +42,11 @@ Func Example() ; Set "Default Paragraph Style" font position to auto Subscript _LOWriter_ParStylePosition($oParStyle, Null, Null, True) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStylePosition($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's new position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStylePosition[2].au3 b/Examples/_LOWriter_ParStylePosition[2].au3 index 37df93fb..50d3bca1 100644 --- a/Examples/_LOWriter_ParStylePosition[2].au3 +++ b/Examples/_LOWriter_ParStylePosition[2].au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" font position to 75% Superscript, and relative size to 50%. _LOWriter_ParStylePosition($oParStyle, Null, 75, Null, Null, 50) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStylePosition($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -42,11 +42,11 @@ Func Example() ; Set "Default Paragraph Style" font position to 75% Subscript _LOWriter_ParStylePosition($oParStyle, Null, Null, Null, 75) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStylePosition($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's new position settings are as follows: " & @CRLF & _ "Is Auto-SuperScript? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleRotateScale.au3 b/Examples/_LOWriter_ParStyleRotateScale.au3 index cfe565c2..ecd3dcf4 100644 --- a/Examples/_LOWriter_ParStyleRotateScale.au3 +++ b/Examples/_LOWriter_ParStyleRotateScale.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" font Rotation to 90 degrees and scale to 75%. _LOWriter_ParStyleRotateScale($oParStyle, 90, 75) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleRotateScale($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Rotation and scale settings are as follows: " & @CRLF & _ "Current rotation in degrees: " & $avParStyleSettings[0] & @CRLF & _ @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleSet.au3 b/Examples/_LOWriter_ParStyleSet.au3 index 4fe44882..7f20a0b2 100644 --- a/Examples/_LOWriter_ParStyleSet.au3 +++ b/Examples/_LOWriter_ParStyleSet.au3 @@ -9,27 +9,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I set the Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate setting the paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now set the current paragraph style to ""Heading 1.""") ; Set the Paragraph style to Heading 1 using the ViewCursor. _LOWriter_ParStyleSet($oDoc, $oViewCursor, "Heading 1") - If (@error > 0) Then _ERROR("Failed to set the Paragraph style. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleShadow.au3 b/Examples/_LOWriter_ParStyleShadow.au3 index 14ec2a6c..807bff7f 100644 --- a/Examples/_LOWriter_ParStyleShadow.au3 +++ b/Examples/_LOWriter_ParStyleShadow.au3 @@ -11,31 +11,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Shadow to 1/4" wide, Color to $LOW_COLOR_PURPLE, Transparent to false, and location to $LOW_SHADOW_TOP_LEFT _LOWriter_ParStyleShadow($oParStyle, $iMicrometers, $LOW_COLOR_PURPLE, False, $LOW_SHADOW_TOP_LEFT) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleShadow($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current shadow settings are as follows: " & @CRLF & _ "Shadow width, in micrometers: " & $avParStyleSettings[0] & @CRLF & _ @@ -47,7 +47,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleSpace.au3 b/Examples/_LOWriter_ParStyleSpace.au3 index 1db97f36..efa9e363 100644 --- a/Examples/_LOWriter_ParStyleSpace.au3 +++ b/Examples/_LOWriter_ParStyleSpace.au3 @@ -11,36 +11,36 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line" & @CR & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers2 = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" line space settings to, 1/4" above paragraph, 1/4" below paragraph, AddSpace = True, Line space mode = ; $LOW_LINE_SPC_MODE_FIX, Line space height = 1/2", and Page Line Space = False. _LOWriter_ParStyleSpace($oParStyle, $iMicrometers, $iMicrometers, True, $LOW_LINE_SPC_MODE_FIX, $iMicrometers2, False) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleSpace($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current line Spacing settings are as follows: " & @CRLF & _ "Spacing above the paragraph, in Micrometers: " & $avParStyleSettings[0] & @CRLF & _ @@ -53,7 +53,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleSpacing.au3 b/Examples/_LOWriter_ParStyleSpacing.au3 index 45d4a83a..245130b1 100644 --- a/Examples/_LOWriter_ParStyleSpacing.au3 +++ b/Examples/_LOWriter_ParStyleSpacing.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" kerning to Auto _LOWriter_ParStyleSpacing($oParStyle, True) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleSpacing($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current kerning settings are as follows: " & @CRLF & _ "Automatically adjust kerning? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -39,11 +39,11 @@ Func Example() ; Set "Default Paragraph Style" kerning to 1.5 _LOWriter_ParStyleSpacing($oParStyle, False, 1.5) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleSpacing($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current kerning settings are as follows: " & @CRLF & _ "Automatically adjust kerning? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -53,7 +53,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleStrikeOut.au3 b/Examples/_LOWriter_ParStyleStrikeOut.au3 index 453579a4..b44c0fc1 100644 --- a/Examples/_LOWriter_ParStyleStrikeOut.au3 +++ b/Examples/_LOWriter_ParStyleStrikeOut.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Strikeout settings to, Words only = True, Strikeout = True, Line style = $LOW_STRIKEOUT_X _LOWriter_ParStyleStrikeOut($oParStyle, True, True, $LOW_STRIKEOUT_X) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleStrikeOut($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Strikeout settings are as follows: " & @CRLF & _ "Strikeout words only? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -41,7 +41,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleTabStopCreate.au3 b/Examples/_LOWriter_ParStyleTabStopCreate.au3 index c798d71a..2be77387 100644 --- a/Examples/_LOWriter_ParStyleTabStopCreate.au3 +++ b/Examples/_LOWriter_ParStyleTabStopCreate.au3 @@ -10,20 +10,20 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a TabStop at 1/4" Tab Stop position, Set the fill character to Asc(~) the Tilde key ASCII Value 126. ; Set alignment To $LOW_TAB_ALIGN_DECIMAL, and the decimal character to ASC(.) a period, ASCII value 46. $iTabStop = _LOWriter_ParStyleTabStopCreate($oParStyle, $iMicrometers, Asc("~"), $LOW_TAB_ALIGN_DECIMAL, Asc(".")) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The new Tab stop has the position of " & $iTabStop) @@ -31,7 +31,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleTabStopDelete.au3 b/Examples/_LOWriter_ParStyleTabStopDelete.au3 index 09939c00..9a945294 100644 --- a/Examples/_LOWriter_ParStyleTabStopDelete.au3 +++ b/Examples/_LOWriter_ParStyleTabStopDelete.au3 @@ -11,23 +11,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a TabStop at 1/4" Tab Stop position. $iTabStop = _LOWriter_ParStyleTabStopCreate($oParStyle, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Delete the newly created Tab Stop. $bDeleted = _LOWriter_ParStyleTabStopDelete($oDoc, $oParStyle, $iTabStop) - If (@error > 0) Then _ERROR("Failed to delete the Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete the Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Was the Tab stop successfully deleted? True/False: " & $bDeleted) @@ -35,7 +35,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleTabStopList.au3 b/Examples/_LOWriter_ParStyleTabStopList.au3 index 9f2f0b83..5b823df2 100644 --- a/Examples/_LOWriter_ParStyleTabStopList.au3 +++ b/Examples/_LOWriter_ParStyleTabStopList.au3 @@ -12,39 +12,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a Tab Stop for the demonstration. _LOWriter_ParStyleTabStopCreate($oParStyle, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create another Tab Stop for the demonstration. _LOWriter_ParStyleTabStopCreate($oParStyle, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Convert 1" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create another Tab Stop for the demonstration. _LOWriter_ParStyleTabStopCreate($oParStyle, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of tab stop positions. $aiTabstops = _LOWriter_ParStyleTabStopList($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph style tab stop positions. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph style tab stop positions. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The number of Tabstops found is " & @extended & @CRLF & @CRLF & "I will now display the array of tab stop positions.") @@ -55,7 +55,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleTabStopMod.au3 b/Examples/_LOWriter_ParStyleTabStopMod.au3 index e3de46a7..bd444f7a 100644 --- a/Examples/_LOWriter_ParStyleTabStopMod.au3 +++ b/Examples/_LOWriter_ParStyleTabStopMod.au3 @@ -11,34 +11,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Convert 1/4" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.25) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Create a Tab Stop for the demonstration. $iTabStop = _LOWriter_ParStyleTabStopCreate($oParStyle, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a Paragraph Tab stop. Error:" & @error & " Extended:" & @extended) ; Convert 1/2" to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Modify the TabStop from 1/4" to 1/2" Tab Stop position, Set the fill character to Asc(~) the Tilde key ASCII Value 126. ; Set alignment To $LOW_TAB_ALIGN_DECIMAL, and the decimal character to ASC(.) a period, ASCII value 46. ; Since I am modifying the TabStop position, @Extended will be my new Tab Stop position. _LOWriter_ParStyleTabStopMod($oParStyle, $iTabStop, $iMicrometers, Asc("~"), $LOW_TAB_ALIGN_DECIMAL, Asc(".")) $iTabStop = @extended - If (@error > 0) Then _ERROR("Failed to modify Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avTabStop = _LOWriter_ParStyleTabStopMod($oParStyle, $iTabStop) - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph Tab stop settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Tab stop, having the position of " & $iTabStop & " has the following settings: " & @CRLF & _ "The Current position is, in micrometers: " & $avTabStop[0] & @CRLF & _ @@ -50,7 +50,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleTxtFlowOpt.au3 b/Examples/_LOWriter_ParStyleTxtFlowOpt.au3 index 6facbc2e..e2728725 100644 --- a/Examples/_LOWriter_ParStyleTxtFlowOpt.au3 +++ b/Examples/_LOWriter_ParStyleTxtFlowOpt.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style." & @CR & "Next Line" & @CR & "Next Line" & @LF) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" Text Flow settings to, Split par, false, Keep Together, false, Orphans 3, Widows 0(off) _LOWriter_ParStyleTxtFlowOpt($oParStyle, False, False, 3, 0) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleTxtFlowOpt($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current Text Flow settings are as follows: " & @CRLF & _ "Allow the paragraph to be split between pages? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -42,7 +42,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStyleUnderLine.au3 b/Examples/_LOWriter_ParStyleUnderLine.au3 index 89016c50..163e7e4c 100644 --- a/Examples/_LOWriter_ParStyleUnderLine.au3 +++ b/Examples/_LOWriter_ParStyleUnderLine.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text before I modify the Default Paragraph style. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to demonstrate modifying a paragraph style.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Retrieve the "Default Paragraph Style" object. $oParStyle = _LOWriter_ParStyleGetObj($oDoc, "Default Paragraph Style") - If (@error > 0) Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Paragraph style object. Error:" & @error & " Extended:" & @extended) ; Set "Default Paragraph Style" underline settings to Words only = True, Underline style $LOW_UNDERLINE_BOLD_DASH_DOT, Underline has ; Color = True, and Color to $LOW_COLOR_BROWN _LOWriter_ParStyleUnderLine($oParStyle, True, $LOW_UNDERLINE_BOLD_DASH_DOT, True, $LOW_COLOR_BROWN) - If (@error > 0) Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Paragraph style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the current settings. Return will be an array with element values in order of function parameter. $avParStyleSettings = _LOWriter_ParStyleUnderLine($oParStyle) - If (@error > 0) Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the Paragraph style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Paragraph's current underline settings are as follows: " & @CRLF & _ "Underline words only? True/False: " & $avParStyleSettings[0] & @CRLF & _ @@ -43,7 +43,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ParStylesGetNames.au3 b/Examples/_LOWriter_ParStylesGetNames.au3 index 4c2b9f7a..1b08fb4f 100644 --- a/Examples/_LOWriter_ParStylesGetNames.au3 +++ b/Examples/_LOWriter_ParStylesGetNames.au3 @@ -10,57 +10,57 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Paragraph Style names. $asParStyles = _LOWriter_ParStylesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now insert a list of available Paragraph styles. There are " & @extended & " results.") ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Paragraph Styles available in this document are:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asParStyles) -1 ; Insert the Paragraph Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asParStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next ; Retrieve Array of Paragraph Style names that are applied to the document $asParStyles = _LOWriter_ParStylesGetNames($oDoc, False, True) - If (@error > 0) Then _ERROR("Failed to retrieve array of Paragraph style names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve array of Paragraph style names. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now display a list of used Paragraph styles. There is " & @extended & " result.") ; Move the View Cursor to the end of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_End) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the View Cursor to the start of the document, select the text. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START,1,True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Paragraph Styles currently in use in this document are:" & @CR & @CR,True) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asParStyles) -1 ; Insert the Paragraph Style name. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asParStyles[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_SearchDescriptorCreate.au3 b/Examples/_LOWriter_SearchDescriptorCreate.au3 index fb3fb348..e735a73d 100644 --- a/Examples/_LOWriter_SearchDescriptorCreate.au3 +++ b/Examples/_LOWriter_SearchDescriptorCreate.au3 @@ -11,30 +11,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the word "Search" using the search descriptor I just created. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Search", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched backwards, and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -43,16 +43,16 @@ Func Example() ; Create a new search descriptor for searching with. Set Backward to False, and Match Case to True. I could have just modified ; my first search descriptor using the modify function, but since I am demonstrating the Search Descriptor Creation function, I will just make a new one. $oSrchDesc2 = _LOWriter_SearchDescriptorCreate($oDoc, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the word "SearcH" using the search descriptor I just created. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc2, "SearcH", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched, matching case, and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -62,7 +62,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_SearchDescriptorCreate[2].au3 b/Examples/_LOWriter_SearchDescriptorCreate[2].au3 index 1e58b897..63e55680 100644 --- a/Examples/_LOWriter_SearchDescriptorCreate[2].au3 +++ b/Examples/_LOWriter_SearchDescriptorCreate[2].au3 @@ -11,30 +11,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. Set Backward to False, Match Case = False, Whole Word = True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the word "Search" using the search descriptor I just created. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Search", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched for whole words only, and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -45,12 +45,12 @@ Func Example() ; Search for the word "Search" using the search descriptor I just created. Starting from my last result. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Search", $aAnEmptyArray, Null, $oResult) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched for whole words only, and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -62,17 +62,17 @@ Func Example() ; I could have just modified my first search descriptor using the modify function, but since I am demonstrating the Search Descriptor Creation ; function, I will just make a new one. $oSrchDesc2 = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the regular expression \b[a-z]{8}\b, which means find a word 8 letters long, \b means word boundry, meaning the result will start at ; the beginning of a whole word, and end at the end of a whole word. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc2, "\b[a-z]{8}\b", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a regular expression, and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -82,7 +82,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_SearchDescriptorCreate[3].au3 b/Examples/_LOWriter_SearchDescriptorCreate[3].au3 index b829a7fd..885954c3 100644 --- a/Examples/_LOWriter_SearchDescriptorCreate[3].au3 +++ b/Examples/_LOWriter_SearchDescriptorCreate[3].au3 @@ -12,33 +12,33 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Set the last paragraph to Paragraph Style Title using the View Cursor _LOWriter_ParStyleSet($oDoc, $oViewCursor, "Title") ; Create a search descriptor for searching with. Set Backward, Match Case, Whole Word, and Regular Expressions to False, and Search Styles to True. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the Paragraph Style "Title" using the search descriptor I just created. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Title", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched for the Paragraph Style ""Title"", and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -46,39 +46,39 @@ Func Example() ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font weight to (Bold) $LOW_WEIGHT_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, Null, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a new search descriptor for searching with. Set Backward, Match Case, Whole word, Regular Expression, and Search Styles to false, and ; Search property values to True. ; I could have just modified my first search descriptor using the modify function, but since I am demonstrating the Search Descriptor Creation ; function, I will just make a new one. $oSrchDesc2 = _LOWriter_SearchDescriptorCreate($oDoc, False, False, False, False, False, True) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Bold font. _LOWriter_FindFormatModifyFont($oDoc, $atFindFormat, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search" that is bold. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc2, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using a Find Format, looking for a boldened word, and found the following: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -88,7 +88,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_SearchDescriptorCreate[4].au3 b/Examples/_LOWriter_SearchDescriptorCreate[4].au3 index fd030e2d..106d1dff 100644 --- a/Examples/_LOWriter_SearchDescriptorCreate[4].au3 +++ b/Examples/_LOWriter_SearchDescriptorCreate[4].au3 @@ -13,30 +13,30 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor for searching with. All set to False $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the word "Search using the search descriptor I just created. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Search", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched for the word ""Search"", and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -44,41 +44,41 @@ Func Example() ; Move the View Cursor to the start of the document _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GOTO_START) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 29 spaces _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 29) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SEArch". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 6, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font to and weight (Bold) to $LOW_WEIGHT_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, Null, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Move the cursor right 10 spaces, without selecting _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 10, False) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Select the word "SearcHing". _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 9, True) - If (@error > 0) Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move ViewCursor. Error:" & @error & " Extended:" & @extended) ; Set the selected text's Font weight to $LOW_WEIGHT_SEMI_BOLD _LOWriter_DirFrmtFont($oDoc, $oViewCursor, Null, Null, Null, $LOW_WEIGHT_SEMI_BOLD) - If (@error > 0) Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the Selected text's settings. Error:" & @error & " Extended:" & @extended) ; Create a Find Format Search Array for Bold font. _LOWriter_FindFormatModifyFont($oDoc, $atFindFormat, Null, Null, $LOW_WEIGHT_BOLD) - If (@error > 0) Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify a Find format array. Error:" & @error & " Extended:" & @extended) ; Search for the word "search", I am using a FindFormat Array with the Bold attribute, however I still have $bSearchPropValues set to false, ; which means instead of searching for formatting that is bold, it will search for any direct formatting involving font weight, so those ; two words I directly formatted above, one to Bold weight the other to Semi-Bold weight, will both be found. $aoResults = _LOWriter_DocFindAll($oDoc, $oSrchDesc, "search", $atFindFormat) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) ; Clear my result String $sResultString = "" @@ -87,7 +87,7 @@ Func Example() If IsArray($aoResults) Then For $i = 0 To UBound($aoResults) - 1 $sResultString &= _LOWriter_DocGetString($aoResults[$i]) & @CRLF - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) Next EndIf @@ -97,7 +97,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_SearchDescriptorModify.au3 b/Examples/_LOWriter_SearchDescriptorModify.au3 index 1b6d5d09..825be05e 100644 --- a/Examples/_LOWriter_SearchDescriptorModify.au3 +++ b/Examples/_LOWriter_SearchDescriptorModify.au3 @@ -12,34 +12,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, seaRch." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor with all set to False. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; modify the Search descriptor to set Match Case to True, and Whole Words to True _LOWriter_SearchDescriptorModify($oSrchDesc, False, True, True) - If (@error > 0) Then _ERROR("Failed to modify the search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify the search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the word "seaRch" using the search descriptor I just created. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "seaRch", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -47,7 +47,7 @@ Func Example() ; Retrieve the current Search Descriptor settings. $abSearch = _LOWriter_SearchDescriptorModify($oSrchDesc) - If (@error > 0) Then _ERROR("Failed to retrieve settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Search Descriptor settings are as follows: " & @CRLF & _ "Search backwards? True/False: " & $abSearch[0] & @CRLF & _ @@ -61,7 +61,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_SearchDescriptorSimilarityModify.au3 b/Examples/_LOWriter_SearchDescriptorSimilarityModify.au3 index f4ad9c5f..789ab655 100644 --- a/Examples/_LOWriter_SearchDescriptorSimilarityModify.au3 +++ b/Examples/_LOWriter_SearchDescriptorSimilarityModify.au3 @@ -12,35 +12,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert some text, to use for searching later. _LOWriter_DocInsertString($oDoc, $oViewCursor, "Some text to Search, SeArCh, SEArch, SEARCH, SearcHing, seaRched, search." & @CR & "A New Line.") - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) ; Create a search descriptor with all set to False. $oSrchDesc = _LOWriter_SearchDescriptorCreate($oDoc) - If (@error > 0) Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a search descriptor. Error:" & @error & " Extended:" & @extended) ; modify the Search descriptor to set the similarity settings to: Similarity = True, Combine = True, Number of characters to remove = 1, ; Number of characters to add, = 1, Number of characters to exchange = 2. _LOWriter_SearchDescriptorSimilarityModify($oSrchDesc, True, True, 1, 1, 2) - If (@error > 0) Then _ERROR("Failed to modify the search descriptor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to modify the search descriptor. Error:" & @error & " Extended:" & @extended) ; Search for the word "Szarzhin" using the search descriptor I just created. $oResult = _LOWriter_DocFindNext($oDoc, $oSrchDesc, "Szarzhin", $aAnEmptyArray) - If (@error > 0) Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to perform search in the document. Error:" & @error & " Extended:" & @extended) $sResultString = "" ; Retrieve the Result's string. If IsObj($oResult) Then $sResultString = _LOWriter_DocGetString($oResult) - If (@error > 0) Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The search was successful, I searched using similarity, and found the following word: " & $sResultString) Else MsgBox($MB_OK, "", "The search was successful, but returned no results.") @@ -48,7 +48,7 @@ Func Example() ; Retrieve the current Similarity settings. $avSim = _LOWriter_SearchDescriptorSimilarityModify($oSrchDesc) - If (@error > 0) Then _ERROR("Failed to retrieve settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Search Descriptor's Similarity settings are as follows: " & @CRLF & _ "Search using Similarity? True/False: " & $avSim[0] & @CRLF & _ @@ -61,7 +61,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_ShapesGetNames.au3 b/Examples/_LOWriter_ShapesGetNames.au3 index cc30127b..6c0d302b 100644 --- a/Examples/_LOWriter_ShapesGetNames.au3 +++ b/Examples/_LOWriter_ShapesGetNames.au3 @@ -11,19 +11,19 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Insert a Frame into the document. _LOWriter_FrameCreate($oDoc, $oViewCursor, Null, 3000, 3000) - If (@error > 0) Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create a Frame. Error:" & @error & " Extended:" & @extended) ; Retrieve an array of Shape names currently in the document. $asShapes = _LOWriter_ShapesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve a list of Shapes. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve a list of Shapes. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($asShapes) @@ -31,7 +31,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableBorderColor.au3 b/Examples/_LOWriter_TableBorderColor.au3 index fab26dd7..7687b853 100644 --- a/Examples/_LOWriter_TableBorderColor.au3 +++ b/Examples/_LOWriter_TableBorderColor.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 3 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the Border width so I can set the Border Color. _LOWriter_TableBorderWidth($oTable, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) ; Set the Border color to a random number for each side. _LOWriter_TableBorderColor($oTable, Random(0, 16777215, $iIntegerFlag), Random(0, 16777215, $iIntegerFlag), Random(0, 16777215, $iIntegerFlag), _ Random(0, 16777215, $iIntegerFlag), Random(0, 16777215, $iIntegerFlag), Random(0, 16777215, $iIntegerFlag)) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border Color settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border Color settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current Border Style settings. Array will be 6 elements, in order of function parameters. $aTableBorder = _LOWriter_TableBorderColor($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Border Color settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Border Color settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Border Color settings are: " & @CRLF & "Top = " & $aTableBorder[0] & @CRLF & "Bottom = " & $aTableBorder[1] & @CRLF & _ "Left = " & $aTableBorder[2] & @CRLF & "Right = " & $aTableBorder[3] & @CRLF & "Vertical = " & $aTableBorder[4] & @CRLF & "Horizontal = " & $aTableBorder[5]) @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableBorderPadding.au3 b/Examples/_LOWriter_TableBorderPadding.au3 index 055207af..7e7566e8 100644 --- a/Examples/_LOWriter_TableBorderPadding.au3 +++ b/Examples/_LOWriter_TableBorderPadding.au3 @@ -11,35 +11,35 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the outer table borders to medium thickness. _LOWriter_TableBorderWidth($oTable, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM, $LOW_BORDERWIDTH_MEDIUM) - If (@error > 0) Then _ERROR("Failed to set Table Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Table Border width settings. Error:" & @error & " Extended:" & @extended) ; Convert 1/2 Inch to Micrometers. $iMicrometers = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the Table padding to 1/2" _LOWriter_TableBorderPadding($oTable, $iMicrometers, $iMicrometers, $iMicrometers, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set Table Border Padding settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Table Border Padding settings. Error:" & @error & " Extended:" & @extended) ; Retrieve Table Border Padding settings. Return will be an Array, with values in order of function parameters. $aiPadding = _LOWriter_TableBorderPadding($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Table Border Padding settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Table Border Padding settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Table Border padding values are as follows: " & @CRLF & _ "Top = " & $aiPadding[0] & " Micrometers" & @CRLF & _ @@ -51,7 +51,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableBorderStyle.au3 b/Examples/_LOWriter_TableBorderStyle.au3 index 2a190e6a..ab4b444d 100644 --- a/Examples/_LOWriter_TableBorderStyle.au3 +++ b/Examples/_LOWriter_TableBorderStyle.au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 3 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the Border width so I can set the Border Style. _LOWriter_TableBorderWidth($oTable, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) ; Set the Border Style, a different style on each side. _LOWriter_TableBorderStyle($oTable, $LOW_BORDERSTYLE_DOTTED, $LOW_BORDERSTYLE_DASHED, $LOW_BORDERSTYLE_DASH_DOT_DOT, $LOW_BORDERSTYLE_THICKTHIN_SMALLGAP, $LOW_BORDERSTYLE_EMBOSSED, $LOW_BORDERSTYLE_DOUBLE_THIN) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border Style settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current Border Style settings.Array will be 6 elements, in order of function parameters. $aTableBorder = _LOWriter_TableBorderStyle($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Border Style settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Border Style settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Border Style settings are: " & @CRLF & "Top = " & $aTableBorder[0] & @CRLF & "Bottom = " & $aTableBorder[1] & @CRLF & _ "Left = " & $aTableBorder[2] & @CRLF & "Right = " & $aTableBorder[3] & @CRLF & "Vertical = " & $aTableBorder[4] & @CRLF & "Horizontal = " & $aTableBorder[5] & _ @@ -44,7 +44,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableBorderWidth.au3 b/Examples/_LOWriter_TableBorderWidth.au3 index 97f8f1c2..3a7f05da 100644 --- a/Examples/_LOWriter_TableBorderWidth.au3 +++ b/Examples/_LOWriter_TableBorderWidth.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 3 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the Border width. _LOWriter_TableBorderWidth($oTable, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK, $LOW_BORDERWIDTH_THICK) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Border width settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current Border Style settings. Array will be 6 elements, in order of function parameters. $aTableBorder = _LOWriter_TableBorderWidth($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Border Width settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Border Width settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The current Border Width settings are: " & @CRLF & "Top = " & $aTableBorder[0] & @CRLF & "Bottom = " & $aTableBorder[1] & @CRLF & _ "Left = " & $aTableBorder[2] & @CRLF & "Right = " & $aTableBorder[3] & @CRLF & "Vertical = " & $aTableBorder[4] & @CRLF & "Horizontal = " & $aTableBorder[5]) @@ -39,7 +39,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableBreak.au3 b/Examples/_LOWriter_TableBreak.au3 index 2eeed444..99daa0c4 100644 --- a/Examples/_LOWriter_TableBreak.au3 +++ b/Examples/_LOWriter_TableBreak.au3 @@ -11,44 +11,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next ; Retrieve the Table's Break settings. $avTableBreak = _LOWriter_TableBreak($oDoc, $oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Table settings. Error:" & @error & " Extended:" & @extended) ; Array elements will be in order of function's parameters. MsgBox($MB_OK, "", "The current Paragraph break settings table are: " & @CRLF & _ @@ -59,11 +59,11 @@ Func Example() ; Change the Table Break settings to: Page break before the Table, $LOW_BREAK_PAGE_BEFORE, Use the page style "Landscape" for after the break, ; And start page numbering at 2. _LOWriter_TableBreak($oDoc, $oTable, $LOW_BREAK_PAGE_BEFORE, "Landscape", 2) - If (@error > 0) Then _ERROR("Failed to set TableBreak settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set TableBreak settings. Error:" & @error & " Extended:" & @extended) ; Retrieve the third down (Row 2) settings again. $avTableBreak = _LOWriter_TableBreak($oDoc, $oTable) - If (@error > 0) Then _ERROR("Failed to retrieve row settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve row settings. Error:" & @error & " Extended:" & @extended) ; Array elements will be in order of function's parameters. MsgBox($MB_OK, "", "The new Paragraph break settings table are: " & @CRLF & _ @@ -75,7 +75,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableColor.au3 b/Examples/_LOWriter_TableColor.au3 index cc446a4a..087be2b5 100644 --- a/Examples/_LOWriter_TableColor.au3 +++ b/Examples/_LOWriter_TableColor.au3 @@ -10,27 +10,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the table Background color, and set Transparent to False. _LOWriter_TableColor($oTable, $LOW_COLOR_LIME, False) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current settings. $avTableProps = _LOWriter_TableColor($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Current Text Table color settings are: " & @CRLF & _ "Table background color: " & $avTableProps[0] & @CRLF & _ @@ -40,7 +40,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableColumnDelete.au3 b/Examples/_LOWriter_TableColumnDelete.au3 index fcf84f85..0c6bb743 100644 --- a/Examples/_LOWriter_TableColumnDelete.au3 +++ b/Examples/_LOWriter_TableColumnDelete.au3 @@ -10,56 +10,56 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 4 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 4) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next MsgBox($MB_OK, "", "I am going to delete the 3rd column over, Column 2, in this table.") _LOWriter_TableColumnDelete($oTable, 2, 1) - If (@error > 0) Then _ERROR("Failed to delete Text Table Column. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Text Table Column. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to delete the columns from the 2nd column over, Column 1, to the last column in this table.") _LOWriter_TableColumnDelete($oTable, 1, 2) - If (@error > 0) Then _ERROR("Failed to delete Text Table Column. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Text Table Column. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableColumnGetCount.au3 b/Examples/_LOWriter_TableColumnGetCount.au3 index 25f51771..fb6ee9b7 100644 --- a/Examples/_LOWriter_TableColumnGetCount.au3 +++ b/Examples/_LOWriter_TableColumnGetCount.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Table names. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table column count. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "This Table has " & $iColumns & " columns.") @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableColumnInsert.au3 b/Examples/_LOWriter_TableColumnInsert.au3 index 5983d893..eedf2db3 100644 --- a/Examples/_LOWriter_TableColumnInsert.au3 +++ b/Examples/_LOWriter_TableColumnInsert.au3 @@ -10,38 +10,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next @@ -49,20 +49,20 @@ Func Example() ; Insert 1 column before the 0th (first) column _LOWriter_TableColumnInsert($oTable, 1, 0) - If (@error > 0) Then _ERROR("Failed to insert column into Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert column into Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to add another 2 columns after the last column in this table.") ; Insert 2 columns after the 3rd (last) column, to do this, I add one to the current number of columns, remembering that column numbering ; starts at 0. _LOWriter_TableColumnInsert($oTable, 2, 4) - If (@error > 0) Then _ERROR("Failed to insert column into Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert column into Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableCreate.au3 b/Examples/_LOWriter_TableCreate.au3 index 11d83b01..91255721 100644 --- a/Examples/_LOWriter_TableCreate.au3 +++ b/Examples/_LOWriter_TableCreate.au3 @@ -9,27 +9,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3, True, $LOW_COLOR_TEAL, "CustomTableName") - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created the Table Object, but it doesn't exist in the document until I insert it.") ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableCreateCursor.au3 b/Examples/_LOWriter_TableCreateCursor.au3 index 0a7150dd..93dd8ef8 100644 --- a/Examples/_LOWriter_TableCreateCursor.au3 +++ b/Examples/_LOWriter_TableCreateCursor.au3 @@ -9,42 +9,42 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to insert a table so that I can demonstrate a Table Cursor.") ; Create a Table, 5 rows, 4 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 4) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Create a Table Cursor at cell A1, which is the first cell of the table. $oTableCursor = _LOWriter_TableCreateCursor($oDoc, $oTable, "A1") - If (@error > 0) Then _ERROR("Failed to create Text Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to move the table cursor down three cells, selecting them, and then combine them. In terms of usefulness, this " & _ "is about all it is good for, is for combining or splitting table cells.") ; Move the Table Cursor down three cells, selecting them _LOWriter_CursorMove($oTableCursor, $LOW_TABLECUR_GO_DOWN, 3, True) - If (@error > 0) Then _ERROR("Failed to move Text Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Text Table Cursor. Error:" & @error & " Extended:" & @extended) ; Merge the Cells selected by this Table Cursor. _LOWriter_TableCursor($oTableCursor, Null, False, True) - If (@error > 0) Then _ERROR("Failed to merge cells selected by Text Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to merge cells selected by Text Table Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableCursor.au3 b/Examples/_LOWriter_TableCursor.au3 index 2b11413a..400ff914 100644 --- a/Examples/_LOWriter_TableCursor.au3 +++ b/Examples/_LOWriter_TableCursor.au3 @@ -10,92 +10,92 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 4 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 4, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next ; Create a Table Cursor. -- Cursor will be created in the first cell ("A1") $oTableCursor = _LOWriter_TableCreateCursor($oDoc, $oTable) - If (@error > 0) Then _ERROR("Failed to create Text Table cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table cursor. Error:" & @error & " Extended:" & @extended) ; Move the TableCursor right Twice, which will place it in the third over cell, (Cell "C1"). _LOWriter_CursorMove($oTableCursor, $LOW_TABLECUR_GO_RIGHT, 2) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) ; Move the Table Cursor to the last cell on the top row, (Cell "E1"), selecting from Cell "C1" to cell "E1" _LOWriter_TableCursor($oTableCursor, "E1", True) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press OK To merge Cells ""C1"", ""D1"", ""E1"" together.") ; Merge cells "C1" to "E1" _LOWriter_TableCursor($oTableCursor, Null, False, True) - If (@error > 0) Then _ERROR("Failed to merge Table cells. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to merge Table cells. Error:" & @error & " Extended:" & @extended) ; Move Table Cursor to cell "B3", without selecting any cells. _LOWriter_TableCursor($oTableCursor, "B3", False) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press OK To split cell ""B3"" into 3 divisions horizontally.") ; Split the cell "B3" horizontally into 3 pieces _LOWriter_TableCursor($oTableCursor, Null, False, Null, 3, True) - If (@error > 0) Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) ; Move Table Cursor to cell "D2", without selecting any cells. _LOWriter_TableCursor($oTableCursor, "D2", False) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press OK To split cell ""D2"" into 2 divisions vertically.") ; Split the cell "D2" vertically into 2 pieces _LOWriter_TableCursor($oTableCursor, Null, False, Null, 2, False) - If (@error > 0) Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now demonstrate how cell names etc change when splitting table cells. I will attempt to split Cell ""A4"" vertically, but will fail.") ; Move Table Cursor to cell "A4", without selecting any cells. _LOWriter_TableCursor($oTableCursor, "A4", False) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) ; Split the cell "A4" vertically into 2 pieces _LOWriter_TableCursor($oTableCursor, Null, False, Null, 2, False) - If (@error > 0) Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Notice the wrong cell was split. That is because when you split a cell, it adds to the column/row count for each split, " & _ "making what used to be cell ""A4"" now be called ""A7"" because we split ""B3"" into three pieces. I will try splitting that cell again, this time requesting cell ""A7"".") ; Move Table Cursor to cell "A7", without selecting any cells. _LOWriter_TableCursor($oTableCursor, "A7", False) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) ; Split the cell "A7" vertically into 2 pieces _LOWriter_TableCursor($oTableCursor, Null, False, Null, 2, False) - If (@error > 0) Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) ; demonstrate error when splitting MsgBox($MB_OK, "", "And if I wanted to Split cell ""E2"", I would request cell ""G2"", because we split ""D2"" into two pieces, " & _ @@ -103,33 +103,33 @@ Func Example() ; Move Table Cursor to cell "G2", without selecting any cells. _LOWriter_TableCursor($oTableCursor, "G2", False) - If (@error > 0) Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move Table Cursor. Error:" & @error & " Extended:" & @extended) ; Split the cell "G2" vertically into 2 pieces _LOWriter_TableCursor($oTableCursor, Null, False, Null, 2, False) - If (@error > 0) Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Split Table cell. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to see the new cell names.") ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableDelete.au3 b/Examples/_LOWriter_TableDelete.au3 index d491675f..af26d678 100644 --- a/Examples/_LOWriter_TableDelete.au3 +++ b/Examples/_LOWriter_TableDelete.au3 @@ -9,31 +9,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to delete the Table.") ; Delete the Table. _LOWriter_TableDelete($oDoc, $oTable) - If (@error > 0) Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetCellNames.au3 b/Examples/_LOWriter_TableGetCellNames.au3 index 8c48c35f..96d5c4d5 100644 --- a/Examples/_LOWriter_TableGetCellNames.au3 +++ b/Examples/_LOWriter_TableGetCellNames.au3 @@ -10,39 +10,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Table cell names. $asNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table names. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The table cells names are:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asNames) -1 ; Insert the Table cell names. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asNames[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetCellObjByCursor.au3 b/Examples/_LOWriter_TableGetCellObjByCursor.au3 index 3f81df9a..470d2dfd 100644 --- a/Examples/_LOWriter_TableGetCellObjByCursor.au3 +++ b/Examples/_LOWriter_TableGetCellObjByCursor.au3 @@ -9,40 +9,40 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 3 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Move the ViewCursor up once, which will place it into the above table. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_UP, 1, False) - If (@error > 0) Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) ; Retrieve the bottom left Table Cell Object. $oCell = _LOWriter_TableGetCellObjByCursor($oDoc, $oTable, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell background color to show which cells I have retrieved the Cell Range Object for. _LOWriter_CellBackColor($oCell, $LOW_COLOR_BLUE, False) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, "This is the cell the Cursor was in.") - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetCellObjByCursor[2].au3 b/Examples/_LOWriter_TableGetCellObjByCursor[2].au3 index 572c3b03..81ff9d6c 100644 --- a/Examples/_LOWriter_TableGetCellObjByCursor[2].au3 +++ b/Examples/_LOWriter_TableGetCellObjByCursor[2].au3 @@ -9,44 +9,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 3 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Move the ViewCursor up once, which will place it into the above table. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_UP, 1, False) - If (@error > 0) Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) ; Move the ViewCursor right once, which will place it into the second over column, I will select as I move, thus selecting a range of cells. _LOWriter_CursorMove($oViewCursor, $LOW_VIEWCUR_GO_RIGHT, 1, True) - If (@error > 0) Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to move View Cursor. Error:" & @error & " Extended:" & @extended) ; When retrieving multiple cells, a cell range will be returned, a cell range is largely the same as a single cell Object, ; but some functions don't accept a cell range. ; Retrieve bottom left, and Bottom second over Table Cell Objects. $oCell = _LOWriter_TableGetCellObjByCursor($oDoc, $oTable, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell background color to show which cells I have retrieved the Cell Range Object for. _LOWriter_CellBackColor($oCell, $LOW_COLOR_BLUE, False) - If (@error > 0) Then _ERROR("Failed to set Text Table cell Background color. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell Background color. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetCellObjByName.au3 b/Examples/_LOWriter_TableGetCellObjByName.au3 index a1614fcb..c70dbbb3 100644 --- a/Examples/_LOWriter_TableGetCellObjByName.au3 +++ b/Examples/_LOWriter_TableGetCellObjByName.au3 @@ -10,47 +10,47 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve top left ("A1") Table Cell Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell background color to show which cells I have retrieved the Cell Range Object for. _LOWriter_CellBackColor($oCell, $LOW_COLOR_BLUE, False) - If (@error > 0) Then _ERROR("Failed to set Text Table cell background color. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell background color. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetCellObjByName[2].au3 b/Examples/_LOWriter_TableGetCellObjByName[2].au3 index 2723cf76..f0aa0234 100644 --- a/Examples/_LOWriter_TableGetCellObjByName[2].au3 +++ b/Examples/_LOWriter_TableGetCellObjByName[2].au3 @@ -10,50 +10,50 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; When retrieving multiple cells, a cell range will be returned, a cell range is largely the same as a single cell Object, ; but some functions don't accept a cell range. ; Retrieve top left ("A1") and bottom left ("A2") Table Cell range Object $oCell = _LOWriter_TableGetCellObjByName($oTable, "A1", "A2") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell background color to show which cells I have retrieved the Cell Range Object for. _LOWriter_CellBackColor($oCell, $LOW_COLOR_BLUE, False) - If (@error > 0) Then _ERROR("Failed to set Text Table cell background color. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell background color. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Cell names. $asCellNames = _LOWriter_TableGetCellNames($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell names. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asCellNames) - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByName($oTable, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by name. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, $asCellNames[$i]) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetCellObjByPosition.au3 b/Examples/_LOWriter_TableGetCellObjByPosition.au3 index 3eebaee3..7282f0f7 100644 --- a/Examples/_LOWriter_TableGetCellObjByPosition.au3 +++ b/Examples/_LOWriter_TableGetCellObjByPosition.au3 @@ -10,46 +10,46 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 3 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve middle left Table Cell Object, Table Rows and columns are 0 based, so left hand column is 0, 2nd row down is 1. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, 0, 1) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell background color to show which cells I have retrieved the Cell Range Object for. _LOWriter_CellBackColor($oCell, $LOW_COLOR_BLUE, False) - If (@error > 0) Then _ERROR("Failed to set Text Table cell background color. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table cell background color. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next @@ -57,7 +57,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetCellObjByPosition[2].au3 b/Examples/_LOWriter_TableGetCellObjByPosition[2].au3 index f3e557d0..45057cd2 100644 --- a/Examples/_LOWriter_TableGetCellObjByPosition[2].au3 +++ b/Examples/_LOWriter_TableGetCellObjByPosition[2].au3 @@ -10,48 +10,48 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 3 rows, 5 columns $oTable = _LOWriter_TableCreate($oDoc, 3, 5) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; When retrieving multiple cells, a cell range will be returned, a cell range is largely the same as a single cell Object, ; but some functions don't accept a cell range. ; Retrieve middle left and middle 2nd in column Table Cell Objects, Table Rows and columns are 0 based, so left hand column is 0, 2nd row down is 1. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, 0, 1, 1, 1) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table cell Object. Error:" & @error & " Extended:" & @extended) ; Set the Cell background color to show which cells I have retrieved the Cell Range Object for. _LOWriter_CellBackColor($oCell, $LOW_COLOR_BLUE, False) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column COunt. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column COunt. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by name as returned in the array of cell names $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to each Cell's name. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next @@ -59,7 +59,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetData.au3 b/Examples/_LOWriter_TableGetData.au3 index 70e1a67e..885f87e0 100644 --- a/Examples/_LOWriter_TableGetData.au3 +++ b/Examples/_LOWriter_TableGetData.au3 @@ -12,44 +12,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next ; Retrieve Table data. $avData = _LOWriter_TableGetData($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) ; The array is an array of arrays, Each Row is contained in an array. @@ -68,7 +68,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetData[2].au3 b/Examples/_LOWriter_TableGetData[2].au3 index 78faa957..10fcc5b7 100644 --- a/Examples/_LOWriter_TableGetData[2].au3 +++ b/Examples/_LOWriter_TableGetData[2].au3 @@ -12,50 +12,50 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next ; Retrieve Table data, second over column (Column 1). $avData = _LOWriter_TableGetData($oTable, -1, 1) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avData, "Column 1") ; Retrieve Table data, second down Row (row 1). $avData = _LOWriter_TableGetData($oTable, 1) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) _ArrayDisplay($avData, "Row 1") @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetData[3].au3 b/Examples/_LOWriter_TableGetData[3].au3 index b28f0edb..6b76c729 100644 --- a/Examples/_LOWriter_TableGetData[3].au3 +++ b/Examples/_LOWriter_TableGetData[3].au3 @@ -11,44 +11,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next ; Retrieve Table data, second column over (Column 1), second row down (row 1). This will return a string. $sData = _LOWriter_TableGetData($oTable, 1, 1) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The returned data was: " & @CRLF & $sData) @@ -56,7 +56,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetObjByCursor.au3 b/Examples/_LOWriter_TableGetObjByCursor.au3 index d6137043..1b631d94 100644 --- a/Examples/_LOWriter_TableGetObjByCursor.au3 +++ b/Examples/_LOWriter_TableGetObjByCursor.au3 @@ -9,21 +9,21 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to insert a table named ""AutoitTest"".") ; Create a Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2, Null, Null, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now move the ViewCursor up into the table so that I can retrieve the Table Object again.") @@ -32,19 +32,19 @@ Func Example() ; Retrieve the Table Object again using the ViewCursor. $oTableNewObj = _LOWriter_TableGetObjByCursor($oDoc, $oViewCursor) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Object using View Cursor. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Object using View Cursor. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now delete the table.") ; Delete the Table. _LOWriter_TableDelete($oDoc, $oTableNewObj) - If (@error > 0) Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableGetObjByName.au3 b/Examples/_LOWriter_TableGetObjByName.au3 index 4ec7e575..714000c1 100644 --- a/Examples/_LOWriter_TableGetObjByName.au3 +++ b/Examples/_LOWriter_TableGetObjByName.au3 @@ -9,37 +9,37 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to insert a table named ""AutoitTest"".") ; Create a Table, 2 rows, 2 columns $oTable = _LOWriter_TableCreate($oDoc, 2, 2, Null, Null, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I will now retrieve the table again by the same name and delete it using the new Object.") ; Retrieve the Table by name. $oTableNewObj = _LOWriter_TableGetObjByName($oDoc, "AutoitTest") - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Object. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Object. Error:" & @error & " Extended:" & @extended) ; Delete the table. _LOWriter_TableDelete($oDoc, $oTableNewObj) - If (@error > 0) Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableInsert.au3 b/Examples/_LOWriter_TableInsert.au3 index e4087285..51c7f162 100644 --- a/Examples/_LOWriter_TableInsert.au3 +++ b/Examples/_LOWriter_TableInsert.au3 @@ -9,27 +9,27 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3, True, $LOW_COLOR_TEAL, "CustomTableName") - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I have created the Table Object, but it doesn't exist in the document until I insert it.") ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableMargin.au3 b/Examples/_LOWriter_TableMargin.au3 index e5b7a4e0..def4efe2 100644 --- a/Examples/_LOWriter_TableMargin.au3 +++ b/Examples/_LOWriter_TableMargin.au3 @@ -11,39 +11,39 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the Table Alignment to $LOW_ORIENT_HORI_LEFT_AND_WIDTH so I can set Table margins. _LOWriter_TableProperties($oTable, $LOW_ORIENT_HORI_LEFT_AND_WIDTH) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Convert 1 inch to micrometers. $iMicrometers = _LOWriter_ConvertToMicrometer(1) - If (@error > 0) Then _ERROR("Failed to convert inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set all Table margins to 1 inch except the right. _LOWriter_TableMargin($oTable, $iMicrometers, $iMicrometers, $iMicrometers, Null) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The Margins are set to 1""") - If (@error > 0) Then _ERROR("Failed to insert Text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text. Error:" & @error & " Extended:" & @extended) ; Retrieve current settings. $avTableProps = _LOWriter_TableMargin($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Current Text Table Margin settings are: " & @CRLF & _ "Top Table Margin: " & $avTableProps[0] & " Micrometers" & @CRLF & _ @@ -55,7 +55,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableProperties.au3 b/Examples/_LOWriter_TableProperties.au3 index 56862c3a..89a53561 100644 --- a/Examples/_LOWriter_TableProperties.au3 +++ b/Examples/_LOWriter_TableProperties.au3 @@ -10,28 +10,28 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns, set Table Split to False, Background color to Teal and set a custom Table name. $oTable = _LOWriter_TableCreate($oDoc, 5, 3, False, $LOW_COLOR_TEAL, "CustomTableName") - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the table settings to: Table Alignment = $LOW_ORIENT_HORI_NONE, Keep Table with next Paragraph = False, Set a New Table Name, ; allow the Table to split across pages, Dont Allow the Rows to Split, and do repeat the Table heading, and include 3 rows as the heading. _LOWriter_TableProperties($oTable, $LOW_ORIENT_HORI_NONE, False, "NewName", True, True, True, 3) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current settings. $avTableProps = _LOWriter_TableProperties($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Current Text Table settings are as follows: " & @CRLF & _ "Table Alignment (See UDF Constants): " & $avTableProps[0] & @CRLF & _ @@ -46,7 +46,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableRowColor.au3 b/Examples/_LOWriter_TableRowColor.au3 index a9528063..b06ccd20 100644 --- a/Examples/_LOWriter_TableRowColor.au3 +++ b/Examples/_LOWriter_TableRowColor.au3 @@ -11,48 +11,48 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next ; Change the 3rd row down (Row 2) background color to: $LOW_COLOR_ORANGE _LOWriter_TableRowColor($oTable, 2, $LOW_COLOR_ORANGE, False) - If (@error > 0) Then _ERROR("Failed to set the row background color settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set the row background color settings. Error:" & @error & " Extended:" & @extended) ; Retrieve row's current background color settings. $avColor = _LOWriter_TableRowColor($oTable, 2) - If (@error > 0) Then _ERROR("Failed to retrieve the row background color settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the row background color settings. Error:" & @error & " Extended:" & @extended) ; Array elements will be in order of function's parameters. MsgBox($MB_OK, "", "The background color settings for the Third row down, (Row 2), is: " & @CRLF & _ @@ -63,7 +63,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableRowDelete.au3 b/Examples/_LOWriter_TableRowDelete.au3 index 9992853a..b36299e5 100644 --- a/Examples/_LOWriter_TableRowDelete.au3 +++ b/Examples/_LOWriter_TableRowDelete.au3 @@ -10,38 +10,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next @@ -49,19 +49,19 @@ Func Example() ; Delete the top Row. (Row 0). _LOWriter_TableRowDelete($oTable, 0, 1) - If (@error > 0) Then _ERROR("Failed to delete a row from the Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a row from the Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to delete 2 rows from the 2nd down row (Row 1).") ; Delete two rows from the 2nd down Row. (Row 1). _LOWriter_TableRowDelete($oTable, 1, 2) - If (@error > 0) Then _ERROR("Failed to delete a row from the Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to delete a row from the Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableRowGetCount.au3 b/Examples/_LOWriter_TableRowGetCount.au3 index 6a84cbb2..8c92047d 100644 --- a/Examples/_LOWriter_TableRowGetCount.au3 +++ b/Examples/_LOWriter_TableRowGetCount.au3 @@ -10,23 +10,23 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Table names. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table row count. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "This Table has " & $iRows & " rows.") @@ -34,7 +34,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableRowInsert.au3 b/Examples/_LOWriter_TableRowInsert.au3 index 1ce0e9c1..cbea9174 100644 --- a/Examples/_LOWriter_TableRowInsert.au3 +++ b/Examples/_LOWriter_TableRowInsert.au3 @@ -10,38 +10,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next @@ -49,20 +49,20 @@ Func Example() ; Add a Row above row 0 (First row) _LOWriter_TableRowInsert($oTable, 1, 0) - If (@error > 0) Then _ERROR("Failed to add a row to Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to add a row to Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "I am going to add 2 rows at the bottom of the table.") ; Add 2 Rows at the end, or below the last row 5 (last row), I add one row number to the last row number, (Row 5) to add a row at the very ; bottom of the table, because Libre Office Tables are 0 based. _LOWriter_TableRowInsert($oTable, 2, 6) - If (@error > 0) Then _ERROR("Failed to add a row to Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to add a row to Text Table. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableRowProperty.au3 b/Examples/_LOWriter_TableRowProperty.au3 index c3a7acbd..f3ee58ce 100644 --- a/Examples/_LOWriter_TableRowProperty.au3 +++ b/Examples/_LOWriter_TableRowProperty.au3 @@ -11,44 +11,44 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next ; Retrieve the third down (Row 2) settings. $avRowProps = _LOWriter_TableRowProperty($oTable, 2) - If (@error > 0) Then _ERROR("Failed to retrieve row settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve row settings. Error:" & @error & " Extended:" & @extended) ; Array elements will be in order of function's parameters. MsgBox($MB_OK, "", "The settings for the Third row down, (Row 2), are: " & @CRLF & _ @@ -58,15 +58,15 @@ Func Example() ; Convert 1.5 inches to Micrometers $iMicrometers = _LOWriter_ConvertToMicrometer(1.5) - If (@error > 0) Then _ERROR("Failed to convert inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the Row properties to: 1.5" height, turn off auto height, and disallow splitting the row between pages. _LOWriter_TableRowProperty($oTable, 2, $iMicrometers, False, False) - If (@error > 0) Then _ERROR("Failed to set row properties. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set row properties. Error:" & @error & " Extended:" & @extended) ; Retrieve the third down (Row 2) settings again. $avRowProps = _LOWriter_TableRowProperty($oTable, 2) - If (@error > 0) Then _ERROR("Failed to retrieve row settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve row settings. Error:" & @error & " Extended:" & @extended) ; Array elements will be in order of function's parameters. MsgBox($MB_OK, "", "The new settings for the Third row down, (Row 2), are: " & @CRLF & _ @@ -78,7 +78,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableSetData.au3 b/Examples/_LOWriter_TableSetData.au3 index 830fd15a..26e1fb7f 100644 --- a/Examples/_LOWriter_TableSetData.au3 +++ b/Examples/_LOWriter_TableSetData.au3 @@ -11,38 +11,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next @@ -67,13 +67,13 @@ Func Example() ; Now set the data _LOWriter_TableSetData($oTable, $avRows) - If (@error > 0) Then _ERROR("Failed to set Text Table Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Data. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableSetData[2].au3 b/Examples/_LOWriter_TableSetData[2].au3 index f6ba1fb2..20034896 100644 --- a/Examples/_LOWriter_TableSetData[2].au3 +++ b/Examples/_LOWriter_TableSetData[2].au3 @@ -11,38 +11,38 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Rows the Table currently contains. $iRows = _LOWriter_TableRowGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Row count. Error:" & @error & " Extended:" & @extended) ; Retrieve how many Columns the Table currently contains. $iColumns = _LOWriter_TableColumnGetCount($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Column count. Error:" & @error & " Extended:" & @extended) For $iRow = 0 To $iRows - 1 For $iColumn = 0 To $iColumns - 1 ; Retrieve each cell by position in the Table. $oCell = _LOWriter_TableGetCellObjByPosition($oTable, $iColumn, $iRow) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Cell by position. Error:" & @error & " Extended:" & @extended) ; Set Cell text String to Cell's position. _LOWriter_CellString($oCell, "Column " & $iColumn & @CR & " Row " & $iRow) - If (@error > 0) Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Cell String. Error:" & @error & " Extended:" & @extended) Next Next @@ -51,7 +51,7 @@ Func Example() ; Retrieve Table data, $avData = _LOWriter_TableGetData($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table Data. Error:" & @error & " Extended:" & @extended) ; Retrieve the second down row, "Row 1" $avColumn = $avData[1] @@ -75,13 +75,13 @@ Func Example() ; Set the Table Data _LOWriter_TableSetData($oTable, $avData) - If (@error > 0) Then _ERROR("Failed to set Text Table Data. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table Data. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableShadow.au3 b/Examples/_LOWriter_TableShadow.au3 index b4662927..948f1e2c 100644 --- a/Examples/_LOWriter_TableShadow.au3 +++ b/Examples/_LOWriter_TableShadow.au3 @@ -11,32 +11,32 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Convert 1/2 Inch to Micrometers. $iMicrometers = _LOWriter_ConvertToMicrometer(0.5) - If (@error > 0) Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert from inches to Micrometers. Error:" & @error & " Extended:" & @extended) ; Set the Table shadow to 1/2 an inch wide, the color to $LOW_COLOR_DKGRAY, Transparent to False, and shadow location to ; $LOW_SHADOW_BOTTOM_LEFT _LOWriter_TableShadow($oTable, $iMicrometers, $LOW_COLOR_DKGRAY, False, $LOW_SHADOW_BOTTOM_LEFT) - If (@error > 0) Then _ERROR("Failed to set Table shadow settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Table shadow settings. Error:" & @error & " Extended:" & @extended) ; Retrieve Table shadow settings. Return will be an Array, with values in order of function parameters. $avShadow = _LOWriter_TableShadow($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Table shadow settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Table shadow settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Table shadow values are as follows: " & @CRLF & _ "Width = " & $avShadow[0] & " Micrometers." & @CRLF & _ @@ -48,7 +48,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableWidth.au3 b/Examples/_LOWriter_TableWidth.au3 index 057734ef..15e2af99 100644 --- a/Examples/_LOWriter_TableWidth.au3 +++ b/Examples/_LOWriter_TableWidth.au3 @@ -11,34 +11,34 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the Table ALignment to $LOW_ORIENT_HORI_LEFT so I can set Table width. _LOWriter_TableProperties($oTable, $LOW_ORIENT_HORI_LEFT) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Convert 4 inches to micrometers. $iMicrometers = _LOWriter_ConvertToMicrometer(4) - If (@error > 0) Then _ERROR("Failed to convert inches to Micrometers. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to convert inches to Micrometers. Error:" & @error & " Extended:" & @extended) _LOWriter_TableWidth($oTable, $iMicrometers) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current settings. $avTableProps = _LOWriter_TableWidth($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Current Text Table Width settings are: " & @CRLF & _ "Table Width: " & $avTableProps[0] & @CRLF & _ @@ -49,7 +49,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TableWidth[2].au3 b/Examples/_LOWriter_TableWidth[2].au3 index 777aacd3..7af0528d 100644 --- a/Examples/_LOWriter_TableWidth[2].au3 +++ b/Examples/_LOWriter_TableWidth[2].au3 @@ -10,31 +10,31 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create a Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Set the Table ALignment to $LOW_ORIENT_HORI_LEFT so I can set Table relative width. _LOWriter_TableProperties($oTable, $LOW_ORIENT_HORI_LEFT) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Set Table Relative width to 50% _LOWriter_TableWidth($oTable, Null, 50) - If (@error > 0) Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to set Text Table settings. Error:" & @error & " Extended:" & @extended) ; Retrieve current settings. $avTableProps = _LOWriter_TableWidth($oTable) - If (@error > 0) Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve Text Table settings. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "The Current Text Table Width settings are: " & @CRLF & _ "Table Width: " & $avTableProps[0] & @CRLF & _ @@ -45,7 +45,7 @@ Func Example() ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_TablesGetNames.au3 b/Examples/_LOWriter_TablesGetNames.au3 index 18d75bd2..1e8c0e1e 100644 --- a/Examples/_LOWriter_TablesGetNames.au3 +++ b/Examples/_LOWriter_TablesGetNames.au3 @@ -10,51 +10,51 @@ Func Example() ; Create a New, visible, Blank Libre Office Document. $oDoc = _LOWriter_DocCreate(True, False) - If (@error > 0) Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to Create a new Writer Document. Error:" & @error & " Extended:" & @extended) ; Retrieve the document view cursor to insert text with. $oViewCursor = _LOWriter_DocGetViewCursor($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve the View Cursor Object for the Writer Document. Error:" & @error & " Extended:" & @extended) ; Create the Table, 5 rows, 3 columns. $oTable = _LOWriter_TableCreate($oDoc, 5, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Insert a paragraph break to separate the tables. _LOWriter_DocInsertString($oDoc, $oViewCursor, @CR) - If (@error > 0) Then _ERROR("Failed to insert Text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text. Error:" & @error & " Extended:" & @extended) ; Create another Table, 2 rows, 3 columns. $oTable2 = _LOWriter_TableCreate($oDoc, 2, 3) - If (@error > 0) Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to create Text Table. Error:" & @error & " Extended:" & @extended) ; Insert the Table into the document at the View Cursor's location. $oTable2 = _LOWriter_TableInsert($oDoc, $oViewCursor, $oTable2) - If (@error > 0) Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert Text Table. Error:" & @error & " Extended:" & @extended) ; Retrieve Array of Table names $asTables = _LOWriter_TablesGetNames($oDoc) - If (@error > 0) Then _ERROR("Failed to retrieve list of Text Tables. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve list of Text Tables. Error:" & @error & " Extended:" & @extended) ; Insert some text. _LOWriter_DocInsertString($oDoc, $oViewCursor, "The document contains the following Table names:" & @CR & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) For $i = 0 To UBound($asTables) -1 ; Insert the Frame names. _LOWriter_DocInsertString($oDoc, $oViewCursor, $asTables[$i] & @CR) - If (@error > 0) Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to insert text. Error:" & @error & " Extended:" & @extended) Next MsgBox($MB_OK, "", "Press ok to close the document.") ; Close the document. _LOWriter_DocClose($oDoc, False) - If (@error > 0) Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to close opened L.O. Document. Error:" & @error & " Extended:" & @extended) EndFunc diff --git a/Examples/_LOWriter_VersionGet.au3 b/Examples/_LOWriter_VersionGet.au3 index 578a72b1..cb0a6288 100644 --- a/Examples/_LOWriter_VersionGet.au3 +++ b/Examples/_LOWriter_VersionGet.au3 @@ -9,15 +9,15 @@ Func Example() ; Retrieve the current full Office version number and name. $sVersionAndName = _LOWriter_VersionGet(False, True) - If (@error > 0) Then _ERROR("Failed to retrieve L.O. version information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve L.O. version information. Error:" & @error & " Extended:" & @extended) ; Retrieve the current full Office version number. $sFullVersion = _LOWriter_VersionGet() - If (@error > 0) Then _ERROR("Failed to retrieve L.O. version information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve L.O. version information. Error:" & @error & " Extended:" & @extended) ; Retrieve the current simple Office version number. $sSimpleVersion = _LOWriter_VersionGet(True) - If (@error > 0) Then _ERROR("Failed to retrieve L.O. version information. Error:" & @error & " Extended:" & @extended) + If @error Then _ERROR("Failed to retrieve L.O. version information. Error:" & @error & " Extended:" & @extended) MsgBox($MB_OK, "", "Your current full Libre Office version, including the name is: " & $sVersionAndName & @CRLF & _ "Your current full Libre Office version is: " & $sFullVersion & @CRLF & _