Skip to content

Commit 16d7c3c

Browse files
committed
fbdocs: wiki snapshot 2021-05-30
1 parent 91d94e6 commit 16d7c3c

File tree

13 files changed

+120
-28
lines changed

13 files changed

+120
-28
lines changed

doc/manual/cache/KeyPgAsm.wakka

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ inc dword ptr [n] ' OK: "ptr" is needed by GAS here%%
3535

3636
==Register Preservation==
3737
When an ##**Asm**## block is opened, the registers ##ebx##, ##esi##, and ##edi## are pushed to the stack, when the block is closed, these registers are popped back from the stack. This is because these registers are required to be preserved by most or all OS's using the x86 CPU. You can therefore use these registers without explicitly preserving them yourself. You should not change ##esp## and ##ebp##, since they are usually used to address local variables.
38+
**Note:** Inside a ##[[KeyPgNaked|Naked]]## procedure, there is no such register preservation.
3839

3940
==Register Names==
4041
~The names of the registers for the x86 architecture are written as follows in an ##**Asm**## block:

doc/manual/cache/KeyPgImageInfo.wakka

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22
Retrieves information about an image
33

44
{{fbdoc item="syntax"}}##
5-
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Imageinfo** ( [[KeyPgByval|byval]] //image// [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]], [[KeyPgByref|byref]] //width// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //height// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //bypp// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //pixdata// [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]] = 0, [[KeyPgByref|byref]] //size// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
5+
for fbc version < 1.08:
6+
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Imageinfo** ( [[KeyPgByval|byval]] //image// [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]], [[KeyPgByref|byref]] //width// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //height// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //bypp// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //pixdata// [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]] = 0, [[KeyPgByref|byref]] //size// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
7+
for fbc version >= 1.08:
8+
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Imageinfo** ( [[KeyPgByval|byval]] //image// [[KeyPgAs|as]] [[KeyPgConstQualifier|const]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]], [[KeyPgByref|byref]] //width// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //height// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //bypp// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //pixdata// [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]] = 0, [[KeyPgByref|byref]] //size// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
9+
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Imageinfo** ( [[KeyPgByval|byval]] //image// [[KeyPgAs|as]] [[KeyPgConstQualifier|const]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]], [[KeyPgByref|byref]] //width// [[KeyPgAs|as]] [[KeyPgLongint|longint]], [[KeyPgByref|byref]] //height// [[KeyPgAs|as]] [[KeyPgLongint|longint]], [[KeyPgByref|byref]] //bypp// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0, [[KeyPgByref|byref]] //pixdata// [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]] = 0, [[KeyPgByref|byref]] //size// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
610
##
711
{{fbdoc item="usage"}}##
8-
//result// = **Imageinfo**( //image// [, [//width//] [, [//height//] [, [//bypp//] [, [//pitch//] [, [//pixdata//] [, //size//]]]]]] )
12+
for fbc version < 1.08::
13+
//result// = **Imageinfo**( //image// [, [//width//] [, [//height//] [, [//bypp//] [, [//pitch//] [, [//pixdata//] [, //size//]]]]]] )
14+
for fbc version >= 1.08:
15+
in the LONG (or INTEGER<32>) version of the function:
16+
//result// = **Imageinfo**( //image// [, //width// [, //height// [, //bypp// [, //pitch// [ , //pixdata// [, //size// ]]]]]] )
17+
in the LONGINT (or INTEGER<64>) version of the function:
18+
//result// = **Imageinfo**( //image// , //width// , //height// [, //bypp// [, //pitch// [ , //pixdata// [, //size// ]]]] )
919
##
1020
{{fbdoc item="param"}}
1121
##//image//##

doc/manual/cache/KeyPgNaked.wakka

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Write functions without prolog/epilog code
1414
##//data_type//## - the [[DataType|data type]] of the function.
1515

1616
{{fbdoc item="desc"}}
17-
##**Naked**## allows the programmer to write procedures without the compiler generating any prolog/epilog code. This is useful when writing small, fast functions in ##[[KeyPgAsm|Asm]]## without any unnecessary overhead.
17+
##**Naked**## allows the programmer to write procedures without the compiler generating any prolog/epilog code.
18+
This is useful when writing small, fast functions in ##[[KeyPgAsm|Asm]]## without any unnecessary overhead (so, no register preservation for such ##[[KeyPgAsm|Asm]]## blocks).
1819

1920
{{fbdoc item="ex"}}
2021
{{fbdoc item="filename" value="examples/manual/procs/naked1.bas"}}%%(freebasic)
21-
'' Naked cdecl function
22+
'' Naked cdecl function (for fbc 32-bit)
2223
Function subtract_c Naked cdecl _ '' parameters pushed onto call stack in reverse order of declaration
2324
( _
2425
ByVal a As Long, _
@@ -37,7 +38,7 @@ Print subtract_c( 5, 1 ) '' 5 - 1
3738

3839
''---------------------------------------------------------------------------------------------------------------------
3940

40-
'' Naked stdcall function
41+
'' Naked stdcall function (for fbc 32-bit)
4142
Function subtract_s Naked stdcall _ '' parameters pushed onto call stack in reverse order of declaration
4243
_ '' called procedure responsible for removing parameters from stack
4344
_ '' (appending constant to RET instruction specifying number of bytes to release)
@@ -58,7 +59,7 @@ Print subtract_s( 5, 1 ) '' 5 - 1
5859

5960
''---------------------------------------------------------------------------------------------------------------------
6061

61-
'' Naked pascal function
62+
'' Naked pascal function (for fbc 32-bit)
6263
Function subtract_p Naked pascal _ '' parameters pushed onto call stack in same order as declaration
6364
_ '' called procedure responsible for removing parameters from stack
6465
_ '' (appending constant to RET instruction specifying number of bytes to release)
@@ -78,7 +79,7 @@ End Function
7879
Print subtract_p( 5, 1 ) '' 5 - 1%%
7980

8081
{{fbdoc item="filename" value="examples/manual/procs/naked2.bas"}}%%(freebasic)
81-
'' Naked cdecl function
82+
'' Naked cdecl function (for fbc 32-bit)
8283
'' plus ecx register preserved in asm block by creating user stack
8384
Function subtract_cp Naked cdecl _ '' parameters pushed onto call stack in reverse order of declaration
8485
( _

doc/manual/cache/KeyPgOpPpConcat.wakka

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Preprocessor operator to concatenate strings
66
##
77
{{fbdoc item="desc"}}
88
This operator creates a new token by concatenating the texts at both sides of it. This text can be recognized by other macros and further expanded. One use, is to create a macro that expands to different macro names, variable names, and function names depending on the arguments received.
9+
10+
**Note** for fbc version >= 1.08**:**
11+
In macro/define's use ""'##_'"" to escape line continuation character '_' to allow multiple lines of macro expanded code to be combined into a single statement.
912

1013
{{fbdoc item="ex"}}
1114
{{fbdoc item="filename" value="examples/manual/prepro/concat.bas"}}%%(freebasic)

doc/manual/cache/KeyPgScreencontrol.wakka

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,42 @@
22
Sets or gets internal graphics library settings
33

44
{{fbdoc item="syntax"}}##
5-
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param1 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param2 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param3 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param4 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0 )
6-
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param [[KeyPgAs|as]] [[KeyPgString|string]] = ##"####"## )
5+
for fbc version < 1.08:
6+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param1 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param2 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param3 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param4 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0 )
7+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param [[KeyPgAs|as]] [[KeyPgString|string]] = ##"####"## )
8+
for fbc version >= 1.08:
9+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgConstQualifier|const]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param1 [[KeyPgAs|as]] [[KeyPgLong|long]] = &h80000000, [[KeyPgByref|byref]] param2 [[KeyPgAs|as]] [[KeyPgLong|long]] = &h80000000, [[KeyPgByref|byref]] param3 [[KeyPgAs|as]] [[KeyPgLong|long]] = &h80000000, [[KeyPgByref|byref]] param4 [[KeyPgAs|as]] [[KeyPgLong|long]] = &h80000000 )
10+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgConstQualifier|const]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param1 [[KeyPgAs|as]] [[KeyPgLongint|longint]], [[KeyPgByref|byref]] param2 [[KeyPgAs|as]] [[KeyPgLongint|longint]] = &h80000000, [[KeyPgByref|byref]] param3 [[KeyPgAs|as]] [[KeyPgLongint|longint]] = &h80000000, [[KeyPgByref|byref]] param4 [[KeyPgAs|as]] [[KeyPgLongint|longint]] = &h80000000 )
11+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgConstQualifier|const]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param [[KeyPgAs|as]] [[KeyPgString|string]])
712
##
813
{{fbdoc item="usage"}}##
9-
**""ScreenControl""**( //what// [, [ //param1// ][, [ //param2// ][, [ //param3// ][, [ //param4// ]]]]] )
10-
##or,##
11-
**""ScreenControl""**( //what// [, //param// ] )
14+
for fbc version < 1.08:
15+
**""ScreenControl""**( //what// [, [ //param1// ][, [ //param2// ][, [ //param3// ][, [ //param4// ]]]]] )
16+
or,
17+
**""ScreenControl""**( //what// [, //param// ] )
18+
for fbc version >= 1.08:
19+
in the LONG (or INTEGER<32>) version of the sub:
20+
**""ScreenControl""**( //what// [, //param1// [, //param2// [, //param3// [, //param4// ]]]] )
21+
or,
22+
**""ScreenControl""**( //what// , //param// )
23+
in the LONGINT (or INTEGER<64>) version of the sub:
24+
**""ScreenControl""**( //what// , //param1// [, //param2// [, //param3// [, //param4// ]]] )
25+
or,
26+
**""ScreenControl""**( //what// , //param// )
1227
##
1328
{{fbdoc item="param"}}
1429
##//what//##
1530
specifies the function to perform
1631
##//param1//##
17-
optional first integer parameter, contains value to be set on entry or value got on exit
32+
first integer parameter, contains value to be set on entry or value got on exit
1833
##//param2//##
19-
optional second integer parameter, contains value to be set on entry or value got on exit
34+
second integer parameter, contains value to be set on entry or value got on exit
2035
##//param3//##
21-
optional third integer parameter, contains value to be set on entry or value got on exit
36+
third integer parameter, contains value to be set on entry or value got on exit
2237
##//param4//##
23-
optional fourth integer parameter, contains value to be set on entry or value got on exit
38+
fourth integer parameter, contains value to be set on entry or value got on exit
2439
##//param//##
25-
optional string parameter, contains text to be set on entry or text got on exit
40+
string parameter, contains text to be set on entry or text got on exit
2641

2742
{{fbdoc item="desc"}}
2843
This function can be used to set or get internal ""GfxLib"" states. The ##//what//## parameter specifies which operation to perform. On operations that set states, the ##//param*//## parameters must contain the values to be set. On operations that get states, ##//param*//## will hold the values returned by ""GfxLib"" when the function returns.

doc/manual/cache/KeyPgScreeninfo.wakka

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22
Retrieves information about current video mode or the desktop.
33

44
{{fbdoc item="syntax"}}##
5-
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **Screeninfo** ( [[KeyPgByref|byref]] //w// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //h// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //depth// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //bpp// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //rate// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //driver// [[KeyPgAs|as]] [[KeyPgString|string]] = "####" )
5+
for fbc version < 1.08:
6+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **Screeninfo** ( [[KeyPgByref|byref]] //w// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //h// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //depth// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //bpp// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //rate// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] //driver// [[KeyPgAs|as]] [[KeyPgString|string]] = "####" )
7+
for fbc version >= 1.08:
8+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **Screeninfo** ( [[KeyPgByref|byref]] //w// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //h// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //depth// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //bpp// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //rate// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByref|byref]] //driver// [[KeyPgAs|as]] [[KeyPgString|string]] = "####" )
9+
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **Screeninfo** ( [[KeyPgByref|byref]] //w// [[KeyPgAs|as]] [[KeyPgLongint|longint]], [[KeyPgByref|byref]] //h// [[KeyPgAs|as]] [[KeyPgLongint|longint]], [[KeyPgByref|byref]] //depth// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0, [[KeyPgByref|byref]] //bpp// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0, [[KeyPgByref|byref]] //pitch// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0, [[KeyPgByref|byref]] //rate// [[KeyPgAs|as]] [[KeyPgLongint|longint]] = 0, [[KeyPgByref|byref]] //driver// [[KeyPgAs|as]] [[KeyPgString|string]] = "####" )
610
##
711
{{fbdoc item="usage"}}##
8-
**Screeninfo** [ //w// ] [, [ //h// ] [, [ //depth// ] [ , [ //bpp// ] [ , [ //pitch// ] [ , [ //rate// ] [, //driver// ]]]]]
12+
for fbc version < 1.08:
13+
**Screeninfo** [ //w// ] [, [ //h// ] [, [ //depth// ] [ , [ //bpp// ] [ , [ //pitch// ] [ , [ //rate// ] [, //driver// ]]]]]]
14+
for fbc version >= 1.08:
15+
in the LONG (or INTEGER<32>) version of the sub:
16+
**Screeninfo** [ //w// [, //h// [, //depth// [, //bpp// [, //pitch// [, //rate// [, //driver// ]]]]]]]
17+
in the LONGINT (or INTEGER<64>) version of the sub:
18+
**Screeninfo** //w// , //h// [, //depth// [, //bpp// [, //pitch// [, //rate// [, //driver// ]]]]]
919
##
1020
{{fbdoc item="param"}}
1121
##//w//##

doc/manual/cache/KeyPgThreadDetach.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Releases a thread handle without waiting for the thread to finish
1313
##[[KeyPgAny|Any]] [[KeyPgPtr|Ptr]]## handle of a thread created by ##[[KeyPgThreadCreate|ThreadCreate]]## or ##[[KeyPgThreadCall|ThreadCall]]##
1414

1515
{{fbdoc item="desc"}}
16-
**""ThreadDetach""** releases resources associated with a thread handle returned by ##[[KeyPgThreadCreate|ThreadCreate]]## or ##[[KeyPgThreadCall|ThreadCall]]##. The thread handle will be destroyed by **""ThreadDetach""** and cannot be used anymore.
16+
**""ThreadDetach""** releases resources associated with the thread handle returned by ##[[KeyPgThreadCreate|ThreadCreate]]## or ##[[KeyPgThreadCall|ThreadCall]]##. The thread handle will be destroyed by **""ThreadDetach""** and cannot be used anymore.
1717
Unlike ##[[KeyPgThreadWait|ThreadWait]]##, **""ThreadDetach""** does not wait for the thread to finish and thread execution continues independently. Any allocated resources will be freed once the thread exits.
1818

1919
In order to avoid memory leaks, the safe way to end a thread is to always signal to it that it must end, and then call ##[[KeyPgThreadWait|ThreadWait]]## on that thread except if **""ThreadDetach""** has previously been called.

doc/manual/cache/ProPgLineContinuation.wakka

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{fbdoc item="title" value="Line continuation"}}----
2-
A single ##_## (underscore) character at the end of a line of code tells the compiler that the line continues in the next line. This allows a single statement (line of code) to be spread across multiple lines in the input file, which can be a nice formatting help.
2+
A single '_' (underscore) character at the end of a line of code tells the compiler that the line continues in the next line. This allows a single statement (line of code) to be spread across multiple lines in the input file, which can be a nice formatting help.
33

44
{{fbdoc item="filename" value="examples/manual/proguide/linecontinuation1.bas"}}%%(freebasic)
55
'' This Dim statement is spread across multiple lines, using the '_' character
@@ -32,9 +32,9 @@ declare sub drawRectangle _
3232
'' (or any other formatting you like)
3333
%%
3434

35-
The ##_## line continuation character can be inserted at pretty much any point in a line of code. It does not work inside comments though.
35+
The '_' line continuation character can be inserted at pretty much any point in a line of code. It does not work inside comments though.
3636

37-
Be careful when adding the ##_## line continuation character right behind an identifier or keyword. It should be separated with at least one space character, otherwise it would be treated as part of the identifier or keyword.
37+
Be careful when adding the '_' line continuation character right behind an identifier or keyword. It should be separated with at least one space character, otherwise it would be treated as part of the identifier or keyword.
3838

3939
{{fbdoc item="filename" value="examples/manual/proguide/linecontinuation3.bas"}}%%(freebasic)
4040
'' Declare variable "a_"
@@ -49,6 +49,9 @@ dim as integer a _
4949
= 5
5050
%%
5151

52-
**Warning:** When an erroneous code line is spread over a multiple lines block by using the _ line continuation character, the error message refers only to the last line of the block.
52+
**Warning:** When an erroneous code line is spread over a multiple lines block by using the '_' line continuation character, the error message refers only to the last line of the block.
53+
54+
**Note** for fbc version >= 1.08**:**
55+
In macro/define's use ""'##_'"" to escape line continuation character '_' to allow multiple lines of macro expanded code to be combined into a single statement.
5356

5457
{{fbdoc item="back" value="CatPgProgrammer|Programmer's Guide"}}

examples/manual/array/erase.bas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Dim MyArray1(1 To 10) As Integer
1010
ReDim MyArray2(1 To 10) As Integer
1111

1212
Erase MyArray1, MyArray2
13+

examples/manual/array/erase2.bas

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'' examples/manual/array/erase2.bas
2+
''
3+
'' NOTICE: This file is part of the FreeBASIC Compiler package and can't
4+
'' be included in other distributions without authorization.
5+
''
6+
'' See Also: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgErase
7+
'' --------
8+
9+
Dim MyArray1(1 To 10) As Integer
10+
ReDim MyArray2(1 To 10) As Integer
11+
12+
Print "MyArray1", LBound( MyArray1 ), UBound( MyArray1 ) ' prints: MyArray1 1 10
13+
Print "MyArray2", LBound( MyArray2 ), UBound( MyArray2 ) ' prints: MyArray2 1 10
14+
15+
Erase MyArray1, MyArray2
16+
17+
Print "MyArray1", LBound( MyArray1 ), UBound( MyArray1 ) ' prints: MyArray1 1 10
18+
Print "MyArray2", LBound( MyArray2 ), UBound( MyArray2 ) ' prints: MyArray2 0 -1
19+

0 commit comments

Comments
 (0)