Skip to content
Paul Squires edited this page Sep 19, 2026 · 1 revision

Home › Miscellaneous Keywords › As

As

Part of a declaration which specifies a data type, or part of the Open statement which specifies a file handle.

Syntax

symbolname As datatype
Open ... As #filenumber
Type ... As datatype

Description

As is used to declare the type of variables, fields or arguments and is also used in the Open statement to determine the file handle. As is also used with the Type (Alias) syntax, similar to C's typedef statement.

Remarks

Differences from QB

See also

Examples

'' don't try to compile this code, the examples are unrelated

Declare Sub mySub (X As Integer, Y As Single, Z As String)

' ...

Dim X As Integer

' ...

Type myType

  X As Integer

  Y As Single

  Z As String

End Type

' ...

Type TheNewType As myType

' ...

Open "test" For Input As #1

' ...

Category: Miscellaneous Keywords
Kind: keyword


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally