Topic Sample


General style page for topics.

On this page:


Components of a Topic:


Syntax: Declaration versus Usage:

FreeBASIC is very compatible with QBasic and therefore inherits much of the quirkiness of the QBasic syntax. While some keywords (primarily functions and subs) can be specified with a full declaration (or prototype), many statements can not. (not easily anyway) Visually the appearance of the usages and declarations should be similar and resemble the examples below. Where possible full declarations for functions and subs should be added.

Usage Example:
PSet [target ,] [STEP] (x, y) [,color]


Declaration Example:

All topics should continue to include the existing syntax section of the documents as-is (with additional font formatting as needed). Where applicable, a declaration section should be added. The syntax line and the declaration line follow the same font formatting rules.

Font styles



Sample Page:

Function


Brief sentence describing intent of function.

Syntax:
declare function Function( param1 as string, param2 as integer = &H1234 ) as integer

Usage:
result = Function( param1 [, param2 ] )


Parameters:
param1
A description of parameter. Format of parameter is monospaced italic with one indent. Description of parameter is normal text with two indents.
param2
A description of parameter. For example: Optional. If omitted a default value of &H1234 is assumed.

Return Value:
Description of return value, including possible failure return. If this section is not present, no return value or return value not applicable is assumed. If the section is present and there is no return value, a simple "None" will suffice.

Description:
Short paragraph describing what function does, quirky properties, etc. At this point, most of what the function/sub does should be described in the previous sections. This is a good place to provide data tables, discussions on interactions with other functions/subs, tips, pitfalls, etc.

Any additional information.

Examples:
Example #1:
Const param1 As String = "a string"
Const param2 As Integer = &Hdeadbeef

Function func( a As String, b As Integer = 0) As Integer
    Return Val(a)+b
End Function

    '' acquire result
    Dim As Integer result
    result = func( param1 )
   
    '' acquire new result with param2
    result = func( param1, param2 )

Output:
sample output
sample output
sample output
sample output


Dialect Differences:
Platform Differences:
  • Not supported on DOS
  • Win32 does not ...
  • etc

Differences from QB:
  • List any differences between FreeBASIC and other basics (primarily QBasic)
  • QBasic does not ...
  • New to FreeBASIC
  • etc

See also:
  • List related Functions / relevant keywords
  • Other FBWiki Links
  • etc

Back to FB Wiki - Help
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode