1<?xml version="1.0" encoding="UTF-8"?> 2 3 4 5<!-- 6 *********************************************************************** 7 * 8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9 * 10 * Copyright 2000, 2010 Oracle and/or its affiliates. 11 * 12 * OpenOffice.org - a multi-platform office productivity suite 13 * 14 * This file is part of OpenOffice.org. 15 * 16 * OpenOffice.org is free software: you can redistribute it and/or modify 17 * it under the terms of the GNU Lesser General Public License version 3 18 * only, as published by the Free Software Foundation. 19 * 20 * OpenOffice.org is distributed in the hope that it will be useful, 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 * GNU Lesser General Public License version 3 for more details 24 * (a copy is included in the LICENSE file that accompanied this code). 25 * 26 * You should have received a copy of the GNU Lesser General Public License 27 * version 3 along with OpenOffice.org. If not, see 28 * <http://www.openoffice.org/license.html> 29 * for a copy of the LGPLv3 License. 30 * 31 ************************************************************************ 32 --> 33 34 35 <helpdocument version="1.0"> 36<meta> 37<topic id="textsbasicshared01030200xml" indexer="include" status="PUBLISH"> 38<title id="tit" xml-lang="en-US">The Basic Editor</title> 39<filename>/text/sbasic/shared/01030200.xhp</filename> 40</topic> 41</meta> 42<body> 43<section id="basiceditor"> 44<bookmark xml-lang="en-US" branch="index" id="bm_id3148647"><bookmark_value>saving;Basic code</bookmark_value> 45<bookmark_value>loading;Basic code</bookmark_value> 46<bookmark_value>Basic editor</bookmark_value> 47<bookmark_value>navigating;in Basic projects</bookmark_value> 48<bookmark_value>long lines;in Basic editor</bookmark_value> 49<bookmark_value>lines of text;in Basic editor</bookmark_value> 50<bookmark_value>continuation;long lines in editor</bookmark_value> 51</bookmark><comment>mw deleted "Basic;"</comment><paragraph role="heading" id="hd_id3147264" xml-lang="en-US" level="1" l10n="U" oldref="1"><link href="text/sbasic/shared/01030200.xhp" name="The Basic Editor">The Basic Editor</link></paragraph> 52</section> 53<paragraph role="paragraph" id="par_id3145069" xml-lang="en-US" l10n="U" oldref="3">The Basic Editor provides the standard editing functions you are familiar with when working in a text document. It supports the functions of the <emph>Edit</emph> menu (Cut, Delete, Paste), the ability to select text with the Shift key, as well as cursor positioning functions (for example, moving from word to word with <switchinline select="sys"><caseinline select="MAC">Command</caseinline><defaultinline>Ctrl</defaultinline></switchinline> and the arrow keys).</paragraph> 54<paragraph role="paragraph" id="par_id3154686" xml-lang="en-US" l10n="CHG" oldref="31">Long lines can be split into several parts by inserting a space and an underline character _ as the last two characters of a line. This connects the line with the following line to one logical line. (If "Option Compatible" is used in the same Basic module, the line continuation feature is also valid for comment lines.)</paragraph> 55<paragraph role="paragraph" id="par_id3151042" xml-lang="en-US" l10n="CHG" oldref="32">If you press the <emph>Run BASIC</emph> icon on the <emph>Macro</emph> bar, program execution starts at the first line of the Basic editor. The program executes the first Sub or Function and then program execution stops. The "Sub Main" does not take precedence on program execution.</paragraph> 56<paragraph role="tip" id="par_id59816" xml-lang="en-US" l10n="NEW">Insert your Basic code between the Sub Main and End Sub lines that you see when you first open the IDE. Alternatively, delete all lines and then enter your own Basic code.</paragraph> 57<paragraph role="heading" id="hd_id3125863" xml-lang="en-US" level="2" l10n="U" oldref="4">Navigating in a Project</paragraph> 58<paragraph role="heading" id="hd_id3145785" xml-lang="en-US" level="3" l10n="U" oldref="6">The Library List</paragraph> 59<paragraph role="paragraph" id="par_id3146120" xml-lang="en-US" l10n="U" oldref="7">Select a library from the <emph>Library</emph> list at the left of the toolbar to load the library in the editor. The first module of the selected library will be displayed.</paragraph> 60<paragraph role="heading" id="hd_id3153190" xml-lang="en-US" level="3" l10n="U" oldref="8">The Object Catalog</paragraph> 61<embed href="text/sbasic/shared/01020200.xhp#object_catalog"/> 62<paragraph role="heading" id="hd_id3148647" xml-lang="en-US" level="2" l10n="U" oldref="15">Saving and Loading Basic Source Code</paragraph> 63<paragraph role="paragraph" id="par_id3154320" xml-lang="en-US" l10n="U" oldref="16">You can save Basic code in a text file for saving and importing in other programming systems.</paragraph> 64<paragraph role="warning" id="par_id3149959" xml-lang="en-US" l10n="U" oldref="25">You cannot save Basic dialogs to a text file.</paragraph> 65<paragraph role="heading" id="hd_id3149403" xml-lang="en-US" level="3" l10n="U" oldref="17">Saving Source Code to a Text File</paragraph> 66<list type="ordered"> 67<listitem> 68<paragraph role="listitem" id="par_id3150327" xml-lang="en-US" l10n="U" oldref="18">Select the module that you want to export as text from the object catalog.</paragraph> 69</listitem> 70<listitem> 71<paragraph role="listitem" id="par_id3150752" xml-lang="en-US" l10n="U" oldref="19">Click the <emph>Save Source As</emph> icon in the Macro toolbar.</paragraph> 72</listitem> 73<listitem> 74<paragraph role="listitem" id="par_id3154754" xml-lang="en-US" l10n="U" oldref="20">Select a file name and click <emph>OK</emph> to save the file.</paragraph> 75</listitem> 76</list> 77<paragraph role="heading" id="hd_id3159264" xml-lang="en-US" level="3" l10n="U" oldref="21">Loading Source Code From a Text File</paragraph> 78<list type="ordered"> 79<listitem> 80<paragraph role="listitem" id="par_id3147343" xml-lang="en-US" l10n="U" oldref="22">Select the module where you want to import the source code from the object catalog.</paragraph> 81</listitem> 82<listitem> 83<paragraph role="listitem" id="par_id3145230" xml-lang="en-US" l10n="U" oldref="23">Position the cursor where you want to insert the program code.</paragraph> 84</listitem> 85<listitem> 86<paragraph role="listitem" id="par_id3149565" xml-lang="en-US" l10n="U" oldref="24">Click the <emph>Insert Source Text</emph> icon in the Macro toolbar.</paragraph> 87</listitem> 88<listitem> 89<paragraph role="listitem" id="par_id3154020" xml-lang="en-US" l10n="U" oldref="33">Select the text file containing the source code and click <emph>OK</emph>.</paragraph> 90</listitem> 91</list> 92<section id="relatedtopics"> 93<paragraph role="paragraph" id="par_id3153198" xml-lang="en-US" l10n="U" oldref="29"><link href="text/sbasic/shared/01050000.xhp" name="Basic IDE">Basic IDE</link></paragraph> 94<embed href="text/sbasic/shared/01020200.xhp#01020200"/> 95</section> 96</body> 97</helpdocument> 98