Openoffice.Org BASIC Guide
Total Page:16
File Type:pdf, Size:1020Kb
OpenOffice.org 3.2 BASIC Guide Copyright The contents of this document are subject to the Public Documentation License. You may only use this document if you comply with the terms of the license. See: http://www.openoffice.org/licenses/PDL.html Contents Copyright....................................................................................................................................................................................2 Preface......................................................................................................5 1 OpenOffice.org BASIC Programming Guide ...................................................7 About OpenOffice.org Basic...................................................................................................................................................7 Intended Users of OpenOffice.org Basic...............................................................................................................................8 Use of OpenOffice.org Basic...................................................................................................................................................8 More Information......................................................................................................................................................................8 2 The Language of OpenOffice.org BASIC ........................................................9 Overview of a Basic Program..................................................................................................................................................9 Working With Variables.........................................................................................................................................................11 Strings.......................................................................................................................................................................................12 Numbers...................................................................................................................................................................................13 Boolean Values........................................................................................................................................................................16 Date and Time.........................................................................................................................................................................16 Arrays........................................................................................................................................................................................17 Scope and Life Span of Variables..........................................................................................................................................20 Constants..................................................................................................................................................................................21 Operators..................................................................................................................................................................................22 Branching.................................................................................................................................................................................23 Loops........................................................................................................................................................................................25 Procedures and Functions......................................................................................................................................................27 Error Handling........................................................................................................................................................................30 Other Instructions...................................................................................................................................................................32 3 Runtime Library ........................................................................................35 Conversion Functions.............................................................................................................................................................35 Strings.......................................................................................................................................................................................38 Date and Time.........................................................................................................................................................................40 Files and Directories...............................................................................................................................................................42 Message and Input Boxes.......................................................................................................................................................47 Other Functions......................................................................................................................................................................49 4 Introduction to the API ..............................................................................51 Universal Network Objects (UNO)......................................................................................................................................51 Properties and Methods..........................................................................................................................................................52 3 Modules, Services and Interfaces...........................................................................................................................................53 Tools for Working with UNO...............................................................................................................................................53 Overview of Central Interfaces..............................................................................................................................................54 5 Working with Documents ...........................................................................59 The StarDesktop......................................................................................................................................................................59 Styles and Templates...............................................................................................................................................................66 6 Text Documents ........................................................................................69 The Structure of Text Documents........................................................................................................................................69 Editing Text Documents........................................................................................................................................................75 More Than Just Text...............................................................................................................................................................81 7 Spreadsheet Documents ............................................................................91 The Structure of Spreadsheets...............................................................................................................................................91 Editing Spreadsheet Documents.........................................................................................................................................107 8 Drawings and Presentations ....................................................................111 The Structure of Drawings...................................................................................................................................................111 Editing Drawing Objects......................................................................................................................................................125 Presentations..........................................................................................................................................................................128 9 Charts (Diagrams) ...................................................................................131 Using Charts in Spreadsheets...............................................................................................................................................131 The Structure of Charts........................................................................................................................................................132 Chart Types............................................................................................................................................................................140 10 Databases ..............................................................................................143 SQL: a Query Language........................................................................................................................................................143 Types of Database Access....................................................................................................................................................143