Uso de cookies

Utilizamos cookies propias y de terceros para mejorar nuestros servicios y mostrarle publicidad relacionada con sus preferencias mediante el análisis de sus hábitos de navegación. Si continúa navegando, consideramos que acepta su uso. Para obtener más información o bien conocer cómo cambiar la configuración lea nuestra Política de cookies

Revisión a fecha de 17:27 28 ago 2015; Salva (Discusión | contribuciones)

(dif) ← Revisión anterior | Revisión actual (dif) | Revisión siguiente → (dif)

Basic IDE Tools 1.0.1: Tools and utilities for Basic IDE

Version Read
  • 1.0.1 for Apache OpenOffice 3.4.1 and previous

Ayuda en línea Vers. 1.0.1 - Español


Online Help Vers. 1.0.1 - English Translation

  • 1.3.0 for Apache OpenOffice 4.0.0 and next
  • 1.2.0 for Apache OpenOffice 3.4.1 and previous

Ayuda en línea Vers. 1.2, 1.3 - Español


Online Help Vers. 1.2, 1.3 - English Translation

Content

What is Basic IDE Tools

Extension.Basic.IDE.Tools.OpenOffice.Logo.jpg
Basic IDE Tools is an extension for Apache OpenOffice and OpenOffice.org, developed by the open-office.es team, which adds a new toolbar to OpenOffice Basic editor (IDE).

Includes several buttons that add new features and options that make working with macros and applications easier for the programmer when writing Basic code.

The extension is released under the GNU GPLv3 license. Before using the extension, please read the terms of the license.

The extension can be downloaded from the official website of Apache OpenOffice extensions: Basic IDE Tools Vers. 1.0.1

How to install Basic IDE Tools

OOo3 Extension 128.png
Basic IDE Tools is installed like any other extension of OpenOffice. If after requesting the extension download does not start automatically the extension manager, locate the installation file on your hard drive (BasicIDETools.1.0.1.zip or BasicIDETools.1.0.1.oxt) and double click itself, or from the context menu, select Open With ... OpenOffice.org.

After requesting permission to install, and accept the license terms, the extension will be integrated in OpenOffice.

Extension.Basic.IDE.Tools.OpenOffice.000.png

As for any extension, will have to close all open OpenOffice applications, including Quick Start (in spanish) so; after restarting OpenOffice, it is activated correctly.

The Basic IDE Tools toolbar

  The Basic IDE Tools toolbar presents eleven buttons that add new options to OpenOffice Basic editor, and a About… button.
Extension.Basic.IDE.Tools.OpenOffice.001.png
Señal Nota.png

This extension uses the text from the clipboard of the operating system to read the selected text, and after processing, replace the selected text with the text processing. Therefore operations do not copy, cut or paste in any application while the extension is performing any process.
The text content of the clipboard before using any of your options is stored to be restored after making the selection.

The functions of the buttons are as follows:

Comment, uncomment or toggle comments

Extension.Basic.IDE.Tools.OpenOffice.002.png
These three buttons, called Add comments, Remove comments and Toggle Comments allow comments, uncomment or alternate comments on selected lines of code.

To apply these options:

  • Select the line or lines you want to add, remove or alternate comments, and...
  • Click on the appropriate button, or...
  • Use one of these keyboard shortcuts:
- Ctrl + Shift + C Add comments
- Ctrl + Shift + X Removes comments
- Ctrl + Shift + W Toggle comments

Toggle comments add comments to the lines that do not have, and remove comments on the lines that do have.

The following video shows the operation of these three options:


Indent, de-indent or re-indent all

Extension.Basic.IDE.Tools.OpenOffice.003.png
These three buttons, called Indentation increase, Indentation decrease and Re-indent All, allow indent, de-indent or re-indent selected lines of the code.

To apply these options:

  • Select the line or lines you want to indent, de-indent or re-indent, or...
  • Select a function or subroutine, or...
  • Select all the code module, and...
  • Click on the appropriate button

Re-indent option applies automatically indentation to all code selected by examining the code.

The following video shows the operation of these buttons:


Rules that follow the option Re-indenting

To apply Re-indenting follow these rules:

  • All lines beginning with one of the keywords Private, Global, Public, Option, Sub, Function are placed at level zero (no indentation), as the lines that contain the keywords End Sub or End Function.
  • All lines beginning with the keywords ', Rem, Dim will be indented to the level used by the previous line.
  • The line following a line that begins with the keyword if, which contain the keyword Then after that word, and that contain code, will be indented to the same level, considering that it is an if then else endif on one line sentence.
  • It is considered as separator decorative lines of code, and be indented to level zero, all beginning with the following text:
'_____
'-----
'*****
' ****
' ++++
rem --
  • Empty lines are not indented. The character used for indentation is the Tab ( Chr(9) )
  • If the line ends with the keyword : (label) is indented to level zero.
  • All spaces and tabs located at the end of lines processed will be removed.

Format code

Extension.Basic.IDE.Tools.OpenOffice.004.png
This button allows you to format the code of the selected lines, applying uniform criteria that improve the readability and visual appearance of the code. Used in conjunction with the option Re-indenting, allows to get a code with a clear and structured look.

To apply this option:

  • Select the line or lines you want to format, or...
  • Select all function or subroutine you want to format, or...
  • Select all the code module to be formatted, and...
  • Click on the Format Basic code button, or...
  • Press the keyboard shortcut Ctrl + Shift + F.

Actions that the Basic code formatter can do

Running this option, can be applied the following actions on the selected code:

  • They read the names of the functions and subroutines in the format uppercase / lowercase as written on the declaration line of the function or subroutine.
  • They read the names of the variables in the format uppercase / lowercase as written in the declaration line of the function or subroutine by declaring them as arguments, or after sentences Dim, Private, Public, Static or Global.
  • They read the names of the constants in the format uppercase / lowercase as written by declaring then sentence Const.
  • It replaces all Basic keywords for the same word formatted. For example, if' is replaced by If, select case by Select Case, msgbox by MsgBox, etc.
  • Replace all variables that are found in the code after the place in which they are declared, just like then assignation to the name of the function at the point of its declaration, by the same word formatted as was declared. For example, if the function is declared as Function HelloWord, from that line, all calls to the function, such as Helloword or helloword are replaced by the HelloWord.
  • Comment lines (with ' or rem) are not modified.
  • Strings (all that is written in quotes ") are not modified.
  • During the process shows a progress bar.

Formatting takes time, depending on the number of selected lines and the length itself. Do not perform any action while applying the code formatting, as clicking on the code, or select another module, or any other action in the IDE; not copy, cut and / or paste into other applications. Wait until then process finishes.

The following video shows the operation of this button:


Keywords recognized

See at the bottom of this page Keywords recognized by the formatter.

Dose not format some variables, constants or function calls or subroutines

You may notice that the code does not have replaced the names of variables, constants, functions or subroutines with the format they have been declared. The reasons are:

  • In order to apply format to the variables and constants in the selected code lines, the lines where it declares must also be selected, otherwise they will not be detected. That is why it is advisable to select all lines between Sub and End Sub or between Function and End Function, or better, select the entire module.
  • In order to format the variables and constants in selected lines of code that have been declared at the module level, must also be selected the lines where they are declared. Otherwise, they won't detected. Therefore it is advisable to select the entire module.
  • If a function or subroutine is called in the code before its declaration, it can't be identified by its statement format, and therefore, will not be replaced with the declared format. It is therefore necessary that the functions and subroutines are declared before use, although we know that this is not always possible.

In future versions we are hoping to solve these three problems.

Find Previous and Find Next

Extension.Basic.IDE.Tools.OpenOffice.005.png
These two buttons called Find Next and Find Previous let you search the selected text in the current module and in all then library modules.

To search the selected text:

  • Select the word or text you want to search, and...
  • Click on the appropriate button, or...
  • Press the keyboard shortcut:
  • F3 to find the next (forward or down)
  • Shift + F3 to find the previous (to back or up)
Señal Nota.png

On computers with MacOS system, the keyboard shortcuts F3 and Shift + F3 are used by the system, so it will not be active. You can customize the keyboard shortcuts to your liking. See Customizing keyboard shortcuts (in Spanish) if you do not know how to do it

The following video shows the operation of these buttons:


Find and Replace

To execute the Find and Replace process, follow this procedure:

  1. Select the text to paste, and copy it to the clipboard (eg with Ctrl + C)
  2. Select the first search string
  3. Press the desired search button or the keyboard shortcut equivalent
  4. Paste the clipboard contents (eg with Ctrl + V)
  5. To continue searching and replacing, repeat from step 3

Convert to uppercase or lowercase

Extension.Basic.IDE.Tools.OpenOffice.006.png
These two buttons called Uppercase and Lowercase allow to convert all uppercase or all lowercase, the selected code.

To apply these options:

  • Select the code you want to convert
  • Click on the appropriate button

The following video shows the operation of these buttons:


Button About...

Extension.Basic.IDE.Tools.OpenOffice.007.png
Presents information about the Basic IDE Tools extension.

After pressing the button displays the following dialog:

Extension.Basic.IDE.Tools.OpenOffice.009.png

Undo changes

Calc.33x.04.014.png
You can use the Undo button on the Standard toolbar of the IDE, or the keyboard shortcut Ctrl + Z to undo the changes made to the selected code.

We observed that the IDE undo button usually fail when trying to undo several steps. This error is not due to Basic IDE Tools. In our trials, the first step to undo has always been made without error, and we consider not secure to undo more steps.

Recommendations for the use of this extension

Creating a basic code can be the result of hours, days, months or even years of work. Therefore it is highly recommended that:

  • Back up your code before using this software.
  • Save the changes to your code always before using this software.

It has been done trials simulating errors. After saving the project, it has been added an option with a simulated error thath ruins the code. Then we closed the IDE editor without saving changes, after reloading the project, we recovered without problems the saved code before applying the option.

It is therefore recommended that you always save the changes before applying a command available in the extension. In the case of noticing that after applying a command for extension in its code has been wasted, you can follow the same procedure as described in the previous paragraph to attempt to retrieve the previously stored code.

Software that is the extension and any associated components are distributed in the hope that it will be useful, AS IS and WITHOUT ANY GUARANTEE of its performance, fitness for a particular purpose, or of the results obtained. If you use this extension, is at your own risk. We are not responsible for any damage or loss that may lead to the use of this software. By installing and / or using this software implies your acceptance of the terms of the GNU GPLv3 license that must enclose the software. Please refer to the GNU General Public License for more detailed information.

Keywords recognized by the formatter

The words recognized by the formatter are presented in the table below these lines. The formatter will replace any occurrence of these words in the code written by the same word with the same look as that presented in the table. They are presented in alphabetical order from left to right in each row, and up and down columns.

Abs AND As Asc Atn
Base Beep Boolean ByRef Byte
ByVal Call Case cBool cByte
cCur cDate cDateFromISO cDateToISO cDbl
ChDir ChDrive Choose Chr cInt
cLng Close Compatible Const ConvertFromURL
ConvertToURL Cos CreateUNODialog CreateUNOListener CreateUNOService
CreateUNOStruct CreateUNOValue cSng cStr CurDir
Currency cVar Date DateSerial DateValue
Day DeclareSet DefBool DefCur DefDate
DefDbl DefInt DefLng DefObj DefSng
DefStr DefVar Dim Dir Do
Double Each Else ElseIf End
EndIf Environ Eof Eqv Erl
Err Error Exit Exp Explicit
False FileAttr FileCopy FileDateTime FileExists
FileLen Fix Float For Format
FreeFile FreeLibrary Function Get GetAttr
GetGUIType GetProcessServiceManager GetSolarVersion GetSystemTicks Global
GlobalScope GoSub GoTo Hex Hour
If IIf Imp In Input
InputBox InStr Int Integer Is
IsMissing IsNull It Join Kill
LBound LCase Left Len Line
Loc Local Lof Log Long
Loop LSet LTrim Mid Minute
MkDir Mod Month MsgBox Name
New Next Not Now Object
Oct On Open Option Optional
OR ParamArray Preserve Print Private
Public Put QbColor Randomize ReDim
Rem Reset Resume Return RGB
Right RmDir Rnd RSet RTrim
Second Seek Select SetAttr Sgn
Shell Sin Single Space Split
Sqr Static Step Stop Str
StrComp String Sub Switch Tan
Then ThisComponent Time Timer TimeSerial
TimeValue To Trim True TwipsPerPixelX
TwipsPerPixelY Type UBound UCase Until
Val Variant Wait Weekday Wend
While With XOR Year '

Translated by Diana Roldán García. Thanks

Modificada el 28 ago 2015 17:27.   Visitas: 12 767