OpenLLM-France/wikimedia huggingface dataset:
# Gambas/Comments

Back to Gambas
A good program has comments. They are very helpful to others trying to understand the program. When the program is compiled, all the comments are skipped. You can make comments as long as you want.
The difference between Gambas comments and VB comments is that Gambas has no such command as REM. Use the apostrophe instead.
'Apostrophe works. Rem does not.
Comments begin with an apostrophe and continue to the end of the line. Multi-line comments are not allowed.
Example
You can comment or uncomment when you are testing a program. In the code window you can also mark some code and make a comment out of it with the shortcut Ctrl + K. You can uncomment with Ctrl + U.
# Gambas/Constant

Back to Gambas

## Constants

Always use constants when a value doesn't change!
# Gambas/Clipboard

Back to Gambas

## The Clipboard Program

This program shows you the use of the clipboard in Gambas. You need 2 commandbuttons and 2 textareas to get the program going.
The Code:
# Gambas/Commands

Back to Gambas
See
The actual life wiki (2006) http://gambasdoc.org/help/lang
The static wiki (old) http://www.binara.net/gambas-wiki/static/Gambas/IndexByName.html
# Gambas/Colours

Back to Gambas

## The RGB Colours Program

This program shows you the RGB colours. You can change the values of each colour from 0 - 255 and you will see the special mixed colour, when you hit the commandbutton.
Out of 3 decimal numbers, one hexadecimal number is build as a string using the following code:
To get the program going , you will need 1 commandbutton, 1 drawingarea, 3 textboxes and 3 textlabels.
What does it look like? See it here ( in German ) http://www.madeasy.de/7/prgfarbergb.htm
The Code:

## The Sunset Program

When you need a background for a program, you can use this little color sunset program.
You will need a drawing area on your form to get the program going. You can choose different colours when you use the following scheme:
Blue RGB(0, 0, i) Red RGB(i, 0, 0) Green RGB(0, i, 0) Yellow RGB(i, i, 0) Violett RGB(i, 0, i) Türkis RGB(0, i, i) Gray RGB(i, i, i)
What does it look like ?
The Code
You can make the program better, when you add the following code and change the border of the form to Resizeable.

## The Spectrum program

The natural colour spectrum is shown in the following program using a slidebar.
You need a drawing area and a slidebar as controls.
Maybe you can change the program, so that the colour value is shown in a textbox. 1. Get a textbox out of the toolbox. 2. Add the following code
in the part PUBLIC SUB ScrollBar1_Change
# Gambas/Function Reference

Back to Gambas

## Function Reference

Gambas has a lot of functions!
* http://gambaswiki.org/wiki/cat/arith
* http://gambaswiki.org/wiki/cat/trigo
* http://gambaswiki.org/wiki/cat/bit
* http://gambaswiki.org/wiki/cat/externfunc
* http://gambaswiki.org/wiki/cat/conv
* http://gambaswiki.org/wiki/cat/char
* http://gambaswiki.org/wiki/cat/type
* http://gambaswiki.org/wiki/lang/localize
* http://gambaswiki.org/wiki/cat/time
Sorry. I cannot list all functions!
# Gambas/Installation

Back to Gambas

## Download

* See http://gambas.sourceforge.net/en/main.html
* Download
* Download Gambas (latest version)

## How to compile, make and install Gambas?
### Long version

See also http://gambaswiki.org/wiki/install
# Gambas/Introduction

Back to Gambas

## What is Gambas ?

Gambas is a programming language for Linux which attempts to mimic the ease of use of Visual Basic while improving on its functionality. Although Gambas is not source code compatible with Visual Basic, it is a BASIC Interpreter with object-oriented extensions. This makes Gambas a good choice for Linux users who want to use their VB knowledge on a GNU basis.
Gambas makes it very easy to build Linux GUI programs (the Gambas IDE is written in Gambas itself.) using the Qt toolkit. There is a Windows version of Gambas which barely runs under the Cygwin environment. Graphical applications do not yet work under the Windows version.
Developed in Paris by Benoît Minisini since 1999, Gambas is released under the GNU General Public Licence, the current version (July 29, 2009) being 2.15.2 Gambas is included in the Linux Professional Distribution from Novell.
'Gambas' is a backronym for GAMBAS Almost Means BASic (Gambas is also the Spanish word for shrimp.)

## Why Gambas ?

With Gambas you can easily:
* Build solutions for any environment using "graphical application" when you start a new project. This mode takes care of which Desktop environment the end user is going to use, and the program will automatically adapt to Gnome, KDE, etc. depending on the Current running Desktop environment.
* Build KDE applications with DCOP
* Translate your programs into other languages
* Offer Visual Basic programs under Linux
* Build network solutions
* Quickly design your program GUI with QT or GTK+
* Use databases such as MySQL, PostgreSQL, Firebird, ODBC and SQLite
* Create network applications easily
* Make 3D OpenGL applications
* Make CGI web applications, and so on...

## Citations

* "This project aims at making a graphical development environment based on a Basic interpreter, so that we have a language like Visual Basic under Linux."
* "If you pass the responsibilty for the pc operating system only to one company , then this is just the same, as if you would sell the abc or the integers to this company."
* "Still, this Qt-based software is one of the most advanced open source RAD tools available. It is nearly complete and very usable and stable. Benoit's goal is to avoid the development failures of Microsoft Visual Basic. The modern concept of Gambas is available as a graphic at the Web site http://gambas.sourceforge.net/en/main.html. Gambas is translated into many languages. To run Gambas applications you need the Gambas interpreter component installed on the user machine."
* Slashdot: Gambas 1.0 Release Candidate Available raindog2 writes "After two and a half years of development, Gambas has become the first Visual Basic-style environment for Linux to enter release candidate status. Anyone who has been frustrated by a lack of production-quality free RAD environments should give it a try."
* You can support Gambas by making a small donation with PayPal Link: https://www.paypal.com/xclick/business=gambas%40users.sourceforge.net&no_note=1&tax=0&currency_code=EUR
# Gambas/Files

Back to Gambas

## File handling

Please refer to the official wiki: http://gambaswiki.org/wiki/lang/open
You can read a file with some text for example.
With Gambas 1
It's a bit easier with Gambas 3.
# Gambas/First

Back to Gambas
For the first steps see:

## Creating your first gambas application

See the Hello World tutorial for information on how to create your first Gambas application.
# Gambas/Helpful

Back to Gambas
Nothing for now.
# Gambas/Links
## Gambas

* http://gambas.sourceforge.net/
** The main Gambas Site
* http://www.gambasdoc.org/help/
** All Commands
* http://www.gambas-es.org/
** Spanish Gambas Site
* http://www.gambas-it.org/wp/
** Italian Gambas Site
* http://gambaslinux.eg2.fr/index.php?lng=fr
** France Gambas Site
* http://wiki.gambas-es.org/index.php?title=Tabla_de_Traducci%C3%B3n_de_ordenes_de_VB6_a_Gambas
** Gambas in comparison to VB
* http://sourceforge.net/mailarchive/forum.php?forum=gambas-user
** Forum
* http://web.archive.org/20110927000819/jsbsan.blogspot.com/p/manuales.html
** Manuales en español
* http://jsbsan.blogspot.com/p/video-tutoriales.html
** Video tutoriales en español
* http://www.kudla.org/index.php?wl_mode=more&wl_eid=73 an activist
* http://groups.yahoo.com/subscribe/GAMBas-it
** The Italian Mailing list and support
* http://bedna.kdesi.sk/index.php?odkaz=15
** Gambas tutorial v Slovencine
* http://slashdot.org/article.pl?sid=04/10/26/142212
** Slashdot has recognized Gambas

## Learning Basic

* http://jsbsan.blogspot.com/
** Gambas: Blog 2 etapa: con pequeños programas y explicaciones en Español. Ademas de enlaces a foros y paginas relacionadas con Gambas (jsbsan)
* http://web.archive.org/20090411104032/jsbsan.wordpress.com/
** Gambas: Blog con pequeños programas y explicaciones en Español. Ademas de enlaces a foros y paginas relacionadas con Gambas (jsbsan)
# Gambas/Graphics

Back to Gambas
If you want to produce some graphics in gambas you should get used to the drawingarea control.

## Draw a Line

This little program will draw a line. You have to start a new graphics project. You take a form as your start form. You need a drawingarea and a commandbutton on the form to get it going.
When you want to draw some more lines, then try this example:
Some other lines are drawn here:
When you want to manipulate the width of your line , then try this example:
If you want to change the color of your line to white, then try this example:
The next small example will draw a box and fill it with white color.

## The Spiral Program

This program shows you a nice spiral. There is no scale command in Gambas (at least, not yet). Therefore the x and y coordinates are transformed in the program. The coordinate system ranges from xmin = - 2 to xmax = 2 and ymin = - 2 to ymax = 2.
You need a Drawingarea and a Commandbutton to get the example going.
How does this look ? See
The code:
# Gambas/Grid

Back to Gambas

## Introduction

A grid has rows and columns. They have width and height. You can fill a grid with text, numbers or even a picture.

## Example 1

You need a new form to get the program going. On this form you place a gridview , which you can find in your toolbox. There should be a picture x.png in your directory. Otherwise it wont be shown. There wont be an error message, when it is not found.

## Create a Grid without the Toolbox

The grid ist creatable. How it is done shows the little example.
You just need a empty form to get the program going.
Properties of the grid
Methods
Events

## Fill the grid with some values

You have a list of values and you want to have them in a grid. The example shows you a solution. Still not very nice and with some German words in it.
You need the following controls:
* 1 Textarea
* 1 Gridview
* 2 Commandbuttons
The code
When you push button1, then the textarea is filled with values. When you push button2, they will be placed in the grid.
You can improve this program if you want. It looks a little newbee like.
# Futurebasic/Language/Reference/kill resources
## KILL RESOURCES
### Revised

October 19, 2000 (Release 4)

### Description

This statement will store specified resource types and IDs in an internal list. When one of these resources is encountered by the compiler, it will not be added to the built application.
There are two important reasons for a call like this. The first is that resources normally included in the runtime shells may be considered unnecessary by a programmer may easily be deleted from the finished product. The second is that multiple resource files may be used and unnecessary resources may be eliminated programmatically.
Example: To prevent a picture resource with an ID of 8001 from being added to the compiled application, the syntax would be:
KILL RESOURCES "PICT", 8001

### See Also

RESOURCES
# Futurebasic/Language/Reference/kill dynamic
## KILL DYNAMIC
### Revised

May, 2001 (Release 5)

### Description

This statement releases the memory allocated for use by a dynamic array. The array may still be used after the KILL DYNAMIC statement is executed and will begin to grow once again as information is added.

### See Also

COMPRESS DYNAMIC; DYNAMIC; READ DYNAMIC; WRITE DYNAMIC
# Futurebasic/Language/Reference/kill picture
## KILL PICTURE
### Description

This statement calls the Toolbox procedure KillPicture, which releases the memory occupied by the picture which is specified by pictureHandle&. This should be a handle that your program created using the PICTURE ON, PICTURE OFF statements (or the Toolbox routines OpenPicture and ClosePicture), or the USR GETPICT statement. You should not use KILL PICTURE to release a picture handle that was created by other means (for example, a picture resource handle).
Warning: Do not use KILL PICTURE to kill a picture that is currently being displayed in a picture field. You must close the picture field first (using the EDIT FIELD CLOSE statement) before calling KILL PICTURE.
Warning: You should make sure that pictureHandle& does not equal zero before calling KILL PICTURE. Disposing of a "nil handle" can cause problems on some older systems.

### See Also

PICTURE; PICTURE ON/OFF; PICTURE FIELD; EDIT FIELD; CLOSE
# Futurebasic/Language/Reference/kill preferences
## KILL PREFERENCES
### Revised

Feb 2002 (Release 6)

### Description

This routine locates and deletes a file with the specified name in the preference folder. If the file does not exist, this statement does nothing.
A full example of using the new PREFERENCE commands can be found on the Put Preferences reference page.

### See Also

PUT PREFERENCES; GET PREFERENCES; MENU PREFERENCES
# Futurebasic/Language/Reference/include
## INCLUDE
### Statement

Appearance Standard Console

### Syntax

INCLUDE {"<path>"|alisResID}

### Description

When the compiler encounters an INCLUDE statement, it looks for a text file indicated by <path> or alisResID, reads the FB statements contained in that file, and effectively inserts those statements into the source code stream. <path> can be either a full or partial pathname; if you use a partial pathname, it's assumed to be relative to the folder containing the "parent" source file (i.e., the source file that has the INCLUDE statement). <path> may refer either to a text file, or to an alias file whose target is a text file. alisResID must be the resource ID number of an "alis" resource whose target is a text file. This resource should exist in the resource fork of the "parent" source file. INCLUDE files may be "nested"; that is, an INCLUDE'd file may contain references to other INCLUDE files. Example: Suppose we create a file "Assign.INCL" which contains the following lines of text: a = 3 b = 7 Now suppose we write a program like this: DIM x(100) INCLUDE "Assign.INCL" c = a + b When we compile this program, the result will be identical to this: DIM x(100) a = 3 b = 7 c = a + b Note: FutureBasic's Project Manager is generally a more convenient way to combine the source code from several different files. However, there are some advantages to using the INCLUDE statement, such as the ability to conditionally include files (see COMPILE LONG IF). FB does not allow a given file to be included more than once in the source stream. If a second INCLUDE reference is made to a given file, that INCLUDE statement will be ignored.

#### See Also

COMPILE, LONG, IF
# Futurebasic/Language/Reference/kill
## KILL
### Description

This statement deletes a (closed, unlocked) file or folder from the disk. The path$ parameter can be either a full or partial pathname; the refNum% parameter can be a working directory reference number, a volume reference number, a drive ID number, or zero. The dirID& parameter is a directory ID number of the item's parent directory. If dirID& is not specified, then the current PARENTID value (if nonzero) is used instead. KILL resets the PARENTID value to zero after the item is deleted.
The easiest way to use this statement is to specify the item's name in path$, the volume reference number of its volume in refNum%, and the ID number of its parent directory in dirID&. For other ways to use these parameters, see Appendix A: Specifying Files and Folders.
Note: You cannot delete a folder if it has any contents, nor if the folder is "open." A folder is considered "open" if your program has executed any statement which returned a working directory reference number for the folder, and has not subsequently closed it using the CLOSE FOLDER statement.

### See Also

PARENTID CLOSE FOLDER
# Futurebasic/Language/Reference/kill appleevent
## KILL APPLEEVENT
### Revised

May, 2001 (Release 5)

### Description

Once established, an Apple Event remains in effect for the life of your program. This includes event handlers that you create as well as event handlers that are created by the runtime. One example might be the apple event that opens a document. Its event type is _"core" and its class is _"odoc". If you wanted to override these established settings you would begin by removing the old version.
Now you are ready to establish a new vector.
Example:
INSERT IMAGE HERE!!!!
<img src="res/cd.gif" alt="" width="20" height="19" border="0">

### See Also

SENDAPPLEEVENT; HANDLEEVENTS; ON APPLEEVENT; GETPROCESSINFO; APPLEEVENTMESSAGE$
# Futurebasic/Language/Reference/instr
## INSTR
### Function

Appearance Standard Console

### Syntax

targetString$|targetContainer$$,searchString$|searchContainer$$)

### Revised

May 30, 2000 (Release 3)

### Description

This function searches for the first occurrence of searchString$ or searchContainer$$ within targetString$ or targetContainer$$, starting at character position startPos . (If startPos is less than 1, it's treated as 1.) If a match is found, the function returns the character position (1..255) within targetString$ or targetContainer$$ where the match begins. If no match is found, the function returns zero. The string search is case-sensitive. Note: INSTR always returns zero in these cases:

### See Also

INDEXF; MID$; LEFT$; RIGHT$
# Futurebasic/Language/Reference/int
## INT
### Function

Appearance Standard Console

### Syntax

nearestInteger& = INT(expr#)

### Description

Returns the value of expr# rounded to the nearest integer. Note: INT returns a "long integer" value, which means that expr# should be within the range -2147483648 through +2147483547. To obtain the integer part of numbers which are outside this range, use the FIX function. (Note however that FIX truncates the fraction part rather than rounding to the nearest integer. In general, FIX and INT don't return the same values.)

#### See Also

FIX, FRAC
# Futurebasic/Language/Reference/kill field
## KILL FIELD
### Description

This statement disposes of the specified handle. This means that the memory block referenced by handle& gets released, and the value in handle& is thereafter no longer a valid handle. KILL FIELD is commonly used with handles returned by GET FIELD or READ FIELD, but it can dispose of any kind of handle. However, you should specifically NOT use it to dispose of resources, regions, window controls, and other "standard" kinds of Macintosh objects which are created and managed by the MacOS. Instead, you should use the appropriate Toolbox routine (ReleaseResource, DisposeRgn, DisposeControl, etc.) to dispose of such objects.
KILL FIELD is similar to the Toolbox call DisposeHandle, except that it (like the DEF DISPOSEH statement) checks for _nil handles and sets the handle& variable to zero.

### See Also

DEF DISPOSEH; GET FIELD; READ FIELD; SYSERROR
# Classical Chinese/Lesson 3
## Text

性惡 2: 故枸木必將待檃栝烝矯然後直；鈍金必將待礱厲然後利； 今人之性惡，必將待師法然後正，得禮義然後治，今人無師法，則偏險而不正； 無禮義，則悖亂而不治，古者聖王以人性惡，以為偏險而不正，悖亂而不治是以為之起禮義，制法度， 以矯飾人之情性而正之，以擾化人之情性而導之也，始皆出於治，合於道者也。 今人之化師法，積文學，道禮義者為君子； 縱性情，安恣孳，而違禮義者為小人。 用此觀之，人之性惡明矣，其善者偽也。
# Classical Chinese/Lesson 5
## Text

道德经 2 章: 天下皆知美之為美，斯惡已。皆知善之為善，斯不善已。有無相生，難易相成，長短相形，高下相盈，音聲相和，前後相隨。恒也。是以聖人處無為之事，行不言之教；萬物作而弗始，生而弗有，為而弗恃，功成而不居。夫唯弗居，是以不去。
道德经 7 章: 天長地久。天地所以能長且久者，以其不自生，故能長生。是以聖人後其身而身先；外其身而身存。非以其無私邪？故能成其私。

## Vocab & Translation

* 天下皆知美之為美，斯惡已。- All under heaven (the world) recognizes the beautiful as beautiful, hence ugliness is known.
** 下
** 皆
** 美
** 為
** 斯
** 已
# Classic Mac OS/Menus and Windows

The two constants of the Mac OS user interface are the overlapping windows and the menu bar across the top of the screen.

## Anatomy of a Window

Windows in Classic Mac OS look and work much like windows in other GUI-based operating systems. The Close Window button is the small beige square at the left side of the title bar (located across the top of the window). The Window-Shade button is located at the right side of the title bar, and looks like a small beige square crossed by a horizontal line. The Resize button is located just to the left of the Window-Shade button, and looks like a small beige square containing another, smaller beige square. Some windows lack a Resize button, others lack a Window-Shade button, and some do not have either.
Windows can be moved on the screen by dragging the ridged area of their title bars, or by the thick edges of the window. Windows can be resized by dragging the rectangle at the bottom-right corner of the window. Note that most dialog boxes lack both a title bar and thick edges, which means that they cannot be moved or resized. (Some newer dialog boxes do feature a title bar, and fewer still a resizable corner.)
Scroll bars, if they appear, always fill the bottom and/or right sides of the window, just inside the thick border.

## The Main Menu Bar

The main menu bar always appears across the top of the screen. At the far left of the menu bar is the menu. This menu contains the About command for the current application, as well as links to a number of applications. To the right of the menu are the menus for the current application. At the far right of the menu bar is the Application menu, and to the left of that menu are the clock and other "menu extras" that have been installed by third-party software.
# Classic Mac OS
## Introduction

Property of: Apple Latest Version: 9.2.2 Status: Ceased Development
The Apple Macintosh platform uses its own operating system known as Mac OS. Subsequent releases of the operating system have been denoted by appending the version number, such as Mac OS 9. With the advent of Mac OS X based on FreeBSD, previous versions have become known as Classic Mac OS and are no longer supported by Apple. Despite the lack of support, many systems running the Classic Mac OS are still in use today.

## Graphical User Interface

Mac OS featured the first graphical user interface (GUI) on a mass produced computer. (Xerox produced the first GUI, but it did not enter production.) Many of the features of the original release of Mac OS are still implemented in modern operating systems, including:
* Icons
* Shortcuts
* Mouse usage
* Visual interactions (e.g. drag and drop)
* Windows, buttons and dialog boxes
* Boot directly into visual interface
* Cut-and-paste
The ability to interact graphically with the operating system significantly reduced the learning curve. Initially many doubted the viability of the Macintosh for business applications, as the GUI was a significant departure from console based terminals. This preconception was dispelled largely through the passage of time and the adoption of GUIs in several other operating systems.

## Table of Contents

The Macintosh Interface
* Menus and Windows
** The  Menu
** Application Menu

## References

* Macworld Mac Secrets: 6th Edition, by David Pogue & Joseph Schorr. ISBN 0-7645-3415-7.