Skip to content

Commit e4194ce

Browse files
committed
fbdoc: wiki snapshot 2018-09-03 & update examples from examples/manual
1 parent 13b4de3 commit e4194ce

12 files changed

+204
-186
lines changed

doc/manual/cache/CompilerErrMsg.wakka

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ During the program compilation three types of errors can arise:
1414
- //7 Identifier's name too big, truncated//
1515
- //8 Literal number too big, truncated//
1616
- //9 Literal string too big, truncated//
17-
- //10 UDT with pointer or var-len string fields//
17+
- //10 UDT with pointer, var-len string, or var-len array fields//
1818
- //11 Implicit variable allocation//
1919
- //12 Missing closing quote in literal string//
2020
- //13 Function result was not explicitly set//
@@ -41,7 +41,7 @@ During the program compilation three types of errors can arise:
4141
- //34 '=' parsed as equality operator in function argument, not assignment to BYREF function result//
4242
- //35 Mixing signed/unsigned operands//
4343
- //36 Mismatching parameter initializer//
44-
- //37 //
44+
- //37 Ambiguous LEN or SIZEOF//
4545
- //38 Suspicious logic operation, mixed boolean and non-boolean operands//
4646
- //39 Redefinition of intrinsic//
4747
- //40 CONST qualifier discarded//

doc/manual/cache/CompilerOptw.wakka

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
Set minimum warning level.
33

44
{{fbdoc item="syntax"}}##
5-
**-w** //level// | **all** | **param** | **escape** | **pedantic** | **next** | **constness**
5+
**-w** //level// | **all** | **none** | **param** | **escape** | **pedantic** | **next** | **funcptr** | **constness**
66
##
77
{{fbdoc item="param"}}
88
##//level//##
9-
Warning messages only with a level equal or greater to this value will be output.
9+
Warning messages only with a level equal or greater to this value will be output.
1010
##**all**##
11-
Equivalent to specifying a ##//level//## of zero (##0##).
11+
Equivalent to specifying a ##//level//## of negative one (##-1##).
12+
##**none**##
13+
Suppresses all warnings.
1214
##**param**##
1315
Warn when procedure parameters aren't specified with either ##[[KeyPgByval|ByVal]]## or ##[[KeyPgByref|ByRef]]##.
1416
##**escape**##
@@ -17,16 +19,20 @@ Set minimum warning level.
1719
Equivalent to specifying the ##**param**## and ##**escape**## arguments, plus length checking of parameters passed ##[[KeyPgByval|ByVal]]## and of any ##[[KeyPgCptr|Cptr]]## converting to pointer only.
1820
##**next**##
1921
Warn when ##[[KeyPgNext|Next]]## is followed by an identifier.
22+
##**funcptr**##
23+
Warn on mismatched procedure pointers, including conversions in ##[[KeyPgCast|CAST]]## and ##[[KeyPgCptr|CPTR]]## expressions. Implies '-w all'. Experimental. Behaviour may change in future versions.
2024
##**constness**##
21-
Warn when ##[[KeyPgConstQualifier|CONST (Qualifier)]]## is discarded in an assignment.
25+
Warn when ##[[KeyPgConstQualifier|CONST (Qualifier)]]## is discarded in an assignment. Implies '-w funcptr' and '-w all'. Behaviour may change in future versions.
2226

2327
{{fbdoc item="desc"}}
24-
The ##-w## compiler option determines which compiler warnings, if any, are output. Each possible warning is associated with a warning level, starting from zero (##0##) and increasing with the potential problems that may occur. A significantly high ##//level//## value will have the effect of suppressing all warning messages.
28+
The ##-w## compiler option determines which compiler warnings, if any, are output. Each possible warning is associated with a warning level, starting from negative one (##-1##) and increasing with the potential problems that may occur.
2529

26-
Note that the ##**param**##, ##**escape**##, ##**pedantic**##, ##**next**## and ##**constness**## arguments provide additional warnings not ordinarily output, even by default.
30+
The ##**param**##, ##**escape**##, ##**pedantic**##, ##**next**##, ##**funcptr**##, and ##**constness**## arguments provide additional warnings not ordinarily output, even by default.
31+
32+
The default, if the ##**-w**## option is not specified, is as if ##**-w 0**## was used. The ##**-w**## option can be specified multiple times. Warning messages having a level of ##-1## are not shown by default.
33+
34+
##-w none##, or a significantly high ##//level//## value will have the effect of suppressing all warning messages.
2735

28-
If the ##**-w**## option is not specified, it's as if ##**-w 0**## was used. The ##**-w**## option can be specified multiple times.
29-
3036
{{fbdoc item="see"}}
3137
- [[CompilerCmdLine|Using the Command Line]]
3238

doc/manual/cache/ExtLibaspell.wakka

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,52 @@ Header version: 0.60.6.1
1010
{{fbdoc item="filename" value="examples/manual/libraries/aspell.bas"}}%%(freebasic)
1111
'' GNU-ASspell example, converted from http://aspell.net/win32/
1212

13-
#include once "aspell.bi"
13+
#include Once "aspell.bi"
1414

15-
dim as AspellConfig ptr spell_config = new_aspell_config()
15+
Dim As AspellConfig Ptr spell_config = new_aspell_config()
1616

1717
'' Change this to suit the installed dictionary language if desired
1818
aspell_config_replace(spell_config, "lang", "en_CA")
1919

2020
'' Create speller object
21-
dim as AspellCanHaveError ptr possible_err = new_aspell_speller(spell_config)
22-
if (aspell_error_number(possible_err) <> 0) then
23-
print *aspell_error_message(possible_err)
24-
end 1
25-
end if
26-
dim as AspellSpeller ptr speller = to_aspell_speller(possible_err)
27-
28-
dim as string word
29-
do
30-
print
31-
input "Enter a word (blank to quit): ", word
32-
if (len(word) = 0) then
33-
exit do
34-
end if
35-
36-
if (aspell_speller_check(speller, strptr(word), len(word)) <> 0) then
37-
print "Word is Correct"
38-
else
39-
print "Suggestions:"
40-
dim as AspellStringEnumeration ptr elements = _
41-
aspell_word_list_elements(aspell_speller_suggest(speller, strptr(word), len(word)))
42-
do
43-
dim as zstring ptr w = aspell_string_enumeration_next(elements)
44-
if (w = 0) then
45-
exit do
46-
end if
47-
print " "; *w
48-
loop
21+
Dim As AspellCanHaveError Ptr possible_err = new_aspell_speller(spell_config)
22+
If (aspell_error_number(possible_err) <> 0) Then
23+
Print *aspell_error_message(possible_err)
24+
End 1
25+
End If
26+
Dim As AspellSpeller Ptr speller = to_aspell_speller(possible_err)
27+
28+
Dim As String word
29+
Do
30+
Print
31+
Input "Enter a word (blank to quit): ", word
32+
If (Len(word) = 0) Then
33+
Exit Do
34+
End If
35+
36+
If (aspell_speller_check(speller, StrPtr(word), Len(word)) <> 0) Then
37+
Print "Word is Correct"
38+
Else
39+
Print "Suggestions:"
40+
Dim As AspellStringEnumeration Ptr elements = _
41+
aspell_word_list_elements(aspell_speller_suggest(speller, StrPtr(word), Len(word)))
42+
Do
43+
Dim As const ZString Ptr w = aspell_string_enumeration_next(elements)
44+
If (w = 0) Then
45+
Exit Do
46+
End If
47+
Print " "; *w
48+
Loop
4949
delete_aspell_string_enumeration(elements)
50-
end if
50+
End If
5151

5252
' - Report the replacement
5353
'aspell_speller_store_repl(speller, misspelled_word, size,
5454
' correctly_spelled_word, size);
5555

5656
' - Add to session or personal dictionary
5757
'aspell_speller_add_to_session|personal(speller, word, size)
58-
loop
58+
Loop
5959

6060
delete_aspell_speller(speller)
6161
%%

doc/manual/cache/ExtLibcryptlib.wakka

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,70 @@ Examples: in examples/math/cryptlib/
99

1010
{{fbdoc item="ex"}}
1111
{{fbdoc item="filename" value="examples/manual/libraries/cryptlib.bas"}}%%(freebasic)
12-
#include once "cryptlib.bi"
12+
#include Once "cryptlib.bi"
1313

14-
function calc_hash( byval filename as string, byval algo as CRYPT_ALGO_TYPE ) as string
15-
const BUFFER_SIZE = 8192
16-
dim as byte buffer( 0 to BUFFER_SIZE-1 )
14+
Function calc_hash( ByVal filename As String, ByVal algo As CRYPT_ALGO_TYPE ) As String
15+
Const BUFFER_SIZE = 8192
16+
Dim As Byte buffer( 0 To BUFFER_SIZE-1 )
1717

1818
'' create a new context using the wanted algorithm
19-
dim as CRYPT_CONTEXT ctx
19+
Dim As CRYPT_CONTEXT ctx
2020
cryptCreateContext( @ctx, CRYPT_UNUSED, algo )
2121

2222
'' open input file in binary mode
23-
dim as integer f = freefile()
24-
if( open( filename for binary access read as #f ) <> 0 ) then
25-
return ""
26-
end if
23+
Dim As Integer f = FreeFile()
24+
If( Open( filename For Binary Access Read As #f ) <> 0 ) Then
25+
Return ""
26+
End If
2727

2828
'' read until end-of-file
29-
do until( eof( f ) )
30-
dim as integer oldpos = seek( f )
31-
get #f, , buffer()
32-
dim as integer readlength = seek( f ) - oldpos
29+
Do Until( EOF( f ) )
30+
Dim As Integer oldpos = Seek( f )
31+
Get #f, , buffer()
32+
Dim As Integer readlength = Seek( f ) - oldpos
3333
'' encrypt
3434
cryptEncrypt( ctx, @buffer(0), readlength )
35-
loop
35+
Loop
3636

3737
'' close input file
38-
close #f
38+
Close #f
3939

4040
'' finalize
4141
cryptEncrypt( ctx, 0, 0 )
4242

4343
'' get the hash result
44-
dim as integer buffersize = BUFFER_SIZE
44+
Dim As Integer buffersize = BUFFER_SIZE
4545
cryptGetAttributeString( ctx, CRYPT_CTXINFO_HASHVALUE, @buffer(0), @buffersize )
4646

4747
'' convert to hexadecimal
48-
dim as string result = ""
49-
for i as integer = 0 to buffersize-1
50-
result += hex( buffer(i) )
51-
next
48+
Dim As String result = ""
49+
For i As Integer = 0 To buffersize-1
50+
result += Hex( buffer(i) )
51+
Next
5252

5353
'' free the context
5454
cryptDestroyContext( ctx )
5555

56-
return result
57-
end function
56+
Return result
57+
End Function
5858

59-
dim as string filename = trim( command(1) )
60-
if( len( filename ) = 0 ) then
61-
print "Usage: hash.exe filename"
62-
end -1
63-
end if
59+
Dim As String filename = Trim( Command(1) )
60+
If( Len( filename ) = 0 ) Then
61+
Print "Usage: hash.exe filename"
62+
End -1
63+
End If
6464

6565
'' init cryptlib
6666
cryptInit( )
6767

6868
'' calculate hashes
69-
print "md5: "; calc_hash( filename, CRYPT_ALGO_MD5 )
70-
print "sha: "; calc_hash( filename, CRYPT_ALGO_SHA )
69+
Print "md5: "; calc_hash( filename, CRYPT_ALGO_MD5 )
70+
Print "sha1: "; calc_hash( filename, CRYPT_ALGO_SHA1 )
7171

7272
'' shutdown cryptlib
7373
cryptEnd( )
7474

75-
sleep
75+
Sleep
7676
%%
7777

7878
{{fbdoc item="back" value="ExtLibTOC|External Library Table of Contents"}}

0 commit comments

Comments
 (0)