From ade819ba190889775cdd86d9581ebe210c44420d Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sun, 4 Feb 2018 08:58:01 -0500 Subject: [PATCH 01/15] fbchkdoc: collect the common code for command line arguments from all the tools in to a single module cmd_opts.bas --- doc/fbchkdoc/chkdocs.bas | 174 +++++------- doc/fbchkdoc/cmd_opts.bas | 585 ++++++++++++++++++++++++++++++++++++++ doc/fbchkdoc/delextra.bas | 83 +++--- doc/fbchkdoc/fbchkdoc.bi | 41 ++- doc/fbchkdoc/fmtcode.bas | 2 +- doc/fbchkdoc/funcs.bi | 23 ++ doc/fbchkdoc/getimage.bas | 47 +-- doc/fbchkdoc/getindex.bas | 135 ++++----- doc/fbchkdoc/getpage.bas | 166 ++++------- doc/fbchkdoc/makefile | 3 +- doc/fbchkdoc/mkimglst.bas | 102 ++----- doc/fbchkdoc/mkprntoc.bas | 84 +++--- doc/fbchkdoc/pretty.bas | 11 +- doc/fbchkdoc/putpage.bas | 208 ++++---------- doc/fbchkdoc/readme.txt | 103 ++++--- doc/fbchkdoc/rebuild.bas | 101 ++----- doc/fbchkdoc/replace.bas | 147 +++++----- doc/fbchkdoc/samps.bas | 16 +- doc/fbchkdoc/spell.bas | 111 ++------ 19 files changed, 1238 insertions(+), 904 deletions(-) create mode 100644 doc/fbchkdoc/cmd_opts.bas diff --git a/doc/fbchkdoc/chkdocs.bas b/doc/fbchkdoc/chkdocs.bas index 1cfcbdfd12..57a41eee3d 100644 --- a/doc/fbchkdoc/chkdocs.bas +++ b/doc/fbchkdoc/chkdocs.bas @@ -105,9 +105,11 @@ type TempInfo_t extra as string end type -dim shared cache_dir as string +'' from cmd_opts.bas +extern cache_dir as string +extern image_dir as string -const PageIndex_File = def_index_file +const PageIndex_File = hardcoded.default_index_file const DocPages_File = "DocPages.txt" const LinkList_File = "linklist.csv" const FixList_File = "fixlist.txt" @@ -1582,10 +1584,9 @@ end sub '' MAIN '' -------------------------------------------------------- -dim i as integer = 1 -dim as string def_cache_dir, web_cache_dir, dev_cache_dir, image_dir - enum OPTIONS + OPT_NONE = 0 + OPT_MISSING_PAGES = 1 OPT_FULL_INDEX = 2 OPT_FUNCT_INDEX = 4 @@ -1633,9 +1634,76 @@ enum OPTIONS end enum -dim opt as OPTIONS +'' froms cmd_opts.bas +extern cmd_opt_help as boolean + +'' private options +dim opt as OPTIONS = OPT_NONE -if command(i) = "" then +'' enable cache +cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_IMAGE or CMD_OPTS_ENABLE_AUTOCACHE ) + +dim i as integer = 1 +while( command(i) > "" ) + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then + cmd_opts_unrecognized_die( i ) + else + select case lcase(command(i)) + case "z" + opt or= OPT_LOAD_FROM_FILE + + case "e" + opt or= OPT_ALL + opt or= OPT_TIMER_LOG + + case "a" + opt or= OPT_ALL_LINKS + opt or= OPT_TIMER_LOG + case "m" + opt or= OPT_MISSING_PAGES + case "full" + opt or= OPT_FULL_INDEX + case "func" + opt or= OPT_FUNCT_INDEX + case "ops" + opt or= OPT_OPS_INDEX + case "n" + opt or= OPT_LINK_NAME_CASE + case "b" + opt or= OPT_MISSING_BACKLINK + case "k" + opt or= OPT_INVALID_BACKLINK + case "q" + opt or= OPT_NO_BACKLINK + case "c" + opt or= OPT_NOT_LINKED + case "p" + opt or= OPT_PRINT_TOC + case "d" + opt or= OPT_NO_TITLE + + case "t" + opt or= OPT_ALL_TOKEN + opt or= OPT_TIMER_LOG + case "h" + opt or= OPT_HEADERS + case "f" + opt or= OPT_DUP_FILE_NAME + case "i" + opt or= OPT_IMAGES + case "tc" + opt or= OPT_TOKEN_COUNTS + + case else + print "option '"; command(i); "' ignored" + end select + end if + i += 1 +wend + +if( cmd_opt_help ) then print "chkdocs [options]" print print "options:" @@ -1670,104 +1738,20 @@ if command(i) = "" then end 0 end if -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - image_dir = opts->Get( "image_dir", default_image_dir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - image_dir = default_image_dir - end if -end scope - -opt = 0 - -while command(i) > "" - - select case lcase(command(i)) - case "-web", "-dev" - cache_dir = def_cache_dir - case "-web+" - cache_dir = web_cache_dir - case "-dev+" - cache_dir = dev_cache_dir - - case "z" - opt or= OPT_LOAD_FROM_FILE - - case "e" - opt or= OPT_ALL - opt or= OPT_TIMER_LOG - - case "a" - opt or= OPT_ALL_LINKS - opt or= OPT_TIMER_LOG - case "m" - opt or= OPT_MISSING_PAGES - case "full" - opt or= OPT_FULL_INDEX - case "func" - opt or= OPT_FUNCT_INDEX - case "ops" - opt or= OPT_OPS_INDEX - case "n" - opt or= OPT_LINK_NAME_CASE - case "b" - opt or= OPT_MISSING_BACKLINK - case "k" - opt or= OPT_INVALID_BACKLINK - case "q" - opt or= OPT_NO_BACKLINK - case "c" - opt or= OPT_NOT_LINKED - case "p" - opt or= OPT_PRINT_TOC - case "d" - opt or= OPT_NO_TITLE - - case "t" - opt or= OPT_ALL_TOKEN - opt or= OPT_TIMER_LOG - case "h" - opt or= OPT_HEADERS - case "f" - opt or= OPT_DUP_FILE_NAME - case "i" - opt or= OPT_IMAGES - case "tc" - opt or= OPT_TOKEN_COUNTS - - case else - print "option '"; command(i); "' ignored" - end select - - i += 1 - -wend +cmd_opts_resolve() +cmd_opts_check() if( (opt and OPT_ALL) = 0 ) then print "No options specified" end 1 end if +'' -------------------------------------------------------- + Timer_Begin() logopen() - logprint "chkdocs: " + format( now(), "yyyy/mm/dd hh:mm:ss" ) - -if( cache_dir = "" ) then - cache_dir = def_cache_dir -end if logprint "cache: " & cache_dir logprint diff --git a/doc/fbchkdoc/cmd_opts.bas b/doc/fbchkdoc/cmd_opts.bas new file mode 100644 index 0000000000..9b0fc6f6d6 --- /dev/null +++ b/doc/fbchkdoc/cmd_opts.bas @@ -0,0 +1,585 @@ +'' fbchkdoc - FreeBASIC Wiki Management Tools +'' Copyright (C) 2018 Jeffery R. Marshall (coder[at]execulink[dot]com) +'' +'' This program is free software; you can redistribute it and/or modify +'' it under the terms of the GNU General Public License as published by +'' the Free Software Foundation; either version 2 of the License, or +'' (at your option) any later version. +'' +'' This program is distributed in the hope that it will be useful, +'' but WITHOUT ANY WARRANTY; without even the implied warranty of +'' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'' GNU General Public License for more details. +'' +'' You should have received a copy of the GNU General Public License +'' along with this program; if not, write to the Free Software +'' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA. + +'' common command line options for fbchkdoc utilities + +'' chng: written [jeffm] + +'' fbdoc headers +#include once "CWikiCon.bi" +#include once "COptions.bi" + +using fb +using fbdoc + +#include once "fbchkdoc.bi" +#include once "funcs.bi" + +'' ------------------------------------ +'' command line options +'' ------------------------------------ + +'' scan the command line options: we need to save these for later. +'' we might have '-ini file' option on the command line which we +'' need to know first, because we are going to 1) read the ini +'' file, then 2) override the values with any other options given +'' on the command line + +extern cmd_opt_help as boolean + +dim shared cmd_opt_enable_url as boolean +dim shared cmd_opt_enable_cache as boolean +dim shared cmd_opt_enable_login as boolean +dim shared cmd_opt_enable_image as boolean +dim shared cmd_opt_enable_autocache as boolean +dim shared cmd_opt_enable_pagelist as boolean +dim shared cmd_opt_enable_manual as boolean + +dim shared cmd_opt_help as boolean +dim shared cmd_opt_verbose as boolean +dim shared cmd_opt_print as boolean + +dim shared cmd_opt_web as boolean +dim shared cmd_opt_dev as boolean +dim shared cmd_opt_alt as boolean + +dim shared cmd_opt_cache as boolean +dim shared cmd_opt_cache_dir as string + +dim shared cmd_opt_url as boolean +dim shared cmd_opt_url_name as string + +dim shared cmd_opt_ini as boolean +dim shared cmd_opt_ini_file as string + +dim shared cmd_opt_ca as boolean +dim shared cmd_opt_ca_file as string + +dim shared cmd_opt_user as boolean +dim shared cmd_opt_username as string + +dim shared cmd_opt_pass as boolean +dim shared cmd_opt_password as string + +dim shared cmd_opt_image as boolean +dim shared cmd_opt_image_dir as string + +dim shared cmd_opt_page as boolean +dim shared cmd_opt_pagefile as string + +dim shared cmd_opt_manual as boolean +dim shared cmd_opt_manual_dir as string + +'' ------------------------------------ +'' resolved options +'' ------------------------------------ + +extern wiki_url as string +extern cache_dir as string +extern ca_file as string +extern wiki_username as string +extern wiki_password as string +extern image_dir as string +extern manual_dir as string + +extern webPageCount as integer +extern webPageList() as string +extern webPageComments() as string + +dim shared wiki_url as string +dim shared cache_dir as string +dim shared ca_file as string +dim shared wiki_username as string +dim shared wiki_password as string +dim shared image_dir as string +dim shared manual_dir as string + +dim shared webPageCount as integer +dim shared webPageList() as string +dim shared webPageComments() as string + + +'' ------------------------------------ +'' API +'' ------------------------------------ + +'' +sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) + + cmd_opt_enable_url = cbool( opts_flags and CMD_OPTS_ENABLE_URL ) + cmd_opt_enable_cache = cbool( opts_flags and CMD_OPTS_ENABLE_CACHE ) + cmd_opt_enable_login = cbool( opts_flags and CMD_OPTS_ENABLE_LOGIN ) + cmd_opt_enable_image = cbool( opts_flags and CMD_OPTS_ENABLE_IMAGE ) + cmd_opt_enable_autocache = cbool( opts_flags and CMD_OPTS_ENABLE_AUTOCACHE ) + cmd_opt_enable_pagelist = cbool( opts_flags and CMD_OPTS_ENABLE_PAGELIST ) + cmd_opt_enable_manual = cbool( opts_flags and CMD_OPTS_ENABLE_MANUAL ) + + '' general options + + cmd_opt_help = false '' -h, -help given on command line + cmd_opt_verbose = false '' -v given on command line + cmd_opt_print = false '' -print options given + cmd_opt_ini = false '' -ini given on command line + cmd_opt_ini_file = "" '' value of '-ini file' given on command line + + '' url & cache options + + cmd_opt_web = false '' -web or -web+ given on command line + cmd_opt_dev = false '' -dev or -dev+ given on command line + cmd_opt_alt = false '' -web+ or -dev+ given on command line + + cmd_opt_cache = false '' -cache given on command line + cmd_opt_cache_dir = "" '' value of '-cache DIR' given on command line + + cmd_opt_url = false '' -url given on command line + cmd_opt_url_name = "" '' value of '-url name' given on command line + + cmd_opt_ca = false '' -certificate given on command line + cmd_opt_ca_file = "" '' value of '-certificate FILE' given on command line + + '' login options + + cmd_opt_user = false '' -u given on command line + cmd_opt_username = "" '' value of -u NAME given on command line + + cmd_opt_pass = false '' -p given on command line + cmd_opt_password = "" '' value of -p WORD given on command line + + cmd_opt_image = false '' -image_dir given on command line + cmd_opt_image_dir = "" '' value of '-image_dir DIR' given on command line + + cmd_opt_manual = false '' -manual_dir given on command line + cmd_opt_manual_dir = "" '' value of '-manual_dir DIR' given on command line + + '' resolved options + + wiki_url = "" '' export: resolved wiki url + cache_dir = "" '' export: resolved cache directory + ca_file = "" '' export: resolved certificate _file + wiki_username = "" '' export: resolved user + wiki_password = "" '' export: resolved pass + image_dir = "" '' export: image directory + manual_dir = "" '' export: manual directory + + webPageCount = 0 + redim webPageList(1 to 1) as string + redim webPageComments(1 to 1) as string + + if( command(1) = "" ) then + cmd_opt_help = true + end if + +end sub + +'' +sub cmd_opts_die( byref msg as const string ) + print msg + end 1 +end sub + +'' +sub cmd_opts_duplicate_die( byval i as const integer ) + cmd_opts_die( "'" & command(i) + "' option can only be specified once" ) +end sub + +'' +sub cmd_opts_unrecognized_die( byval i as const integer ) + cmd_opts_die( "Unrecognized option '" + command(i) + "'" ) +end sub + +'' +sub cmd_opts_unexpected_die( byval i as const integer ) + cmd_opts_die( "Unrecognized option '" + command(i) + "'" ) +end sub + +'' +function cmd_opts_read( byref i as integer ) as boolean + + '' return true if we processed the option + '' return false if we did not + + if( left( command(i), 1 ) = "-" ) then + + select case lcase(command(i)) + case "-h", "-help" + cmd_opt_help = true + + case "-v" + cmd_opt_verbose = true + + case "-print" + cmd_opt_print = true + + case "-web", "-dev", "-web+", "-dev+" + + if( cmd_opt_enable_url or cmd_opt_enable_cache ) then + + if( cmd_opt_dev or cmd_opt_web ) then + print "-web, -web+, -dev, -dev+ option can only be specified once" + end 1 + end if + + select case lcase(command(i)) + case "-dev" + cmd_opt_dev = true + case "-web" + cmd_opt_web = true + case "-dev+" + cmd_opt_dev = true + cmd_opt_alt = true + case "-web+" + cmd_opt_web = true + cmd_opt_alt = true + end select + + else + return false + end if + + case "-url" + + if( cmd_opt_enable_url ) then + + if( cmd_opt_url ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_url = true + i += 1 + cmd_opt_url_name = command(i) + + else + return false + end if + + case "-cache" + + if( cmd_opt_enable_cache ) then + + if( cmd_opt_cache ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_cache = true + i += 1 + cmd_opt_cache_dir = command(i) + + else + return false + end if + + case "-certificate" + + if( cmd_opt_enable_url ) then + + if( cmd_opt_ca ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_ca = true + i += 1 + cmd_opt_ca_file = command(i) + + else + return false + end if + + case "-u" + + if( cmd_opt_enable_login ) then + + if( cmd_opt_user ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_user = true + i += 1 + cmd_opt_username = command(i) + + else + return false + end if + + case "-p" + + if( cmd_opt_enable_login ) then + + if( cmd_opt_pass ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_pass = true + i += 1 + cmd_opt_password = command(i) + + else + return false + end if + + case "-image_dir" + + if( cmd_opt_enable_image ) then + + if( cmd_opt_image ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_image = true + i += 1 + cmd_opt_image_dir = command(i) + + else + return false + end if + + case "-manual_dir" + + if( cmd_opt_enable_manual ) then + + if( cmd_opt_manual ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_manual = true + i += 1 + cmd_opt_manual_dir = command(i) + + else + return false + end if + + case "-ini" + if( cmd_opt_ini ) then + cmd_opts_duplicate_die( i ) + end if + cmd_opt_ini = true + i += 1 + cmd_opt_ini_file = command(i) + + case else + return false + end select + + else + if( cmd_opt_enable_pagelist ) then + if left( command(i), 1) = "@" then + scope + dim h as integer, x as string, cmt as string + h = freefile + if open( mid(command(i),2) for input access read as #h ) <> 0 then + print "Error reading '" + command(i) + "'" + else + while eof(h) = 0 + line input #h, x + x = ParsePageName( x, cmt ) + if( x > "" ) then + webPageCount += 1 + if( webPageCount > ubound(webPageList) ) then + redim preserve webPageList(1 to Ubound(webPageList) * 2) + redim preserve webPageComments(1 to Ubound(webPageComments) * 2) + end if + webPageList(webPageCount) = x + webPageComments(webPageCount) = cmt + end if + wend + close #h + end if + end scope + else + webPageCount += 1 + if( webPageCount > ubound(webPageList) ) then + redim preserve webPageList(1 to Ubound(webPageList) * 2) + redim preserve webPageComments(1 to Ubound(webPageComments) * 2) + end if + webPageList(webPageCount) = command(i) + webPageComments(webPageCount) = "" + end if + + else + return false + + end if + + end if + + i += 1 + + return true + +end function + +'' +function cmd_opts_resolve() as boolean + + '' resolved values for options will be, in order of priority: + '' 1) what was given on the command line, or else + '' 2) what was found in the ini file, or else + '' 3) hard coded default value + + '' load the hard-coded values first + dim as string ini_file = hardcoded.default_ini_file + dim as string web_wiki_url = hardcoded.default_web_wiki_url + dim as string dev_wiki_url = "" + dim as string web_ca_file = "" + dim as string dev_ca_file = "" + dim as string def_cache_dir = hardcoded.default_def_cache_dir + dim as string web_cache_dir = hardcoded.default_web_cache_dir + dim as string dev_cache_dir = hardcoded.default_dev_cache_dir + dim as string web_user = "" + dim as string web_pass = "" + dim as string dev_user = "" + dim as string dev_pass = "" + dim as string def_image_dir = hardcoded.default_image_dir + dim as string def_manual_dir = hardcoded.default_manual_dir + + '' -ini file on the command line overrides the hardcoded value + if( cmd_opt_ini ) then + ini_file = cmd_opt_ini_file + end if + + '' read defaults from the configuration file (if it exists) + '' they can override the hard coded values + scope + dim as COptions ptr opts = new COptions( ini_file ) + if( opts <> NULL ) then + web_wiki_url = opts->Get( "web_wiki_url", web_wiki_url ) + dev_wiki_url = opts->Get( "dev_wiki_url", dev_wiki_url ) + web_ca_file = opts->Get( "web_certificate", web_ca_file ) + dev_ca_file = opts->Get( "dev_certificate", dev_ca_file ) + def_cache_dir = opts->Get( "cache_dir", def_cache_dir ) + web_cache_dir = opts->Get( "web_cache_dir", web_cache_dir ) + dev_cache_dir = opts->Get( "dev_cache_dir", dev_cache_dir ) + web_user = opts->Get( "web_username" ) + web_pass = opts->Get( "web_password" ) + dev_user = opts->Get( "dev_username" ) + dev_pass = opts->Get( "dev_password" ) + def_image_dir = opts->Get( "image_dir" ) + def_manual_dir = opts->Get( "manual_dir" ) + delete opts + elseif( cmd_opt_ini ) then + '' if we explicitly gave the -ini file option, report the error + cmd_opts_die( "Warning: unable to load options file '" + ini_file + "'" ) + end if + end scope + + '' now apply the command line overrides + if( cmd_opt_web ) then + if( cmd_opt_alt ) then + cache_dir = web_cache_dir + else + cache_dir = def_cache_dir + end if + wiki_url = web_wiki_url + ca_file = web_ca_file + wiki_username = web_user + wiki_password = web_pass + end if + + if( cmd_opt_dev ) then + if( cmd_opt_alt ) then + cache_dir = dev_cache_dir + else + cache_dir = def_cache_dir + end if + wiki_url = dev_wiki_url + ca_file = dev_ca_file + wiki_username = dev_user + wiki_password = dev_pass + end if + + if( cmd_opt_cache ) then + cache_dir = cmd_opt_cache_dir + end if + + if( cache_dir = "" and cmd_opt_enable_autocache ) then + cache_dir = def_cache_dir + end if + + if( cmd_opt_url ) then + wiki_url = cmd_opt_url_name + end if + + if( cmd_opt_ca ) then + ca_file = cmd_opt_ca_file + end if + + if( cmd_opt_user ) then + wiki_username = cmd_opt_username + end if + + if( cmd_opt_pass ) then + wiki_password = cmd_opt_password + end if + + if( cmd_opt_image ) then + image_dir = cmd_opt_image_dir + else + image_dir = def_image_dir + end if + + if( cmd_opt_manual ) then + manual_dir = cmd_opt_manual_dir + else + manual_dir = def_manual_dir + end if + + if( cmd_opt_print ) then + + print "ini_file = " & ini_file + print + print "web_wiki_url = " & web_wiki_url + print "dev_wiki_url = " & dev_wiki_url + print "web_cache_dir = " & web_cache_dir + print "dev_cache_dir = " & dev_cache_dir + print "web_ca_file = " & web_ca_file + print "dev_ca_file = " & dev_ca_file + print "web_username = " & web_user + print "web_password = " & "*****" + print "dev_username = " & dev_user + print "dev_password = " & "*****" + print "def_image_dir = " & def_image_dir + print "def_manual_dir = " & def_manual_dir + print + print "wiki_url = " & wiki_url + print "cache_dir = " & cache_dir + print "ca_file = " & ca_file + print "wiki_username = " & wiki_username + print "wiki_password = " & "*****" + print "image_dir = " & image_dir + print "manual_dir = " & manual_dir + print + + end 1 + + end if + + function = true + +end function + +'' +function cmd_opts_check() as boolean + + if( cmd_opt_enable_cache ) then + '' check that we have the values we need + if( cache_dir = "" ) then + cmd_opts_die( "no cache directory specified" ) + end if + end if + + if( cmd_opt_enable_url ) then + if( wiki_url = "" ) then + cmd_opts_die( "no url specified" ) + end if + end if + + function = true + +end function diff --git a/doc/fbchkdoc/delextra.bas b/doc/fbchkdoc/delextra.bas index d419b28bb7..3fd443f77d 100644 --- a/doc/fbchkdoc/delextra.bas +++ b/doc/fbchkdoc/delextra.bas @@ -31,9 +31,13 @@ using fb using fbdoc +const def_index_file = hardcoded.default_index_file + dim shared pagehash as HASH dim shared filehash as HASH +'' -------------------------------------------------------- + '' function ReadIndex( byref f as string ) as integer dim as string x @@ -84,72 +88,59 @@ sub DeleteExtraFiles _ end sub - '' -------------------------------------------------------- '' MAIN '' -------------------------------------------------------- -dim as string cache_dir, def_cache_dir, web_cache_dir, dev_cache_dir -dim as integer i = 1, isgit = FALSE, nodelete = FALSE +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern cache_dir as string -if( command(i) = "" ) then - print "delextra [options]" - print - print " -n only print what would happen but don't" - print " actually delete any files" - print " -git use 'git rm' instead of file system delete" - print - print " -web delete extra files in cache_dir" - print " -web+ delete extra files in web cache_dir" - print " -dev delete extra files in cache_dir" - print " -dev+ delete extra files in dev cache_dir" - end 0 -end if +'' private options +dim isgit as boolean = false +dim nodelete as boolean = false -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope +'' enable cache +cmd_opts_init( CMD_OPTS_ENABLE_CACHE ) +dim i as integer = 1 while( command(i) > "" ) - if( left(command(i), 1) = "-" ) then + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then select case lcase(command(i)) - case "-web", "-dev" - cache_dir = def_cache_dir - case "-web+" - cache_dir = web_cache_dir - case "-dev+" - cache_dir = dev_cache_dir case "-git" isgit = TRUE case "-n" nodelete = TRUE case else - print "Unrecognized option '" + command(i) + "'" - end 1 + cmd_opts_unrecognized_die( i ) end select else - print "Unexpected option '" + command(i) + "'" - end 1 + cmd_opts_unexpected_die( i ) end if i += 1 -wend +wend -if( cache_dir = "" ) then - cache_dir = def_cache_dir +if( cmd_opt_help ) then + print "delextra [options]" + print + print " -n only print what would happen but don't" + print " actually delete any files" + print " -git use 'git rm' instead of file system delete" + print + print " -web delete extra files in cache_dir" + print " -web+ delete extra files in web cache_dir" + print " -dev delete extra files in cache_dir" + print " -dev+ delete extra files in dev cache_dir" + end 0 end if + +cmd_opts_resolve() +cmd_opts_check() + +'' -------------------------------------------------------- + print "cache: "; cache_dir print "Reading '" + def_index_file + "' ..." diff --git a/doc/fbchkdoc/fbchkdoc.bi b/doc/fbchkdoc/fbchkdoc.bi index 269e84eff9..966781fb82 100644 --- a/doc/fbchkdoc/fbchkdoc.bi +++ b/doc/fbchkdoc/fbchkdoc.bi @@ -1,19 +1,38 @@ #ifndef __FBCHKDOC_FBCHKDOC_BI__ #define __FBCHKDOC_FBCHKDOC_BI__ -'' configuration file -const default_optFile = "fbchkdoc.ini" +/' + The hard-coded defaults are the option values used + when: + 1) ini file not found, or + 2) ini file was found but option not present; and + 3) no option was given on the command line -const default_ManualDir = "../manual/" + In otherwords, provide hard-coded defaults to work with + the FreeBASIC development tree, when no other options + are specified in the ini file or on command line. +'/ -'' cache dirs -const default_CacheDir = "../manual/cache/" -const default_web_CacheDir = "../manual/cache.web/" -const default_dev_CacheDir = "../manual/cache.dev/" +namespace hardcoded -'' other common defaults -const def_index_file = "PageIndex.txt" -const default_image_dir = "../manual/html/images/" -const default_fb_dir = "../../" + '' configuration file + const default_ini_file = "fbchkdoc.ini" + + const default_manual_dir = "../manual/" + + '' cache dirs + const default_def_cache_dir = "../manual/cache/" + const default_web_cache_dir = "../manual/cache.web/" + const default_dev_cache_dir = "../manual/cache.dev/" + + '' url defaults + const default_web_wiki_url = "https://www.freebasic.net/wiki/wikka.php" + + '' other common defaults + const default_index_file = "PageIndex.txt" + const default_image_dir = "../manual/html/images/" + const default_fb_dir = "../../" + +end namespace #endif diff --git a/doc/fbchkdoc/fmtcode.bas b/doc/fbchkdoc/fmtcode.bas index d1b48aeacf..8d691e05d6 100644 --- a/doc/fbchkdoc/fmtcode.bas +++ b/doc/fbchkdoc/fmtcode.bas @@ -145,7 +145,7 @@ function FormatFbCodeLoadKeywords( byref filename as string ) as boolean '' Load the keywords, this will allow keywords to be cased. if( filename = "" ) then - filename = default_ManualDir + "templates/default/keywords.lst" + filename = hardcoded.default_manual_dir + "templates/default/keywords.lst" end if function = ( fbdoc_loadkeywords( filename ) <> 0 ) diff --git a/doc/fbchkdoc/funcs.bi b/doc/fbchkdoc/funcs.bi index 535fadadef..8a188b1267 100644 --- a/doc/fbchkdoc/funcs.bi +++ b/doc/fbchkdoc/funcs.bi @@ -44,4 +44,27 @@ declare function ScanSourceDirsAndFiles( byref path as string, dirs() as string, declare function FormatFbCode( byref txt as string ) as string declare function FormatFbCodeLoadKeywords( byref filename as string ) as boolean + +'' cmd_opts.bas +enum CMD_OPTS_ENABLE_FLAGS + CMD_OPTS_ENABLE_NONE = 0 + CMD_OPTS_ENABLE_URL = 1 + CMD_OPTS_ENABLE_CACHE = 2 + CMD_OPTS_ENABLE_LOGIN = 4 + CMD_OPTS_ENABLE_IMAGE = 8 + CMD_OPTS_ENABLE_PAGELIST = 16 + CMD_OPTS_ENABLE_MANUAL = 32 + + CMD_OPTS_ENABLE_AUTOCACHE = &h1000 + +end enum + +declare sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) +declare sub cmd_opts_die( byref msg as const string ) +declare sub cmd_opts_unrecognized_die( byval i as const integer ) +declare sub cmd_opts_unexpected_die( byval i as const integer ) +declare function cmd_opts_read( byref i as integer ) as boolean +declare function cmd_opts_resolve() as boolean +declare function cmd_opts_check() as boolean + #endif diff --git a/doc/fbchkdoc/getimage.bas b/doc/fbchkdoc/getimage.bas index c9463ba0de..0eba9980e0 100644 --- a/doc/fbchkdoc/getimage.bas +++ b/doc/fbchkdoc/getimage.bas @@ -27,6 +27,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" +#include once "funcs.bi" '' const MAX_IMAGEFILES = 100 @@ -40,6 +41,8 @@ dim shared curl as CURL ptr dim shared ImageFiles(1 to MAX_IMAGEFILES ) as ImageFile dim shared NumImageFiles as integer = 0 +'' -------------------------------------------------------- + ''::::: function writeFunction cdecl ( byval buf as any ptr, byval size as size_t, byval nmemb as size_t , byval stream as any ptr) as size_t fwrite( buf, size, nmemb, stream ) @@ -132,10 +135,29 @@ end function '' MAIN '' -------------------------------------------------------- -dim as string f, filename, url, image_dir -dim as integer h, i = 1 +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern image_dir as string + +'' private options +dim f as string + +'' enable image dir +cmd_opts_init( CMD_OPTS_ENABLE_IMAGE ) + +dim i as integer = 1 +while( command(i) > "" ) + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then + cmd_opts_unrecognized_die( i ) + else + f = command(i) + end if + i += 1 +wend -if( command(1) = "" ) then +if( cmd_opt_help ) then print "getimage imagelist.txt" print print " imagelist.txt text file listing images to get in the" @@ -145,20 +167,13 @@ if( command(1) = "" ) then end 0 end if -'' read defaults from the configuration file (if it exists) -scope - dim as fb.fbdoc.COptions ptr opts = new fb.fbdoc.COptions( default_optFile ) - if( opts <> NULL ) then - image_dir = opts->Get( "image_dir", default_image_dir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - image_dir = default_image_dir - end if -end scope +cmd_opts_resolve() +cmd_opts_check() + +'' -------------------------------------------------------- -f = command(1) +dim as string filename, url +dim as integer h h = freefile if( open( f for input access read as #h ) <> 0 ) then diff --git a/doc/fbchkdoc/getindex.bas b/doc/fbchkdoc/getindex.bas index da48651321..907abb670c 100644 --- a/doc/fbchkdoc/getindex.bas +++ b/doc/fbchkdoc/getindex.bas @@ -25,6 +25,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" +#include once "funcs.bi" '' libs #inclib "pcre" @@ -36,10 +37,14 @@ using fbdoc #include "crt/stdlib.bi" #include "crt/string.bi" +const def_index_file = hardcoded.default_index_file + '' temporary files const def_html_file = "PageIndex.html" const def_text_file = "PageIndex0.txt" +'' -------------------------------------------------------- + '' sub RemoveHTMLtags _ ( _ @@ -234,89 +239,75 @@ end sub '' MAIN '' -------------------------------------------------------- -dim as string wiki_url, web_wiki_url, dev_wiki_url -dim as string ca_file, web_ca_file, dev_ca_file -dim as string def_cache_dir, web_cache_dir, dev_cache_dir -dim as string sPage, sBody, cache_dir -dim as integer i = 1 -dim as integer blocal = FALSE +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern wiki_url as string +extern cache_dir as string +extern ca_file as string -sPage = "PageIndex" +'' private options +dim as boolean blocal = false '' -local given on command line -if( command(i) = "" ) then - print "getindex [-local] {server}" - print - print "server:" - print " -web get index from the web server (in " + default_optFile + ")" - print " -dev get index from the development server (in " + default_optFile + ")" - print " -url URL get index from URL" - print " -certificate file" - print " certificate to use to authenticate server (.pem)" - print - print "if -local is specified, then just read the file names from the cache:" - print " -web get page names from cache_dir" - print " -web+ get page names from web_cache_dir" - print " -dev get page names from cache_dir" - print " -dev+ get page names from dev_cache_dir" - end 0 -end if - -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - web_wiki_url = opts->Get( "web_wiki_url" ) - dev_wiki_url = opts->Get( "dev_wiki_url" ) - web_ca_file = opts->Get( "web_certificate", "" ) - dev_ca_file = opts->Get( "dev_certificate", "" ) - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - end if -end scope +'' enable url and cache +cmd_opts_init( CMD_OPTS_ENABLE_URL or CMD_OPTS_ENABLE_CACHE ) +dim i as integer = 1 while( command(i) > "" ) - if( left( command(i), 1 ) = "-" ) then + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then select case lcase(command(i)) - case "-web" - wiki_url = web_wiki_url - cache_dir = def_cache_dir - ca_file = web_ca_file - case "-dev" - wiki_url = dev_wiki_url - cache_dir = def_cache_dir - ca_file = dev_ca_file - case "-web+" - wiki_url = web_wiki_url - cache_dir = web_cache_dir - ca_file = web_ca_file - case "-dev+" - wiki_url = dev_wiki_url - cache_dir = dev_cache_dir - ca_file = dev_ca_file - case "-url" - i += 1 - wiki_url = command(i) - cache_dir = def_cache_dir - case "-certificate" - i += 1 - ca_file = command(i) case "-local" blocal = TRUE case else - print "Unrecognized option '" + command(i) + "'" - end 1 + cmd_opts_unrecognized_die( i ) end select else - print "Unexpected option '" + command(i) + "'" - end 1 + cmd_opts_unexpected_die( i ) end if i += 1 -wend +wend + +if( cmd_opt_help ) then + print "getindex {server} [options]" + print + print "{server}:" + print " -web get index from the web server url" + print " -web+ get index from the web server url" + print " -dev get index from the development server url" + print " -dev+ get index from the development server url" + print " -url URL get index from URL (overrides other options)" + print " -certificate FILE" + print " certificate to use to authenticate server (.pem)" + print " -cache DIR override the cache directory location" + print + print "options:" + print " -local use local cache only, don't query server, just" + print " read the cache dir to get the list of page names" + print + print "if -local is specified, then just read the file names from the cache:" + print " -web get page names from cache_dir" + print " -web+ get page names from web_cache_dir" + print " -dev get page names from cache_dir" + print " -dev+ get page names from dev_cache_dir" + print + print "general options:" + print " -h, -help show the help information" + print " -ini file set ini file name (instead of" & hardcoded.default_ini_file & ")" + print " -print print active options and quit" + print " -v be verbose" + end 0 +end if + +cmd_opts_resolve() +cmd_opts_check() + +'' -------------------------------------------------------- + +dim sPage as string +dim sBody as string + +sPage = "PageIndex" if( blocal ) then @@ -325,7 +316,7 @@ if( blocal ) then else if( len( wiki_url ) = 0 ) then - print "wiki_url not set. use -url, -web, -web+, -dev, -dev+" + print "wiki_url not set. use -url, -web, -web+, -dev, or -dev+" end 1 end if diff --git a/doc/fbchkdoc/getpage.bas b/doc/fbchkdoc/getpage.bas index afc7403b31..93acd8122f 100644 --- a/doc/fbchkdoc/getpage.bas +++ b/doc/fbchkdoc/getpage.bas @@ -36,139 +36,83 @@ using fb using fbdoc - '' -------------------------------------------------------- '' MAIN '' -------------------------------------------------------- -dim as string web_wiki_url, dev_wiki_url -dim as string ca_file, web_ca_file, dev_ca_file -dim as string def_cache_dir, web_cache_dir, dev_cache_dir - -dim as integer i = 1, webPageCount = 0, nfailedpages = 0 -redim webPageList(1 to 1) as string -redim failedpages(1 to 1) as string -dim as string wiki_url, cache_dir, cmt -var allow_retry = true - -if( command(i) = "" ) then - print "getpage {server} [pages] [@pagelist]" - print - print "server:" - print " -web get pages from the web server in to cache_dir" - print " -web+ get pages from the web server in to web_cache_dir" - print " -dev get pages from the development server in to cache_dir" - print " -dev+ get pages from the development server in to dev_cache_dir" - print " -url URL get pages from URL" - print " -certificate file" - print " certificate to use to authenticate server (.pem)" - print - print "options:" - print " pages list of wiki pages on the command line" - print " @pagelist text file with a list of pages, one per line" - print " -auto don't ask for user input, don't retry failed downloads" - print - end 1 -end if - -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - web_wiki_url = opts->Get( "web_wiki_url" ) - dev_wiki_url = opts->Get( "dev_wiki_url" ) - web_ca_file = opts->Get( "web_certificate" ) - dev_ca_file = opts->Get( "dev_certificate" ) - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope - -while command(i) > "" - if( left( command(i), 1 ) = "-" ) then +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern wiki_url as string +extern cache_dir as string +extern ca_file as string +extern webPageCount as integer +extern webPageList() as string +extern webCommentList() as string + +'' private options +dim allow_retry as boolean = true + +'' enable url and cache +cmd_opts_init( CMD_OPTS_ENABLE_URL or CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_PAGELIST ) + +dim i as integer = 1 +while( command(i) > "" ) + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then select case lcase(command(i)) - case "-web" - wiki_url = web_wiki_url - cache_dir = def_cache_dir - ca_file = web_ca_file - case "-dev" - wiki_url = dev_wiki_url - cache_dir = def_cache_dir - ca_file = dev_ca_file - case "-web+" - wiki_url = web_wiki_url - cache_dir = web_cache_dir - ca_file = web_ca_file - case "-dev+" - wiki_url = dev_wiki_url - cache_dir = dev_cache_dir - ca_file = dev_ca_file - case "-url" - i += 1 - wiki_url = command(i) - cache_dir = def_cache_dir - case "-certificate" - i += 1 - ca_file = command(i) case "-auto" allow_retry = false case else - print "Unrecognized option '" + command(i) + "'" - end 1 + cmd_opts_unrecognized_die( i ) end select else - if left( command(i), 1) = "@" then - scope - dim h as integer, x as string - h = freefile - if open( mid(command(i),2) for input access read as #h ) <> 0 then - print "Error reading '" + command(i) + "'" - else - while eof(h) = 0 - line input #h, x - x = ParsePageName( x, cmt ) - if( x > "" ) then - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = x - end if - wend - close #h - end if - end scope - else - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = command(i) - end if + cmd_opts_unexpected_die( i ) end if i += 1 -wend +wend -'' URL must be set -if( len( wiki_url ) = 0 ) then - print "wiki_url not set. use -url, -web, -web+, -dev, -dev+" +if( cmd_opt_help ) then + print "getpage {server} [options] [pages] [@pagelist]" + print + print "{server}:" + print " -web get pages from the web server in to cache_dir" + print " -web+ get pages from the web server in to web_cache_dir" + print " -dev get pages from the development server in to cache_dir" + print " -dev+ get pages from the development server in to dev_cache_dir" + print " -url URL get pages from URL (overrides other options)" + print " -certificate FILE" + print " certificate to use to authenticate server (.pem)" + print " -cache DIR override the cache directory location" + print + print "options:" + print " pages list of wiki pages on the command line" + print " @pagelist text file with a list of pages, one per line" + print " -auto don't ask for user input, don't retry failed downloads" + print + print "general options:" + print " -h, -help, show the help information" + print " -ini file set ini file name (instead of" & hardcoded.default_ini_file & ")" + print " -print print active options and quit" + print " -v be verbose" + print end 1 end if +cmd_opts_resolve() +cmd_opts_check() + '' no pages? nothing to do... if( webPageCount = 0 ) then print "no pages specified." end 1 end if +'' -------------------------------------------------------- + +dim as integer nfailedpages = 0 +redim failedpages(1 to 1) as string + '' main loop - has option to retry/list failed pages do diff --git a/doc/fbchkdoc/makefile b/doc/fbchkdoc/makefile index c7f66727ae..914e51f8a4 100644 --- a/doc/fbchkdoc/makefile +++ b/doc/fbchkdoc/makefile @@ -8,6 +8,7 @@ endif FBC := fbc LIBFUNCS_SRC := \ + cmd_opts.bas \ funcs.bas \ funcsdir.bas \ fmtcode.bas \ @@ -64,7 +65,7 @@ endif .PHONY: all all: $(APPS) ../libfbdoc/libfbdoc.a -getindex$(EXEEXT): getindex.bas $(DEPS) +getindex$(EXEEXT): getindex.bas $(LIBFUNCS) $(DEPS) $(FBC) $(FBCFLAGS) $< $(FBLFLAGS) -x $@ getpage$(EXEEXT): getpage.bas $(LIBFUNCS) $(DEPS) diff --git a/doc/fbchkdoc/mkimglst.bas b/doc/fbchkdoc/mkimglst.bas index 516af571c8..31da4881b8 100644 --- a/doc/fbchkdoc/mkimglst.bas +++ b/doc/fbchkdoc/mkimglst.bas @@ -39,6 +39,9 @@ using fb using fbdoc +'' -------------------------------------------------------- + +'' function ScanForImages _ ( _ byval _this as CWiki ptr, _ @@ -85,18 +88,33 @@ function ScanForImages _ end function - '' -------------------------------------------------------- '' MAIN '' -------------------------------------------------------- -dim as string cache_dir, def_cache_dir, web_cache_dir, dev_cache_dir - -dim as integer i = 1, webPageCount = 0 -redim webPageList(1 to 1) as string -dim as string cmt +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern cache_dir as string +extern webPageCount as integer +extern webPageList() as string +extern webCommentList() as string + +'' enable url and cache +cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE or CMD_OPTS_ENABLE_PAGELIST ) + +dim i as integer = 1 +while( command(i) > "" ) + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then + cmd_opts_unrecognized_die( i ) + else + cmd_opts_unexpected_die( i ) + end if + i += 1 +wend -if( command(i) = "" ) then +if( cmd_opt_help ) then print "mkimglst [pages] [@pagelist] [options]" print print " pages list of wiki pages on the command line" @@ -109,80 +127,20 @@ if( command(i) = "" ) then end 0 end if -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope - -while command(i) > "" - if( left(command(i), 1) = "-" ) then - select case lcase(command(i)) - case "-web", "-dev" - cache_dir = def_cache_dir - case "-web+" - cache_dir = web_cache_dir - case "-dev+" - cache_dir = dev_cache_dir - case else - print "Unrecognized option '" + command(i) + "'" - end 1 - end select - else - if left( command(i), 1) = "@" then - scope - dim h as integer, x as string - h = freefile - if open( mid(command(i),2) for input access read as #h ) <> 0 then - print "Error reading '" + command(i) + "'" - else - while eof(h) = 0 - line input #h, x - x = ParsePageName( x, cmt ) - if( x > "" ) then - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = x - end if - wend - close #h - end if - end scope - else - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = command(i) - end if - end if - i += 1 -wend +cmd_opts_resolve() +cmd_opts_check() +'' no pages? nothing to do... if( webPageCount = 0 ) then print "no pages specified." end 1 end if +'' -------------------------------------------------------- + dim as CWikiCache ptr wikicache dim as string sPage, sBody -if( cache_dir = "" ) then - cache_dir = default_CacheDir -end if print "cache: "; cache_dir '' Initialize the cache diff --git a/doc/fbchkdoc/mkprntoc.bas b/doc/fbchkdoc/mkprntoc.bas index 6aa8c0554e..2d86b385ee 100644 --- a/doc/fbchkdoc/mkprntoc.bas +++ b/doc/fbchkdoc/mkprntoc.bas @@ -38,17 +38,15 @@ using fb using fbdoc - -'' -------------------------------------------------------- -'' MAIN -'' -------------------------------------------------------- - +'' private options dim shared as CWikiCache ptr wikicache dim shared opt_with_tut_pages as boolean = false dim shared opt_with_dev_pages as boolean = false declare sub MakeTOC( byval h as integer, byref sPage as string, byval baselevel as integer ) +'' -------------------------------------------------------- + '' sub WriteText( byval h as integer, byref sOut as string, byval break as integer, byval indent as integer ) @@ -287,70 +285,56 @@ sub MakeTOC( byval h as integer, byref sPage as string, byval baselevel as integ end sub +'' -------------------------------------------------------- '' MAIN +'' -------------------------------------------------------- -dim as string cache_dir, def_cache_dir, web_cache_dir, dev_cache_dir -dim as integer i = 1, h +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern cache_dir as string -if( command(i) = "" ) then - print "mkprntoc [options]" - print - print " -web use files in cache_dir" - print " -web+ use files in web cache_dir" - print " -dev use files in cache_dir" - print " -dev+ use files in dev cache_dir" - print " -with-tut-pages include tutorial pages" - print " -with-dev-pages include developer pages" - end 0 -end if - -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope +cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE ) +dim i as integer = 1 while( command(i) > "" ) - if( left(command(i), 1) = "-" ) then + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then select case lcase(command(i)) - case "-web", "-dev" - cache_dir = def_cache_dir - case "-web+" - cache_dir = web_cache_dir - case "-dev+" - cache_dir = dev_cache_dir case "-with-tut-pages" opt_with_tut_pages = true case "-with-dev-pages" opt_with_dev_pages = true case else - print "Unrecognized option '" + command(i) + "'" - end 1 + cmd_opts_unrecognized_die( i ) end select else - print "Unexpected option '" + command(i) + "'" - end 1 + cmd_opts_unexpected_die( i ) end if i += 1 -wend +wend -if( cache_dir = "" ) then - cache_dir = default_CacheDir +if( cmd_opt_help ) then + print "mkprntoc [options]" + print + print " -web use files in cache_dir" + print " -web+ use files in web cache_dir" + print " -dev use files in cache_dir" + print " -dev+ use files in dev cache_dir" + print " -with-tut-pages include tutorial pages" + print " -with-dev-pages include developer pages" + end 0 end if -print "cache: "; cache_dir + +cmd_opts_resolve() +cmd_opts_check() + +'' -------------------------------------------------------- dim as string sPage, sBody +dim as integer h + +print "cache: "; cache_dir '' Initialize the cache wikicache = new CWikiCache( cache_dir, CWikiCache.CACHE_REFRESH_NONE ) diff --git a/doc/fbchkdoc/pretty.bas b/doc/fbchkdoc/pretty.bas index e4c8052bab..741194244f 100644 --- a/doc/fbchkdoc/pretty.bas +++ b/doc/fbchkdoc/pretty.bas @@ -24,20 +24,17 @@ end if dim filename as string = command(1) '' read defaults from the configuration file (if it exists) +'' !!! FIXME !!! this should use cmd_opts.bas scope - dim as COptions ptr opts = new COptions( default_optFile ) + dim as COptions ptr opts = new COptions( hardcoded.default_ini_file ) if( opts <> NULL ) then - manual_dir = opts->Get( "manual_dir", default_ManualDir ) + manual_dir = opts->Get( "manual_dir", hardcoded.default_manual_dir ) delete opts else - def_manual_dir = default_ManualDir + manual_dir = hardcoded.default_manual_dir end if end scope -if( manual_dir = "" ) then - manual_dir = default_ManualDir -end if - FormatFbCodeLoadKeywords( manual_dir & "templates/default/keywords.lst" ) dim text as string = ReadFileAsText( command(1) ) diff --git a/doc/fbchkdoc/putpage.bas b/doc/fbchkdoc/putpage.bas index 6a648f43e5..16b20fe81c 100644 --- a/doc/fbchkdoc/putpage.bas +++ b/doc/fbchkdoc/putpage.bas @@ -41,167 +41,85 @@ using fbdoc '' MAIN '' -------------------------------------------------------- -dim as string web_wiki_url, dev_wiki_url -dim as string ca_file, web_ca_file, dev_ca_file -dim as string def_cache_dir, web_cache_dir, dev_cache_dir -dim as string web_user, web_pass, dev_user, dev_pass - -dim as string sPage, sBody, sNote, sBodyOld, sUserName, sPassword, sNoteDef +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern wiki_url as string +extern cache_dir as string +extern ca_file as string +extern wiki_username as string +extern wiki_password as string +extern webPageCount as integer +extern webPageList() as string +extern webPageComments() as string + +'' private options dim as integer iComment = 0 -sUserName = "" -sPassword = "" -sNote = "Auto-update" -sNoteDef = "" - -dim as CWikiCache ptr wikicache = NULL -dim as CWikiCon ptr wikicon = NULL - -dim as integer i = 1, webPageCount = 0 -redim webPageList(1 to 1) as string, webPageComments(1 to 1) as string -dim as string wiki_url, cache_dir, cmt, sComment - -if( command(i) = "" ) then - print "putpage {location} [options]" - print - print "location:" - print " -web put pages on the web server from cache_dir" - print " -web+ put pages on the web server from web_cache_dir" - print " -dev put pages on the development server from cache_dir" - print " -dev+ put pages on the development server from dev_cache_dir" - print " -url URL put pages on URL from cache_dir" - print - print "options:" - print " pages list of wiki pages on the command line" - print " @pagelist text file with a list of pages, one per line" - print " -comment prompt for comment line when storing pages" - print " -comment1 prompt for comment line only once" - print " -u user specifiy wiki account username" - print " -p pass specifiy wiki account password" - print " -certificate file" - print " certificate to use to authenticate server (.pem)" - print - end 1 -end if - -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - web_wiki_url = opts->Get( "web_wiki_url" ) - dev_wiki_url = opts->Get( "dev_wiki_url" ) - web_ca_file = opts->Get( "web_certificate", "" ) - dev_ca_file = opts->Get( "dev_certificate", "" ) - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - web_user = opts->Get( "web_username" ) - web_pass = opts->Get( "web_password" ) - dev_user = opts->Get( "dev_username" ) - dev_pass = opts->Get( "dev_password" ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope +'' enable url, cache, and login +cmd_opts_init( CMD_OPTS_ENABLE_URL or CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_LOGIN or CMD_OPTS_ENABLE_PAGELIST ) -while command(i) > "" - if( left( command(i), 1 ) = "-" ) then +dim i as integer = 1 +while( command(i) > "" ) + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then select case lcase(command(i)) - case "-web" - wiki_url = web_wiki_url - cache_dir = def_cache_dir - sUserName = web_user - sPassword = web_pass - ca_file = web_ca_file - case "-dev" - wiki_url = dev_wiki_url - cache_dir = def_cache_dir - sUserName = dev_user - sPassword = dev_pass - ca_file = dev_ca_file - case "-web+" - wiki_url = web_wiki_url - cache_dir = web_cache_dir - sUserName = web_user - sPassword = web_pass - ca_file = web_ca_file - case "-dev+" - wiki_url = dev_wiki_url - cache_dir = dev_cache_dir - sUserName = dev_user - sPassword = dev_pass - ca_file = dev_ca_file - case "-url" - i += 1 - wiki_url = command(i) - cache_dir = def_cache_dir - sUserName = "" - sPassword = "" - case "-certificate" - i += 1 - ca_file = command(i) - case "-u" - i += 1 - sUserName = command(i) - case "-p" - i += 1 - sPassword = command(i) case "-comment" iComment = 1 case "-comment1" iComment = 2 case else - print "Unrecognized option '" + command(i) + "'" - end 1 + cmd_opts_unrecognized_die( i ) end select else - if left( command(i), 1) = "@" then - scope - dim h as integer, x as string - h = freefile - if open( mid(command(i),2) for input access read as #h ) <> 0 then - print "Error reading '" + command(i) + "'" - else - while eof(h) = 0 - line input #h, x - x = ParsePageName( x, cmt ) - if( x > "" ) then - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - redim preserve webPageComments(1 to Ubound(webPageComments) * 2) - end if - webPageList(webPageCount) = x - webPageComments(webPageCount) = cmt - end if - wend - close #h - end if - end scope - else - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - redim preserve webPageComments(1 to Ubound(webPageComments) * 2) - end if - webPageList(webPageCount) = command(i) - webPageComments(webPageCount) = "" - end if + cmd_opts_unexpected_die( i ) end if i += 1 wend -'' URL must be set -if( len( wiki_url ) = 0 ) then - print "wiki_url not set. use -url, -web, -web+, -dev, -dev+" +if( cmd_opt_help ) then + print "putpage {server} [options] [pages] [@pagelist]" + print + print "{server}:" + print " -web put pages on the web server from cache_dir" + print " -web+ put pages on the web server from web_cache_dir" + print " -dev put pages on the development server from cache_dir" + print " -dev+ put pages on the development server from dev_cache_dir" + print " -url URL put pages on URL from cache_dir (overrides other options)" + print " -certificate FILE" + print " certificate to use to authenticate server (.pem)" + print " -cache DIR override the cache directory location" + print + print "options:" + print " pages list of wiki pages on the command line" + print " @pagelist text file with a list of pages, one per line" + print " -comment prompt for comment line when storing pages" + print " -comment1 prompt for comment line only once" + print " -u user specifiy wiki account username" + print " -p pass specifiy wiki account password" + print + print "general options:" + print " -h, -help show the help information" + print " -ini file set ini file name (instead of" & hardcoded.default_ini_file & ")" + print " -print print active options and quit" + print " -v be verbose" + print end 1 end if +cmd_opts_resolve() +cmd_opts_check() + +'' -------------------------------------------------------- + +dim as string sPage, sBody, sNote, sBodyOld, sNoteDef, sComment + +sNote = "Auto-update" +sNoteDef = "" + +dim as CWikiCache ptr wikicache = NULL +dim as CWikiCon ptr wikicon = NULL + if( webPageCount = 0 ) then print "No pages specified" end if @@ -242,7 +160,7 @@ if( webPageCount > 0 ) then print "OK" if( wikicon->LoadPage( sPage, TRUE, TRUE, sBodyOld ) <> FALSE ) then if( wikicon->GetPageID() > 0 ) then - if( wikicon->Login( sUserName, sPassword ) ) = FALSE then + if( wikicon->Login( wiki_username, wiki_password ) ) = FALSE then print "Unable to login" else if( iComment > 0 ) then @@ -274,7 +192,7 @@ if( webPageCount > 0 ) then end if else print "Unable to get existing page ID - will try to store as a new page .." - if( wikicon->Login( sUserName, sPassword ) ) = FALSE then + if( wikicon->Login( wiki_username, wiki_password ) ) = FALSE then print "Unable to login" else print "Storing '" + sPage + "': "; diff --git a/doc/fbchkdoc/readme.txt b/doc/fbchkdoc/readme.txt index 403abc6136..83d1bf09a3 100644 --- a/doc/fbchkdoc/readme.txt +++ b/doc/fbchkdoc/readme.txt @@ -49,7 +49,7 @@ Table of Contents: 5.4 Name case fixups 5.5 Update PrintToc 5.6 Sychronizing Wiki Samples - 5.7 Synchronizing Wiki with SVN + 5.7 Synchronizing Wiki with GIT repo 6. Authors 7. Notes @@ -84,13 +84,16 @@ issue. ============ Because these tools are so specific to FreeBASIC and its wiki, there is -no binary package. Checkout /fbc/trunk/fbdocs from sourceforge.net to get +no binary package. Checkout https:/www.github.com/freebasic/fbc to get all the sources needed. Required to build and run are: FreeBASIC, curl, pcre, fbdoc (found in ../fbdoc), ASpell, make, and probably a few other libs or commands. The utilities use relative paths by default. Always run the utilities -so that ./fbchkdoc is the current working directory. +so that ./fbchkdoc is the current working directory. However, if you +correctly set-up a fbchkdoc.ini file, the exes can be located anywhere, and +you can use the current directory, which contatins fbchkdoc.ini as the +working directory. 2. Compiling @@ -110,53 +113,84 @@ they can be specified in the fbchkdoc.ini configuration file. Copy fbchkdoc.org to fbchkdoc.ini. fbchkdoc.org is a template for the configuration settings file. fbchkdoc.ini may contain user names and -passwords and to avoid having it committed to SVN by accident, it has a -different name. A description of the options in this file are below: +passwords and to avoid having it committed to GIT or SVN by accident, it has +a different name. Alternatively, you can use your own ini file by passing +the '-ini FILE' command line option to any of the tools. + + + A description of the options in this file are below: manual_dir normally '../manual'. Relative to this directory, there needs to - be a few other sub directoried and files, like templates and html. + be a few other sub directories and files, like templates and html. + Set or override this option from the command line using the + '-manual_dir DIR' command line option. cache_dir normally '../manual/cache'. This is where the wakka source files are - stored and modified. + stored and modified. This cache directory is selected when the + '-web' or '-dev' command line option is given. Set or override this + option from the command line using the '-cache DIR' command line + option. - web_cache_dir + web_cache_dir also for storing wakka files. Typically an extra copy of cache_dir. Not used by any of these tools, but useful for comparing one snapshot of the wiki with another. For example, after making changes to - cache_dir, changes (diff) can be inspected. Though not needed as - much since wakka files are also stored in SVN. + cache_dir, changes (diff) can be inspected. If working with a git + repository then can also perform a diff with another commit. This + cache directory is selected when the '-web+' command line option is + given. Set or override this option from the command line using the + '-cache DIR' command line option. dev_cache_dir like web_cache_dir, excect a duplicate of the off-line server's wiki. + This cache directory is selected when the '-dev+' command line option + is given. Set or override this option from the command line using + the '-cache DIR' command line option. image_dir - location of the images (used in the wiki) + location of the images (used in the wiki). Set or override this + option with the '-image_dir DIR' command line option. fb_dir top-level FreeBASIC directory web_wiki_url - the location of the on-line wiki. + the location of the on-line wiki. This url is selected when the + '-web' or '-web+' command line option is given. Set or override + this url with the '-url URL' command line option' web_username, web_password the username and password for the on-line wiki. These options are - only if writing (saving files) to the on-line wiki. + only if writing (saving files) to the on-line wiki. This user + name and password selected when the '-web' or '-web+' command line + option is given. Set or override these options with + '-u USER -p PASS' command line options. dev_wiki_url the location of the secondary "off-line" duplicate wiki. This url is required only if there is a secondary wiki that can be used. + This url is selected when the '-dev' or '-dev+' command line options + are given. Set or override this url with the '-url URL' command + line option web_cert_file - path and file name to the certificate for web url + path and file name to the certificate for web url. Selected when the + '-web' or '-web+' command line option given. Set or override this + option with the '-certificate FILE' command line option. dev_cert_file - path and file name to the certificate for dev url + path and file name to the certificate for dev url. Selected when the + '-dev' or '-dev+' command line option given. Set or override this + option with the '-certificate FILE' command line option. dev_username, dev_password the username and password for the off-line wiki. These options are - only if writing (saving files) to the off-line wiki. + only if writing (saving files) to the off-line wiki. This user + name and password selected when the '-dev' or '-dev+' command line + option is given. Set or override these options with + '-u USER -p PASS' command line options. Why all the extra directories and extra wiki, you ask? I have all these @@ -397,15 +431,15 @@ formats). Typical usage: $ ./getindex -web - $ ./delextra -web -svn + $ ./delextra -web -git This utility will delete (or remove) the extra *.wakka files in the cache directory not present in the PageIndex for the wiki. Type './delextra' without any command line arguments to see a full list of options. When pages are deleted from the wiki, old file names will persist in the -cache directories. Use this utility to purge deleted wiki pages. Pass "-svn" -on the command line to use "svn rm" instead of FreeBASIC's built-in KILL +cache directories. Use this utility to purge deleted wiki pages. Pass "-git" +on the command line to use "git rm" instead of FreeBASIC's built-in KILL statement. @@ -521,7 +555,7 @@ this tools set. Use this sparingly as it takes a *long* time and needlessly taxes the server. If you don't need the most up to date wiki pages, use the snapshot -in SVN instead +at https://www.github.com/freebasic/fbc instead 5.2 Downloading changed pages since last download @@ -560,8 +594,8 @@ working set. $ ./getpage -dev @list.txt Then use a diff tool to compare the two sets of files in the cache dir -and the web_cache dir. Of course, if the snap-shot of the wiki in SVN is -up to date, you can also use SVN diff to query changes. +and the web_cache dir. Of course, if the snap-shot of the wiki in GIT is +up to date, you can also use GIT diff to query changes. 5.4 Name case fix-ups @@ -602,7 +636,7 @@ examples/manual/samples.bas program can be used to compile all, or a specified directory of sample sources and optionally report an error. Assuming that PageIndex.txt and the cache directory is up to date, these -commands will help synchronize the samples with SVN +commands will help synchronize the samples with GIT Find out if new samples were added or changed: $ ./samps check @PageIndex.txt @@ -610,10 +644,10 @@ commands will help synchronize the samples with SVN Extract them from the cache directory to the sample directory: $ ./samps extract @PageIndex.txt - Note: SVN commands to add files or set properties are not automatically - issued, so remember to 'svn add' any new samples. + Note: GIT commands to add files or set properties are not automatically + issued, so remember to 'git add' any new samples. - Check for deleted samples, and use 'svn rm' to get rid of them: + Check for deleted samples, and use 'git rm' to get rid of them: $ ./samps checkex Most of the time you should assume that the wiki has the most up to date @@ -626,11 +660,11 @@ commands will help synchronize the samples with SVN -5.7 Synchronizing Wiki with SVN - --------------------------- +5.7 Synchronizing Wiki with GIT repo + -------------------------------- The following is a list of "things to do" if you are going to maintain the -wiki, SVN, examples, etc, on a regular basis: +wiki, GIT, examples, etc, on a regular basis: 1) Get the most up to date PageIndex.txt $ ./getindex -web @@ -665,8 +699,8 @@ wiki, SVN, examples, etc, on a regular basis: $ ./samps extract @PageIndex.txt $ ./samps checkex @PageIndex.txt - The samps utility will not automatically 'svn add' or 'svn delete' files - so be sure to make the appropriate changes to svn. If no samples were + The samps utility will not automatically 'git add' or 'git rm' files + so be sure to make the appropriate changes to git. If no samples were added or changed, proceed to step 8. 7) Build and run examples/manual/samples.bas. This should test all of the @@ -678,9 +712,10 @@ wiki, SVN, examples, etc, on a regular basis: 8) By this point, the wiki, cache directory, and examples should be in good working condition. Proceed to the fbdoc directory to generate the output formats needed. Once you are satisfied with the results, be sure - to commit the cache directory to SVN. + to commit the cache directory to GIT. - 9) You are done. The wiki and examples have been synchronized with SVN. + 9) You are done. The wiki and examples have been synchronized with the + git repository. 6. Authors @@ -702,7 +737,7 @@ name or format that was convenient and then get in the habit of using it. These utilities are a means to an end. They are intended to help get a (sometimes boring) job completed. They could be totally obsolete should the documentation ever move to a different wiki application. The strategy so far -has been to do the least amount of work possible and still complete the task +has been to do the least amount of work possible and still complete the task. If you make any changes to these sources, please feel free to add your name to the Authors and be sure to update any relevant parts of this file. diff --git a/doc/fbchkdoc/rebuild.bas b/doc/fbchkdoc/rebuild.bas index d143e89c4a..c137495f27 100644 --- a/doc/fbchkdoc/rebuild.bas +++ b/doc/fbchkdoc/rebuild.bas @@ -34,6 +34,8 @@ using fb using fbdoc +'' -------------------------------------------------------- + ''::::: function ReadTextFile( byref sFile as string ) as string dim ret as string, h as integer @@ -65,13 +67,29 @@ end sub '' MAIN '' -------------------------------------------------------- -dim as string cache_dir, def_cache_dir, web_cache_dir, dev_cache_dir - -dim as integer i = 1, webPageCount = 0 -redim webPageList(1 to 1) as string -dim as string cmt, x +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern cache_dir as string +extern webPageCount as integer +extern webPageList() as string +extern webCommentList() as string + +'' enable url and cache +cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE or CMD_OPTS_ENABLE_PAGELIST ) + +dim i as integer = 1 +while( command(i) > "" ) + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then + cmd_opts_unrecognized_die( i ) + else + cmd_opts_unexpected_die( i ) + end if + i += 1 +wend -if( command(i) = "" ) then +if( cmd_opt_help ) then print "rebuild [pages] [@pagelist] [options]" print print " pages list of wiki pages on the command line" @@ -84,80 +102,20 @@ if( command(i) = "" ) then end 0 end if -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope - -while command(i) > "" - if( left(command(i), 1) = "-" ) then - select case lcase(command(i)) - case "-web", "-dev" - cache_dir = def_cache_dir - case "-web+" - cache_dir = web_cache_dir - case "-dev+" - cache_dir = dev_cache_dir - case else - print "Unrecognized option '" + command(i) + "'" - end 1 - end select - else - if left( command(i), 1) = "@" then - scope - dim h as integer, x as string - h = freefile - if open( mid(command(i),2) for input access read as #h ) <> 0 then - print "Error reading '" + command(i) + "'" - else - while eof(h) = 0 - line input #h, x - x = ParsePageName( x, cmt ) - if( x > "" ) then - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = x - end if - wend - close #h - end if - end scope - else - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = command(i) - end if - end if - i += 1 -wend +cmd_opts_resolve() +cmd_opts_check() +'' no pages? nothing to do... if( webPageCount = 0 ) then print "no pages specified." end 1 end if +'' -------------------------------------------------------- + dim as string sPage, sBody1, sBody2, f dim as CWiki ptr wiki -if( cache_dir = "" ) then - cache_dir = default_CacheDir -end if print "cache: "; cache_dir for i = 1 to webpagecount @@ -182,4 +140,3 @@ for i = 1 to webpagecount delete wiki next - diff --git a/doc/fbchkdoc/replace.bas b/doc/fbchkdoc/replace.bas index 56c53b8db3..3c422021f9 100644 --- a/doc/fbchkdoc/replace.bas +++ b/doc/fbchkdoc/replace.bas @@ -28,10 +28,15 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" +#include once "funcs.bi" using fb using fbdoc +const def_index_file = hardcoded.default_index_file + +'' -------------------------------------------------------- + ''::::: function xxReplaceSubStr _ ( _ @@ -94,83 +99,27 @@ end sub '' MAIN '' -------------------------------------------------------- -dim as string wiki_url, cache_dir -dim as string web_wiki_url, dev_wiki_url -dim as string def_cache_dir, web_cache_dir, dev_cache_dir - -type replace_t - sName as string - sOld as string - sNew as string -end type +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern wiki_url as string +extern cache_dir as string -dim replace(1 to 1000) as replace_t -dim count as integer = 0 -dim as string sComment, f -dim as string sName, sOld, sNew, x, text, newtext -dim as integer h, i = 1, bNoSave = FALSE, bHTML = FALSE, bProcess = TRUE - -if( command(i) = "" ) then - print "replace [-f] file.txt [-c comment] [-n] [-r] [-s] [options...]" - print - print " -f file.txt specifies a file in the following format:" - print " page,oldtext,newtext" - print - print " -c comment specifies the comment" - print " -s skip processing" - print " -n don't save the changes." - print " -r create html page with clone and delete links" - print - print " -web replace files in cache_dir" - print " -web+ replace files in web cache_dir" - print " -dev replace files in cache_dir" - print " -dev+ replace files in dev cache_dir" - print - print " automatically writes 'changed.txt' with a list of changed page names" - print " (i.e. can then use 'putpage web @changed.txt')" - end 0 -end if +'' private options +dim f as string +dim sComment as string +dim bNoSave as boolean = false +dim bHTML as boolean = false +dim bProcess as boolean = true -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - web_wiki_url = opts->Get( "web_wiki_url" ) - dev_wiki_url = opts->Get( "dev_wiki_url" ) - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope +'' enable cache +cmd_opts_init( CMD_OPTS_ENABLE_URL or CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE ) +dim i as integer = 1 while( command(i) > "" ) - if( left(command(i), 1) = "-" ) then - + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then select case lcase(command(i)) - case "-web" - wiki_url = web_wiki_url - cache_dir = def_cache_dir - case "-dev" - wiki_url = dev_wiki_url - cache_dir = def_cache_dir - case "-web+" - wiki_url = web_wiki_url - cache_dir = web_cache_dir - case "-dev+" - wiki_url = dev_wiki_url - cache_dir = dev_cache_dir - case "-url" - i+= 1 - wiki_url = command(i) - cache_dir = def_cache_dir - case "-c" i += 1 sComment = command(i) @@ -189,32 +138,67 @@ while( command(i) > "" ) bHTML = TRUE case else - print "Unrecognized option '" + command(i) + "'" - end 1 - + cmd_opts_unrecognized_die( i ) end select - else f = command(i) - end if - i += 1 wend +if( cmd_opt_help ) then + print "replace [-f] file.txt [-c comment] [-n] [-r] [-s] [options...]" + print + print " -f file.txt specifies a file in the following format:" + print " page,oldtext,newtext" + print + print " -c comment specifies the comment" + print " -s skip processing" + print " -n don't save the changes." + print " -r create html page with clone and delete links" + print + print " -web replace files in cache_dir" + print " -web+ replace files in web cache_dir" + print " -dev replace files in cache_dir" + print " -dev+ replace files in dev cache_dir" + print + print " automatically writes 'changed.txt' with a list of changed page names" + print " (i.e. can then use 'putpage -web @changed.txt')" + end 0 +end if + +cmd_opts_resolve() + if f = "" then print "filename not specified" end if +if( cache_dir = "" ) then + cmd_opts_die( "no cache directory specified" ) +end if + '' generating HTML? if( bHTML ) then '' URL must be set if( len( wiki_url ) = 0 ) then - print "wiki_url not set." - end 1 + cmd_opts_die( "wiki_url not set." ) end if end if + +'' -------------------------------------------------------- + +type replace_t + sName as string + sOld as string + sNew as string +end type + +dim replace(1 to 1000) as replace_t +dim count as integer = 0 +dim as string sName, sOld, sNew, x, text, newtext +dim as integer h + if( open( f for input as #2 ) <> 0 ) then print "Unable to open '"; f; "'" end 1 @@ -239,9 +223,6 @@ if( bProcess ) then kill "changed.txt" end if - if( cache_dir = "" ) then - cache_dir = def_cache_dir - end if print "cache: "; cache_dir if( open( def_index_file for input as #1 ) <> 0 ) then diff --git a/doc/fbchkdoc/samps.bas b/doc/fbchkdoc/samps.bas index 5576a8b90d..14e160b9ed 100644 --- a/doc/fbchkdoc/samps.bas +++ b/doc/fbchkdoc/samps.bas @@ -769,6 +769,7 @@ function cmd_addlang_proc() as integer end function + '' ========== '' MAIN '' ========== @@ -781,16 +782,17 @@ sample_dir = "examples/manual/" '' read defaults from the configuration file (if it exists) scope - dim as COptions ptr opts = new COptions( default_optFile ) + '' !!! FIXME !!! - this should use cmd_opts.bas + dim as COptions ptr opts = new COptions( hardcoded.default_ini_file ) if( opts <> NULL ) then - manual_dir = opts->Get( "manual_dir", default_ManualDir ) - wiki_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - base_dir = opts->Get( "fb_dir", default_fb_dir ) + manual_dir = opts->Get( "manual_dir", hardcoded.default_manual_dir ) + wiki_cache_dir = opts->Get( "cache_dir", hardcoded.default_def_cache_dir ) + base_dir = opts->Get( "fb_dir", hardcoded.default_fb_dir ) delete opts else - manual_dir = default_ManualDir - wiki_cache_dir = default_CacheDir - base_dir = default_fb_dir + manual_dir = hardcoded.default_manual_dir + wiki_cache_dir = hardcoded.default_def_cache_dir + base_dir = hardcoded.default_fb_dir end if end scope diff --git a/doc/fbchkdoc/spell.bas b/doc/fbchkdoc/spell.bas index 32046dab9b..9818f7fe98 100644 --- a/doc/fbchkdoc/spell.bas +++ b/doc/fbchkdoc/spell.bas @@ -50,6 +50,8 @@ dim shared CurrentPage as string dim shared haveTitle as integer dim shared counter as integer +'' -------------------------------------------------------- + '' function IsKeyword( byref word as string ) as integer dim kw as string @@ -349,15 +351,30 @@ end function '' MAIN '' -------------------------------------------------------- -dim as string manual_dir, def_manual_dir -dim as string cache_dir, def_cache_dir -dim as string web_cache_dir, dev_cache_dir - -dim as integer i = 1, webPageCount = 0 -redim webPageList(1 to 1) as string -dim as string cmt +'' from cmd_opts.bas +extern cmd_opt_help as boolean +extern cache_dir as string +extern manual_dir as string +extern webPageCount as integer +extern webPageList() as string +extern webCommentList() as string + +'' enable url and cache +cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE or CMD_OPTS_ENABLE_MANUAL ) + +dim i as integer = 1 +while( command(i) > "" ) + if( cmd_opts_read( i ) ) then + continue while + elseif( left( command(i), 1 ) = "-" ) then + cmd_opts_unrecognized_die( i ) + else + cmd_opts_unexpected_die( i ) + end if + i += 1 +wend -if( command(i) = "" ) then +if( cmd_opt_help ) then print "spell [pages] [@pagelist] [options]" print print " pages list of wiki pages on the command line" @@ -370,88 +387,20 @@ if( command(i) = "" ) then end 0 end if -'' read defaults from the configuration file (if it exists) -scope - dim as COptions ptr opts = new COptions( default_optFile ) - if( opts <> NULL ) then - def_manual_dir = opts->Get( "manual_dir", default_ManualDir ) - def_cache_dir = opts->Get( "cache_dir", default_CacheDir ) - web_cache_dir = opts->Get( "web_cache_dir", default_web_CacheDir ) - dev_cache_dir = opts->Get( "dev_cache_dir", default_dev_CacheDir ) - delete opts - else - '' print "Warning: unable to load options file '" + default_optFile + "'" - '' end 1 - def_manual_dir = default_ManualDir - def_cache_dir = default_CacheDir - web_cache_dir = default_web_CacheDir - dev_cache_dir = default_dev_CacheDir - end if -end scope - -while command(i) > "" - if( left(command(i), 1) = "-" ) then - select case lcase(command(i)) - case "-web", "-dev" - cache_dir = def_cache_dir - case "-web+" - cache_dir = web_cache_dir - case "-dev+" - cache_dir = dev_cache_dir - case else - print "Unrecognized option '" + command(i) + "'" - end 1 - end select - else - if left( command(i), 1) = "@" then - scope - dim h as integer, x as string - h = freefile - if open( mid(command(i),2) for input access read as #h ) <> 0 then - print "Error reading '" + command(i) + "'" - else - while eof(h) = 0 - line input #h, x - x = ParsePageName( x, cmt ) - if( x > "" ) then - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = x - end if - wend - close #h - end if - end scope - else - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - end if - webPageList(webPageCount) = command(i) - end if - end if - i += 1 -wend +cmd_opts_resolve() +cmd_opts_check() +'' no pages? nothing to do... if( webPageCount = 0 ) then print "no pages specified." end 1 end if +'' -------------------------------------------------------- + dim as CWikiCache ptr wikicache dim as string sPage, sBody -if( manual_dir = "" ) then - manual_dir = def_manual_dir -end if - -if( cache_dir = "" ) then - cache_dir = def_cache_dir -end if -print "cache: "; cache_dir - '' Initialize the cache wikicache = new CWikiCache( cache_dir, CWikiCache.CACHE_REFRESH_NONE ) if wikicache = NULL then From fa99f99374b265e6995dda0fcad3c335269718f1 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 10 Feb 2018 08:11:27 -0500 Subject: [PATCH 02/15] fbchkdoc: add checks for filenames, orphaned pages, deleted pages. Removed pages marked for delete from the set of pages to check --- doc/fbchkdoc/chkdocs.bas | 616 +++++++++++++++++++++++++++++---------- 1 file changed, 456 insertions(+), 160 deletions(-) diff --git a/doc/fbchkdoc/chkdocs.bas b/doc/fbchkdoc/chkdocs.bas index 57a41eee3d..2348bb2b1f 100644 --- a/doc/fbchkdoc/chkdocs.bas +++ b/doc/fbchkdoc/chkdocs.bas @@ -47,64 +47,32 @@ using fbdoc enum LINK_FLAGS FLAG_NONE = 0 - FLAG_LINK_KEYPG = 1 shl 0 - FLAG_LINK_CATPG = 1 shl 1 - FLAG_LINK_PROPG = 1 shl 2 + FLAG_LINK_KEYPG = 1 shl 0 '' dest link page begins with 'KeyPg' + FLAG_LINK_CATPG = 1 shl 1 '' dest link page begins with 'CatPg' + FLAG_LINK_PROPG = 1 shl 2 '' dest link page begins with 'ProPg' + FLAG_LINK_DEVPG = 1 shl 3 '' dest link page begins with 'Dev' - FLAG_LINK_BACK = 1 shl 3 - FLAG_LINK_LINK = 1 shl 4 - FLAG_LINK_URL = 1 shl 5 - FLAG_LINK_KEYWORD = 1 shl 6 + FLAG_LINK_BACK = 1 shl 4 '' dest link is {{fbdoc item="back" value=".."}} + FLAG_LINK_LINK = 1 shl 5 '' dest link is a wiki link specified with [[ ]] + FLAG_LINK_URL = 1 shl 6 '' dest link is an url link specified with [[url]] + FLAG_LINK_KEYWORD = 1 shl 7 '' dest link is {{fbdoc item="keyword" value=".."}} - FLAG_PAGE_KEYPG = 1 shl 7 - FLAG_PAGE_CATPG = 1 shl 8 - FLAG_PAGE_PROPG = 1 shl 9 + FLAG_PAGE_KEYPG = 1 shl 8 '' page name begins with "KeyPg" + FLAG_PAGE_CATPG = 1 shl 9 '' page name begins with "CatPg" + FLAG_PAGE_PROPG = 1 shl 10 '' page name begins with "ProPg" + FLAG_PAGE_DEVPG = 1 shl 11 '' page name begins with 'Dev' - FLAG_PAGE_DOCPAGE = 1 shl 10 + FLAG_PAGE_DOCPAGE = 1 shl 12 '' page is reachable from DocToc - FLAG_PAGE_HASBACKLINK = 1 shl 11 - FLAG_PAGE_LINKED_FROM_CATPG = 1 shl 12 - FLAG_PAGE_LINKED_FROM_INDEX = 1 shl 13 + FLAG_PAGE_HASBACKLINK = 1 shl 13 '' page contains at least one backlink + FLAG_PAGE_LINKED_FROM_CATPG = 1 shl 14 '' page is linked from DocToc, or CatPg* + FLAG_PAGE_LINKED_FROM_INDEX = 1 shl 15 '' page is linked from CatPgFunctIndex, CatPgFullIndex, CatPgGfx, CatPgOpIndex, CatPgCompOpt - FLAG_FILE_NOT_FOUND = 1 shl 14 - FLAG_FILE_DUPLICATE = 1 shl 15 - - FLAG_PAGE_DEVPG = 1 shl 16 + FLAG_FILE_NOT_FOUND = 1 shl 16 + FLAG_FILE_DUPLICATE = 1 shl 17 '' {{fbdoc item="filename" value="..."}} filename value is used more than once (duplicate) end enum -type PageInfo_t - sName as string - flags as integer - sTitle as string - msg as integer -End type - -type LinkInfo_t - sName as string '' page name - sType as string '' link type - sLink as string - flags as integer -end type - -type SampInfo_t - sFile as string - sPage as string - flags as integer -end type - -type ImageInfo_t - sUrl as string - sLink as string - sPage as string - flags as integer -end type - -type TempInfo_t - text as string - extra as string -end type - '' from cmd_opts.bas extern cache_dir as string extern image_dir as string @@ -115,54 +83,6 @@ const LinkList_File = "linklist.csv" const FixList_File = "fixlist.txt" const SampList_File = "samplist.log" -'' -redim shared sPages() as PageInfo_t -redim preserve sPages(1 to 1) as PageInfo_t -dim shared nPages as integer = 0, maxPages as integer = 1 - -redim shared sLinks() as LinkInfo_t -redim preserve sLinks(1 to 1) as LinkInfo_t -dim shared nLinks as integer = 0, maxLinks as integer = 1 - -redim shared sSamps() as SampInfo_t -redim preserve sSamps(1 to 1) as SampInfo_t -dim shared nSamps as integer = 0, maxSamps as integer = 1 - -redim shared sImages() as ImageInfo_t -redim preserve sImages(1 to 1) as ImageInfo_t -dim shared nImages as integer = 0, maxImages as integer = 1 - -redim shared sTemps() as TempInfo_t -redim preserve sTemps(1 to 1) as TempInfo_t -dim shared nTemps as integer = 0, maxTemps as integer = 1 - -dim shared temphash as HASH - -dim shared pagehash as HASH -dim shared pagehash_lcase as HASH -dim shared pagehash_keypg as HASH -dim shared pagehash_catpg as HASH -dim shared pagehash_scanned as HASH - -dim shared linkhash as HASH -dim shared linkhash_back as HASH -dim shared linkhash_link as HASH -dim shared linkhash_url as HASH -dim shared linkhash_keyword as HASH - -dim shared samphash as HASH - -dim shared imagehash as HASH - -type timers_t - text as string - value as double - lapsed as double -end type - -dim shared as timers_t timers(1 to 20) -dim shared as integer ntimers = 0 - dim shared token_names(0 to WIKI_TOKENS-1) as zstring ptr = _ { _ @"WIKI_TOKEN_NULL", _ @@ -199,8 +119,20 @@ dim shared token_names(0 to WIKI_TOKENS-1) as zstring ptr = _ dim shared token_counts(0 to WIKI_TOKENS-1) as integer -'' ---------------------------------------------------- +'' ---------------------------------------------- +'' TIMERS +'' ---------------------------------------------- +type timers_t + text as string + value as double + lapsed as double +end type + +dim shared as timers_t timers(1 to 30) +dim shared as integer ntimers = 0 + +''::::: sub Timer_Begin() ntimers += 1 timers( ntimers ).text = "BEGIN" @@ -208,6 +140,7 @@ sub Timer_Begin() timers( ntimers ).lapsed = 0 end sub +''::::: sub Timer_Mark( byref text as string ) ntimers += 1 timers( ntimers ).text = text @@ -215,6 +148,7 @@ sub Timer_Mark( byref text as string ) timers( ntimers ).lapsed = timers( ntimers ).value - timers( ntimers - 1 ).value end sub +''::::: sub Timer_End() ntimers += 1 timers( ntimers ).text = "END" @@ -222,6 +156,7 @@ sub Timer_End() timers( ntimers ).lapsed = timers( ntimers ).value - timers( 1 ).value end sub +''::::: sub Timer_Dump() dim h as integer, i as integer h = freefile @@ -234,17 +169,19 @@ sub Timer_Dump() close #h end sub +'' ---------------------------------------------- +'' LOG FILE +'' ---------------------------------------------- -'' ---------------------------------------------------- - -''::::: dim shared logfileH as integer +''::::: sub logopen() logfileH = freefile open "results.txt" for output as #logfileH end sub +''::::: sub logprint( byref txt as string = "" ) 'if( txt ) > "" then print txt @@ -254,6 +191,7 @@ sub logprint( byref txt as string = "" ) 'end if end sub +''::::: sub logclose() if logfileH <> 0 then close #logfileH @@ -286,7 +224,20 @@ sub WriteTextFile( byref sFile as string, byref text as string ) end if end sub -'' ---------------------------------------------------- +'' ---------------------------------------------- +'' TEMPORARY LIST +'' ---------------------------------------------- + +type TempInfo_t + text as string + extra as string +end type + +redim shared sTemps() as TempInfo_t +redim preserve sTemps(1 to 1) as TempInfo_t +dim shared nTemps as integer = 0, maxTemps as integer = 1 + +dim shared temphash as HASH ''::::: sub Temps_Clear () @@ -317,12 +268,120 @@ sub Temps_Add( byref text as string, byref extra as string = "", byval bAllowDup end if sTemps(i).text = text sTemps(i).extra = extra - temphash.add( text ) + temphash.add( text, cast(any ptr, nTemps) ) + end if + +end sub + +''::::: +function Temps_Exists( byref text as string ) as integer + function = temphash.test( text ) +end function + +'' ---------------------------------------------- +'' FILES +'' ---------------------------------------------- + +type FileInfo_t + sFileName as string +end type + +redim shared sFiles() as FileInfo_t +redim preserve sFiles(1 to 1) as FileInfo_t +dim shared nFiles as integer = 0, maxFiles as integer = 1 + +dim shared filehash as HASH +dim shared filehash_lcase as HASH + +''::::: +sub Files_Clear () + nFiles = 0 + maxFiles = 1 + redim sFiles( 1 to maxFiles ) as FileInfo_t + filehash.clear() + filehash_lcase.clear() +end sub + +''::::: +sub Files_Add( byref filename as string, byval bAllowDup as integer = FALSE ) + + dim as integer i + + if( bAllowDup <> FALSE ) then + i = nfiles + 1 + else + if( filehash.test( filename ) = 0 ) then + i = nfiles + 1 + end if + end if + + if( i > nfiles ) then + nfiles += 1 + if nfiles > maxFiles then + maxfiles *= 2 + redim preserve sFiles( 1 to maxFiles ) as FileInfo_t + end if + sFiles(i).sFileName = filename + filehash.add( filename, cast(any ptr, nFiles) ) + filehash_lcase.add( lcase( filename ), cast(any ptr, nFiles) ) end if end sub -'' ---------------------------------------------------- +''::::: +sub Files_LoadFromCache( byref path as const string ) + dim as string d + + Files_Clear + + d = dir( path + "*.wakka" ) + while d > "" + Files_Add left( d, len(d) - 6 ) + d = dir() + wend + + logprint "Found " & nFiles & " *.wakka files in the cache directory." + +end sub + +'' ---------------------------------------------- +'' PAGES +'' ---------------------------------------------- + +type SPECIAL_PAGE_INFO + name as zstring ptr +end type + +'' +dim shared Special_Pages_tbl( 1 to ... ) as zstring ptr = _ + { _ + ( @"DocToc" ), _ + ( @"DevToc" ), _ + ( @"CommunityTutorials" ), _ + ( @"CatPgFullIndex" ), _ + ( @"CatPgFunctIndex" ), _ + ( @"CatPgGfx" ), _ + ( @"CatPgOpIndex" ), _ + ( @"CatPgCompOpt" ) _ + } + +type PageInfo_t + sName as string + flags as integer + sTitle as string + msg as integer +End type + +redim shared sPages() as PageInfo_t +redim preserve sPages(1 to 1) as PageInfo_t +dim shared nPages as integer = 0, maxPages as integer = 1 + +dim shared pagehash as HASH +dim shared pagehash_lcase as HASH +dim shared pagehash_keypg as HASH +dim shared pagehash_catpg as HASH +dim shared pagehash_devpg as HASH +dim shared pagehash_scanned as HASH ''::::: sub Pages_Clear () @@ -333,6 +392,7 @@ sub Pages_Clear () pagehash_lcase.clear() pagehash_catpg.clear() pagehash_keypg.clear() + pagehash_devpg.clear() pagehash_scanned.clear() end sub @@ -366,6 +426,15 @@ sub Pages_Add ( byref d as string, byref t as string = "" ) .flags or= FLAG_PAGE_CATPG pagehash_catpg.add( lcase(.sName), cast(any ptr, nPages) ) + case else + + select case lcase(left(d, 3)) + case "dev" + .flags or= FLAG_PAGE_DEVPG + pagehash_devpg.add( lcase(.sName), cast(any ptr, nPages) ) + + end select + end select end with end sub @@ -415,22 +484,6 @@ sub Pages_LoadFromFile( byref sFileName as string, byval mask as integer = 0 ) end sub -''::::: -sub Pages_LoadFromCache() - dim as string d - - Pages_Clear - - d = dir( cache_dir + "*.wakka" ) - while d > "" - Pages_Add Trim(d) - d = dir() - wend - - logprint "Found " & nPages & " pages." - -end sub - ''::::: sub Pages_SaveToFile( byref sFileName as string, byval mask as integer = -1 ) @@ -460,7 +513,21 @@ function Pages_Exists( byref sPageName as string, byval bCaseSensitive as intege end if end function -'' ---------------------------------------------------- +'' ---------------------------------------------- +'' SAMPLES +'' ---------------------------------------------- + +type SampInfo_t + sFile as string + sPage as string + flags as integer +end type + +redim shared sSamps() as SampInfo_t +redim preserve sSamps(1 to 1) as SampInfo_t +dim shared nSamps as integer = 0, maxSamps as integer = 1 + +dim shared samphash as HASH ''::::: sub Samps_Clear() @@ -514,9 +581,23 @@ sub Samps_SaveToFile( byref sFileName as string, byval mask as integer = -1 ) end sub -'' ---------------------------------------------------- +'' ---------------------------------------------- +'' IMAGES +'' ---------------------------------------------- + +type ImageInfo_t + sUrl as string + sLink as string + sPage as string + flags as integer +end type + +redim shared sImages() as ImageInfo_t +redim preserve sImages(1 to 1) as ImageInfo_t +dim shared nImages as integer = 0, maxImages as integer = 1 + +dim shared imagehash as HASH -''::::: sub Images_Clear() nImages = 0 maxImages = 1 @@ -549,8 +630,26 @@ sub Images_Add( byref sUrl as string, byref sLink as string, byref sPage as stri end sub +'' ---------------------------------------------- +'' LINKS +'' ---------------------------------------------- + +type LinkInfo_t + sName as string '' page name (source) + sType as string '' link type + sLink as string '' destination + flags as integer +end type -'' ---------------------------------------------------- +redim shared sLinks() as LinkInfo_t +redim preserve sLinks(1 to 1) as LinkInfo_t +dim shared nLinks as integer = 0, maxLinks as integer = 1 + +dim shared linkhash as HASH +dim shared linkhash_back as HASH +dim shared linkhash_link as HASH +dim shared linkhash_url as HASH +dim shared linkhash_keyword as HASH ''::::: sub Links_Clear() @@ -646,6 +745,11 @@ sub Links_Add( byref sName as string, byref sType as string, byref sLink as stri .flags or= FLAG_LINK_CATPG case "propg" .flags or= FLAG_LINK_PROPG + case else + select case left( lcase( .sLink ), 3 ) + case "dev" + .flags or= FLAG_LINK_DEVPG + end select end select @@ -1014,13 +1118,137 @@ function Links_Exists( byref sPageName as string, byref sLinkName as string, byr end function -'' ---------------------------------------------------- +'' ---------------------------------------------- +'' CHECKS +'' ---------------------------------------------- + +''::::: +sub Check_Filenames() + + /' looking for + - duplicate wiki pagenames + - duplicate cache filenames + - cache filename exists but wiki pagename does not + - wiki pagename exists but cache filename does not + '/ + + logprint "Checking that wiki page names match cache filenames:" + + dim i as integer + dim j as integer + dim n as integer + dim found as integer = 0 + + '' test for duplicate filenames + n = 0 + for i = 1 to nFiles + j = cint( filehash_lcase.getinfo( lcase( sFiles(i).sFileName ) ) ) + if( j <> i ) then + logprint "file name '" & sFiles(j).sFileName & "' is duplicate of '" & sFiles(i).sFileName + n += 1 + end if + next + if( n = 0 ) then + logprint "No duplicate *.wakka file names found in the cache directory" + end if + + '' test for duplicate wiki page names + n = 0 + for i = 1 to nPages + j = cint( pagehash_lcase.getinfo( lcase( sPages(i).sName ) ) ) + if( j <> i ) then + logprint "wiki page '" & sPages(j).sName & "' is duplicate of '" & sPages(i).sName + n += 1 + end if + next + if( n = 0 ) then + logprint "No duplicate page names found in the wiki page index" + end if + + '' test for file names that exist, but wiki page is missing + for i = 1 to nFiles + if( pagehash.test( sFiles(i).sFileName ) = 0 ) then + logprint "'" & sFiles(i).sFileName & "' exist in cache dir but not wiki index" + end if + next + + '' test for page names that exist, but cache dir filename is missing + for i = 1 to nPages + if( filehash.test( sPages(i).sName ) = 0 ) then + logprint "'" & sPages(i).sName & "' is wiki page but does not exist in cache dir" + end if + next + + logprint + +end sub + +''::::: +sub Check_DeletedPages() + + /' + we are looking for pages that have "!!! DELETE ME !!!" + as the starting text. If we find any, remove them + from our list of pages to scan + '/ + + dim i as integer + dim sBody as string + dim f as string + dim chk as string = "!!! DELETE ME !!!" + + dim keep_pages( 1 to 2, 1 to nPages + 1) as string + dim n_keep_pages as integer = 0 + dim n_delete_pages as integer = 0 + dim n_empty_pages as integer = 0 + + logprint "Checking for deleted pages (pages marked for removal !!! DELETE ME !!!):" + + Temps_Clear() + + for i = 1 to nPages + f = cache_dir + sPages(i).sName + ".wakka" + sBody = LoadFileAsString( f ) + if( left( ucase( ltrim( sBody, any " " & chr(9))), len( chk ) ) = chk ) then + n_delete_pages += 1 + Temps_Add( sPages(i).sName ) + elseif( trim( sBody, any chr(9, 10, 13, 32) ) = "" ) then + n_empty_pages += 1 + Temps_Add( sPages(i).sName ) + else + n_keep_pages += 1 + keep_pages( 1, n_keep_pages ) = sPages(i).sName + keep_pages( 2, n_keep_pages ) = sPages(i).sTitle + end if + next + + if nTemps = 0 then + logprint "No pages marked for delete and no pages empty" + else + for i = 1 to nTemps + logprint "marked for delete or empty '" + sTemps(i).text + "'" + next + logprint "Found " + str( n_delete_pages ) + " pages marked for delete, removed from scan" + logprint "Found " + str( n_empty_pages ) + " empty pages, removed from scan" + end if + + '' rebuild the pages list without the deleted pages + Pages_Clear() + + for i = 1 to n_keep_pages + Pages_Add( keep_pages(1, i), keep_pages(2, i) ) + next + + logprint str(n_keep_pages) + " pages to be scanned" + logprint + +end sub ''::::: sub Check_MissingPages() /' - we are looking for pages that have a + we are looking for pages (i.e. wanted pages) that have a link on (some) page, but do not exist as a topic - sometimes gives a false positives since the link name might be mispelled or incorrect, in @@ -1054,6 +1282,44 @@ sub Check_MissingPages() end sub +''::::: +sub Check_OrphanPages() + + /' + look for pages that are not linked from anywhere + '/ + + dim i as integer + dim n_orphan as integer + + logprint "Checking orphan pages (pages with no links to them):" + logprint " these pages might be CamelCase only links on wiki" + + Temps_Clear() + + '' find all pages that are linked to + for i = 1 to nLinks + if( (sLinks(i).flags and (FLAG_LINK_LINK or FLAG_LINK_KEYWORD)) <> 0 ) then + Temps_Add( sLinks(i).sLink ) + end if + next + + for i = 1 to nPages + if( temphash.test( sPages(i).sName ) = 0 ) then + n_orphan += 1 + logprint "orphan page '" + sPages(i).sName + "'" + end if + next + + if n_orphan = 0 then + logprint "No orphan pages" + else + logprint "Found links to " + str(n_orphan) + " orphan pages" + end if + logprint + +end sub + ''::::: sub Check_NameCase( byref outfile as string ) @@ -1170,7 +1436,7 @@ end sub ''::::: -sub Check_DuplicateFilenames() +sub Check_DuplicateSampleFilenames() /' report the results of duplicate sample filesname @@ -1504,6 +1770,7 @@ sub Check_PrintToc() end sub +''::::: sub Check_PagesNotLinked() dim as integer j, c = 0 @@ -1524,6 +1791,7 @@ sub Check_PagesNotLinked() end sub +''::::: sub Check_PagesNoBackLink() dim as integer j, c = 0 @@ -1545,6 +1813,7 @@ sub Check_PagesNoBackLink() end sub +''::::: sub Check_DocPagesMissingTitles() dim as integer j, c = 0 @@ -1580,35 +1849,33 @@ sub Report_TokenCounts() end sub -'' -------------------------------------------------------- +'' ---------------------------------------------- '' MAIN -'' -------------------------------------------------------- +'' ---------------------------------------------- enum OPTIONS OPT_NONE = 0 - OPT_MISSING_PAGES = 1 - OPT_FULL_INDEX = 2 - OPT_FUNCT_INDEX = 4 - OPT_LINK_NAME_CASE = 8 - OPT_MISSING_BACKLINK = 16 - OPT_INVALID_BACKLINK = 32 - OPT_NO_BACKLINK = 64 - OPT_HEADERS = 128 - OPT_NOT_LINKED = 256 - OPT_PRINT_TOC = 512 - - OPT_LOAD_FROM_FILE = 1024 - OPT_TIMER_LOG = 2048 - - OPT_NO_TITLE = 4096 - OPT_DUP_FILE_NAME = 8192 - - OPT_IMAGES = 16384 - - OPT_OPS_INDEX = 32768 - - OPT_TOKEN_COUNTS = 65536 + OPT_MISSING_PAGES = 1 shl 0 + OPT_FULL_INDEX = 1 shl 1 + OPT_FUNCT_INDEX = 1 shl 2 + OPT_LINK_NAME_CASE = 1 shl 3 + OPT_MISSING_BACKLINK = 1 shl 4 + OPT_INVALID_BACKLINK = 1 shl 5 + OPT_NO_BACKLINK = 1 shl 6 + OPT_HEADERS = 1 shl 7 + OPT_NOT_LINKED = 1 shl 8 + OPT_PRINT_TOC = 1 shl 9 + OPT_LOAD_FROM_FILE = 1 shl 10 + OPT_TIMER_LOG = 1 shl 11 + OPT_NO_TITLE = 1 shl 12 + OPT_DUP_SAMPLE_FILE = 1 shl 13 + OPT_IMAGES = 1 shl 14 + OPT_OPS_INDEX = 1 shl 15 + OPT_TOKEN_COUNTS = 1 shl 16 + OPT_DELETED_PAGES = 1 shl 17 + OPT_ORPHAN_PAGES = 1 shl 18 + OPT_FILENAMES = 1 shl 19 OPT_ALL_LINKS = _ OPT_MISSING_PAGES _ @@ -1626,10 +1893,13 @@ enum OPTIONS OPT_ALL_TOKEN = _ OPT_HEADERS _ - or OPT_DUP_FILE_NAME + or OPT_DUP_SAMPLE_FILE OPT_ALL = _ OPT_ALL_LINKS _ + or OPT_DELETED_PAGES _ + or OPT_ORPHAN_PAGES _ + or OPT_FILENAMES _ or OPT_ALL_TOKEN end enum @@ -1663,6 +1933,10 @@ while( command(i) > "" ) opt or= OPT_TIMER_LOG case "m" opt or= OPT_MISSING_PAGES + case "del" + opt or= OPT_DELETED_PAGES + case "o" + opt or= OPT_ORPHAN_PAGES case "full" opt or= OPT_FULL_INDEX case "func" @@ -1690,7 +1964,7 @@ while( command(i) > "" ) case "h" opt or= OPT_HEADERS case "f" - opt or= OPT_DUP_FILE_NAME + opt or= OPT_DUP_SAMPLE_FILE case "i" opt or= OPT_IMAGES case "tc" @@ -1733,7 +2007,10 @@ if( cmd_opt_help ) then print " n check name case in links" print " tc report token counts" print - print " e check everything! ( a t )" + print " del check deleted pages" + print " o check orphaned pages" + print + print " e check everything! ( a t del o )" print end 0 end if @@ -1746,7 +2023,7 @@ if( (opt and OPT_ALL) = 0 ) then end 1 end if -'' -------------------------------------------------------- +'' ---------------------------------------------- Timer_Begin() @@ -1759,10 +2036,24 @@ Timer_Mark("Startup") '' Pages_Clear +Files_Clear Samps_Clear +Files_LoadFromCache( cache_dir ) Pages_LoadFromFile( PageIndex_File ) +logprint + +if( (opt and OPT_FILENAMES) <> 0 ) then + Check_FileNames() + Timer_Mark("Check_Cache_FileNames()") +end if + +if( (opt and OPT_DELETED_PAGES) <> 0 ) then + Check_DeletedPages() + Timer_Mark("Check_DeletedPages()") +end if + Links_Clear '' @@ -1786,6 +2077,11 @@ if( (opt and OPT_MISSING_PAGES) <> 0 ) then Timer_Mark("Check_MissingPages()") end if +if( (opt and OPT_ORPHAN_PAGES) <> 0 ) then + Check_OrphanPages() + Timer_Mark("Check_OrpanPages()") +end if + if( (opt and OPT_FULL_INDEX) <> 0 ) then Check_IndexLinks("full") Timer_Mark("Check_IndexLinks(""full"")") @@ -1843,10 +2139,10 @@ if( (opt and OPT_NO_TITLE) <> 0 ) then Timer_Mark("Check_DocPagesMissingTitles()") end if -if( (opt and OPT_DUP_FILE_NAME) <> 0 ) then - '' duplicated file names - Check_DuplicateFilenames() - Timer_Mark("Check_DuplicateFilenames()") +if( (opt and OPT_DUP_SAMPLE_FILE) <> 0 ) then + '' duplicated sample file names + Check_DuplicateSampleFilenames() + Timer_Mark("Check_DuplicateSampleFilenames()") end if if( (opt and OPT_IMAGES) <> 0 ) then From 35150038c6b105a3c59a182e6d5eae26f6e2195a Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 10 Feb 2018 12:13:26 -0500 Subject: [PATCH 03/15] fbchkdoc: add checks for unescaped CamelCase words and links --- doc/fbchkdoc/chkdocs.bas | 95 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 6 deletions(-) diff --git a/doc/fbchkdoc/chkdocs.bas b/doc/fbchkdoc/chkdocs.bas index 2348bb2b1f..d31cfaf162 100644 --- a/doc/fbchkdoc/chkdocs.bas +++ b/doc/fbchkdoc/chkdocs.bas @@ -506,7 +506,7 @@ end sub ''::::: function Pages_Exists( byref sPageName as string, byval bCaseSensitive as integer ) as integer dim i as integer - if( bCaseSensitive = 0 ) then + if( bCaseSensitive ) then function = pagehash.test( sPageName ) else function = pagehash_lcase.test( lcase(sPageName)) @@ -1264,7 +1264,7 @@ sub Check_MissingPages() for i = 1 to nLinks if( (sLinks(i).flags and FLAG_LINK_URL ) = 0 ) then - if Pages_Exists( sLinks(i).sLink, FALSE ) = FALSE then + if Pages_Exists( sLinks(i).sLink, TRUE ) = FALSE then Temps_Add( sLinks(i).sLink, sLinks(i).sName ) end if end if @@ -1835,6 +1835,78 @@ sub Check_DocPagesMissingTitles() end sub +''::::: +sub Check_TokenUnescapedCamelCase() + + dim i as integer + dim f as string + dim sBody as string + dim text as string + dim wiki as CWiki Ptr + dim token as WikiToken ptr + dim wikipage as string + + const PATTERN = $"\b([A-Z]+[a-z]+[A-Z0-9][A-Za-z0-9]*)\b" + + dim re as CRegex ptr = new CRegex( PATTERN, REGEX_OPT_DOTALL ) + + logprint "Checking DocPages for unescaped camel case links to missing pages:" + + Temps_Clear() + + wiki = new CWiki + + for i = 1 to nPages + + if( ( sPages(i).flags and FLAG_PAGE_DOCPAGE ) <> 0 ) then + + f = cache_dir + sPages(i).sName + ".wakka" + sBody = LoadFileAsString( f ) + wiki->Parse( sPages(i).sName, sBody ) + + token = wiki->GetTokenList()->GetHead() + do while( token <> NULL ) + + select case as const token->id + case WIKI_TOKEN_TEXT + + dim text as zstring ptr = strptr( token->text ) + if( re->Search( text ) ) then + dim as integer ofs = 0 + do + wikipage = *re->GetStr( 0 ) + Temps_Add( wikipage ) + if( Pages_Exists( wikipage, TRUE ) = false ) then + logprint "'" & sPages(i).sName & "' has """ & *re->GetStr( 0 ) & """" + end if + loop while re->SearchNext() + end if + end select + + + token = wiki->GetTokenList()->GetNext( token ) + loop + + end if + + next + + delete re + delete wiki + wiki = NULL + + logprint + + logprint "Wiki pages linked by CamelCase wiki link" + + for i = 1 to nTemps + logprint "'" + sTemps(i).text + "'" + next + + logprint + +end sub + ''::::: sub Report_TokenCounts() @@ -1873,9 +1945,10 @@ enum OPTIONS OPT_IMAGES = 1 shl 14 OPT_OPS_INDEX = 1 shl 15 OPT_TOKEN_COUNTS = 1 shl 16 - OPT_DELETED_PAGES = 1 shl 17 - OPT_ORPHAN_PAGES = 1 shl 18 - OPT_FILENAMES = 1 shl 19 + OPT_TOKEN_CAMEL_CASE = 1 shl 17 + OPT_DELETED_PAGES = 1 shl 18 + OPT_ORPHAN_PAGES = 1 shl 19 + OPT_FILENAMES = 1 shl 20 OPT_ALL_LINKS = _ OPT_MISSING_PAGES _ @@ -1893,7 +1966,8 @@ enum OPTIONS OPT_ALL_TOKEN = _ OPT_HEADERS _ - or OPT_DUP_SAMPLE_FILE + or OPT_DUP_SAMPLE_FILE _ + or OPT_TOKEN_CAMEL_CASE OPT_ALL = _ OPT_ALL_LINKS _ @@ -1969,6 +2043,8 @@ while( command(i) > "" ) opt or= OPT_IMAGES case "tc" opt or= OPT_TOKEN_COUNTS + case "cc" + opt or= OPT_TOKEN_CAMEL_CASE case else print "option '"; command(i); "' ignored" @@ -2006,6 +2082,7 @@ if( cmd_opt_help ) then print " h check page headers" print " n check name case in links" print " tc report token counts" + print " cc report unescaped camel case word" print print " del check deleted pages" print " o check orphaned pages" @@ -2157,6 +2234,12 @@ if( (opt and OPT_TOKEN_COUNTS) <> 0 ) then Timer_Mark("Report_TokenCounts()") end if +if( (opt and OPT_TOKEN_CAMEL_CASE) <> 0 ) then + '' find unescaped camel case words + Check_TokenUnescapedCamelCase() + Timer_Mark("Check_TokenUnescapedCamelCase()") +end if + logprint logprint "Execution time: " + str(cint(timer - timers(1).value)) + " seconds." From b1865255bef8b3749ebe701b79b1314c5f75ede1 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 10 Feb 2018 15:19:29 -0500 Subject: [PATCH 04/15] fbchkdoc: add -scan option to test pages that start with !!! DELETE ME !!!, and -html option to write 'delete.html' helper file to delete pages from the wiki. --- doc/fbchkdoc/delextra.bas | 90 +++++++++++++++++++++++++++++++++++---- 1 file changed, 81 insertions(+), 9 deletions(-) diff --git a/doc/fbchkdoc/delextra.bas b/doc/fbchkdoc/delextra.bas index 3fd443f77d..17d90d4441 100644 --- a/doc/fbchkdoc/delextra.bas +++ b/doc/fbchkdoc/delextra.bas @@ -21,6 +21,7 @@ '' fbdoc headers #include once "fbdoc_defs.bi" +#include once "fbdoc_string.bi" #include once "COptions.bi" #include once "hash.bi" @@ -39,7 +40,19 @@ dim shared filehash as HASH '' -------------------------------------------------------- '' -function ReadIndex( byref f as string ) as integer +sub loghtml( byref x as string, byval bNew as integer = FALSE ) + dim h as integer = freefile + if( bNew ) then + open "delete.html" for output as #h + else + open "delete.html" for append as #h + end if + print #h, x + close #h +end sub + +'' +function ReadIndex( byref f as const string ) as boolean dim as string x dim as integer h h = freefile @@ -58,23 +71,67 @@ function ReadIndex( byref f as string ) as integer return FALSE end function +'' +function ScanForDeleteMe _ + ( _ + filename as const string _ + ) as boolean + + dim sBody as string + dim chk as string = "!!! DELETE ME !!!" + + sBody = LoadFileAsString( filename ) + if( left( ucase( ltrim( sBody, any " " & chr(9))), len( chk ) ) = chk ) then + function = true + else + function = false + end if + +end function + '' sub DeleteExtraFiles _ ( _ - byref path as string, _ - byval isgit as integer, _ - byval nodelete as integer _ + byref path as const string, _ + byval isgit as boolean, _ + byval nodelete as boolean, _ + byval doscan as boolean, _ + byval bHTML as boolean, _ + byref wiki_url as const string _ ) dim d as string, i as integer + dim remove as boolean + dim pagename as string + + if( bHTML ) then + loghtml( "", TRUE ) + loghtml( "" ) + end if + d = dir( path + "*.wakka" ) while( d > "" ) + + pagename = left( d, len(d) - len(".wakka") ) + if( filehash.test( lcase(d) ) = FALSE ) then + remove = true + elseif( ScanForDeleteMe( path + d ) ) then + remove = true + else + remove = false + end if + + if( bHTML and remove ) then + loghtml( "" + pagename + "/delete
" ) + end if + + if( remove ) then dim n as string = ReplacePathChar( path + d, asc("/") ) if( isgit ) then print "Removing '" + n + "'" if( nodelete = FALSE ) then - shell !"git rm \"" + n + !"\"" + shell !"git -C \"" & path & !"\" rm \"" + n + !"\"" end if else print "Deleting '" + path + d + "'" @@ -83,9 +140,15 @@ sub DeleteExtraFiles _ end if end if end if + d = dir() wend + if( bHTML ) then + loghtml( "" ) + loghtml( "" ) + end if + end sub '' -------------------------------------------------------- @@ -95,13 +158,16 @@ end sub '' from cmd_opts.bas extern cmd_opt_help as boolean extern cache_dir as string +extern wiki_url as string '' private options dim isgit as boolean = false dim nodelete as boolean = false +dim doscan as boolean = false +dim bHTML as boolean = false '' enable cache -cmd_opts_init( CMD_OPTS_ENABLE_CACHE ) +cmd_opts_init( CMD_OPTS_ENABLE_URL or CMD_OPTS_ENABLE_CACHE ) dim i as integer = 1 while( command(i) > "" ) @@ -109,10 +175,14 @@ while( command(i) > "" ) continue while elseif( left( command(i), 1 ) = "-" ) then select case lcase(command(i)) + case "-scan" + doscan = true + case "-html" + bHTML = true case "-git" - isgit = TRUE + isgit = true case "-n" - nodelete = TRUE + nodelete = true case else cmd_opts_unrecognized_die( i ) end select @@ -127,6 +197,8 @@ if( cmd_opt_help ) then print print " -n only print what would happen but don't" print " actually delete any files" + print " -scan scan page for !!! DELETE ME !!!" + print " -html write delete.html helper file" print " -git use 'git rm' instead of file system delete" print print " -web delete extra files in cache_dir" @@ -149,4 +221,4 @@ if( ReadIndex( def_index_file ) = FALSE ) then end 1 end if -DeleteExtraFiles( cache_dir, isgit, nodelete ) +DeleteExtraFiles( cache_dir, isgit, nodelete, doscan, bHTML, wiki_url ) From 2cc23533b64885bf53b6db43cb1aab27c13e8e9a Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 10 Feb 2018 08:17:04 -0500 Subject: [PATCH 05/15] fbdoc: wiki snapshot 2018-02-08; includes last revision of pages marked for removal --- doc/manual/cache/Casting.wakka | 2 + doc/manual/cache/CodeLib.wakka | 3 +- doc/manual/cache/CodeLibDevTools.wakka | 2 + doc/manual/cache/CodeLibExample.wakka | 2 + doc/manual/cache/CodeLibGame.wakka | 14 + doc/manual/cache/CodeLibGfx.wakka | 37 ++ doc/manual/cache/CodeLibGraphics.wakka | 37 ++ doc/manual/cache/CodeLibMath.wakka | 17 + doc/manual/cache/CodeLibMisc.wakka | 2 + doc/manual/cache/CodeLibOSSpecific.wakka | 30 ++ doc/manual/cache/CodeLibSound.wakka | 7 + doc/manual/cache/CodeLibText.wakka | 19 + doc/manual/cache/CodeLibWeb.wakka | 8 + doc/manual/cache/CodeLibrary.wakka | 3 - doc/manual/cache/CompilerCredits.wakka | 22 +- doc/manual/cache/CountingPine.wakka | 51 +-- doc/manual/cache/DevIL.wakka | 2 + doc/manual/cache/DevTranslateHeader.wakka | 8 +- doc/manual/cache/DirectMedia.wakka | 2 + doc/manual/cache/DocToc.wakka | 2 + doc/manual/cache/ExtLibTOC.wakka | 3 +- doc/manual/cache/ExtLibfbsound.wakka | 2 + doc/manual/cache/ExtLibmini.wakka | 2 + doc/manual/cache/FBWikiCheck.wakka | 114 ----- doc/manual/cache/FBWikiFaq.wakka | 4 +- doc/manual/cache/FBWikiFormatting.wakka | 14 +- doc/manual/cache/FBWikiKeywordTemplate.wakka | 19 +- doc/manual/cache/FBWikiPageNames.wakka | 10 +- doc/manual/cache/FBWikiTopicSample.wakka | 3 +- doc/manual/cache/FormattingRules.wakka | 276 ++++++++++++ doc/manual/cache/GD.wakka | 2 + doc/manual/cache/GFXLib2.wakka | 2 + doc/manual/cache/GfxInternalFormats.wakka | 1 + doc/manual/cache/GfxLib.wakka | 3 +- doc/manual/cache/KeyPgAny.wakka | 2 +- doc/manual/cache/KeyPgOverride.wakka | 2 +- doc/manual/cache/KeyPgRedim.wakka | 6 +- doc/manual/cache/ProPgProfiling.wakka | 3 +- doc/manual/cache/SirMud.wakka | 6 +- doc/manual/cache/TableMarkup.wakka | 395 ++++++++++++++++++ doc/manual/cache/TableMarkupReference.wakka | 74 ++++ doc/manual/cache/TutBasicInput.wakka | 4 +- .../TutBeginnersGuideToTypesAsObjects.wakka | 4 +- .../TutBeginnersGuideToTypesAsObjects2.wakka | 4 +- .../cache/TutConditionalCompilation.wakka | 5 +- doc/manual/cache/TutDynaArrayType.wakka | 11 +- doc/manual/cache/TutDynamicArrays.wakka | 4 +- doc/manual/cache/TutFunctionOverloading.wakka | 4 +- doc/manual/cache/TutGettingStarted.wakka | 2 + doc/manual/cache/TutGettingStartedQB.wakka | 2 + doc/manual/cache/TutHowToProgGame1.wakka | 22 +- doc/manual/cache/TutIfStatement.wakka | 4 + doc/manual/cache/TutIntroArrays.wakka | 4 +- doc/manual/cache/TutIntroScope.wakka | 4 +- doc/manual/cache/TutIntroTypeDef.wakka | 2 + doc/manual/cache/TutLinkedLists.wakka | 4 +- doc/manual/cache/TutMathAngles.wakka | 2 + doc/manual/cache/TutMathIntroTrig.wakka | 4 +- doc/manual/cache/TutNewToProg.wakka | 4 +- doc/manual/cache/TutPointers.wakka | 4 +- doc/manual/cache/TutPointersData.wakka | 4 +- doc/manual/cache/TutPortingFromQB.wakka | 2 +- doc/manual/cache/TutPterDataType.wakka | 5 +- doc/manual/cache/TutSelectStatement.wakka | 2 + doc/manual/cache/TutUsingLibs.wakka | 2 + doc/manual/cache/TutUsingMouse.wakka | 6 +- doc/manual/cache/WikkaFormattingRules.wakka | 2 + 67 files changed, 1090 insertions(+), 240 deletions(-) create mode 100644 doc/manual/cache/CodeLibGame.wakka create mode 100644 doc/manual/cache/CodeLibGfx.wakka create mode 100644 doc/manual/cache/CodeLibGraphics.wakka create mode 100644 doc/manual/cache/CodeLibMath.wakka create mode 100644 doc/manual/cache/CodeLibOSSpecific.wakka create mode 100644 doc/manual/cache/CodeLibSound.wakka create mode 100644 doc/manual/cache/CodeLibText.wakka create mode 100644 doc/manual/cache/CodeLibWeb.wakka delete mode 100644 doc/manual/cache/FBWikiCheck.wakka create mode 100644 doc/manual/cache/FormattingRules.wakka create mode 100644 doc/manual/cache/TableMarkup.wakka create mode 100644 doc/manual/cache/TableMarkupReference.wakka diff --git a/doc/manual/cache/Casting.wakka b/doc/manual/cache/Casting.wakka index 0473271707..9fe481df12 100644 --- a/doc/manual/cache/Casting.wakka +++ b/doc/manual/cache/Casting.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + =====Quick Introduction===== This tutorial covers ideas behind casting pointers, and what data is cast. I don't know the technical workings in the compiler, but I do know this works, and it's convenient if you are working with lots of information, that has a base-type of some sorts that it builds off of. Hopefully, this will make more sense as we go on. diff --git a/doc/manual/cache/CodeLib.wakka b/doc/manual/cache/CodeLib.wakka index 73d5089cf0..363eb8b8bf 100644 --- a/doc/manual/cache/CodeLib.wakka +++ b/doc/manual/cache/CodeLib.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + Welcome to the FreeBASIC Code Library. Find links to tools, code snippets, examples, etc. here. {{fbdoc item="section" value="Code Library"}} @@ -7,7 +9,6 @@ Welcome to the FreeBASIC Code Library. Find links to tools, code snippets, exam {{fbdoc item="section" value="Websites and Tutorials"}} - [[http://imortisoft.no-ip.org/b2b/| Back2BASIC]] - Successor to QBExpress by Imortis [[http://games.freebasic.net/|FBGD]] - The FreeBASIC Games Directory by Lachie Dazdarian [[http://www.petesqbsite.com/sections/express/express.shtml|QBExpress]] - "Original" QB Magazine by Pete diff --git a/doc/manual/cache/CodeLibDevTools.wakka b/doc/manual/cache/CodeLibDevTools.wakka index ff4fe9422f..4db5fd306d 100644 --- a/doc/manual/cache/CodeLibDevTools.wakka +++ b/doc/manual/cache/CodeLibDevTools.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + {{fbdoc item="section" value="Windows IDEs, GUI and RAD"}} [[http://fbedit.freebasic.net/viewforum.php?f=2|FBEdit]] - IDE for FreeBASIC by KetilO diff --git a/doc/manual/cache/CodeLibExample.wakka b/doc/manual/cache/CodeLibExample.wakka index ec3593f909..83974eada7 100644 --- a/doc/manual/cache/CodeLibExample.wakka +++ b/doc/manual/cache/CodeLibExample.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + {{anchor name="EXAMPLE"}}{{fbdoc item="section" value="Example Page (Linked Lists)"}} [[http://freebasic.net/forum/|Linked List]] - External example or library diff --git a/doc/manual/cache/CodeLibGame.wakka b/doc/manual/cache/CodeLibGame.wakka new file mode 100644 index 0000000000..2e15e8a0b3 --- /dev/null +++ b/doc/manual/cache/CodeLibGame.wakka @@ -0,0 +1,14 @@ +!!! DELETE ME !!! + +{{anchor name="GAME"}}{{fbdoc item="section" value="FreeBASIC Games"}} + [[http://games.freebasic.net/ FreeBASIC Games Directory by Lachie Dazdarian]] + ==Featured Games:== + [[http://csgp.suret.net/ Cute Short Game Project by redcrab]] + [[http://www.freebasic.net/forum/viewtopic.php?t=3931 Kingdoms by Piptol]] + [[http://www.freebasic.net/forum/viewtopic.php?t=5068 Lynn's Legacy by cha0s and Josiah Tobin]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7796 Nanohost by Several]] + [[http://lithium.zext.net/ Several Games by Lithium]] + [[http://lachie.phatcode.net/starcage.php Star Cage by Lachie Dazdarian]] + [[http://syn9.thingie.net/?table=griffonlegend The Griffon Legend by syn9]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9065 100 Line Tetris by Deleter]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9738 Any PNG or JPEG as a Jigsaw Puzzle by Mysoft]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibGfx.wakka b/doc/manual/cache/CodeLibGfx.wakka new file mode 100644 index 0000000000..92cf927d76 --- /dev/null +++ b/doc/manual/cache/CodeLibGfx.wakka @@ -0,0 +1,37 @@ +!!! DELETE ME !!! + +{{anchor name="GRAPHIC"}}{{fbdoc item="section" value="Graphics Code"}} + ==Demos== + [[http://aapproj.phatcode.net/fbgfx/index.html The FreeBASIC GFX Demo Central by Adigun A.Polack]] + [[http://www.freebasic.net/forum/viewtopic.php?t=6938 Animated Clouds by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8817 Flame Demo by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7936 Island Generation by rdc]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8287 Ascii Fire by rdc]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8758 Plasma Generation by Zamaster]] + + ==Graphics Functions and Primitives== + [[http://www.freebasic.net/forum/viewtopic.php?t=7111 AntiAliased Bezier Curves by Acetoline]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7067 Antialiased Circles by Acetoline]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9572 Ellipse Renderer by Pritchard]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7546 Catmull-rom Splines by relsoft]] [[http://www.freebasic.net/forum/viewtopic.php?t=7545 Bezier vs Catmull-rom by relsoft]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9588 Accurate Image Scaler by KristopherWindsor]] + [[http://www.freebasic.net/forum/viewtopic.php?t=6676 Spline Curve by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=13251 Rotozoom by Dr_D]] + + ==Colors and Palettes== + [[http://www.freebasic.net/forum/viewtopic.php?t=9441 24bit to 16bit color width by Eternal_Pain]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8764 HSV Color Space by Antoni]] + + ==Formats== + [[http://www.freebasic.net/forum/viewtopic.php?t=8024 PNG_LOAD by yetifoot]] + [[http://www.freebasic.net/arch/category.php?id=6 JPEG image loader by Antoni]] + + ==3D== + [[http://www.freebasic.net/forum/viewtopic.php?t=8724 Tree Generation by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7931 Quadtree-Based Renderer by relsoft]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7332 Irrlicht 3D + ODE Physics by BMarley]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8400 OpenGL Shader Demo by Dr_D]] + + ==Animation== + [[http://www.freebasic.net/forum/viewtopic.php?t=7340 ASCII Animation Example by Pritchard]] + [[http://lachie.phatcode.net/articles.php Chain-Like Animation Tutorial by Lachie Dazdarian]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibGraphics.wakka b/doc/manual/cache/CodeLibGraphics.wakka new file mode 100644 index 0000000000..92cf927d76 --- /dev/null +++ b/doc/manual/cache/CodeLibGraphics.wakka @@ -0,0 +1,37 @@ +!!! DELETE ME !!! + +{{anchor name="GRAPHIC"}}{{fbdoc item="section" value="Graphics Code"}} + ==Demos== + [[http://aapproj.phatcode.net/fbgfx/index.html The FreeBASIC GFX Demo Central by Adigun A.Polack]] + [[http://www.freebasic.net/forum/viewtopic.php?t=6938 Animated Clouds by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8817 Flame Demo by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7936 Island Generation by rdc]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8287 Ascii Fire by rdc]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8758 Plasma Generation by Zamaster]] + + ==Graphics Functions and Primitives== + [[http://www.freebasic.net/forum/viewtopic.php?t=7111 AntiAliased Bezier Curves by Acetoline]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7067 Antialiased Circles by Acetoline]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9572 Ellipse Renderer by Pritchard]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7546 Catmull-rom Splines by relsoft]] [[http://www.freebasic.net/forum/viewtopic.php?t=7545 Bezier vs Catmull-rom by relsoft]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9588 Accurate Image Scaler by KristopherWindsor]] + [[http://www.freebasic.net/forum/viewtopic.php?t=6676 Spline Curve by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=13251 Rotozoom by Dr_D]] + + ==Colors and Palettes== + [[http://www.freebasic.net/forum/viewtopic.php?t=9441 24bit to 16bit color width by Eternal_Pain]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8764 HSV Color Space by Antoni]] + + ==Formats== + [[http://www.freebasic.net/forum/viewtopic.php?t=8024 PNG_LOAD by yetifoot]] + [[http://www.freebasic.net/arch/category.php?id=6 JPEG image loader by Antoni]] + + ==3D== + [[http://www.freebasic.net/forum/viewtopic.php?t=8724 Tree Generation by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7931 Quadtree-Based Renderer by relsoft]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7332 Irrlicht 3D + ODE Physics by BMarley]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8400 OpenGL Shader Demo by Dr_D]] + + ==Animation== + [[http://www.freebasic.net/forum/viewtopic.php?t=7340 ASCII Animation Example by Pritchard]] + [[http://lachie.phatcode.net/articles.php Chain-Like Animation Tutorial by Lachie Dazdarian]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibMath.wakka b/doc/manual/cache/CodeLibMath.wakka new file mode 100644 index 0000000000..3b41177923 --- /dev/null +++ b/doc/manual/cache/CodeLibMath.wakka @@ -0,0 +1,17 @@ +!!! DELETE ME !!! + +{{anchor name="MATH"}}{{fbdoc item="section" value="Math Code"}} + [[http://sourceforge.net/projects/fbmath/ FBMath by jdebord]] + [[http://www.freebasic.net/forum/viewtopic.php?t=4135 Pixel-Perfect Collision Detection by 1000101]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8963 2D vector class by Pritchard]] + [[http://www.freebasic.net/forum/viewtopic.php?t=386 A* Pathfinding by dumbledore]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7525 Fraction Library by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7173 Big Number Wrapper by Yetifoot]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9501 Minicalc textmode calculator by KristopherWindsor]] + [[http://www.freebasic.net/forum/viewtopic.php?p=75713 BCD arithmetics by srvaldez]] + [[http://www.freebasic.net/forum/viewtopic.php?p=49695 10Byte extended float by srvaldez, included in FB examples]] + + ==Physics simulation== + [[http://www.freebasic.net/forum/viewtopic.php?t=3167 Atom smash simulation by coderjeff]] + [[http://www.freebasic.net/forum/viewtopic.php?t=3428 2d rigid body library by coderjeff]] + [[http://www.freebasic.net/forum/viewtopic.php?t=14579 Irrlicht wrapper + Newton Intergrated by SiskinEDGE]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibMisc.wakka b/doc/manual/cache/CodeLibMisc.wakka index 32ad2e0a8b..e42f641f93 100644 --- a/doc/manual/cache/CodeLibMisc.wakka +++ b/doc/manual/cache/CodeLibMisc.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + {{anchor name="OTHER"}}{{fbdoc item="section" value="Miscellaneous Code"}} [[http://code.google.com/p/fb-extended-lib/|FreeBASIC Extended Library]] diff --git a/doc/manual/cache/CodeLibOSSpecific.wakka b/doc/manual/cache/CodeLibOSSpecific.wakka new file mode 100644 index 0000000000..66b3078dda --- /dev/null +++ b/doc/manual/cache/CodeLibOSSpecific.wakka @@ -0,0 +1,30 @@ +!!! DELETE ME !!! + +{{anchor name="OSSPEC"}}{{fbdoc item="section" value="OS Specific Code"}} + ==Windows== + [[http://www.freebasic.net/forum/viewtopic.php?t=1173 Screen Saver Kit (WIN) by jofers]] + [[http://www.freebasic.net/forum/viewtopic.php?t=5942 ServiceFB (Win) by zerospeed]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9498 FBWinPrint 1.0 by vdecampo]] + [[http://www.freebasic.net/forum/viewtopic.php?p=47539 In memory dialogs by MichaelW]] + [[http://www.freebasic.net/forum/viewtopic.php?t=4767 Printing to UTF8 to Windows by Jonathan Brickman]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9495 Talking program usin Win Voice API, by coder guy]] + [[http://www.freebasic.net/forum/viewtopic.php?t=6569 Jpeg and Gif resources using the API by Zippy]] + [[http://www.freebasic.net/forum/viewtopic.php?p=76442 Using GfxLib in Windows API by MichaelW]] + [[http://www.freebasic.net/forum/viewtopic.php?p=69681 Print a bitmap file by MichaelW]] + [[http://www.freebasic.net/forum/viewtopic.php?p=70771 ShellExecute wrapper by RayBritton]] + [[http://www.execulink.com/~coder/freebasic/fbwiki.html FBWiki to chm format converter by coderjeff]] + [[http://www.freebasic.net/forum/viewtopic.php?p=75625 FB ODBC library by KaraK]] + [[http://www.freebasic.net/forum/viewtopic.php?p=119557 Get a file from an URL by Sisophon]] + [[http://www.freebasic.net/forum/viewtopic.php?t=14224 FB Windows GUI Toolkit by eodor]] + [[http://www.freebasic.net/forum/viewtopic.php?t=13468 Screen to AVI lib by vdecampo]] + + ==Linux== + [[http://www.freebasic.net/forum/viewtopic.php?t=8040 Printing on Linux by coderJeff]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7611 Using GfxLib on Gtk by caseih]] + + ==DOS== + [[http://www.freebasic.net/forum/viewtopic.php?p=70185 Detect system codepage by DrV]] + [[http://www.freebasic.net/forum/viewtopic.php?p=5993 Calling an Interrupt requiring a pointer by DrV]] + [[http://www.freebasic.net/forum/viewtopic.php?p=2766 Access BTRIEVE files by mjs]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8981 "GetDiskFreeSpaceEx" Check for disk total/free space on FAT32 by DOS386]] + [[http://www.freebasic.net/forum/viewtopic.php?t=4899 DPMI host detection version/capabilities by DrV]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibSound.wakka b/doc/manual/cache/CodeLibSound.wakka new file mode 100644 index 0000000000..99c3087346 --- /dev/null +++ b/doc/manual/cache/CodeLibSound.wakka @@ -0,0 +1,7 @@ +!!! DELETE ME !!! + +{{anchor name="SND"}}{{fbdoc item="section" value="Sound Code"}} + [[http://www.freebasic.net/forum/viewtopic.php?t=2294 Mic Input using FMod by mambazo]] + [[http://www.freebasic.net/forum/viewtopic.php?t=11 Using FMod In-Game by shiftlynx]] + [[http://www.freebasic.net/forum/viewtopic.php?p=20477 Using the PC Speaker by several]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9226 Wave synthesizer by Zamaster]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibText.wakka b/doc/manual/cache/CodeLibText.wakka new file mode 100644 index 0000000000..c4bb8183b5 --- /dev/null +++ b/doc/manual/cache/CodeLibText.wakka @@ -0,0 +1,19 @@ +!!! DELETE ME !!! + +{{anchor name="TEXT"}}{{fbdoc item="section" value="Text/Parser Code"}} + [[http://hmcsoft.org/p/libini.php Cross Platform INI library by SirMud]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7437 XML Parser by Pritchard]] + [[http://www.freebasic.net/forum/viewtopic.php?t=5693 Expression Parser by yetifoot]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8680 Turing Machine by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7321 Roman Numeral to Integer Conversion by stylin]] + [[http://www.freebasic.net/forum/viewtopic.php?p=35589 Unicode console calender, by zippy and voodooattack]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8636 FB source to highlighted HTML by Kristopher Windsor]] + [[http://www.execulink.com/~coder/freebasic/docs.html Portable help (not .chm) viewer by coderjeff]] + [[http://www.execulink.com/~coder/freebasic/lisp.html Lisp interpreter by coderjeff]] + + ==Cryptography== + [[http://www.freebasic.net/forum/viewtopic.php?t=7379 MARS encryption by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7667 AES Encryption/Decryption by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7273 DES/LUCIFER Encryption/Decryption by Zamaster]] + [[http://www.freebasic.net/forum/viewtopic.php?t=5288 MD5 Calculator by DOS386]] + [[http://www.freebasic.net/forum/viewtopic.php?t=9496 Tiger Hash by Mindless]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibWeb.wakka b/doc/manual/cache/CodeLibWeb.wakka new file mode 100644 index 0000000000..73a8b4aecf --- /dev/null +++ b/doc/manual/cache/CodeLibWeb.wakka @@ -0,0 +1,8 @@ +!!! DELETE ME !!! + +{{anchor name="WEB"}}{{fbdoc item="section" value="Networking- Web Code"}} + [[http://www.freebasic.net/forum/viewtopic.php?t=4199 FB Web Server (Win) by parakeet]] + [[http://www.freebasic.net/forum/viewtopic.php?t=7913 FB Server side scripting (uses the server above) by fishhf]] + [[http://www.freebasic.net/forum/viewtopic.php?t=8454 ChiSock portable sockets library by cha0s]] + [[http://www.freebasic.net/forum/viewtopic.php?t=1608 CenoChat Serverless chat program by cenozoite]] + [[http://www.freebasic.net/forum/viewtopic.php?t=4036 LibIRCClient to create custom IRC clients by voodooattack]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibrary.wakka b/doc/manual/cache/CodeLibrary.wakka index 6d3a927729..bf5fbf785d 100644 --- a/doc/manual/cache/CodeLibrary.wakka +++ b/doc/manual/cache/CodeLibrary.wakka @@ -4,11 +4,9 @@ [[http://www.freebasic.net/forum/viewtopic.php?t=13932|FBEdit, an IDE for FB by KetilO (Win32)]] [[http://www.planetsquires.com/jellyfishpro_freebasic.htm|JellyFish Pro, an IDE for FB by Paul Squires (Win32)]] [[http://www.freebasic.net/forum/viewtopic.php?t=9035|VISG GUI Builder (WIN) by mrhx]] - [[http://www.freewebs.com/fielden/|EzeeGui GUI builder (WIN) by Jerry Fielden]] {{anchor name="GRAPHIC"}}{{fbdoc item="section" value="Graphics Code"}} ==Demos== - [[http://aapproj.phatcode.net/fbgfx/index.html|The FreeBASIC GFX Demo Central by Adigun A.Polack]] [[http://www.freebasic.net/forum/viewtopic.php?t=6938|Animated Clouds by Zamaster]] [[http://www.freebasic.net/forum/viewtopic.php?t=7936|Island Generation by rdc]] [[http://www.freebasic.net/forum/viewtopic.php?t=8758|Plasma Generation by Zamaster]] @@ -76,7 +74,6 @@ [[http://games.freebasic.net/|FreeBASIC Games Directory by Lachie Dazdarian]] ==Featured Games:== - [[http://csgp.suret.net/|Cute Short Game Project by redcrab]] [[http://www.freebasic.net/forum/viewtopic.php?t=3931|Kingdoms by Piptol]] [[http://www.freebasic.net/forum/viewtopic.php?t=5068|Lynn's Legacy by cha0s and Josiah Tobin]] [[http://cs.smu.ca/~c_adams1/relativity/|Relativity by Lithium]] diff --git a/doc/manual/cache/CompilerCredits.wakka b/doc/manual/cache/CompilerCredits.wakka index 4048dd1b9f..909a59d2e3 100644 --- a/doc/manual/cache/CompilerCredits.wakka +++ b/doc/manual/cache/CompilerCredits.wakka @@ -19,11 +19,11 @@ - **Mark Junker** (mjscod[at]gmx.de): Author of huge parts of the runtime (printing support, date/time, functions, SCR/LPTx/COM/console/keyboard I/O), Cygwin port, first FB installer scripts. - **Matthew Fearnley** (matthew.w.fearnley[at]gmail.com): - Print Using & Co, ImageInfo, and others, dialect specifics, optimization improvements in the compiler, many fixes and improvements. + Print Using & Co, ""ImageInfo"", and others, dialect specifics, optimization improvements in the compiler, many fixes and improvements. - **Ruben Rodriguez** (rubentbstk[at]gmail.com): Var keyword, const specifier, placement new, operator overloading and, other OOP-related work, C BFD wrapper, many fixes and improvements. - **Simon Nash**: - AndAlso/OrElse operators, ellipsis for array initializers, miscellaneous fixes and improvements. + ""AndAlso""/""OrElse"" operators, ellipsis for array initializers, miscellaneous fixes and improvements. ==__Contributors__== @@ -44,7 +44,7 @@ - **Dumbledore**: wx-c headers & examples - **dr0p** (dr0p[at]perfectbg.com): - PostgreSQL headers & examples + ""PostgreSQL"" headers & examples - **Edmond Leung** (leung.edmond[at]gmail.com): SDL headers & examples - **Eric Lope** (vic_viperph[at]yahoo.com): @@ -54,17 +54,17 @@ - **fsw** (fsw.fb[at]comcast.net): Win32 API headers, Gtk/Glade/wx-c examples - **Garvan O'Keeffe** (sisophon2001[at]yahoo.com): - FB ports of many NeHe OpenGL lessons, PDFlib examples + FB ports of many ""NeHe"" OpenGL lessons, PDFlib examples - **Hans L. Nemeschkal** (Hans.Leo.Nemeschkal[at]univie.ac.at): DISLIN headers - **Jofers** (spam[at]betterwebber.com): - ThreadCall keyword, libffi/libjit headers, FreeType examples + ""ThreadCall"" keyword, libffi/libjit headers, ""FreeType"" examples - **Jose Manuel Postigo** (postigo[at]uma.es): Linux serial devices support - **Laanan Fisher** (laananfisher[at]gmail.com): FB test suite using CUnit - **Matthew Riley** (pestery): - OpenGL, GLFW, glext, FreeGLUT, cryptlib headers + OpenGL, GLFW, glext, ""FreeGLUT"", cryptlib headers - **Matthias Faust** (matthias_faust[at]web.de): SDL_ttf headers & examples - **Marzec**: @@ -81,14 +81,14 @@ GSL matrix example - **Saga Musix** (Jojo): BASS examples with sounds - - **Sisophon2001**: + - **""Sisophon2001""**: gfxlib2 fixes, Nehe OpenGL lesson ports - **Sterling Christensen** (sterling[at]engineer.com): Ex-project-member, author of FB's initial QB-like graphics library - - **TeeEmCee**: + - **""TeeEmCee""**: gfxlib2 fixes - **TJF** (Thomas.Freiherr[at]gmx.net): - ARM port, GTK+, glib, Cairo, Pango headers & examples, SQLiteExtensions headers + ARM port, GTK+, glib, Cairo, Pango headers & examples, ""SQLiteExtensions"" headers - **zydon**: Win32 API examples @@ -96,10 +96,10 @@ - **Plasma**: Owner of the freebasic.net domain and main site hoster, many thanks to, him. - - **VonGodric**: + - **""VonGodric""**: Author of the first FreeBASIC IDE: FBIDE. - **Everybody that helped writing the documentation** (and in special Nexinarus who started it): - http://www.freebasic.net/wiki/wikka.php?wakka=ContributorList + https://www.freebasic.net/wiki/wikka.php?wakka=ContributorList - All users that reported bugs, requested features and as such helped improving the compiler, language and run-time libraries. {{fbdoc item="back" value="FBWiki|Main Page"}} \ No newline at end of file diff --git a/doc/manual/cache/CountingPine.wakka b/doc/manual/cache/CountingPine.wakka index 0ebfa6597d..0fa24a1fd0 100644 --- a/doc/manual/cache/CountingPine.wakka +++ b/doc/manual/cache/CountingPine.wakka @@ -1,50 +1 @@ -!!! Template keyword page !!! -{{fbdoc item="title" value="KEYWORD"}}---- -Short description of keyword - -{{fbdoc item="syntax"}}## - [[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Keyword**( [[KeyPgByval|byval]] //foo// [[KeyPgAs|as]] [[KeyPgInteger|integer]] ) [[KeyPgAs|as]] [[KeyPgString|string]] -## -{{fbdoc item="param"}} - ##//foo//##: parameter description - -{{fbdoc item="usage"}}## - //result// = **Keyword**( //foo// ) -## - -{{fbdoc item="ret"}} - Description of the function's return value (if any) - -{{fbdoc item="desc"}} - A lengthy description of the keyword - - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - -{{fbdoc item="ex"}} -Examples go here -""{{fbdoc item="filename" value="examples/manual/keyword.bas"}}""%%(freebasic) -''(fbdoc item escaped in quotes to prevent it being parsed) -'' This is a brief program to demonstrate the use of KEYWORD - -dim foo as integer -print keyword(foo) -%% - -{{image class="center" title="Example output of graphics program" url="/images/keyword.png"}} - -{{fbdoc item="target"}} - - List of platform-specific differences - -{{fbdoc item="lang"}} - - List of the differences in each dialect, e.g: - - Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Keyword""**##. - - -{{fbdoc item="diff"}} - - List of differences from QBASIC, e.g: - - New to ""FreeBASIC"" - -{{fbdoc item="see"}} - - List of other related keywords - -{{fbdoc item="back" value="CatPgName|Category name"}} \ No newline at end of file +a.k.a counting_pine on https://www.freebasic.net/forum \ No newline at end of file diff --git a/doc/manual/cache/DevIL.wakka b/doc/manual/cache/DevIL.wakka index 88b571c181..ccc6426e51 100644 --- a/doc/manual/cache/DevIL.wakka +++ b/doc/manual/cache/DevIL.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + DevIL is a cross-platform image library which aims to provide a common API for different image file formats. {{fbdoc item="see"}} diff --git a/doc/manual/cache/DevTranslateHeader.wakka b/doc/manual/cache/DevTranslateHeader.wakka index ec15874c6a..3e6849e20d 100644 --- a/doc/manual/cache/DevTranslateHeader.wakka +++ b/doc/manual/cache/DevTranslateHeader.wakka @@ -1 +1,7 @@ -=====Under Construction===== \ No newline at end of file +{{fbdoc item="title" value="C Header Translation Tutorial"}}---- +How to translate C headers to ""FreeBASIC"" + +==Under Construction== + +{{fbdoc item="back" value="DevToc|FreeBASIC Developer Information"}} +{{fbdoc item="back" value="DocToc|Table of Contents"}} diff --git a/doc/manual/cache/DirectMedia.wakka b/doc/manual/cache/DirectMedia.wakka index 523602cf8c..8dc2d64858 100644 --- a/doc/manual/cache/DirectMedia.wakka +++ b/doc/manual/cache/DirectMedia.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + Simple DirectMedia Layer (SDL) is a library that creates an abstraction over various platforms' graphics, sound, and input APIs, allowing a developer to write a computer game or other multimedia application once and run it on GNU/Linux, Windows, Mac OS Classic, Mac OS X, BeOS and a few other unofficially ported platforms. It manages video, events, numeric audio, CD-ROM sound, threads, and timers. {{fbdoc item="see"}} diff --git a/doc/manual/cache/DocToc.wakka b/doc/manual/cache/DocToc.wakka index 07b1c5ffd2..ca892e28c3 100644 --- a/doc/manual/cache/DocToc.wakka +++ b/doc/manual/cache/DocToc.wakka @@ -74,6 +74,8 @@ {{fbdoc item="keyword" value="CompilerErrMsg|Compiler Error Messages"}} {{fbdoc item="keyword" value="CompilerTools|Tools used by fbc"}} + {{fbdoc item="keyword" value="CompilerTools|Tools used by fbc"}} + {{fbdoc item="keyword" value="CompilerInstallingGcc|Installing gcc for -gen gcc"}} {{fbdoc item="section" value="FreeBASIC dialects and QBASIC"}} diff --git a/doc/manual/cache/ExtLibTOC.wakka b/doc/manual/cache/ExtLibTOC.wakka index b48a24aee2..5b5fb8eb71 100644 --- a/doc/manual/cache/ExtLibTOC.wakka +++ b/doc/manual/cache/ExtLibTOC.wakka @@ -113,4 +113,5 @@ This is the list of external library bindings currently included in ""FreeBASIC" {{fbdoc item="keyword" value="ExtLibwindows|Windows API"}} {{fbdoc item="keyword" value="ExtLibX11|X11"}} - Windowing system commonly used on Linux systems -{{fbdoc item="back" value="DocToc|Table of Contents"}} \ No newline at end of file +{{fbdoc item="back" value="DocToc|Table of Contents"}} +{{fbdoc item="back" value="DevToc|FreeBASIC Developer Information"}} \ No newline at end of file diff --git a/doc/manual/cache/ExtLibfbsound.wakka b/doc/manual/cache/ExtLibfbsound.wakka index b46255b03e..1bcd40af83 100644 --- a/doc/manual/cache/ExtLibfbsound.wakka +++ b/doc/manual/cache/ExtLibfbsound.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + {{fbdoc item="title" value="FBSOUND"}}---- Free cross platform Sound and DSP Library. Written in FreeBASIC and optimized Assembly using SSE and MMX diff --git a/doc/manual/cache/ExtLibmini.wakka b/doc/manual/cache/ExtLibmini.wakka index a36bd8d1e7..f975d0d7a2 100644 --- a/doc/manual/cache/ExtLibmini.wakka +++ b/doc/manual/cache/ExtLibmini.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + {{fbdoc item="title" value="The Mini Library"}}---- The Mini Library is a real-time terrain rendering system diff --git a/doc/manual/cache/FBWikiCheck.wakka b/doc/manual/cache/FBWikiCheck.wakka deleted file mode 100644 index 6cc8b7f1e1..0000000000 --- a/doc/manual/cache/FBWikiCheck.wakka +++ /dev/null @@ -1,114 +0,0 @@ -chkdocs: 2008/07/25 16:55:55 -cache: ../fbdoc/cache/ - -Loaded 933 page names from 'PageIndex.txt' -scanning pages: - -Found 15296 links -Saved 15296 links to 'linklist.csv' -Saved 805 page names to 'DocPages.txt' -Saved 747 file names to 'samplist.log' - -Checking missing pages: -No missing pages - -Checking 'CatPgFullIndex': - Ignoring 'KeyPgOp*' pages -All keypages on 'CatPgFullIndex' - -Checking 'CatPgFunctIndex': - Ignoring 'KeyPgOp*' pages -All keypages on 'CatPgFunctIndex' - -Checking missing backlinks: - Ignoring missing backlinks to 'catpgfunctindex' - Ignoring missing backlinks to 'catpgfullindex' - Ignoring missing backlinks to 'catpggfx' - Ignoring missing backlinks to 'catpgopindex' - Ignoring missing backlinks to 'catpgcompopt' -'KeyPgMetaLang' does not have backlink to 'CatPgPreProcess' -Found 1 missing backlinks - -Checking invalid backlinks: -'DocToc' should be removed from 'FreeBASIC' -'DocToc' should be removed from 'CVSCompile' -'ExtLibTOC' should be removed from 'ExtLibfbsound' -'ExtLibTOC' should be removed from 'ExtLibmini' -'FBWiki' should be removed from 'TiGer' -Found 5 invalid backlinks - -Checking headers: -'TutHowToProgGame1' has invalid horzline -Found 1 invalid headers - -Checking mismatched name case in links: -No mismatched name case in links - -Checking pages not linked from any CatPg: -Found 0 not linked from any CatPg - -Checking pages with no back link: -'KeyPgClass' has no backlink -Found 1 pages with no backlink at all - -Checking PrintToc for missing pages: -Reading '../fbdoc/cache/PrintToc.wakka' -Missing 'AntoniGual' -Missing 'CatPgCompOpt' -Missing 'CatPgFullIndex' -Missing 'CatPgFunctIndex' -Missing 'CatPgGfx' -Missing 'CatPgOpArithmetic' -Missing 'CatPgOpAssignment' -Missing 'CatPgOpConditional' -Missing 'CatPgOperators' -Missing 'CatPgOpIndexing' -Missing 'CatPgOpIterating' -Missing 'CatPgOpLogical' -Missing 'CatPgOpMemory' -Missing 'CatPgOpPoint' -Missing 'CatPgOpPrepro' -Missing 'CatPgOpShortCircuit' -Missing 'CatPgOpString' -Missing 'CatPgOpTypeclass' -Missing 'CatPgProgrammer' -Missing 'DataType' -Missing 'DocToc' -Missing 'DrV' -Missing 'ExtLibTOC' -Missing 'FaqPgbloadworkaround' -Missing 'FaqPggetputstructure' -Missing 'FreeBASIC' -Missing 'GarvanOKeeffe' -Missing 'GfxLib' -Missing 'JeffMarshall' -Missing 'LaananFisher' -Missing 'LilloWiki' -Missing 'RandyKeeling' -Missing 'SirMud' -Missing 'SotSvart' -Missing 'SrcPgGfxNull' -Missing 'TutMathAngles' -Missing 'TutMathIntroTrig' -Missing 'Unicode' -Missing 'x86' -Found 39 missing pages - -Checking DOC pages with no title: -'AntoniGual' has no title -'DrV' has no title -'GarvanOKeeffe' has no title -'JeffMarshall' has no title -'LilloWiki' has no title -'RandyKeeling' has no title -'SotSvart' has no title -Found 7 DOC pages with no title - -Checking duplicate filenames: -No duplicate file names - -Checking Image References: -No references to missing image files - - -Execution time: 34 seconds. diff --git a/doc/manual/cache/FBWikiFaq.wakka b/doc/manual/cache/FBWikiFaq.wakka index 69d9616758..560c680880 100644 --- a/doc/manual/cache/FBWikiFaq.wakka +++ b/doc/manual/cache/FBWikiFaq.wakka @@ -36,7 +36,7 @@ {{anchor name="item4"}}==How do I add my tutorial to the community tutorials?== A tutorial might be a work that is already written or it might be a work in progress. In both cases you can add the tutorial as follows: - - Login into your Wiki account. Note: use same name and password as in the forum, you can't register into the Wiki, the Login/Register form is disabled for registering. + - Login into your Wiki account. ++Use same name and password as in the forum++. **Note: currently, Login/Register form is disabled** due to spam attacks in the past. To create an account for this wiki, visit [[https://www.freebasic.net/forum/viewtopic.php?f=9&t=25849|Wiki signups]] in the forum. - Go to the [[CommunityTutorials|Community Tutorials]] page - Edit the tutorials page and add a link to your tutorial in the appropriate section. If your tutorial does not fit in to any of the existing sections, add a new section. - Look at the links already on the tutorials page for examples of how your link should be added. @@ -47,7 +47,7 @@ - If the tutorial is a work in progress, please return to finish it. {{anchor name="item5"}}==What formatting style should I use on my tutorial?== - The overall style for your tutorial is up to you. There are no specific rules for how you //must// format it, but you may want to look at other tutorials of pages in the FreeBASIC manual for some ideas. The [[FormattingRules|formatting codes]] used are the same as any other page in the wiki. We only ask that all sample code be enclosed between tags where ##**""%""""%""( freebasic )**## is the starting tag and ##**""%""""%""**## is the ending tag so it is recognized by our document converters. + The overall style for your tutorial is up to you. There are no specific rules for how you //must// format it, but you may want to look at other tutorials of pages in the FreeBASIC manual for some ideas. The [[FBWikiFormatting|formatting codes]] used are the same as any other page in the wiki. We only ask that all sample code be enclosed between tags where ##**""%""""%""( freebasic )**## is the starting tag and ##**""%""""%""**## is the ending tag so it is recognized by our document converters. {{anchor name="item6"}}==Why haven't I been recognized for my contributions to the wiki?== There is no specific person keeping track of the contributions made to the documentation. diff --git a/doc/manual/cache/FBWikiFormatting.wakka b/doc/manual/cache/FBWikiFormatting.wakka index 1143247f5d..a9c7e41799 100644 --- a/doc/manual/cache/FBWikiFormatting.wakka +++ b/doc/manual/cache/FBWikiFormatting.wakka @@ -1,7 +1,7 @@ {{fbdoc item="title" value="FBWiki Formatting Codes"}}---- Describes the formatting codes to be used in this wiki. -This guideline describes the formatting codes that are allowed in the FBWiki. This is a subset of the markup codes supported by the on-line wikka engine. Because this wiki is also converted to other formats, like html and plan-text, only a few of markup codes can be used by the ""FreeBASIC"" documentation and manual generators. +This guideline describes the formatting codes that are allowed in the FBWiki. This is a subset of the markup codes supported by the on-line wikka engine. Because this wiki is also converted to other formats, like html and plain-text, only a few of markup codes can be used by the ""FreeBASIC"" documentation and manual generators. In all of the examples following, the markup line with the formatting codes is followed by the output. @@ -13,7 +13,7 @@ In all of the examples following, the markup line with the formatting codes is f You can also use double-quote escaping to avoid linking of ""CamelCase"" words - ##""""WikiWord"" is not parsed as a link""## + ##""""WikiWord"" is not parsed as a link""## ""WikiWord"" is not parsed as a link {{fbdoc item="section" value="Text Formatting"}} @@ -40,13 +40,13 @@ In all of the examples following, the markup line with the formatting codes is f {{fbdoc item="section" value="Headers"}} The wiki will recognize markup using two ##=## for the smallest header up to six ##=## for the largest. The ##fbdoc## manual generator treats all as the same size when converted. - ##==Header==## + ##""==""Header""==""## ==Header== Recommend using ##""{{fbdoc}}""## action for sections and subsections. See [[FBWikiFbdocAction|fbdoc action]]. page. {{fbdoc item="section" value="Horizontal Separator"}} - Creates a horizontal separator line across the page. + Creates a horizontal separator line across the page. On some displays, this line is very faint and difficult to see; but it is there. ##""----""## ---- @@ -105,7 +105,7 @@ In all of the examples following, the markup line with the formatting codes is f ##""[[https://www.freebasic.net|FreeBASIC Website]]""## [[https://www.freebasic.net|FreeBASIC Website]] - Link to a place on the same page using the ##{{anchor}}## action. Create an invisible anchor somewhere on the page with: + Link to a place on the same page using the ##""{{""anchor""}}""## action. Create an invisible anchor somewhere on the page with: ##""{{anchor name="item1"}}""##{{anchor name="item1"}} Then link to that anchor with: @@ -115,8 +115,8 @@ In all of the examples following, the markup line with the formatting codes is f {{fbdoc item="section" value="Tables"}} The ""{{table}}"" action is recognized by the document generators, using the following format. - ##""{{table columns="5" cellpadding="2" cells="A;B;A and B;A or B;0;0;0;0;0;1;0;1;1;0;0;1;1;1;1;1"}}""## - {{table columns="5" cellpadding="2" cells="A;B;A and B;A or B;0;0;0;0;0;1;0;1;1;0;0;1;1;1;1;1"}} + ##""{{table columns="4" cellpadding="2" cells="A;B;A and B;A or B;0;0;0;0;0;1;0;1;1;0;0;1;1;1;1;1"}}""## + {{table columns="4" cellpadding="2" cells="A;B;A and B;A or B;0;0;0;0;0;1;0;1;1;0;0;1;1;1;1;1"}} {{fbdoc item="section" value="Left and Right Columns of Text"}} diff --git a/doc/manual/cache/FBWikiKeywordTemplate.wakka b/doc/manual/cache/FBWikiKeywordTemplate.wakka index 3388d3c48b..4fbf146f9e 100644 --- a/doc/manual/cache/FBWikiKeywordTemplate.wakka +++ b/doc/manual/cache/FBWikiKeywordTemplate.wakka @@ -1,8 +1,8 @@ {{fbdoc item="title" value="Keyword Template"}}---- -Keyword template. +Keyword template - short description of the keyword goes here. {{fbdoc item="syntax"}}## - [[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **""MyFunction""**( //param1// [[KeyPgAs|as]] [[KeyPgString|string]], //param2// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = &H1234 ) [[KeyPgAs|as]] [[KeyPgInteger|integer]] + [[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **""MyFunction""**( [[KeyPgByval|byval]] //param1// [[KeyPgAs|as]] [[KeyPgString|string]], //param2// [[KeyPgAs|as]] [[KeyPgInteger|integer]] = &H1234 ) [[KeyPgAs|as]] [[KeyPgInteger|integer]] ## {{fbdoc item="usage"}}## //result// = **""MyFunction""**( //param1// [, //param2// ] ) @@ -14,13 +14,18 @@ Keyword template. Parameter description. {{fbdoc item="ret"}} - Returns a value of zero (0) if successful, and a non-zero error code on failure. + Description of the return value (if any), eg: Returns a value of zero (0) if successful, and a non-zero error code on failure. {{fbdoc item="desc"}} This topic can be copied and pasted in to a newly created keyword. + + A lengthy description of the keyword + + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. {{fbdoc item="ex"}} -{{fbdoc item="filename" value="examples/manual/check/FBWikiKeywordTemplate_1.bas"}}%%(freebasic) +Examples go here. To include the example in the examples/manual folder, markup each code example with ""{{fbdoc item="filename" ...}}"" action. +""{{fbdoc item="filename" value="examples/manual/check/MyFunction.bas"}}""%%(freebasic) '' sample code '' sample code '' sample code @@ -34,15 +39,19 @@ sample output %% {{fbdoc item="lang"}} + - List of the differences in each dialect, e.g: + - Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__MyFunction""**##. - Supported only with //[[CompilerOptlang|-lang fb]]//. {{fbdoc item="target"}} - - None + - List of platform-specific differences {{fbdoc item="diff"}} + - List of differences from QBASIC, e.g: - New to ""FreeBASIC"" {{fbdoc item="see"}} + - List of other related keywords - ##[[FBWikiKeywordTemplate|Keyword Template]]## {{fbdoc item="back" value="FBWikiHelp|FB Wiki - Help"}} \ No newline at end of file diff --git a/doc/manual/cache/FBWikiPageNames.wakka b/doc/manual/cache/FBWikiPageNames.wakka index cdf9ed5344..cd4748d64b 100644 --- a/doc/manual/cache/FBWikiPageNames.wakka +++ b/doc/manual/cache/FBWikiPageNames.wakka @@ -10,8 +10,11 @@ Most page name prefixes have been chosen to help the document converters to proc [[DocToc|DocToc]] - ""FreeBASIC Manual"" - Table of Contents Any page that is reachable through the links on this page is considered to be part of the ""FreeBASIC"" Manual and will be included in the downloadable versions of the documentation. + [[DevToc|DevToc]] - ""FreeBASIC Developer"" - Table of Contents + Table of contents for topics related to developing ""FreeBASIC"" itself and compiler internals. Developer pages linked from this page are part of the ""FreeBASIC"" Manual in some converted formats, otherwise are available only online. + [[CommunityTutorials|CommunityTutorials]] - Community Tutorials - Main page for community submitted tutorials. These pages are not part of the ""FreeBASIC"" Manual and are available only online. + Main page for community submitted tutorials. Tutorial pages linked from this page are part of the ""FreeBASIC"" Manual in some converted formats, otherwise are available only online. [[FBWikiHelp|FBWikiHelp]] - FB Wiki - Help The "help on help" starting point for the online documentation. @@ -28,13 +31,14 @@ Most page name prefixes have been chosen to help the document converters to proc ==Programmer's Guide Pages== Page names that begin with **""ProPg""** indicate a page that is part of the [[CatPgProgrammer|Programmer's Guide]]. These page names have special meaning to the document converters when automatically building a full table of contents and applying styles. +==Developer Pages== + Page names that begin with **""Dev""** are reserved for developer pages, that document topics such as compiling ""FreeBASIC"" from sources and compiler internals. + ==Tutorial Pages== Page names that begin with **""Tut""** are reserved for tutorial pages linked from [[CommunityTutorials|Community Tutorials]]. The first letter of each word in the name of the tutorial will be capitalized e.g. **""TutHelloWorld""** ==Other Page Prefixes== - **""Compiler*""** pages - reserved for pages that document the compiler itself (for example command line options). - - **""SVN*""** pages - reserved for instructions on compiling the compiler and runtime library from sources. - - **""Dev*""** pages - reserved for pages that document the internals of the ""FreeBASIC"" compiler and runtime libraries. Starting point: [[DevToc|DevToc]] - **""Faq*""** pages - reserved for pages that provide answers to a list of Frequently Asked Questions. - **""KeyPgPp*""** pages - like a **""KeyPg*""** page except reserved for preprocessor directives. e.g. [[KeyPgPpdefine|KeyPgPpdefine]] - **""SrcPg*""** pages - a source example. diff --git a/doc/manual/cache/FBWikiTopicSample.wakka b/doc/manual/cache/FBWikiTopicSample.wakka index 67cb874fe5..6da5a2c242 100644 --- a/doc/manual/cache/FBWikiTopicSample.wakka +++ b/doc/manual/cache/FBWikiTopicSample.wakka @@ -57,7 +57,6 @@ Brief sentence describing intent of function. {{fbdoc item="usage"}}## //result// = **Function**( //param1// [, //param2// ] ) ## - {{fbdoc item="param"}} ##//param1//## A description of parameter. Format of parameter is ##//monospaced italic//## with one indent. Description of parameter is normal text with two indents. @@ -100,7 +99,7 @@ sample output {{fbdoc item="lang"}} - Only available in the //[[CompilerOptlang|-lang fb]]// dialect. - - In the ////[[CompilerOptlang|-lang qb]]// dialect, ... + - In the //[[CompilerOptlang|-lang qb]]// dialect, ... - etc {{fbdoc item="target"}} diff --git a/doc/manual/cache/FormattingRules.wakka b/doc/manual/cache/FormattingRules.wakka new file mode 100644 index 0000000000..15aeb8e898 --- /dev/null +++ b/doc/manual/cache/FormattingRules.wakka @@ -0,0 +1,276 @@ +!!! DELETE ME !!! + + +======Wikka Formatting Guide======---<<===General Guidelines===If a markup sequence is not in these guidelines, then it is not officially supported. Use caution when implementing markup that is not officially supported by this document, as undocumented functionality may change with version updates.--- ---Unless otherwise stated in these guidelines, all markup is line based, that is, a newline character should not intervene. These are identified as 'inline' markup.<<::c::---===Escaping Markup===---Anything between 2 sets of double-quotes is not formatted. +This is the equivalent of escaping a character(s):--- ---<< +~##""**two bold ""**"" stars**""## + +~**two bold ""**"" stars** +<~~This text is double-indented
    This text is also indented""## <<::c::<< +~This text is indented +~~This text is double-indented +~This text is also indented +<<::c::---To create bulleted/ordered lists, use the following markup (you can always use 4 spaces instead of a tilde):--- ---**Bulleted lists**---<< +##""~- Line one""## +##""~- Line two""## +<<::c::<< +~- Line one +~- Line two +<<::c::---**Numbered lists**---<< +##""~1) Line one""## +##""~1) Line two""## +<<::c::<< +~1) Line one +~1) Line two +<<::c::---**Ordered lists using uppercase characters**---<< +##""~A) Line one""## +##""~A) Line two""## +<<::c::<< +~A) Line one +~A) Line two +<<::c::---**Ordered lists using lowercase characters**---<< +##""~a) Line one""## +##""~a) Line two""## +<<::c::<< +~a) Line one +~a) Line two +<<::c::---**Ordered lists using uppercase Roman numerals**---<< +##""~I) Line one""## +##""~I) Line two""## +<<::c::<< +~I) Line one +~I) Line two +<<::c::---**Ordered lists using lowercase Roman numerals**---<< +##""~i) Line one""## +##""~i) Line two""## +<<::c::<< +~i) Line one +~i) Line two +<<::c::---===6. Inline comments===---To format some text as an inline comment, use an indent (tilde, tab, or four spaces) followed by a **""&""**.--- ---<< +##""~& Comment""## +##""~~& Subcomment""## +##""~~~& Subsubcomment""## +<<::c::<< +~& Comment +~~& Subcomment +~~~& Subsubcomment +<<::c::--- ---===7. Images===---To place images on a Wiki page, you can use the ##image## action.--- ---Image links can be external or internal Wiki links. You don't need to enter a link at all, and in that case just an image will be inserted. You can use the optional classes ##left## and ##right## to float images left and right. You don't need to use all those attributes, only ##url## is required while ##alt## is recommended for +accessibility.--- ---<< +~##""{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif" link="RecentChanges"}}""## +--- +~{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif" link="RecentChanges"}} +<<::c::---===8. Links===---To create a ** link to a wiki page ** you can use any of the +following options:--- --- +~- Type a ##""WikiName""## (works only for page names with no whitespace): --- --- ##""FormattingRules""## --- FormattingRules --- --- +--- +~- Add a forced link surrounding the page name by ##""[[""## and ##""]]""## (everything after the | will be shown as description): --- --- ##""[[SandBox|Test +your formatting skills]]""## --- [[SandBox|Test your formatting skills]] --- --- ##""[[SandBox|沙箱]]""## --- [[SandBox|沙箱]] --- --- +--- +~- Add an image with a link (see instructions above) +--- ---To ** link to external pages **, you can do any of the following:--- --- +~- Type a URL inside the page: --- --- ##""http://blog.wikkawiki.org""## --- http://blog.wikkawiki.org --- --- +--- +~- Add a forced link surrounding the URL by ##""[[""## and ##""]]""## (everything after the | will be shown as description): --- --- ##""[[http://docs.wikkawiki.org|Wikka documentation]]""## --- [[http://docs.wikkawiki.org|Wikka documentation]] --- --- ##""[[community@wikkawiki.org|Wikka community list]]""## --- [[community@wikkawiki.org|Wikka community list]] --- --- +--- +~- Add an image with a link (see instructions above) +--- +~- Add an interwiki link ([[InterWiki browse the list of available interwiki tags]]): --- --- ##""WikiPedia:WikkaWiki""## --- WikiPedia:WikkaWiki --- --- ##""Google:CSS""## --- Google:CSS --- --- ##""Thesaurus:Happy""## --- Thesaurus:Happy --- --- +--- ---===9. Tables===---<## characters before and after the block.--- ---**Example:**--- --- +~##"">> Some text in a right-floated box hanging around. >> Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler.""##--- --->> Some text in a right-floated box hanging around. >> Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. +::c:: +** Note: Use ##""::c::""## to clear floated blocks. **--- ---===12. Code formatters===---You can easily embed code blocks in a wiki page using a simple markup. Anything within a code block is displayed literally. To create a ** generic code block ** you can use the following markup:--- --- +~##""%% This is a code block %%""##. + +%% This is a code block %% +---To create a ** code block with syntax highlighting **, you need to specify a // code formatter // (see below for a list of available code formatters).--- --- +~##""%%(""{{color c="red" text="php"}}"")
echo "Hello, World!";
?>
%%""## +--- +%%(php) + +%% +--- ---You can also specify an optional // starting line // number.--- +~##""%%(php;""{{color c="red" text="15"}}"")
echo "Hello, World!";
?>
%%""## +--- +%%(php;15) + +%% +--- ---If you specify a // filename //, this will be used for downloading the code.--- +~##""%%(php;15;""{{color c="red" text="test.php"}}"")
echo "Hello, World!";
?>
%%""## +--- +%%(php;15;test.php) + +%% +--- --- +|?|List of available code formatters|| +|| +|=|Language|=|Formatter|=|Language|=|Formatter|=|Language|=|Formatter|| +|#| +|=|Actionscript||##actionscript##|=|ABAP||##abap##|=|ADA||##ada##|| +|=|Apache Log||##apache##|=|""AppleScript""||##applescript##|=|ASM||##asm##|| +|=|ASP||##asp##|=|""AutoIT""||##autoit##|=|Bash||##bash##|| +|=|""BlitzBasic""||##blitzbasic##|=|""Basic4GL""||##basic4gl##|=|bnf||##bnf##|| +|=|C||##c##|=|C for Macs||##c_mac##|=|C#||##csharp##|| +|=|C""++""||##cpp##|=|C""++"" (+QT)||##cpp-qt##|=|CAD DCL||##caddcl##|| +|=|""CadLisp""||##cadlisp##|=|CFDG||##cfdg##|=|""ColdFusion""||##cfm##|| +|=|CSS||##css##|=|D||##d##|=|Delphi||##delphi##|| +|=|Diff-Output||##diff##|=|DIV||##div##|=|DOS||##dos##|| +|=|Dot||##dot##|=|Eiffel||##eiffel##|=|Fortran||##fortran##|| +|=|""FreeBasic""||##freebasic##|=|FOURJ's Genero 4GL||##genero##|=|GML||##gml##|| +|=|Groovy||##groovy##|=|Haskell||##haskell##|=|HTML||##html4strict##|| +|=|INI||##ini##|=|Inno Script||##inno##|=|Io||##io##|| +|=|Java 5||##java5##|=|Java||##java##|=|Javascript||##javascript##|| +|=|""LaTeX""||##latex##|=|Lisp||##lisp##|=|Lua||##lua##|| +|=|Matlab||##matlab##|=|mIRC Scripting||##mirc##|=|Microchip Assembler||##mpasm##|| +|=|Microsoft Registry||##reg##|=|Motorola 68k Assembler||##m68k##|=|""MySQL""||##mysql##|| +|=|NSIS||##nsis##|=|Objective C||##objc##|=|""OpenOffice"" BASIC||##oobas##|| +|=|Objective Caml||##ocaml##|=|Objective Caml (brief)||##ocaml-brief##|=|Oracle 8||##oracle8##|| +|=|Pascal||##pascal##|=|Per (FOURJ's Genero 4GL)||##per##|=|Perl||##perl##|| +|=|PHP||##php##|=|PHP (brief)||##php-brief##|=|PL/SQL||##plsql##|| +|=|Python||##phyton##|=|Q(uick)BASIC||##qbasic##|=|robots.txt||##robots##|| +|=|Ruby on Rails||##rails##|=|Ruby||##ruby##|=|SAS||##sas##|| +|=|Scheme||##scheme##|=|sdlBasic||##sdlbasic##|=|Smarty||##smarty##|| +|=|SQL||##sql##|=|TCL/iTCL||##tcl##|=|T-SQL||##tsql##|| +|=|Text||##text##|=|thinBasic||##thinbasic##|=|Unoidl||##idl##|| +|=|VB.NET||##vbnet##|=|VHDL||##vhdl##|=|Visual BASIC||##vb##|| +|=|Visual Fox Pro||##visualfoxpro##|=|""WinBatch""||##winbatch##|=|XML||##xml##|| +|=|X""++""||##xpp##|=|""ZiLOG"" Z80 Assembler||##z80##|=| || +--- ---===13. Mindmaps===---Wikka has native support for [[Wikka:FreeMind|mindmaps]]. There are two options for embedding a mindmap in a wiki page.--- --- **Option 1:** Upload a ""FreeMind"" file to a webserver, and then place a link to it on a wikka page: ##""http://yourdomain.com/freemind/freemind.mm""## No special formatting is necessary. --- ---**Option 2:** Paste the ""FreeMind"" data directly into a wikka page: + +~-Open a ""FreeMind"" file with a text editor. +~-Select all, and copy the data. +~-Browse to your Wikka site and paste the Freemind data into a page. +::c:: +---===14. Embedded HTML===---You can easily paste HTML in a wiki page by wrapping it into two sets of doublequotes.--- --- +~##""[html code]""## +<< +~##""y = xn+1""## +~""y = xn+1"" +<<::c::<< +~##""CSS""## +~""CSS"" +<<::c::---By default, some HTML tags are removed by the ""SafeHTML"" parser to protect against potentially dangerous code. The list of tags that are stripped can be found on the Wikka:SafeHTML page.--- ---It is possible to allow // all // HTML tags to be used, see Wikka:UsingHTML for more information.--- --- ----CategoryWiki \ No newline at end of file diff --git a/doc/manual/cache/GD.wakka b/doc/manual/cache/GD.wakka index 368672e762..119b206232 100644 --- a/doc/manual/cache/GD.wakka +++ b/doc/manual/cache/GD.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + GD is a graphics library for dynamically manipulating images. It can create GIFs, JPEGs, PNGs, and WBMPs. GD can create images composed of lines, arcs, text (using program-selected fonts), other images, and multiple colors. Version 2.0 adds support for truecolor images, alpha channels, resampling (for smooth resizing of truecolor images), and many other features. diff --git a/doc/manual/cache/GFXLib2.wakka b/doc/manual/cache/GFXLib2.wakka index 1724b1c212..f40f164c98 100644 --- a/doc/manual/cache/GFXLib2.wakka +++ b/doc/manual/cache/GFXLib2.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + {{fbdoc item="title" value="GfxLib2"}}---- {{delete}} [[GfxLib]] is the built-in graphics library included in ""FreeBASIC"". As well as re-creating every ""QuickBASIC"" graphics command, ""GfxLib"" has built-in commands to handle input from the keyboard and mouse. diff --git a/doc/manual/cache/GfxInternalFormats.wakka b/doc/manual/cache/GfxInternalFormats.wakka index a0566aa2cc..dd4ec875d3 100644 --- a/doc/manual/cache/GfxInternalFormats.wakka +++ b/doc/manual/cache/GfxInternalFormats.wakka @@ -1,4 +1,5 @@ {{fbdoc item="title" value="Internal graphics formats"}}---- +Information on the internal formats used by ""FreeBASIC"" to represent graphics. **Pixel formats** diff --git a/doc/manual/cache/GfxLib.wakka b/doc/manual/cache/GfxLib.wakka index 3502a50c08..e9fed0ec73 100644 --- a/doc/manual/cache/GfxLib.wakka +++ b/doc/manual/cache/GfxLib.wakka @@ -1,6 +1,5 @@ {{fbdoc item="title" value="GfxLib - FreeBASIC graphics library overview"}}---- - -""GfxLib"" is the built-in graphics library included in ""FreeBASIC"". As well as re-creating every ""QuickBASIC"" graphics command, ""GfxLib"" has built-in commands to handle input from the keyboard and mouse. Major contributors of the library are Lillo, ""CoderJeff"" and ""DrV"". +The libary named ""GfxLib"" is the built-in graphics library included in ""FreeBASIC"". As well as re-creating every ""QuickBASIC"" graphics command, ""GfxLib"" has built-in commands to handle input from the keyboard and mouse. Major contributors of the library are Lillo, ""coderJeff"" and ""DrV"". The library supports various drivers depending on the platform: diff --git a/doc/manual/cache/KeyPgAny.wakka b/doc/manual/cache/KeyPgAny.wakka index 79707de3f9..3aff8607bc 100644 --- a/doc/manual/cache/KeyPgAny.wakka +++ b/doc/manual/cache/KeyPgAny.wakka @@ -1,5 +1,5 @@ {{fbdoc item="title" value="ANY"}}---- -##**Any**## is used as a placeholder for a type or value in various ways. +The ##**Any**## keyword is used as a placeholder for a type or value in various ways. {{fbdoc item="syntax"}}## [[KeyPgDim|Dim]] //identifier// [[KeyPgAs|As]] **Any** [[KeyPgPointer|Pointer]]|[[KeyPgPtr|Ptr]] diff --git a/doc/manual/cache/KeyPgOverride.wakka b/doc/manual/cache/KeyPgOverride.wakka index 90e1385da3..59d681f804 100644 --- a/doc/manual/cache/KeyPgOverride.wakka +++ b/doc/manual/cache/KeyPgOverride.wakka @@ -50,4 +50,4 @@ End Function {{fbdoc item="see"}} - ##[[KeyPgVirtual|Virtual]]##, ##[[KeyPgAbstract|Abstract]]## -{{fbdoc item="back" value="CatPgProcedures|Procedures"}}{{fbdoc item="back" value="CatPgUserDefTypes|User Defined Types"}} \ No newline at end of file +{{fbdoc item="back" value="CatPgUserDefTypes|User Defined Types"}} \ No newline at end of file diff --git a/doc/manual/cache/KeyPgRedim.wakka b/doc/manual/cache/KeyPgRedim.wakka index bec9ff4dc8..9b4859ad01 100644 --- a/doc/manual/cache/KeyPgRedim.wakka +++ b/doc/manual/cache/KeyPgRedim.wakka @@ -28,9 +28,9 @@ Defines or resizes a variable-length array **NOTES**: - ##**Redim** [[KeyPgPreserve|Preserve]]## may not work as expected in all cases: - ##[[KeyPgPreserve|Preserve]]##'s current behavior is to keep the original data contiguous in memory, and only expand or truncate the size of the memory (if resizing is not possible, the whole original data block is first shifted to another memory location). - Its behavior (with a single dimension) is well-defined only when the upper bound is changed. If the lower bound is changed, the current result is that the data is in effect shifted to start at the new lower bound. - With multiple dimensions, only the upper bound of only the first dimension may be safely increased. If the first dimension is reduced, the existing mappable data may be lost. If lower-order dimensions are resized at all, the effects can be hard to predict (because multidimensional arrays are stored in row-major order : values differing only in the last index are contiguous). + - ##[[KeyPgPreserve|Preserve]]##'s current behavior is to keep the original data contiguous in memory, and only expand or truncate the size of the memory (if resizing is not possible, the whole original data block is first shifted to another memory location). + - Its behavior (with a single dimension) is well-defined only when the upper bound is changed. If the lower bound is changed, the current result is that the data is in effect shifted to start at the new lower bound. + - With multiple dimensions, only the upper bound of only the first dimension may be safely increased. If the first dimension is reduced, the existing mappable data may be lost. If lower-order dimensions are resized at all, the effects can be hard to predict (because multidimensional arrays are stored in row-major order : values differing only in the last index are contiguous). - ##**Redim**## cannot be used on fixed-size arrays - i.e. arrays with constant bounds made with ##[[KeyPgDim|Dim]]##. This includes the fixed-size arrays contained in UDTs (user-defined ##[[KeyPgType|Type]]##s). This also includes fixed-length arrays passed as parameters in a function. ""FreeBASIC"" cannot prevent you trying this at compile-time, but the results at run-time will be undefined. - Using ##**Redim**## within a member procedure with an array that contains the instance of the object class is undefined, and will [hopefully] result in horrible crashes (if array data are shifted in memory, the ##[[KeyPgThis|This]]## reference becomes incoherent, similarly to a dangling pointer). - For use of ##**Redim**## (resizing) with a complex expression, (especially if the array expression itself contains parentheses), the array expression must be enclosed in parentheses in order to solve the parsing ambiguity. diff --git a/doc/manual/cache/ProPgProfiling.wakka b/doc/manual/cache/ProPgProfiling.wakka index db526ad0d1..acc92d47a1 100644 --- a/doc/manual/cache/ProPgProfiling.wakka +++ b/doc/manual/cache/ProPgProfiling.wakka @@ -64,4 +64,5 @@ gprof program[.exe] --brief --flat-profile > profile.txt The details may vary from one port of ""FreeBASIC"" to the next, but source code built for profiling with ""FreeBASIC"" should be compatible with other languages also supporting GPROF. -{{fbdoc item="back" value="CatPgProgrammer|Programmer's Guide"}} \ No newline at end of file +{{fbdoc item="back" value="CatPgProgrammer|Programmer's Guide"}} +{{fbdoc item="back" value="DevToc|FreeBASIC Developer Information"}} \ No newline at end of file diff --git a/doc/manual/cache/SirMud.wakka b/doc/manual/cache/SirMud.wakka index 1d3ad5134c..f1cb731c82 100644 --- a/doc/manual/cache/SirMud.wakka +++ b/doc/manual/cache/SirMud.wakka @@ -13,13 +13,13 @@ I am SirMud or sir_mud on the forums/irc. - Extended String Input Routine Simple Object for various input needs. See code in this topic: [[http://www.freebasic.net/forum/viewtopic.php?t=6574|http://www.freebasic.net/forum/viewtopic.php?t=6574]] First code post will work with all version of freebasic > .15, last post by me is designed for the new OO like features present in .17 and higher. - FreeBASIC Extended Library [[http://code.google.com/p/fb-extended-lib/]] - Extended runtime library providing many features. Project is open-source and ran by me, Stylin, DrD and MindlessXD + Extended runtime library providing many features. Project is open-source and ran by me, Stylin, ""DrD"" and ""MindlessXD"" - Dr Mudball's Laboratory: Rise of the Bustrons! [[http://drmudball.googlepages.com/index.html]] - Simple yet addicting Arcade / Puzzle style game written by DrD and myself. + Simple yet addicting Arcade / Puzzle style game written by ""DrD"" and myself. {{fbdoc item="section" value="Contact Info"}} You can usually find me in the IRC room #freebasic on the FreeNode network. You can also instant message me on Yahoo! at ima(nospace)dirty(nospace)pr0n(nospace)bot You can also email me here: ebben[dot]feagan[at]g[removethis]mail[dot]com -Note: FB linux deb package and FBoTG were removed since I haven't updated them in quite some time. \ No newline at end of file +Note: FB linux deb package and ""FBoTG"" were removed since I haven't updated them in quite some time. \ No newline at end of file diff --git a/doc/manual/cache/TableMarkup.wakka b/doc/manual/cache/TableMarkup.wakka new file mode 100644 index 0000000000..7ba3c03ef6 --- /dev/null +++ b/doc/manual/cache/TableMarkup.wakka @@ -0,0 +1,395 @@ +!!! DELETE ME !!! + +=====Wikka Table Markup Guide===== +>>==See also:== +~-For earlier Wikka versions, check the [[Docs:TableActionInfo table]] action +~-Updated versions of this page can be found on the [[Docs:TableMarkup Wikka documentation server]] +~-For a more formal description, check this server's TableMarkupReference page. +>> +As of ##1.2##, Wikka introduces a flexible markup for data tables. Any kind of tables allowed by XHTML can be created using this markup, from the most basic examples (e.g. simple rows of cells) to complex tables with full support for accessibility options.::c:: + +====1. Table basics: cells, rows, columns==== + +The most basic element of a table is a **cell**. Single cells can be created using the standard delimiter ##""||""##, e.g.: + +##""||Hello||""## + +||Hello|| + +Note that a cell must always be open and closed by delimiters. + +**Rows** can be created by adding on the same line multiple cells: + +##""||Cell 1||Cell 2||Cell 3||""## + +||Cell 1||Cell 2||Cell 3|| + +**Columns** can be created by adding rows on separate lines: + +##""||Cell 1||""## +##""||Cell 2||""## +##""||Cell 3||""## + +||Cell 1|| +||Cell 2|| +||Cell 3|| + +By now you should be able to create simple tables with **multiple rows and columns**. + +##""||Cell 1||Cell 2||Cell 3||""## +##""||Cell 4||Cell 5||Cell 6||""## +##""||Cell 7||Cell 8||Cell 9||""## + +||Cell 1||Cell 2||Cell 3|| +||Cell 4||Cell 5||Cell 6|| +||Cell 7||Cell 8||Cell 9|| + +====2. Headings==== + +As soon as you create slightly more complex data tables, you will need to specify column and row **headings**. Headings are special cells that specify what kind of data rows and columns contain. The most basic way of creating a heading is by using ##""|=|""## as a delimiter. + +The following is an example of a simple table with **column headings**: + +##""|=|Apples|=|Pears|=|""## +##""||300Kg||480Kg||""## + +|=|Apples|=|Pears|=| +||300Kg||480Kg|| + +**Row headings** are created in the same way. Since they are usually followed by normal cells, they must be terminated with the ##""||""## standard delimiter if the next element in the row is a simple cell: + +##""|=|Apples||300Kg||""## +##""|=|Pears||480Kg||""## + +|=|Apples||300Kg|| +|=|Pears||480Kg|| + +You should be able by now to create simple tables with row and column headings: + +##""|=| |=|Apples|=|Pears|=|""## +##""|=|Mary||300Kg||320Kg||""## +##""|=|John||400Kg||630Kg||""## + +|=| |=|Apples|=|Pears|=| +|=|Mary||300Kg||320Kg|| +|=|John||400Kg||630Kg|| + +We will describe later how to add accessibility parameters for row and column headings. + +====3. Captions==== + +Usually tables are introduced with a caption that describes what the table contains. A caption element is introduced with a ##""|?|""## delimiter and terminated with a standard delimiter ##""||""##. + +##""|?|Fruit production in 2006||""## +##""|=| |=|Apples|=|Pears|=|""## +##""|=|Mary||300Kg||320Kg||""## +##""|=|John||400Kg||630Kg||""## + +|?|Fruit production in 2006|| +|=| |=|Apples|=|Pears|=| +|=|Mary||300Kg||320Kg|| +|=|John||400Kg||630Kg|| + +====4. Spans==== + +**Spans** are used to combine multiple cells or multiple headings vertically or horizontally and are created using the following [[TableMarkupReference attribute parameters]]: + +##""||""(''span options'')Element content""||""## + +A **cell spanning multiple columns** is generated by prefixing the cell content with a ##(x:''n'')## parameter, where ##''n''## is the number of columns to be spanned. The following example shows how to create a cell spanning two columns: + +##""||(x:2)Cell spanning 2 columns||Cell 3||""## +##""||Cell 4||Cell 5||Cell 6||""## +##""||Cell 7||Cell 8||Cell 9||""## + +||(x:2)Cell spanning 2 columns||Cell 3|| +||Cell 4||Cell 5||Cell 6|| +||Cell 7||Cell 8||Cell 9|| + +Spans can also be applied to rows. A **cell spanning multiple rows** is generated by prefixing the cell content with a ##(y:''n'')## parameter, where ##''n''## is the number of rows to be spanned. The following example shows how to create a cell spanning two rows: + +##""||(y:2)Cell spanning 2 rows||Cell 2||Cell 3||""## +##""||Cell 5||Cell 6||""## +##""||Cell 7||Cell 8||Cell 9||""## + +||(y:2)Cell spanning 2 rows||Cell 2||Cell 3|| +||Cell 5||Cell 6|| +||Cell 7||Cell 8||Cell 9|| + +Spans are particularly useful to create **subheadings**: + +##""|?|Fruit production in the last two years||""## +##""|=| |=|(x:2)Apples|=|(x:2)Pears|=|""## +##""|=| |=|2005|=|2006|=|2005|=|2006|=|""## +##""|=|Mary||300Kg||320Kg||400kg||280Kg||""## +##""|=|John||400Kg||630Kg||210Kg||300Kg||""## + +|?|Fruit production in the last two years|| +|=| |=|(x:2)Apples|=|(x:2)Pears|=| +|=| |=|2005|=|2006|=|2005|=|2006|=| +|=|Mary||300Kg||320Kg||400kg||280Kg|| +|=|John||400Kg||630Kg||210Kg||300Kg|| + +Column and row spans can be combined to created funky table layouts: + +##""||(x:2;y:2)2x2||(x:2)2x1||(y:2)1x2||""## +##""||(y:2)1x2||1x1||""## +##""||1x1||1x1||(x:2)2x1||""## + +||(x:2;y:2)2x2||(x:2)2x1||(y:2)1x2|| +||(y:2)1x2||1x1|| +||1x1||1x1||(x:2)2x1|| + + +====5. Formatting text within tables==== + +You can use any kind of basic [[Docs:TextFormatting Wikka markup]] to render text within tables. +The following example adds basic formatting to cell content: + +##""|?|Using text formatting within tables||""## +##""||##Monospaced##||//Italics//||**Bold**||__Underlined__||""## +##""||''Highlighted''||++Strikethrough++||(x:2)**//Bold italics//**||""## + +|?|Using text formatting within tables|| +||##Monospaced##||//Italics//||**Bold**||__Underlined__|| +||''Highlighted''||++Strikethrough++||(x:2)**//Bold italics//**|| + +====6. Adding actions and images within tables==== + +Simple, content-generating [[Docs:UsingActions actions]] (including [[Docs:AddingImages images]]) can be added within table cells and headings. + +##""|?|Using actions within tables||""## +##""||This wiki contains {{countpages}} pages||""## +##""||{{image url="images/wikka_logo.jpg" class="center" alt="a w" title="w image"}}||""## +##""||{{color c="red" text="some colored text"}}||""## + +|?|Using actions within tables|| +||This wiki contains {{countpages}} pages|| +||{{image url="images/wikka_logo.jpg" class="center" alt="a w" title="w image"}}|| +||{{color c="red" text="some colored text"}}|| + +====7. Adding links within tables==== + +All the available options to create [[Docs:AddingLinks links]] can be used within table cells or headings: + +##""|?|Adding links within tables||""## +##""||Camelcase links: SandBox||""## +##""||Escaped camelcase links: ""SandBox"" escaped||""## +##""||Forced links: [[HomePage main]]||""## +##""||Interwiki links: Wikipedia:Wikka||""## +##""||Forced interwiki links: [[Wikipedia:Wikka Wikka article on Wikipedia]]||""## +##""||External links: http://www.example.com ||""## +##""||Forced external links: [[http://www.example.com Example.com]]||""## +##""||Image links: {{image url="images/wizard.gif" alt="wizard" title="Display an index of pages on this wiki" link="PageIndex"}}||""## + +|?|Adding links within tables|| +||Camelcase links: SandBox|| +||Escaped camelcase links: ""SandBox escaped""|| +||Forced links: [[HomePage main]]|| +||Interwiki links: Wikipedia:Wikka|| +||Forced interwiki links: [[Wikipedia:Wikka Wikka article on Wikipedia]]|| +||External links: http://www.example.com || +||Forced external links: [[http://www.example.com Example.com]]|| +||Image links: {{image url="images/wizard.gif" alt="wizard" title="Display an index of pages on this wiki" link="PageIndex"}}|| + +====8. Adding HTML within tables==== + +You can also use [[Docs:UsingHTML embedded HTML]] in table elements: + +##""|?|Embedding HTML within tables||""## +##""||Here's some superscript: ""a2+1""||""## +##""||And here's some subscript too: ""a2k""||""## +##""||I love acronyms: ""WYSIWYG""||""## + +|?|Embedding HTML within tables|| +||Here's some superscript: ""a2+1""|| +||And here's some subscript too: ""a2k""|| +||I love acronyms: ""WYSIWYG""|| + +====9. Adding a touch of style==== + +The table markup introduces a new [[TableMarkupReference style selector]]. CSS style options can be added to any element by enclosing them within **single braces**, right before the element content, e.g.: +##""||""{''style options''}Element content""||""## + +For example, to render a cell with **red background** and **white text color**, you can do the following: + +##""||{background-color:red; color:white}Hello||""## + +||{background-color:red; color:white}Hello|| + +You can play with **font size** and **text alignment**: + +##""|?|Adding some more style||""## +##""||{font-size:190%; text-align:right}Please scale me!||""## +##""||{font-size:170%; text-align:right}Please scale me!||""## +##""||{font-size:150%; text-align:right}Please scale me!||""## +##""||{font-size:130%; text-align:right}Please scale me!||""## +##""||{font-size:110%; text-align:right}Please scale me!||""## +##""||{font-size:90%; text-align:right}Please scale me!||""## +##""||{font-size:70%; text-align:right}Please scale me!||""## + +|?|Adding some more style|| +||{font-size:190%; text-align:right}Please scale me!|| +||{font-size:170%; text-align:right}Please scale me!|| +||{font-size:150%; text-align:right}Please scale me!|| +||{font-size:130%; text-align:right}Please scale me!|| +||{font-size:110%; text-align:right}Please scale me!|| +||{font-size:90%; text-align:right}Please scale me!|| +||{font-size:70%; text-align:right}Please scale me!|| + +You can also apply style to **headings** and **captions**: + +##""|?|{border:1px dotted red; color:red}Style can be applied anywhere||""## +##""|=|{color:#000; font-size:150%; font-style:italic; font-family:Georgia, Hoefler Text, Georgia, serif; font-weight:normal; line-height:150%}Emphemeral Quibus|=|""## +##""||Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis auctor auctor pede.||""## + +|?|{border:1px dotted red; color:red}Style can be applied anywhere|| +|=|{color:#000; font-size:150%; font-style:italic; font-family:Georgia, Hoefler Text, Georgia, serif; font-weight:normal; line-height:150%}Emphemeral Quibus|=| +||Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis auctor auctor pede.|| + +Please note that **style parameters should always follow attribute parameters**, when both are specified for an element (see the [[TableMarkupReference table markup reference]]): + +##""|?|Give priority||""## +##""||(x:2;y:2){background-color:pink}2x2||(x:2){background-color:lightblue}2x1||(y:2){background-color:lightyellow}1x2||""## +##""||(y:2){background-color:lightyellow}1x2||{background-color:#333;color:white}1x1||""## +##""||{background-color:lightblue}1x1||{background-color:#333;color:white}1x1||(x:2){background-color:pink}2x1||""## + +|?|Give priority|| +||(x:2;y:2){background-color:pink}2x2||(x:2){background-color:lightblue}2x1||(y:2){background-color:lightyellow}1x2|| +||(y:2){background-color:lightyellow}1x2||{background-color:#333;color:white}1x1|| +||{background-color:lightblue}1x1||{background-color:#333;color:white}1x1||(x:2){background-color:pink}2x1|| + +====10. Adding style through classes==== + +You can apply existing classes from your stylesheet to any element using the class parameter ##(c:''class'')##. Note that custom style declarations specified through braced markup override class attributes. + +The following example applies to table cells two class selectors defined in the stylesheet. The third row shows how to override a class selector with custom style attributes: + +##""|?|Using class selectors to add style to table elements||""## +##""||(c:highlight)This cell uses the ##.highlight## class||""## +##""||(c:smaller)This cell uses the ##.smaller## class||""## +##""||(c:smaller){font-size:150%}This cell uses the ##.smaller## class overridden by custom style settings||""## + +|?|Using class selectors to add style to table elements|| +||(c:highlight)This cell uses the ##.highlight## class|| +||(c:smaller)This cell uses the ##.smaller## class|| +||(c:smaller){font-size:150%}This cell uses a ##.smaller## class overridden by custom style settings|| + +====11. Global table attributes==== + +Table-level attributes can be specified by adding at the beginning of the table the following element: ##""|!| ||""##, which is used as a container for global table attributes. For example, you can specify **global style options** for a table by adding them to this element: + +##""|!|{border:3px solid blue; background-color: black; color: white; width: 300px; text-align: center}||""## +##""||Cell 1||""## +##""||Cell 2||""## +##""||Cell 3||""## + +|!|{border:3px solid blue; background-color: black; color: white; width: 300px; text-align: center}|| +||Cell 1|| +||Cell 2|| +||Cell 3|| + +====12. Referring to elements: the ##id## attribute==== + +##id## attributes are used to refer to unique elements in a page and to provide an anchor for styling and linking. You can specify an ##id## for any table element by using the ##(i:''id'')## parameter. + +For example, the following markup creates a table with the ##id## "main_table" containing two cells with ##id##'s "cell_1" and "cell_2" + +##""|!|(i:main_table)||""## +##""|?|Using id to refer to table elements||""## +##""||(i:cell_1)This cell can be referred to by using the ##cell_1## id||""## +##""||(i:cell_2)This cell can be referred to by using the ##cell_2## id||""## + +|!|(i:main_table)|| +|?|Using id to refer to table elements|| +||(i:cell_1)This cell can be referred to by using the ##cell_1## id|| +||(i:cell_2)This cell can be referred to by using the ##cell_2## id|| + +====13. Accessibility options: adding titles==== + +Any table element can be given a ##title## attribute to enhance its accessibility. Titles are typically displayed in graphical browsers by hovering over the corresponding element and are useful to display unobtrusive descriptions about specific elements. You can specify a ##title## for any table element by using the ##(t:''title'')## parameter. + +The following example adds titles to several table elements (you can hover over the table to display them): + +##""|!|(t:Comparative figures for fruit production in the last year){width: 350px}||""## +##""|?|Fruit production in 2006||""## +##""|=| |=|(t:yearly production of apples)Apples|=|(t:yearly production of pears)Pears|=|""## +##""|=|(t:Mary's contribution to 2006 production)Mary||(t:Mary's production of apples in 2006){text-align:center}300Kg||(t:Mary's production of pears in 2006){text-align:center}320Kg||""## +##""|=|(t:John's contribution to 2006 production)John||(t:John's production of apples in 2006){text-align:center}400Kg||(t:John's production of pears in 2006){text-align:center}630Kg||""## + +|!|(t:Comparative figures for fruit production in the last year){width: 350px}|| +|?|Fruit production in 2006|| +|=| |=|(t:yearly production of apples)Apples|=|(t:yearly production of pears)Pears|=| +|=|(t:Mary's contribution to 2006 production)Mary||(t:Mary's production of apples in 2006){text-align:center}300Kg||(t:Mary's production of pears in 2006){text-align:center}320Kg|| +|=|(t:John's contribution to 2006 production)John||(t:John's production of apples in 2006){text-align:center}400Kg||(t:John's production of pears in 2006){text-align:center}630Kg|| + +====14. Accessibility options: adding a summary==== + +Tables can take an optional ##summary## attribute to describe the purpose and/or structure of the table. The description provided by the summary attribute is particularly helpful to users of non-visual browsers. You can specify a summary by adding a ##(u:''Summary'')## parameter in the table global attributes. + +For example, the following line: +##""|!|(u:This is a summary)||""## +will add to the table a ##summary## attribute with the value ##This is a summary##. + +====15. Accessibility options: table head, table body and table foot==== + +Rows in a table can be grouped in a table head, table body and table foot. This division enables browsers to support scrolling of table bodies independently of the table head and foot. When long tables are printed, the table head and foot information may be repeated on each page that contains table data. The table head and table foot should contain information about the table's columns. The table body should contain rows of table data. + +Wikka allows you to create groups of rows with special markers: +~- The ##""|[|""## marker groups the rows it precedes as a **table head** block; +~- The ##""|]|""## marker groups the rows it precedes as a **table foot** block; +~- The ##""|#|""## marker groups the rows it precedes as a **table body**; + +The following example shows how to use these elements to create row groups. Note that Wikka uses different backgrounds to differentiate column headings in the table head and foot from row headings in the table body: + +##""|!|(u:A table with summary, caption, head, foot and body){width: 400px}||""## +##""|?|Here's how you can group rows||""## +##""|[|""## +##""|=|Name|=|Place|=|Telephone||""## +##""|]|""## +##""|=|Name|=|Place|=|Telephone||""## +##""|#|""## +##""|=|John Smith||New York||555-1234||""## +##""|=|Jane Smith||Los Angeles||555-2345||""## +##""|=|John Doe||Unknown||Unknown||""## +##""|=|Jane Doe||Unknown||Unknown||""## + +|!|(u:A table with summary, caption, head, foot and body){width: 400px}|| +|?|Here's how you can group rows|| +|[| +|=|Name|=|Place|=|Telephone|| +|]| +|=|Name|=|Place|=|Telephone|| +|#| +|=|John Smith||New York||555-1234|| +|=|Jane Smith||Los Angeles||555-2345|| +|=|John Doe||Unknown||Unknown|| +|=|Jane Doe||Unknown||Unknown|| + +====16. Accessibility options: heading scope==== + +To be semantically correct and accessible to users with non-visual browsers, headings should contain scope attributes describing the cell range they refer to. +~-Column heading scopes can be specified using the ##(o:col)## parameter in the corresponding column heading; +~-Row heading scopes can be specified using the ##(o:row)## parameter in the corresponding row heading; + +The following example shows how to correctly add column and row scopes to a table to make it accessible: + +##""|!|(u:The number of employees and the foundation year of some imaginary companies.)||""## +##""|?|Table 1: Company data||""## +##""|[|""## +##""|||=|(o:col)Employees|=|(o:col)Founded||""## +##""|#|""## +##""|=|(o:row)ACME Inc||1000||1947||""## +##""|=|(o:row)XYZ Corp||2000||1973||""## + +|!|(u:The number of employees and the foundation year of some imaginary companies.)|| +|?|Table 1: Company data|| +|[| +|||=|(o:col)Employees|=|(o:col)Founded|| +|#| +|=|(o:row)ACME Inc||1000||1947|| +|=|(o:row)XYZ Corp||2000||1973|| + + +---- +CategoryWiki \ No newline at end of file diff --git a/doc/manual/cache/TableMarkupReference.wakka b/doc/manual/cache/TableMarkupReference.wakka new file mode 100644 index 0000000000..69e7dd26b9 --- /dev/null +++ b/doc/manual/cache/TableMarkupReference.wakka @@ -0,0 +1,74 @@ +!!! DELETE ME !!! + +======Wikka Table Markup Reference====== +>>==See also:== +~-For an informal introduction to this markup and several examples consult this server's TableMarkup page. +~-Updated versions of this page can be found on the [[Docs:TableMarkupReference|Wikka documentation server]]. +>> +==== 1. Table Markup Scheme ==== + +The generic markup for table elements follows this scheme: + +~**##{{color fg="#F00" text="|*|"}}{{color fg="blue" text="(attribute parameters)"}}{{color fg="green" text="{style parameters}"}}content{{color fg="#F00" text="||"}}##** + +==Example:== + +~##""|=|(i:main_heading){text-size: 120%}This is the main heading||""## + +===Understanding the Table Markup Scheme=== + +~1)**Opening delimiter** --- **##{{color fg="#F00" text="|*|"}}##** is any of the delimiters described in the //elements table// below. +~1)**Attributes** --- **##{{color fg="blue" text="(attribute parameters)"}}##** is an optional series of ##parameter:value## declarations enclosed in brackets. Valid parameters are described in the //attribute table// below. Multiple parameter declarations can be separated with a semicolon (**##;##**). +~1)**Style** --- **##{{color fg="green" text="{style parameters}"}}##** is an optional series of CSS style declarations enclosed in braces. Multiple style declarations can be separated with a semicolon (**##;##**). +~1)**Content** --- **##content##** can be any valid content for that element (including [[Docs:TextFormatting|formatted text]]). +~1)**Closing delimiter** --- **##{{color fg="#F00" text="||"}}##** is the standard delimiter. + +==Note:== +Some elements are //self closing// and do not accept any attributes, style parameters or content. See the notes in the //elements table// below. + +==== 2. Elements ==== + +|!|{width: 80%}|| +|?|Table Elements|| +|=|""XHTML Elements""|=|Delimiter|=|Notes|| +||####||##""|!|""##||Optional, only useful for adding attributes. **Must** be first in table markup if used. Should be on a line by itself.|| +||####||##""|_|""##|||| +||####||##""|-|""##||Selfclosing - must not be closed!|| +||####||##""|[|""##|||| +||####||##""|]|""##|||| +||####||##""|#|""##|||| +||####||none||Will be opened for each row of table cells.|| +||##
##||##""|?|""##|||| +||##
##||##""|=|""##|||| +||####||##""||""##|||| + +==== 3. Attributes ==== + +|?|Table Attributes|| +|[| +|=|Attribute|=|Markup key|| +|]| +|=|Attribute|=|Markup key|| +|#| +|=|(x:2)Core|| +||##id##||##i##|| +||##title##||##t##|| +||##class##||##c##|| +||##style##||##s##|| +|=|(x:2)i18n|| +||##xml:lang##||##l##|| +||##dir##||##d##|| +|=|(x:2)Table cells|| +||##colspan##||##x##|| +||##rowspan##||##y##|| +||##scope##||##o##|| +||##headers##||##h##|| +||##abbr##||##a##|| +||##axis##||##z##|| +|=|(x:2)Other Table elements|| +||##span##||##p##|| +||##summary##||##u##|| + + +---- +CategoryWiki \ No newline at end of file diff --git a/doc/manual/cache/TutBasicInput.wakka b/doc/manual/cache/TutBasicInput.wakka index da1344c8c5..a27aa26070 100644 --- a/doc/manual/cache/TutBasicInput.wakka +++ b/doc/manual/cache/TutBasicInput.wakka @@ -51,4 +51,6 @@ Print "Press any button to exit" Sleep %% -For more information check out the {{fbdoc item="keyword" value="CatPgInput|User Input"}} Section. \ No newline at end of file +For more information check out the {{fbdoc item="keyword" value="CatPgInput|User Input"}} Section. + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka index dfdffa2459..64cb5a16ab 100644 --- a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka +++ b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka @@ -356,4 +356,6 @@ I hope this tutorial has been useful for you, although there are still a few thi - [[ProPgTypeObjects|Types as Objects]] - ##[[KeyPgVisPublic|Public:]]## - ##[[KeyPgVisPrivate|Private:]]## - - ##[[KeyPgVisProtected|Protected:]]## \ No newline at end of file + - ##[[KeyPgVisProtected|Protected:]]## + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka index d96e955842..29a007e48b 100644 --- a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka +++ b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka @@ -478,4 +478,6 @@ http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgOpNew http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgOpDelete http://en.wikipedia.org/wiki/Copy_constructor http://en.wikipedia.org/wiki/Object_copy -http://en.wikipedia.org/wiki/Name_mangling \ No newline at end of file +http://en.wikipedia.org/wiki/Name_mangling + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutConditionalCompilation.wakka b/doc/manual/cache/TutConditionalCompilation.wakka index af16585866..bdbdc78298 100644 --- a/doc/manual/cache/TutConditionalCompilation.wakka +++ b/doc/manual/cache/TutConditionalCompilation.wakka @@ -57,8 +57,9 @@ Of course, there are many applications to this. Who says you need to do this on #endif %%## -The scope of this tutorial is a limited one, but this method is used by professionals. It makes life easy when programming. I have used this method in my own code. To see this code in action, view the source [[http://avinash.apeshell.net/stuff/ship/flyaround.bas|here]]. +The scope of this tutorial is a limited one, but this method is used by professionals. It makes life easy when programming. Avinash 'aetherFox' Vora **avinashvora** [at] **gmail** [dot] **com**. -http://avinash.apeshell.net \ No newline at end of file + +//Last reviewed by ""sancho3" on February 07, 2018 Notes: Removed dead links// \ No newline at end of file diff --git a/doc/manual/cache/TutDynaArrayType.wakka b/doc/manual/cache/TutDynaArrayType.wakka index e2ebfc6ba2..33722d8f1c 100644 --- a/doc/manual/cache/TutDynaArrayType.wakka +++ b/doc/manual/cache/TutDynaArrayType.wakka @@ -47,7 +47,8 @@ Print 'Save the current array size tmp = myType.size 'Now resize the array -myType.darray = Reallocate(myType.darray, 10) +'myType.darray = Reallocate(myType.darray, 10) +myType.darray = Reallocate(myType.darray, 10 * sizeof(integer)) ' Editors Note: above code line changed to this 'Set the length indicator myType.size = 10 @@ -111,7 +112,9 @@ This section simply prints out the values using the same method that was used to Of course, this should be a dynamic array, so you should be able to resize the array, and this is exactly what the next section of code will do. %%(freebasic) tmp = myType.size -myType.darray = Reallocate(myType.darray, 10) +'myType.darray = Reallocate(myType.darray, 10) +myType.darray = Reallocate(myType.darray, 10 * sizeof(integer)) ' Editors Note: above code line changed to this + myType.size = 10 %% The first line of code saves the current size of the array so that the new memory segment can be initialized while not overwriting any existing data. You will see this in a moment. @@ -212,4 +215,6 @@ Next Print "Press any key..." Sleep -%% \ No newline at end of file +%% + +//Last reviewed by ""sancho3"" on February 08, 2018 Notes: Error in code fixed and noted// \ No newline at end of file diff --git a/doc/manual/cache/TutDynamicArrays.wakka b/doc/manual/cache/TutDynamicArrays.wakka index 3e0c589db2..daa8c9fe0d 100644 --- a/doc/manual/cache/TutDynamicArrays.wakka +++ b/doc/manual/cache/TutDynamicArrays.wakka @@ -71,4 +71,6 @@ end Try it out! You can see that it does not work properly. This is because only the first dimension in an array may change sizes, while the rest remain the same size, in order for PRESERVE to work properly. -There is a workaround, which I will post later, after I edit it in order to make sense to any program, not just mine, and make some revisions so it does not go out of bounds. For the moment, get creative ;) \ No newline at end of file +There is a workaround, which I will post later, after I edit it in order to make sense to any program, not just mine, and make some revisions so it does not go out of bounds. For the moment, get creative ;) + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutFunctionOverloading.wakka b/doc/manual/cache/TutFunctionOverloading.wakka index a9da0be163..ab7e475113 100644 --- a/doc/manual/cache/TutFunctionOverloading.wakka +++ b/doc/manual/cache/TutFunctionOverloading.wakka @@ -95,4 +95,6 @@ It means //safety//: You may notice that I utilize two OPTIONs in these examples ====Wrapping Up==== -I hope you have learned at least the basics of function overloading (since that's all I covered). And I hope you start thinking about the themes I've brought up, if you haven't before. Next time I'll discuss overloading functions with different numbers of parameters, different return types, as well as the joys and pitfalls of both. Stay tuned. \ No newline at end of file +I hope you have learned at least the basics of function overloading (since that's all I covered). And I hope you start thinking about the themes I've brought up, if you haven't before. Next time I'll discuss overloading functions with different numbers of parameters, different return types, as well as the joys and pitfalls of both. Stay tuned. + +//Last reviewed by ""sancho3"" on February 08, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutGettingStarted.wakka b/doc/manual/cache/TutGettingStarted.wakka index e95a8b53c0..9a80021862 100644 --- a/doc/manual/cache/TutGettingStarted.wakka +++ b/doc/manual/cache/TutGettingStarted.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + {{fbdoc item="title" value="Getting Started"}}---- See also: TutGettingStartedQB diff --git a/doc/manual/cache/TutGettingStartedQB.wakka b/doc/manual/cache/TutGettingStartedQB.wakka index 44defd6b9e..b2e53c92ba 100644 --- a/doc/manual/cache/TutGettingStartedQB.wakka +++ b/doc/manual/cache/TutGettingStartedQB.wakka @@ -20,6 +20,8 @@ SLEEP Now press F5. Congratulations, you've just seen how much like QB FreeBASIC really is. Now you can use most console commands for QB just like you remember. For example: +//Last Reviewed by ""Sancho3"" on February 06, 2018// + %% LOCATE 10,10 PRINT "I'm the center of the universe!" diff --git a/doc/manual/cache/TutHowToProgGame1.wakka b/doc/manual/cache/TutHowToProgGame1.wakka index 69a588164f..3e2d1402a9 100644 --- a/doc/manual/cache/TutHowToProgGame1.wakka +++ b/doc/manual/cache/TutHowToProgGame1.wakka @@ -1,13 +1,13 @@ -{{fbdoc item="title" value="How to Program a Game: Lesson 1"}} +{{fbdoc item="title" value="How to Program a Game: Lesson 1"}}---- {{fbdoc item="section" value="Introduction by Lachie Dazdarian"}} The objective of this series of lessons is to help newbies who know very little of BASIC to learn the basics of programming in FreeBASIC necessary to create any computer game. Some elementary BASIC knowledge would help a lot, though I believe that people who don't know BASIC at all should comprehend these lessons too. I'm using here the word (well, it's an acronym) "BASIC" and not FreeBASIC, because if you know the basics of QuickBASIC, Visual BASIC or any other variant of BASIC, these lessons should be easy to comprehend. -I'm starting this series because I feel that tutorials of this kind were always something what our community was lacking, even before FreeBASIC. I've corresponded during my programming lifetime with quite few programming newbies, and they all had almost identical problems when trying to program a game. So I think I'm able to detect what beginners need quite well and on what way the stuff needs to be explained to them. I also remember my beginnings and the problems I had with using separated routines that were never meant to be combined and used to create a game. The breaking point for me was the moment when I discovered RelLib (a QuickBASIC graphics library by R.E.Lope) and the scrolling engine that was created with it. That scrolling engine motivated me to explore its mechanics and expand on it (with some help from R.E.Lope). In one single moment I acquired the ability to program most of the stuff (necessary to complete a game) by myself. It's like driving a bike. The moment when you acquire the actual skill lasts for one second. +I'm starting this series because I feel that tutorials of this kind were always something what our community was lacking, even before FreeBASIC. I've corresponded during my programming lifetime with quite few programming newbies, and they all had almost identical problems when trying to program a game. So I think I'm able to detect what beginners need quite well and on what way the stuff needs to be explained to them. I also remember my beginnings and the problems I had with using separated routines that were never meant to be combined and used to create a game. The breaking point for me was the moment when I discovered ""RelLib"" (a QuickBASIC graphics library by R.E.Lope) and the scrolling engine that was created with it. That scrolling engine motivated me to explore its mechanics and expand on it (with some help from R.E.Lope). In one single moment I acquired the ability to program most of the stuff (necessary to complete a game) by myself. It's like driving a bike. The moment when you acquire the actual skill lasts for one second. -So that's my goal with this series. To learn you enough so you would be self-sufficient in 90% of cases. And the best way to learn new things is to see them applied. Many tutorials fail in this by being too generic. You will always need help from more expert programmers, but the point is that you don't need it on every step. Have in mind that this depends on the type of game you are developing and the graphics library / tools you are using. +So that's my goal with this series. To teach you enough so you would be self-sufficient in 90% of cases. And the best way to learn new things is to see them applied. Many tutorials fail in this by being too generic. You will always need help from more expert programmers, but the point is that you don't need it on every step. Have in mind that this depends on the type of game you are developing and the graphics library / tools you are using. -The example programs and mini-games we'll create will be coded in GFXlib (the FreeBASIC's built-in graphics library). Lynn's Legacy, ArKade, Mighty Line and Poxie were coded in it (among many others), and I think those games are good references. But don't worry. Switching from one graphics library to another is relatively easy when you know how to code in at least one. +The example programs and mini-games we'll create will be coded in GFXlib (the FreeBASIC's built-in graphics library). Lynn's Legacy, ""ArKade"", Mighty Line and Poxie were coded in it (among many others), and I think those games are good references. But don't worry. Switching from one graphics library to another is relatively easy when you know how to code in at least one. This tutorial will not deal with raycasting engines (3D programming) or something "advance" like that. If you want that but are a beginner, you NEED the following lessons FIRST. @@ -41,7 +41,12 @@ We can set a loop on more ways (with WHILE:WEND statements, using the GOTO state ' We'll put our statements here later LOOP UNTIL INKEY$ = "Q" or INKEY$ = "q" %% - +(Editors Note: The suffixes on commands such as the $ on INKEY$ is: +obligatory in the -lang qb dialect. +optional in the -lang fblite dialect. +forbidden in the -lang fb dialec +Check the documentation for the specific keyword) + If you compile this code and run it, you'll get a small black empty 320*200 window which you can turn off by pushing the letter Q (you might need to hold it). The program simply loops until you press "Q or "q". I used both upper and lower case "Q" symbol in case Caps Lock is turned on on your keyboard. INKEY$ is a statement that returns the last key pushed on the keyboard. I will explain later why it shouldn't be used with games and what's a better substitute. To draw a circle we'll use the CIRCLE statement (refer to GFXlib's documentation). Check the following code: @@ -87,7 +92,7 @@ Or... DIM [AS type_of_variable] variable1, variable2, variable3, ... %% -The data inside [ ] is optional and the brackets are not used. Types of variables available in FreeBASIC are BYTE, SHORT, INTEGER, STRING, SINGLE, DOUBLE and few others, but I don't find details about them important on this level. What you need to know now is that you should declare variables or arrays AS INTEGER when they hold graphics data (memory buffers holding graphics) or when they represent data which doesn't need decimal precision (number of lives, points, etc.). Variables that need decimal precision are declared AS SINGLE or DOUBLE. Those are usually variables used in games which rely on physics formulae like arcade car driving games or jump 'n run games (gravity effect). Simply, the difference between the speed of two pixels per cycle and the speed of one pixel per cycle is most often too large, and in those limits you can't emulate effects like fluid movement on the most satisfactory way. Also, behind DIM you should put SHARED which makes that the specific variable readable in the entire program (all subroutines). Don't use SHARED only with variables declared inside subroutines (I do it very rarely). If you are going to declare ARRAYS inside a subroutine, I advise you to replace DIM with REDIM. Strings are used to hold text data. Like YourName = "Dodo", but you need to declare YourName AS STRING first. +The data inside [ ] is optional and the brackets are not used. Types of variables available in FreeBASIC are BYTE, SHORT, INTEGER, STRING, SINGLE, DOUBLE and few others, but I don't find details about them important on this level. What you need to know now is that you should declare variables or arrays AS INTEGER when they hold graphics data (memory buffers holding graphics) or when they represent data which doesn't need decimal precision (number of lives, points, etc.). Variables that need decimal precision are declared AS SINGLE or DOUBLE. Those are usually variables used in games which rely on physics formulae like arcade car driving games or jump 'n run games (gravity effect). Simply, the difference between the speed of two pixels per cycle and the speed of one pixel per cycle is most often too large, and in those limits you can't emulate effects like fluid movement on the most satisfactory way. Also, behind DIM you should put SHARED which makes that the specific variable readable in the entire program (all subroutines). Don't use SHARED only with variables declared inside subroutines (I do it very rarely). If you are going to declare ARRAYS inside a subroutine, I advise you to replace DIM with REDIM. Strings are used to hold text data. Like ""YourName"" = "Dodo", but you need to declare ""YourName"" AS STRING first. Now I will introduce a new statement instead of INKEY$ which can detect multiple keypresses and is much more responsive (perfect response) than INKEY$. The flaw of INKEY$, as well as being very non-responsive (which you probably were able to detect when trying to shut down the previously compiled examples), is that it can detect only one keypress at any given moment which renders it completely unusable in games. @@ -171,7 +176,7 @@ The last version of the code does not represent the desirable way of coding, but The way variables are declared in the above code is not the most convenient in larger projects where we have huge amount of variables usually associated to several objects (an object can be the player, enemy or anything that is defined with MORE THAN ONE variable). -So first we'll define a user defined data type with the statement TYPE that can contain more variables/arrays (stay with me). We'll name this user data type ObjectType. The code: +So first we'll define a user defined data type with the statement TYPE that can contain more variables/arrays (stay with me). We'll name this user data type ""ObjectType"". The code: %%(freebasic) TYPE ObjectType @@ -190,7 +195,7 @@ After this we declare our circle as an object: ' the statement CIRCLE, thus "CircleM". %% -How is this method beneficial? It allows us to manage the program variables on a more efficient and cleaner way. Instead of (in this example) having to declare each circle's characteristic (it's position, speed, etc.) separately, we'll simply use a type:def that includes all these variables and associate a variable or an array to it (in this case that's CircleM). So now the circle's x position is flagged with CircleM.X, circle's y position with CircleM.Y and circle's speed with CircleM.speed. I hope you see now why this is better. One user defined type can be connected with more variables or arrays. In this example you can add another object with something like DIM SHARED EnemyCircle(8) AS ObjectType which would allow us to manage 8 "evil" circles with a specific set of routines (an AI of some sort) using the variables from the ObjectType type:def (x, y, speed), and these circles could "attack" the user's circle on some way. In the next lesson all this will become more clear. Have in mind that not ALL variables need to be declared using a type:def. This is only for "objects" in your game that are defined (characterized) with more variables (like a hero determined by health, money, score, strength, etc.). +How is this method beneficial? It allows us to manage the program variables on a more efficient and cleaner way. Instead of (in this example) having to declare each circle's characteristic (it's position, speed, etc.) separately, we'll simply use a type:def that includes all these variables and associate a variable or an array to it (in this case that's ""CircleM""). So now the circle's x position is flagged with ""CircleM"".X, circle's y position with ""CircleM"".Y and circle's speed with ""CircleM"".speed. I hope you see now why this is better. One user defined type can be connected with more variables or arrays. In this example you can add another object with something like DIM SHARED ""EnemyCircle""(8) AS ""ObjectType"" which would allow us to manage 8 "evil" circles with a specific set of routines (an AI of some sort) using the variables from the ""ObjectType"" type:def (x, y, speed), and these circles could "attack" the user's circle on some way. In the next lesson all this will become more clear. Have in mind that not ALL variables need to be declared using a type:def. This is only for "objects" in your game that are defined (characterized) with more variables (like a hero determined by health, money, score, strength, etc.). After the change the final version of the code looks like this: @@ -250,6 +255,7 @@ In this section we'll start to code our mini-game which won't be completed in th First I'll show you what graphics we'll be using. We are going to work in 8-bit color depth mode, so the images that we are going to use need to be saved in that mode (256 colors mode). For warrior sprites I'll use the sprites of the main character from my first game Dark Quest. http://hmcsoft.org/fb/htpagl1-sprites.png +(Editors Note: The link above is not active anymore. The game Dark Quest is still available for download at http://lachie.phatcode.net/downloads.php) As you see this image features 12 sprites of our warrior, each 20*20 pixels large. Two for each direction (walk animation) and one sprite for each direction when the warrior is swinging with his sword. Sword swinging won't be implemented in the first lesson but will become necessary later. diff --git a/doc/manual/cache/TutIfStatement.wakka b/doc/manual/cache/TutIfStatement.wakka index d05dd7d957..b2ec764947 100644 --- a/doc/manual/cache/TutIfStatement.wakka +++ b/doc/manual/cache/TutIfStatement.wakka @@ -184,3 +184,7 @@ End If %% Remember that the And operator will only return True if both operands return True. If value is 6, 6 is greater than 5 and 6 is also less than 7, so both statements are True and the expression evaluates to True. + +Editors Note: See also [[KeyPgOpAndAlso|AndAlso]] and [[KeyPgOpOrElse|OrElse]] + +//Last Reviewed By ""Sancho3"", February 06, 2018// diff --git a/doc/manual/cache/TutIntroArrays.wakka b/doc/manual/cache/TutIntroArrays.wakka index 26b57fa096..35e63b85e1 100644 --- a/doc/manual/cache/TutIntroArrays.wakka +++ b/doc/manual/cache/TutIntroArrays.wakka @@ -232,4 +232,6 @@ The -exx compiler switch will enable error and bounds checking within your progr This is a great help in debugging your program, and finding problems associated with arrays. -exx will also inform of you of Null pointer assignments, so it is quite useful when working with pointers as well. -Using -exx does add quite of bit of additional code to your program, so once your program is functioning correctly, you will want to compile the program without the -exx switch. \ No newline at end of file +Using -exx does add quite of bit of additional code to your program, so once your program is functioning correctly, you will want to compile the program without the -exx switch. + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutIntroScope.wakka b/doc/manual/cache/TutIntroScope.wakka index 03bf43fc74..4208453808 100644 --- a/doc/manual/cache/TutIntroScope.wakka +++ b/doc/manual/cache/TutIntroScope.wakka @@ -95,4 +95,6 @@ Variables declared within a control block, such as a For-Next, exist as long as == Scope...End Scope Variables == -Variables declared within a scope block exist as long as the the scope block exists. Once the program leaves the scope block, any variables created within the scope block are destroyed. \ No newline at end of file +Variables declared within a scope block exist as long as the the scope block exists. Once the program leaves the scope block, any variables created within the scope block are destroyed. + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutIntroTypeDef.wakka b/doc/manual/cache/TutIntroTypeDef.wakka index a5e8f03429..2e5f8d4f85 100644 --- a/doc/manual/cache/TutIntroTypeDef.wakka +++ b/doc/manual/cache/TutIntroTypeDef.wakka @@ -342,3 +342,5 @@ myVariantd.d = 356.56 {{table columns="1" cellpadding="2" cells=" You cannot use dynamic strings within a union."}} Using a combination of ##//unions//## and ##//type//##s within a program allows you to design custom data types that have a lot of flexibility, but care must be taken to ensure that you are using the data constructs correctly. Improper use of these data types can lead to hard-to-find bugs. The benefits however, out-weigh the risks and once mastered, are a powerful programming tool. + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutLinkedLists.wakka b/doc/manual/cache/TutLinkedLists.wakka index d097f1264b..2c75d93b30 100644 --- a/doc/manual/cache/TutLinkedLists.wakka +++ b/doc/manual/cache/TutLinkedLists.wakka @@ -381,4 +381,6 @@ Sub ListRemoveAll(list As listnode Ptr, bDelete As Integer = 0) End Sub %% -If you haven't noticed already, ""ListAdd"" and ""ListAddHead"" return a pointer to the data you inputted. The sample code (see above) shows how to use this functionality. ""ListRemove"" returns a pointer to next node. That's how ""ListRemoveAll"" removes the nodes. ""ListRemoveAll"" is the only function that doesn't return anything. There is no need, since the whole list will be empty after you have called it. \ No newline at end of file +If you haven't noticed already, ""ListAdd"" and ""ListAddHead"" return a pointer to the data you inputted. The sample code (see above) shows how to use this functionality. ""ListRemove"" returns a pointer to next node. That's how ""ListRemoveAll"" removes the nodes. ""ListRemoveAll"" is the only function that doesn't return anything. There is no need, since the whole list will be empty after you have called it. + +//Last edited by ""sancho3"" on February 8, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutMathAngles.wakka b/doc/manual/cache/TutMathAngles.wakka index 0e53c9fbc4..6c7f80edff 100644 --- a/doc/manual/cache/TutMathAngles.wakka +++ b/doc/manual/cache/TutMathAngles.wakka @@ -64,3 +64,5 @@ CONST RADToDeg AS DOUBLE = 57.29577951308233 '' 180/PI **Gradients** Gradients are used mainly in some forms of engineering. Within the gradient system a circle has 400 grads. + +//Last reviewed by ""sancho3"" on February 08, 2018// diff --git a/doc/manual/cache/TutMathIntroTrig.wakka b/doc/manual/cache/TutMathIntroTrig.wakka index 5b7aca20be..5fd4ad31ff 100644 --- a/doc/manual/cache/TutMathIntroTrig.wakka +++ b/doc/manual/cache/TutMathIntroTrig.wakka @@ -154,4 +154,6 @@ This means the same as {{fbdoc item="keyword" value="KeyPgSin|SIN"}}(y)*{{fbdoc {{fbdoc item="keyword" value="KeyPgTan|TAN"}}(y) = {{fbdoc item="keyword" value="KeyPgSin|SIN"}}((y)/{{fbdoc item="keyword" value="KeyPgCos|COS"}}(y) -There are several more useful identities out there. Search for trigonometric identities or consult any higher mathematical reference. \ No newline at end of file +There are several more useful identities out there. Search for trigonometric identities or consult any higher mathematical reference. + +//Last reviewed by ""sancho3"" on February 08, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutNewToProg.wakka b/doc/manual/cache/TutNewToProg.wakka index ce88f28608..cfd5704b30 100644 --- a/doc/manual/cache/TutNewToProg.wakka +++ b/doc/manual/cache/TutNewToProg.wakka @@ -187,4 +187,6 @@ Pixel: One 'dot' on your monitor. Monitors are made up of thousands of tiny do Syntax: How words are grouped together. Your syntax in programming are sets of rules that tell you what code can be placed where. It makes sure that only logical code is allowed. Ex: Print "Hi". PRINT is the COMMAND, "Hi" is what the command will PRINT. Make sense? -Variable: A word that holds data in programming. You assign these words values, and with those values, you can save information on your program. \ No newline at end of file +Variable: A word that holds data in programming. You assign these words values, and with those values, you can save information on your program. + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutPointers.wakka b/doc/manual/cache/TutPointers.wakka index 688629393b..23cd9878ef 100644 --- a/doc/manual/cache/TutPointers.wakka +++ b/doc/manual/cache/TutPointers.wakka @@ -132,4 +132,6 @@ We can now reference the string in our type using the reference operator. print "aptr: "; *mytype.sptr %%## -Pointers can be confusing for the uninitiated, however they need not be if it is kept in mind that the pointer doesn't contain data, it simply points to some data. The pointer is a memory address, and you manipulate that data through the reference operator *. It really isn't much different than a normal variable. \ No newline at end of file +Pointers can be confusing for the uninitiated, however they need not be if it is kept in mind that the pointer doesn't contain data, it simply points to some data. The pointer is a memory address, and you manipulate that data through the reference operator *. It really isn't much different than a normal variable. + +//Last reviewed by ""sancho3"" on February 07, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutPointersData.wakka b/doc/manual/cache/TutPointersData.wakka index f41fe11f7d..eb081b7991 100644 --- a/doc/manual/cache/TutPointersData.wakka +++ b/doc/manual/cache/TutPointersData.wakka @@ -108,4 +108,6 @@ We need the parenthesis around the add operation because the reference operator Notice that we didn't increment aptr directly. If we did, aptr would no longer point to the start of the memory buffer and the program would crash when we deallocated the buffer since it would [[KeyPgDeallocate|deallocate]] memory outside the memory buffer. If the need arises to directly increment a pointer, then create a temporary pointer variable and increment that, rather than the pointer used in the original allocation. -Memory buffers and pointers are a powerful way to store and manipulate data in memory. Care must be taken though to ensure that you are accessing the data correctly according to the type of data being stored in the buffer. \ No newline at end of file +Memory buffers and pointers are a powerful way to store and manipulate data in memory. Care must be taken though to ensure that you are accessing the data correctly according to the type of data being stored in the buffer. + +//Last reviewed by ""sancho3"" on February 07, 2018// \ No newline at end of file diff --git a/doc/manual/cache/TutPortingFromQB.wakka b/doc/manual/cache/TutPortingFromQB.wakka index 5e72aa3d6c..6503a9f71f 100644 --- a/doc/manual/cache/TutPortingFromQB.wakka +++ b/doc/manual/cache/TutPortingFromQB.wakka @@ -2,7 +2,7 @@ Let's try to compile a big (4000+ lines) graphical QB program in FreeBasic, to see how compatible FB is with QB. As an example I will use Jark's TCRay a great raytracer with quadric, cubic and quadratic shapes, perlin noise programmed in 2004. You can get TCRay.zip from -http://www.mandelbrot-dazibao.com/Programs/Programs.htm +http://www.petesqbsite.com/downloads/graphics.shtml Notice TCRay is a QB4.5 interpreted program, Jark never had the patience to compile his work, he just tested it interpreted and went on adding features. diff --git a/doc/manual/cache/TutPterDataType.wakka b/doc/manual/cache/TutPterDataType.wakka index c195e2c658..44e65001f0 100644 --- a/doc/manual/cache/TutPterDataType.wakka +++ b/doc/manual/cache/TutPterDataType.wakka @@ -80,7 +80,7 @@ Pointer indexing works the same way as pointer arithmetic, but the details are h Freebasic has a set of pointer functions to complement the pointer operators. ~- [[KeyPgCptr|Cptr]] Converts expression to a data_type pointer. Expression can be another pointer or an integer. -~- [[KeyPgPeek|Peek]] Returns the contents of memory location pointer to by pointer. Data_type specifies the type of expected data. +~- [[KeyPgPeek|Peek]] Returns the contents of memory location pointed to by pointer. Data_type specifies the type of expected data. ~- [[KeyPgPoke|Poke]] Puts the value of expression into the memory location pointed to by pointer. The data_type specifies the type of data being placed into the memory location. ~- [[KeyPgSadd|Sadd]] Returns the location in memory where the string data in a dynamic string is located. ~- [[KeyPgOpStrptr|Strptr]] The same as Sadd. @@ -225,6 +225,7 @@ Next %% This code snippet uses the index method to load the actual data into the memory segments. Notice that this looks and acts just like a two-dimensional array. While this may not seem useful within this context, you could use this code to create a dynamic array within a type definition. Since you cannot have a standard dynamic array within a type, this allows you get the same functionality. +//Editors Note: Dynamic arrays are allowed in recent releases of FreeBASIC// One thing you need to be aware of is how to deallocate a structure such as this. The rule is to just do the reverse of the allocation operations. Since the last allocate operation initialized the data memory segments, you deallocate these memory segments first and then you can deallocate the base pointer. @@ -239,3 +240,5 @@ Deallocate myMemArray %% You need to be sure that you deallocate in the right order, otherwise you will end up with memory segments that are not freed, but inaccessible. These are memory leaks and can cause a whole host of problems in your program. + +//Last reviewed by ""sancho3"" on February 07, 2018// diff --git a/doc/manual/cache/TutSelectStatement.wakka b/doc/manual/cache/TutSelectStatement.wakka index 3ed57f7ca7..2256b77912 100644 --- a/doc/manual/cache/TutSelectStatement.wakka +++ b/doc/manual/cache/TutSelectStatement.wakka @@ -107,3 +107,5 @@ End %% If you compare the two programs, you can see that the logic is quite similar, however the Select Case is much more readable and understandable than the If-ElseIf ladder. + +//Last Reviewed by ""Sancho3"" on February 06, 2018// diff --git a/doc/manual/cache/TutUsingLibs.wakka b/doc/manual/cache/TutUsingLibs.wakka index 199d6cec98..ee23b926a4 100644 --- a/doc/manual/cache/TutUsingLibs.wakka +++ b/doc/manual/cache/TutUsingLibs.wakka @@ -126,3 +126,5 @@ tinyPTC: PTC_Close () %% That's all there is to quitting! As you can see, there is nothing inherently more difficult in using libraries in FreeBASIC compared to QuickBASIC. In fact, because coders don't need to jump through hoops to get to memory, it's actually much easier, even with the more modern OS and hardware. + +//Last Reviewed by ""Sancho3"" on February 06, 2018// diff --git a/doc/manual/cache/TutUsingMouse.wakka b/doc/manual/cache/TutUsingMouse.wakka index a903a241b8..6caa687c24 100644 --- a/doc/manual/cache/TutUsingMouse.wakka +++ b/doc/manual/cache/TutUsingMouse.wakka @@ -13,7 +13,7 @@ After doing some searches, I quickly noticed that there simply wasn't an officia As with most tutorials, this one too can be better explained with the use of an example program. We will be creating a very simple program that acts upon the user's interaction with the mouse and certain areas of the screen. It should provide the bases of code needed to efficiently operate and control the mouse in your own programming projects. -IMPORTANT: It is mandatory that you set yourself in a graphic mode in order to use the mouse. the mouse commands will always return -1 for a value if the graphic mode is not set. +//Editors Note: The mouse functions will work with a graphics window as demonstrated in this tutorial. They will work with console window however in Windows, Quick Edit mode must be turned off.// ==THE SAMPLE PROGRAM DESCRIPTION== @@ -168,4 +168,6 @@ As always, if you have any questions regarding this tutorial or any other I've w MystikShadows Stéphane Richard -srichard@adaworld.com \ No newline at end of file +srichard@adaworld.com + +//Last Reviewed by ""Sancho3"" on February 06, 2018// \ No newline at end of file diff --git a/doc/manual/cache/WikkaFormattingRules.wakka b/doc/manual/cache/WikkaFormattingRules.wakka index 0f2409886f..c8e358057b 100644 --- a/doc/manual/cache/WikkaFormattingRules.wakka +++ b/doc/manual/cache/WikkaFormattingRules.wakka @@ -1,3 +1,5 @@ +!!! DELETE ME !!! + ======Wikka Formatting Guide======---<<===General Guidelines===If a markup sequence is not in these guidelines, then it is not officially supported. Use caution when implementing markup that is not officially supported by this document, as undocumented functionality may change with version updates.--- ---Unless otherwise stated in these guidelines, all markup is line based, that is, a newline character should not intervene. These are identified as 'inline' markup.<<::c::---===Escaping Markup===---Anything between 2 sets of double-quotes is not formatted. This is the equivalent of escaping a character(s):--- ---<< ~##""**two bold ""**"" stars**""## From 2b85bc6da50ca98107e36cfff1c84e1dc584aaad Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 10 Feb 2018 15:19:56 -0500 Subject: [PATCH 06/15] fbdoc: wiki snapshot 2018-02-10 --- .../cache/TutBeginnersGuideToTypesAsObjects.wakka | 2 +- .../cache/TutBeginnersGuideToTypesAsObjects2.wakka | 10 +++++----- doc/manual/cache/TutConstQualifiers.wakka | 14 +++++++------- doc/manual/cache/TutIfStatement.wakka | 6 +++--- doc/manual/cache/TutIntroArrays.wakka | 10 +++++----- doc/manual/cache/TutIntroExtType.wakka | 2 +- doc/manual/cache/TutSelectStatement.wakka | 6 +++--- doc/manual/cache/TutUsingMouse.wakka | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka index 64cb5a16ab..0ceb310566 100644 --- a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka +++ b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects.wakka @@ -235,7 +235,7 @@ End Type Then you would build it like ##type(xpart, ypart, zpart)##. -Most or all operators can be overloaded, and most of them are binary ops, meaning they have two operands like the + example above. Some are unary ops having only a right hand side, like ##Not## and unary minus. They would be done like '##Operator Not(ByRef rhs As bar) As bar##'. +Most or all operators can be overloaded, and most of them are binary ops, meaning they have two operands like the + example above. Some are unary ops having only a right hand side, like ##Not## and unary minus. They would be done like '##""Operator Not(ByRef rhs As bar) As bar""##'. There are some special cases where they have to be declared inside the ##Type##; these are the assignment operators and casts. diff --git a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka index 29a007e48b..0ee1436dd2 100644 --- a/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka +++ b/doc/manual/cache/TutBeginnersGuideToTypesAsObjects2.wakka @@ -259,15 +259,15 @@ Print a.x[0], a.x[1], b.x[0], b.x[1] This may seem quite complex at first, it's worth just reading through it again, and experimenting with the examples, it's not too tricky once you're used to it. -**Passing objects to functions ByVal** +**Passing objects to functions ""ByVal""** ---- -The idea of deep and shallow copies also applies to passing an object to a function by value. When you pass a reference to an object (ByRef), you can modify the object, and these modifications will persist, however you can also pass by value, which will mean you can modify it without the changes persisting outside of the function. When an object is passed by value to a function, a new copy is created, and if that object has a copy constructor, then this is invoked, if it doesn't, then the hidden shallow copy is performed. Once the function ends, the objects destructor is called. +The idea of deep and shallow copies also applies to passing an object to a function by value. When you pass a reference to an object (""ByRef""), you can modify the object, and these modifications will persist, however you can also pass by value, which will mean you can modify it without the changes persisting outside of the function. When an object is passed by value to a function, a new copy is created, and if that object has a copy constructor, then this is invoked, if it doesn't, then the hidden shallow copy is performed. Once the function ends, the objects destructor is called. **New/Delete** ---- -New and delete are special operators for dynamically allocating memory, then destroying it. Because it is used with dynamic memory, it is used with pointers. In all the examples up until now, we just used Dim to create our objects, this will create them on the stack, but by using new we can create them dynamically, which can allow more flexibility, just like using Allocate/DeAllocate with normal memory. Another important thing about new, is that you don't need to check if the pointer is NULL after new, like you would if you did allocate. If new fails, it causes an exception, which will end the program. In later versions of FreeBASIC, it is likely that some kind of try..catch mechanism will be created to allow better exception handling, but as of the time of writing, this is not yet implemented. +New and delete are special operators for dynamically allocating memory, then destroying it. Because it is used with dynamic memory, it is used with pointers. In all the examples up until now, we just used Dim to create our objects, this will create them on the stack, but by using new we can create them dynamically, which can allow more flexibility, just like using Allocate/""DeAllocate"" with normal memory. Another important thing about new, is that you don't need to check if the pointer is NULL after new, like you would if you did allocate. If new fails, it causes an exception, which will end the program. In later versions of FreeBASIC, it is likely that some kind of try..catch mechanism will be created to allow better exception handling, but as of the time of writing, this is not yet implemented. There are two different varieties of the new/delete. The first type, creates just a single element or object, for example: @@ -366,7 +366,7 @@ Delete[] bar When you run this code, you will see that three constructor/destructor pairs are called, because we created an array of three instances of foo. -You must remember to call Delete, or Delete[] for any memory allocated with New, or you will cause a memory leak, just like the way you must rememeber to call DeAllocate for any memory you allocate with the Allocate function. +You must remember to call Delete, or Delete[] for any memory allocated with New, or you will cause a memory leak, just like the way you must rememeber to call ""DeAllocate"" for any memory you allocate with the Allocate function. **Name Mangling** ---- @@ -446,7 +446,7 @@ When using GDB, these will be shown as follows (note in ""C++"" they use :: wher BAR::BAR() - The default constructor BAR::BAR(BAR&) - The copy constructor (& in ""C++"" means a reference, like byref) - BAR::BAR(int) - The constructor taking an integer argument (note there is no special symbol to denote ByVal, as this is the default passing method in C/""C++"") + BAR::BAR(int) - The constructor taking an integer argument (note there is no special symbol to denote ""ByVal"", as this is the default passing method in C/""C++"") BAR::~BAR() - The destructor BAR::operator void*() - A cast to Any ptr (void is similar to Any, * means pointer) BAR::operator=(int) - The assignment operator (Let), dentoted by '=', in C/""C++"" '=' is assignment, '""==""' is equality testing. diff --git a/doc/manual/cache/TutConstQualifiers.wakka b/doc/manual/cache/TutConstQualifiers.wakka index ae50280cc1..3e1a068013 100644 --- a/doc/manual/cache/TutConstQualifiers.wakka +++ b/doc/manual/cache/TutConstQualifiers.wakka @@ -39,7 +39,7 @@ Sub my_sub (some_num As Integer) End Sub %% -Normally functions are allowed to modify the variables you send to them. Of course, whether they modify the original variable or just a local copy of the variable depends on whether you use ByVal or ByRef (and of course pointers is a whole different things altogether), but they normally are allowed to modify a variable. This may be undesirable, for whatever reason, and the Const qualifier exists to prevent that. In the function given above, some_num can be modified by the function. Normally it would only be a local copy that is modified, which is fine, since it won't affect the original Const Integer, but what if we declare the function like this? +Normally functions are allowed to modify the variables you send to them. Of course, whether they modify the original variable or just a local copy of the variable depends on whether you use ""ByVal"" or ""ByRef"" (and of course pointers is a whole different things altogether), but they normally are allowed to modify a variable. This may be undesirable, for whatever reason, and the Const qualifier exists to prevent that. In the function given above, some_num can be modified by the function. Normally it would only be a local copy that is modified, which is fine, since it won't affect the original Const Integer, but what if we declare the function like this? %%(freebasic) Sub my_sub (ByRef some_num As Integer) @@ -52,7 +52,7 @@ Now my_sub has direct access to whatever variable you pass to it, and for that r my_sub(my_const_int) %% -Why? Simply because the function may modify the variable. We don't know for sure that it will, of course, but it might, so we can't do that. In fact, the error you'll get if you try to compile that is "Invalid assignment/conversion." It's almost as if the Const Integer is a different variable type, but only when it's ByRef. In that case, it would act like trying to pass a string to an integer argument (or vice-versa). Yet if it's not passed ByRef, we don't have a problem, since there's no way the function can possibly modify the variable! +Why? Simply because the function may modify the variable. We don't know for sure that it will, of course, but it might, so we can't do that. In fact, the error you'll get if you try to compile that is "Invalid assignment/conversion." It's almost as if the Const Integer is a different variable type, but only when it's ""ByRef"". In that case, it would act like trying to pass a string to an integer argument (or vice-versa). Yet if it's not passed ""ByRef"", we don't have a problem, since there's no way the function can possibly modify the variable! And of course, if we did something like this: @@ -67,7 +67,7 @@ Then it compiles just fine, but if you try to do the following within the functi some_num = 3 %% -Why? Once again, the original variable has been passed ByRef to the sub. It's now in local scope, but because it's ByRef, any modifications to the variable would modify the original, which cannot be done. Once again, it's entirely possible to create a copy of the variable and modify it all you want: +Why? Once again, the original variable has been passed ""ByRef"" to the sub. It's now in local scope, but because it's ""ByRef"", any modifications to the variable would modify the original, which cannot be done. Once again, it's entirely possible to create a copy of the variable and modify it all you want: %%(freebasic) Dim As Integer copy_of_some_num = some_num @@ -114,7 +114,7 @@ Dim As Const my_type t t.t_int = 3 %% -As for the OOP side of things (and if you aren't interested in OOP you can skip this part) - you may be wondering about methods. Methods implicitly pass the object ByRef as this when called. Is there a way to create constant objects? Of course! We've already seen that. But some object methods will modify the object, and some won't. Is there a distinction? The answer is yes. As of November 23, 2007, we now have Const procs. That means you can do this: +As for the OOP side of things (and if you aren't interested in OOP you can skip this part) - you may be wondering about methods. Methods implicitly pass the object ""ByRef"" as this when called. Is there a way to create constant objects? Of course! We've already seen that. But some object methods will modify the object, and some won't. Is there a distinction? The answer is yes. As of November 23, 2007, we now have Const procs. That means you can do this: %%(freebasic) Type my_object @@ -153,7 +153,7 @@ u.modifier_sub() Sleep %% -Once again, the way this works is based on the simple rule. Since the implicitly passed copy of this is passed ByRef, any method is normally able to modify the contents of the object - and if the object is declared As Const, that's not supposed to happen! Thus, there are essentially two kinds of method. The two kinds are given names in the C""++"" documentation page (listed below in the references): there are mutators and inspectors. Mutators may modify objects, but inspectors do not. Thus, for objects declared As Const, only the inspector methods for those objects may be used - while all methods may be called for non-Const objects. The inspector methods are, of course, the ones declared as Const methods. Thus, for Const objects only their Const methods may be used. +Once again, the way this works is based on the simple rule. Since the implicitly passed copy of this is passed ""ByRef"", any method is normally able to modify the contents of the object - and if the object is declared As Const, that's not supposed to happen! Thus, there are essentially two kinds of method. The two kinds are given names in the C""++"" documentation page (listed below in the references): there are mutators and inspectors. Mutators may modify objects, but inspectors do not. Thus, for objects declared As Const, only the inspector methods for those objects may be used - while all methods may be called for non-Const objects. The inspector methods are, of course, the ones declared as Const methods. Thus, for Const objects only their Const methods may be used. This is all very good, but some of you may be asking - Why do I need this? Well, a direct answer would be out of the *scope* (heh) of this tutorial, so I'll counter - why do we need scope at all? The reason for Const qualifiers (and the future Const methods) is the same as the reason for scope within procedures and modules, and the same reason for hiding of variables in objects: because we want to be certain that something won't unexpectedly change in the middle of the program, when we least expect it. Sometimes we want things to change, and that's when we //don't// use the Const qualifier. But when you want something to stay what it is, you use the Const qualifier, and you can be certain it will not change (and the compiler won't compile the code if there is danger of it happening!) This is the definition of Const, how it works, and it's the reason you use it! And in general, it's the reason you use //any// scoping control or data hiding. @@ -166,8 +166,8 @@ If you have any other difficulties with Const qualifiers, remember that even tho If you still don't understand Const qualifiers, you probably are a newbie who doesn't know much about scope yet anyways - and that's fine, you'll learn as you go. Eventually some decent documentation for this feature will be created, but until then this is all you have. Bear in mind: if you don't understand how they work, you probably won't need them. I for one have written fine programs long before they were around, and I'll probably continue to do so without using them anywhere they aren't needed. There are specific instances when they're useful, and if you understand those instances then you may as well use them when those instances arise. But if you don't understand, that's fine! -Finally, here are some links that should be helpful. The first is a C""++"" documentation page about Const qualifiers in C""++"" - of course, it only makes sense if you understand C""++"", and they also talk about things we don't have yet (i.e., Const methods). Nevertheless it's a fine place to start if you know any C""++"", so check it out if you like. There is also a link to a forum topic in which I asked about FreeBasic development (and learned about Const qualifiers), and a link to the original SourceForge Feature Request page in which Const qualifiers were originally requested as a feature: +Finally, here are some links that should be helpful. The first is a C""++"" documentation page about Const qualifiers in C""++"" - of course, it only makes sense if you understand C""++"", and they also talk about things we don't have yet (i.e., Const methods). Nevertheless it's a fine place to start if you know any C""++"", so check it out if you like. There is also a link to a forum topic in which I asked about FreeBasic development (and learned about Const qualifiers), and a link to the original ""SourceForge"" Feature Request page in which Const qualifiers were originally requested as a feature: -http://www.parashift.com/c++-faq-lite/const-correctness.html +https://isocpp.org/wiki/faq/const-correctness http://www.freebasic.net/forum/viewtopic.php?t=9975&postdays=0&postorder=asc&start=0 http://sourceforge.net/tracker/index.php?func=detail&aid=1480621&group_id=122342&atid=693199 \ No newline at end of file diff --git a/doc/manual/cache/TutIfStatement.wakka b/doc/manual/cache/TutIfStatement.wakka index b2ec764947..1ded7a07cf 100644 --- a/doc/manual/cache/TutIfStatement.wakka +++ b/doc/manual/cache/TutIfStatement.wakka @@ -43,7 +43,7 @@ ElseIf Then End If %% -In this format if is True then the code following the Then is executed. If the answer is False then the ElseIf is executed. If the ElseIf is True, the code following the Then (of the ElseIf) is executed, otherwise the code following the End If is executed. You can have as many ElseIf statements as you need to fully cover the range of questions you need to ask. +In this format if is True then the code following the Then is executed. If the answer is False then the ""ElseIf"" is executed. If the ""ElseIf"" is True, the code following the Then (of the ""ElseIf"") is executed, otherwise the code following the End If is executed. You can have as many ""ElseIf"" statements as you need to fully cover the range of questions you need to ask. %%(freebasic) If Then @@ -55,7 +55,7 @@ Else End If %% -This format is a combination of all the other formats. If is True then the code following the Then is executed. If the answer is False then the ElseIf is executed. If the ElseIf is True, the code following the Then (of the ElseIf) is executed, otherwise the code following the Else is executed. +This format is a combination of all the other formats. If is True then the code following the Then is executed. If the answer is False then the ""ElseIf"" is executed. If the ""ElseIf"" is True, the code following the Then (of the ""ElseIf"") is executed, otherwise the code following the Else is executed. This format enables you to ask a series of questions and if the answer is False to all the questions, you can take a default course of action based on the Else block. @@ -95,7 +95,7 @@ If var were to contain the value of 3, then Not 3 is -4, which will be regarded === Overlapping Conditions === -When using compound conditions care must be taken to ensure that the conditions do not overlap. In most cases overlapping conditions will produce unpredictable results. Each condition must produce a unique result, and the combination of the individual results, must itself express a unique result. This is very important in If-ElseIf constructs; an overlapping condition within an If-ElseIf block may execute the wrong code at the wrong time. +When using compound conditions care must be taken to ensure that the conditions do not overlap. In most cases overlapping conditions will produce unpredictable results. Each condition must produce a unique result, and the combination of the individual results, must itself express a unique result. This is very important in If-""ElseIf"" constructs; an overlapping condition within an If-""ElseIf"" block may execute the wrong code at the wrong time. === Nested If Statements === diff --git a/doc/manual/cache/TutIntroArrays.wakka b/doc/manual/cache/TutIntroArrays.wakka index 35e63b85e1..9b89e7e858 100644 --- a/doc/manual/cache/TutIntroArrays.wakka +++ b/doc/manual/cache/TutIntroArrays.wakka @@ -77,7 +77,7 @@ For example, to define a cube in space, you would use the y,x,z format, where y Dim myCube(y, x, z) as Integer. %% -##MyCube(10, 10, 10)## would create a cube with 11 vertical units, 0 to 10, 11 horizontal units, 0 to 10 and 10 depth units, 0 to 10. To access the center of the cube, you would use ##iCenter = myCube(5, 5, 5)##. +##""MyCube(10, 10, 10)""## would create a cube with 11 vertical units, 0 to 10, 11 horizontal units, 0 to 10 and 10 depth units, 0 to 10. To access the center of the cube, you would use ##iCenter = myCube(5, 5, 5)##. You will probably never need to use arrays of more than three dimensions, unless you are doing some advanced mathematical calculations. However, if you need to use higher-dimensional arrays, the same principles apply. @@ -87,7 +87,7 @@ The arrays described above are static arrays; the array size cannot change durin Static arrays, the arrays described above, are kept on the heap, but dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the requested dimensions of the array. -You specify a dynamic array by using the ##ReDim## keyword. +You specify a dynamic array by using the ##""ReDim""## keyword. %%(freebasic) Redim myArray(1 to 5, 1 to 5) as Integer @@ -99,11 +99,11 @@ If you don't know the needed array bounds at the start of the program execution, Dim myArray() as Integer %% -In this case the compiler sets a default value of 0 for the array size. You can then use the ##ReDim## at some point in the program to set the array bounds. +In this case the compiler sets a default value of 0 for the array size. You can then use the ##""ReDim""## at some point in the program to set the array bounds. -=== ReDim and ReDim Preserve === +=== ""ReDim"" and ""ReDim"" Preserve === -Dynamic arrays can change sizes during execution. ##ReDim## will clear the contents of the array to the default data type values, while ##ReDim Preserve## will keep intact the existing contents, unless the array size is smaller than the previous size. +Dynamic arrays can change sizes during execution. ##""ReDim""## will clear the contents of the array to the default data type values, while ##""ReDim Preserve""## will keep intact the existing contents, unless the array size is smaller than the previous size. === Array Functions === diff --git a/doc/manual/cache/TutIntroExtType.wakka b/doc/manual/cache/TutIntroExtType.wakka index 900ce56cd9..8625a3d0aa 100644 --- a/doc/manual/cache/TutIntroExtType.wakka +++ b/doc/manual/cache/TutIntroExtType.wakka @@ -257,7 +257,7 @@ Constructor MyRect (xx_ As Integer, yy_ As Integer, w_ As Integer, _ this.Fillcolor_ = fc_ End Constructor %% -The Methods and Properties are defined using the Sub/Function/Property methodname.TypeName syntax. This tells the compiler how to match up methods with the proper type definition. The Constructors are defined with the type name for the same reason. The //this// identifier is a hidden parameter that is passed to the methods that refers to the defined type. You use the //this// identifier to specify that you want to access the type constructs. +The Methods and Properties are defined using the Sub/Function/Property ##""TypeName.methodname""## syntax. This tells the compiler how to match up methods with the proper type definition. The Constructors are defined with the type name for the same reason. The //this// identifier is a hidden parameter that is passed to the methods that refers to the defined type. You use the //this// identifier to specify that you want to access the type constructs. === Using Your Object=== diff --git a/doc/manual/cache/TutSelectStatement.wakka b/doc/manual/cache/TutSelectStatement.wakka index 2256b77912..92f31ad37c 100644 --- a/doc/manual/cache/TutSelectStatement.wakka +++ b/doc/manual/cache/TutSelectStatement.wakka @@ -1,7 +1,7 @@ {{fbdoc item="title" value="The Select Case Statement"}}---- //Written by [[WikiRick|rdc]]// -The Select Case block can be viewed as an optimized If-ElseIf ladder, and works in much the same way. The standard Select Case can use any of the standard data types for and the specialized Select Case As Const format is optimized for integer values. +The Select Case block can be viewed as an optimized If-""ElseIf"" ladder, and works in much the same way. The standard Select Case can use any of the standard data types for and the specialized Select Case As Const format is optimized for integer values. This code snippet shows the syntax of the standard select case. Expression is usually a variable which can be of any of the standard data types, or individual elements of a Type or array. @@ -84,7 +84,7 @@ In the program, when you press a key, the value is translated to a number using The compiler will check the value of keycode against the Case ranges to see if the block should execute. If keycode falls within a particular range, the Print statement will execute, and then the flow of the program will continue with the next line following the End Select. If keycode doesn't match any Case range, then the program will continue with the next line following the End Select. -A Select Case can usually be translated from an If-Elseif ladder. To illustrate this, the previous program is shown below as an If-ElseIf ladder. +A Select Case can usually be translated from an If-Elseif ladder. To illustrate this, the previous program is shown below as an If-""ElseIf"" ladder. %%(freebasic) 'Ascii code of key press @@ -106,6 +106,6 @@ Loop Until keycode = 27 '27 is the ascii code for Escape End %% -If you compare the two programs, you can see that the logic is quite similar, however the Select Case is much more readable and understandable than the If-ElseIf ladder. +If you compare the two programs, you can see that the logic is quite similar, however the Select Case is much more readable and understandable than the If-""ElseIf"" ladder. //Last Reviewed by ""Sancho3"" on February 06, 2018// diff --git a/doc/manual/cache/TutUsingMouse.wakka b/doc/manual/cache/TutUsingMouse.wakka index 6caa687c24..41a2b0cf5c 100644 --- a/doc/manual/cache/TutUsingMouse.wakka +++ b/doc/manual/cache/TutUsingMouse.wakka @@ -25,7 +25,7 @@ In FreeBasic, there's basically 2 commands that you need to worry about when try {{fbdoc item="title" value="GETMOUSE"}} ---- {{fbdoc item="syntax"}} -result = GetMouse (x, y [, [ wheel ] [, [ buttons ] [, [ clip ]]]]) +result = ""GetMouse"" (x, y [, [ wheel ] [, [ buttons ] [, [ clip ]]]]) {{fbdoc item="desc"}} GETMOUSE retrieves the mouse position and button status. @@ -45,7 +45,7 @@ Mouse position is stored in X and Y when the function is called. If the mouse is {{fbdoc item="title" value="SETMOUSE"}} ---- {{fbdoc item="syntax"}} -result = SetMouse([ x ] [, [ y ] [, [ visibility ] [, [ clip ]]]]) +result = ""SetMouse""([ x ] [, [ y ] [, [ visibility ] [, [ clip ]]]]) {{fbdoc item="desc"}} SETMOUSE will set the X,Y coordinates of the mouse pointer, as well as setting it's visibility. From 887ee778763a2876025090dc72e7954198414965 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 10 Feb 2018 15:31:02 -0500 Subject: [PATCH 07/15] fbdoc: remove pages marked for delete as of 2018-02-10 --- doc/manual/cache/Casting.wakka | 59 --- doc/manual/cache/CodeLib.wakka | 18 - doc/manual/cache/CodeLibDevTools.wakka | 10 - doc/manual/cache/CodeLibExample.wakka | 9 - doc/manual/cache/CodeLibGame.wakka | 14 - doc/manual/cache/CodeLibGfx.wakka | 37 -- doc/manual/cache/CodeLibGraphics.wakka | 37 -- doc/manual/cache/CodeLibMath.wakka | 17 - doc/manual/cache/CodeLibMisc.wakka | 156 -------- doc/manual/cache/CodeLibOSSpecific.wakka | 30 -- doc/manual/cache/CodeLibSound.wakka | 7 - doc/manual/cache/CodeLibText.wakka | 19 - doc/manual/cache/CodeLibWeb.wakka | 8 - doc/manual/cache/DevIL.wakka | 7 - doc/manual/cache/DirectMedia.wakka | 7 - doc/manual/cache/ExtLibfbsound.wakka | 15 - doc/manual/cache/ExtLibmini.wakka | 11 - doc/manual/cache/FormattingRules.wakka | 276 -------------- doc/manual/cache/GD.wakka | 9 - doc/manual/cache/GFXLib2.wakka | 6 - doc/manual/cache/TableMarkup.wakka | 395 -------------------- doc/manual/cache/TableMarkupReference.wakka | 74 ---- doc/manual/cache/TestPage.wakka | 10 - doc/manual/cache/TutGettingStarted.wakka | 7 - doc/manual/cache/WikkaFormattingRules.wakka | 275 -------------- 25 files changed, 1513 deletions(-) delete mode 100644 doc/manual/cache/Casting.wakka delete mode 100644 doc/manual/cache/CodeLib.wakka delete mode 100644 doc/manual/cache/CodeLibDevTools.wakka delete mode 100644 doc/manual/cache/CodeLibExample.wakka delete mode 100644 doc/manual/cache/CodeLibGame.wakka delete mode 100644 doc/manual/cache/CodeLibGfx.wakka delete mode 100644 doc/manual/cache/CodeLibGraphics.wakka delete mode 100644 doc/manual/cache/CodeLibMath.wakka delete mode 100644 doc/manual/cache/CodeLibMisc.wakka delete mode 100644 doc/manual/cache/CodeLibOSSpecific.wakka delete mode 100644 doc/manual/cache/CodeLibSound.wakka delete mode 100644 doc/manual/cache/CodeLibText.wakka delete mode 100644 doc/manual/cache/CodeLibWeb.wakka delete mode 100644 doc/manual/cache/DevIL.wakka delete mode 100644 doc/manual/cache/DirectMedia.wakka delete mode 100644 doc/manual/cache/ExtLibfbsound.wakka delete mode 100644 doc/manual/cache/ExtLibmini.wakka delete mode 100644 doc/manual/cache/FormattingRules.wakka delete mode 100644 doc/manual/cache/GD.wakka delete mode 100644 doc/manual/cache/GFXLib2.wakka delete mode 100644 doc/manual/cache/TableMarkup.wakka delete mode 100644 doc/manual/cache/TableMarkupReference.wakka delete mode 100644 doc/manual/cache/TestPage.wakka delete mode 100644 doc/manual/cache/TutGettingStarted.wakka delete mode 100644 doc/manual/cache/WikkaFormattingRules.wakka diff --git a/doc/manual/cache/Casting.wakka b/doc/manual/cache/Casting.wakka deleted file mode 100644 index 9fe481df12..0000000000 --- a/doc/manual/cache/Casting.wakka +++ /dev/null @@ -1,59 +0,0 @@ -!!! DELETE ME !!! - -=====Quick Introduction===== -This tutorial covers ideas behind casting pointers, and what data is cast. I don't know the technical workings in the compiler, but I do know this works, and it's convenient if you are working with lots of information, that has a base-type of some sorts that it builds off of. Hopefully, this will make more sense as we go on. - -====Base-type==== -This is my wording for what Cpp would call Class x **extends** basetype -FreeBASIC, however, does not use Classes (yet), and definitely does not support "extends" in this context. I don't know if you would call this a hack, but it works, and I'm happy with it. - -====Code==== -You'll need to be familiar with cptr() and what pointers are. - -So, you have your base type. For this, I'll use some code I'm using in a game, where I need all objects to share certain information for collision detection: - -type ObjectDefinition - '' Collision Data - as integer typeID, objID - as ubyte integrity - '' Object Constants (for physics) - as single mass, size, e, u -end type - -Any object will need this information, from a player's instance to any segment of floor. - -Now, whatever data you put in this type, you'll want a quick way of defining and getting that information out. - -This is how I'd do that: - -#macro Object( typename ) -type typename - __object__ as ObjectDefinition -#endmacro - -#macro endObject -end type -#endmacro - -So, to make an object: -Object( test ) - /' Fill in the data here '/ -endObject - -Now, to get the ObjectDefinition, you could do: -dim x as test -x.__object__ - -But, this makes it so you only have the __object__, so the x variable is no longer accessible. - -Here is a better, more preferred approach: -dim x as test -var n = cptr( ObjectDefinition ptr, @x ) -no, "n" can be recast to get the original x variable: -var revert = cptr( test ptr, n ) -now, revert will point to x - -The reason this works, is because in the macro, __object__ is first, so it is the first bit of data found when casting. - -Hope you enjoy, --Oz \ No newline at end of file diff --git a/doc/manual/cache/CodeLib.wakka b/doc/manual/cache/CodeLib.wakka deleted file mode 100644 index 363eb8b8bf..0000000000 --- a/doc/manual/cache/CodeLib.wakka +++ /dev/null @@ -1,18 +0,0 @@ -!!! DELETE ME !!! - -Welcome to the FreeBASIC Code Library. Find links to tools, code snippets, examples, etc. here. - -{{fbdoc item="section" value="Code Library"}} - - [[http://www.freebasic.net/wiki/wikka.php?wakka=CodeLibDevTools|IDEs, RAD and GUIs]] - Development tools + GUI/RAD application development - [[http://www.freebasic.net/wiki/wikka.php?wakka=CodeLibMisc|Misc]] - Miscellaneous code examples - -{{fbdoc item="section" value="Websites and Tutorials"}} - - [[http://games.freebasic.net/|FBGD]] - The FreeBASIC Games Directory by Lachie Dazdarian - [[http://www.petesqbsite.com/sections/express/express.shtml|QBExpress]] - "Original" QB Magazine by Pete - -* This page is a work in progress. Your feedback and support is greatly appreciated. -Please visit the [[http://www.freebasic.net/forum/viewforum.php?f=9|documentation forum]]. - -{{fbdoc item="back" value="DocToc|Table of Contents"}} \ No newline at end of file diff --git a/doc/manual/cache/CodeLibDevTools.wakka b/doc/manual/cache/CodeLibDevTools.wakka deleted file mode 100644 index 4db5fd306d..0000000000 --- a/doc/manual/cache/CodeLibDevTools.wakka +++ /dev/null @@ -1,10 +0,0 @@ -!!! DELETE ME !!! - -{{fbdoc item="section" value="Windows IDEs, GUI and RAD"}} - - [[http://fbedit.freebasic.net/viewforum.php?f=2|FBEdit]] - IDE for FreeBASIC by KetilO - [[http://www.freebasiccompiler.com/|FireFly Visual Designer]] - RAD/GUI Designer for FreeBASIC by PaulSquires - -{{fbdoc item="section" value="Cross-Platform IDEs, GUI and RAD"}} - - [[http://freebasic.net/forum/viewtopic.php?t=12322|AntTweakBar]] - Linux and Windows GUI Library \ No newline at end of file diff --git a/doc/manual/cache/CodeLibExample.wakka b/doc/manual/cache/CodeLibExample.wakka deleted file mode 100644 index 83974eada7..0000000000 --- a/doc/manual/cache/CodeLibExample.wakka +++ /dev/null @@ -1,9 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="EXAMPLE"}}{{fbdoc item="section" value="Example Page (Linked Lists)"}} - [[http://freebasic.net/forum/|Linked List]] - External example or library - -== Linked List Internal Example == -%%(freebasic) -'' Some code here -%% \ No newline at end of file diff --git a/doc/manual/cache/CodeLibGame.wakka b/doc/manual/cache/CodeLibGame.wakka deleted file mode 100644 index 2e15e8a0b3..0000000000 --- a/doc/manual/cache/CodeLibGame.wakka +++ /dev/null @@ -1,14 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="GAME"}}{{fbdoc item="section" value="FreeBASIC Games"}} - [[http://games.freebasic.net/ FreeBASIC Games Directory by Lachie Dazdarian]] - ==Featured Games:== - [[http://csgp.suret.net/ Cute Short Game Project by redcrab]] - [[http://www.freebasic.net/forum/viewtopic.php?t=3931 Kingdoms by Piptol]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5068 Lynn's Legacy by cha0s and Josiah Tobin]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7796 Nanohost by Several]] - [[http://lithium.zext.net/ Several Games by Lithium]] - [[http://lachie.phatcode.net/starcage.php Star Cage by Lachie Dazdarian]] - [[http://syn9.thingie.net/?table=griffonlegend The Griffon Legend by syn9]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9065 100 Line Tetris by Deleter]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9738 Any PNG or JPEG as a Jigsaw Puzzle by Mysoft]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibGfx.wakka b/doc/manual/cache/CodeLibGfx.wakka deleted file mode 100644 index 92cf927d76..0000000000 --- a/doc/manual/cache/CodeLibGfx.wakka +++ /dev/null @@ -1,37 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="GRAPHIC"}}{{fbdoc item="section" value="Graphics Code"}} - ==Demos== - [[http://aapproj.phatcode.net/fbgfx/index.html The FreeBASIC GFX Demo Central by Adigun A.Polack]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6938 Animated Clouds by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8817 Flame Demo by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7936 Island Generation by rdc]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8287 Ascii Fire by rdc]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8758 Plasma Generation by Zamaster]] - - ==Graphics Functions and Primitives== - [[http://www.freebasic.net/forum/viewtopic.php?t=7111 AntiAliased Bezier Curves by Acetoline]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7067 Antialiased Circles by Acetoline]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9572 Ellipse Renderer by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7546 Catmull-rom Splines by relsoft]] [[http://www.freebasic.net/forum/viewtopic.php?t=7545 Bezier vs Catmull-rom by relsoft]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9588 Accurate Image Scaler by KristopherWindsor]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6676 Spline Curve by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=13251 Rotozoom by Dr_D]] - - ==Colors and Palettes== - [[http://www.freebasic.net/forum/viewtopic.php?t=9441 24bit to 16bit color width by Eternal_Pain]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8764 HSV Color Space by Antoni]] - - ==Formats== - [[http://www.freebasic.net/forum/viewtopic.php?t=8024 PNG_LOAD by yetifoot]] - [[http://www.freebasic.net/arch/category.php?id=6 JPEG image loader by Antoni]] - - ==3D== - [[http://www.freebasic.net/forum/viewtopic.php?t=8724 Tree Generation by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7931 Quadtree-Based Renderer by relsoft]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7332 Irrlicht 3D + ODE Physics by BMarley]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8400 OpenGL Shader Demo by Dr_D]] - - ==Animation== - [[http://www.freebasic.net/forum/viewtopic.php?t=7340 ASCII Animation Example by Pritchard]] - [[http://lachie.phatcode.net/articles.php Chain-Like Animation Tutorial by Lachie Dazdarian]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibGraphics.wakka b/doc/manual/cache/CodeLibGraphics.wakka deleted file mode 100644 index 92cf927d76..0000000000 --- a/doc/manual/cache/CodeLibGraphics.wakka +++ /dev/null @@ -1,37 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="GRAPHIC"}}{{fbdoc item="section" value="Graphics Code"}} - ==Demos== - [[http://aapproj.phatcode.net/fbgfx/index.html The FreeBASIC GFX Demo Central by Adigun A.Polack]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6938 Animated Clouds by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8817 Flame Demo by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7936 Island Generation by rdc]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8287 Ascii Fire by rdc]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8758 Plasma Generation by Zamaster]] - - ==Graphics Functions and Primitives== - [[http://www.freebasic.net/forum/viewtopic.php?t=7111 AntiAliased Bezier Curves by Acetoline]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7067 Antialiased Circles by Acetoline]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9572 Ellipse Renderer by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7546 Catmull-rom Splines by relsoft]] [[http://www.freebasic.net/forum/viewtopic.php?t=7545 Bezier vs Catmull-rom by relsoft]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9588 Accurate Image Scaler by KristopherWindsor]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6676 Spline Curve by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=13251 Rotozoom by Dr_D]] - - ==Colors and Palettes== - [[http://www.freebasic.net/forum/viewtopic.php?t=9441 24bit to 16bit color width by Eternal_Pain]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8764 HSV Color Space by Antoni]] - - ==Formats== - [[http://www.freebasic.net/forum/viewtopic.php?t=8024 PNG_LOAD by yetifoot]] - [[http://www.freebasic.net/arch/category.php?id=6 JPEG image loader by Antoni]] - - ==3D== - [[http://www.freebasic.net/forum/viewtopic.php?t=8724 Tree Generation by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7931 Quadtree-Based Renderer by relsoft]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7332 Irrlicht 3D + ODE Physics by BMarley]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8400 OpenGL Shader Demo by Dr_D]] - - ==Animation== - [[http://www.freebasic.net/forum/viewtopic.php?t=7340 ASCII Animation Example by Pritchard]] - [[http://lachie.phatcode.net/articles.php Chain-Like Animation Tutorial by Lachie Dazdarian]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibMath.wakka b/doc/manual/cache/CodeLibMath.wakka deleted file mode 100644 index 3b41177923..0000000000 --- a/doc/manual/cache/CodeLibMath.wakka +++ /dev/null @@ -1,17 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="MATH"}}{{fbdoc item="section" value="Math Code"}} - [[http://sourceforge.net/projects/fbmath/ FBMath by jdebord]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4135 Pixel-Perfect Collision Detection by 1000101]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8963 2D vector class by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=386 A* Pathfinding by dumbledore]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7525 Fraction Library by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7173 Big Number Wrapper by Yetifoot]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9501 Minicalc textmode calculator by KristopherWindsor]] - [[http://www.freebasic.net/forum/viewtopic.php?p=75713 BCD arithmetics by srvaldez]] - [[http://www.freebasic.net/forum/viewtopic.php?p=49695 10Byte extended float by srvaldez, included in FB examples]] - - ==Physics simulation== - [[http://www.freebasic.net/forum/viewtopic.php?t=3167 Atom smash simulation by coderjeff]] - [[http://www.freebasic.net/forum/viewtopic.php?t=3428 2d rigid body library by coderjeff]] - [[http://www.freebasic.net/forum/viewtopic.php?t=14579 Irrlicht wrapper + Newton Intergrated by SiskinEDGE]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibMisc.wakka b/doc/manual/cache/CodeLibMisc.wakka deleted file mode 100644 index e42f641f93..0000000000 --- a/doc/manual/cache/CodeLibMisc.wakka +++ /dev/null @@ -1,156 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="OTHER"}}{{fbdoc item="section" value="Miscellaneous Code"}} - [[http://code.google.com/p/fb-extended-lib/|FreeBASIC Extended Library]] - - [[http://www.freebasic.net/forum/viewtopic.php?t=7441|FB CAD by owen]] - [[http://fbstd.sourceforge.net/|FBstd C++ Lib Port (W.I.P.) by stylin]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6859|Testly by zerospeed]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8935|Boolean Type by Imortis]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8226|Associative Arrays by jofers]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8823|Safe FBstring Type by stylin]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8778|Aligned Memory Allocation by 1000101]] - [[http://www.freebasic.net/forum/viewtopic.php?t=3545|FreeBASIC Memory Leak Detector by DrV & Others]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6576|Auto-deallocating 'Smart' Pointers by stylin]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9463|UDTs for Properties by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8504|Portable way to add a resource to a program by voodooattack]] - [[http://www.freebasic.net/forum/viewtopic.php?p=66616|CPU Identification by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4221|Cpu Cycle counter for benchmarking of code by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?p=84902&highlight=#84902|Use of the FBGfx built-in LZW routines by Lillo]] - [[http://rapidq.phatcode.net/tutorial/Freebasic_DLL_tutorial.html|Using FB dll's in RapidQ programs by JohnK]] - - ==Serial Port== - [[http://www.freebasic.net/forum/viewtopic.php?p=66616|Drive a Parallax servo controller by phishguy]] - [[http://www.freebasic.net/forum/viewtopic.php?p=34643|Modbus device finder by Antoni]] - [[http://www.freebasic.net/forum/viewtopic.php?p=3132|Serial port terminal program by Antoni]] - [[http://www.freebasic.net/forum/viewtopic.php?p=26794|CRC Calculation by Fragmeister]] - -{{anchor name="MATH"}}{{fbdoc item="section" value="Math Code"}} - [[http://sourceforge.net/projects/fbmath/|FBMath by jdebord]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4135|Pixel-Perfect Collision Detection by 1000101]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8963|2D vector class by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=386|A* Pathfinding by dumbledore]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7525|Fraction Library by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7173|Big Number Wrapper by Yetifoot]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9501|Minicalc textmode calculator by KristopherWindsor]] - [[http://www.freebasic.net/forum/viewtopic.php?p=75713|BCD arithmetics by srvaldez]] - [[http://www.freebasic.net/forum/viewtopic.php?p=49695|10Byte extended float by srvaldez, included in FB examples]] - - ==Physics simulation== - [[http://www.freebasic.net/forum/viewtopic.php?t=3167|Atom smash simulation by coderjeff]] - [[http://www.freebasic.net/forum/viewtopic.php?t=3428|2d rigid body library by coderjeff]] - [[http://www.freebasic.net/forum/viewtopic.php?t=14579|Irrlicht wrapper + Newton Intergrated by SiskinEDGE]] - -{{anchor name="IO"}}{{fbdoc item="section" value="I/O Code"}} - [[http://www.freebasic.net/forum/viewtopic.php?t=6574|Text Input by Pritchard & sir_mud]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6847|ConLib Console library with PCopy by cha0s]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7744|Lock Mouse to Grid Positions by Pritchard]] - -{{anchor name="GRAPHIC"}}{{fbdoc item="section" value="Graphics Code"}} - ==Demos== - [[http://aapproj.phatcode.net/fbgfx/index.html|The FreeBASIC GFX Demo Central by Adigun A.Polack]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6938|Animated Clouds by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8817|Flame Demo by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7936|Island Generation by rdc]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8287|Ascii Fire by rdc]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8758|Plasma Generation by Zamaster]] - - ==Graphics Functions and Primitives== - [[http://www.freebasic.net/forum/viewtopic.php?t=7111|AntiAliased Bezier Curves by Acetoline]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7067|Antialiased Circles by Acetoline]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9572|Ellipse Renderer by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7546|Catmull-rom Splines by relsoft]] [[http://www.freebasic.net/forum/viewtopic.php?t=7545|Bezier vs Catmull-rom by relsoft]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9588|Accurate Image Scaler by KristopherWindsor]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6676|Spline Curve by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=13251|Rotozoom by Dr_D]] - - ==Colors and Palettes== - [[http://www.freebasic.net/forum/viewtopic.php?t=9441|24bit to 16bit color width by Eternal_Pain]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8764|HSV Color Space by Antoni]] - - ==Formats== - [[http://www.freebasic.net/forum/viewtopic.php?t=8024|PNG_LOAD by yetifoot]] - [[http://www.freebasic.net/arch/category.php?id=6|JPEG image loader by Antoni]] - - ==3D== - [[http://www.freebasic.net/forum/viewtopic.php?t=8724|Tree Generation by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7931|Quadtree-Based Renderer by relsoft]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7332|Irrlicht 3D + ODE Physics by BMarley]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8400|OpenGL Shader Demo by Dr_D]] - - ==Animation== - [[http://www.freebasic.net/forum/viewtopic.php?t=7340|ASCII Animation Example by Pritchard]] - [[http://lachie.phatcode.net/articles.php|Chain-Like Animation Tutorial by Lachie Dazdarian]] - -{{anchor name="GAME"}}{{fbdoc item="section" value="FreeBASIC Games"}} - [[http://games.freebasic.net/|FreeBASIC Games Directory by Lachie Dazdarian]] - ==Featured Games:== - [[http://csgp.suret.net/|Cute Short Game Project by redcrab]] - [[http://www.freebasic.net/forum/viewtopic.php?t=3931|Kingdoms by Piptol]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5068|Lynn's Legacy by cha0s and Josiah Tobin]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7796|Nanohost by Several]] - [[http://lithium.zext.net/|Several Games by Lithium]] - [[http://lachie.phatcode.net/starcage.php|Star Cage by Lachie Dazdarian]] - [[http://syn9.thingie.net/?table=griffonlegend|The Griffon Legend by syn9]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9065|100 Line Tetris by Deleter]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9738|Any PNG or JPEG as a Jigsaw Puzzle by Mysoft]] - -{{anchor name="OSSPEC"}}{{fbdoc item="section" value="OS Specific Code"}} - ==Windows== - [[http://www.freebasic.net/forum/viewtopic.php?t=1173|Screen Saver Kit (WIN) by jofers]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5942|ServiceFB (Win) by zerospeed]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9498|FBWinPrint 1.0 by vdecampo]] - [[http://www.freebasic.net/forum/viewtopic.php?p=47539|In memory dialogs by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4767|Printing to UTF8 to Windows by Jonathan Brickman]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9495|Talking program usin Win Voice API, by coder guy]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6569|Jpeg and Gif resources using the API by Zippy]] - [[http://www.freebasic.net/forum/viewtopic.php?p=76442|Using GfxLib in Windows API by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?p=69681|Print a bitmap file by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?p=70771|ShellExecute wrapper by RayBritton]] - [[http://www.execulink.com/~coder/freebasic/fbwiki.html|FBWiki to chm format converter by coderjeff]] - [[http://www.freebasic.net/forum/viewtopic.php?p=75625|FB ODBC library by KaraK]] - [[http://www.freebasic.net/forum/viewtopic.php?p=119557|Get a file from an URL by Sisophon]] - [[http://www.freebasic.net/forum/viewtopic.php?t=14224|FB Windows GUI Toolkit by eodor]] - [[http://www.freebasic.net/forum/viewtopic.php?t=13468|Screen to AVI lib by vdecampo]] - - ==Linux== - [[http://www.freebasic.net/forum/viewtopic.php?t=8040|Printing on Linux by coderJeff]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7611|Using GfxLib on Gtk by caseih]] - - ==DOS== - [[http://www.freebasic.net/forum/viewtopic.php?p=70185|Detect system codepage by DrV]] - [[http://www.freebasic.net/forum/viewtopic.php?p=5993|Calling an Interrupt requiring a pointer by DrV]] - [[http://www.freebasic.net/forum/viewtopic.php?p=2766|Access BTRIEVE files by mjs]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8981|"GetDiskFreeSpaceEx" Check for disk total/free space on FAT32 by DOS386]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4899|DPMI host detection version/capabilities by DrV]] - -{{anchor name="SND"}}{{fbdoc item="section" value="Sound Code"}} - [[http://www.freebasic.net/forum/viewtopic.php?t=2294|Mic Input using FMod by mambazo]] - [[http://www.freebasic.net/forum/viewtopic.php?t=11|Using FMod In-Game by shiftlynx]] - [[http://www.freebasic.net/forum/viewtopic.php?p=20477|Using the PC Speaker by several]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9226|Wave synthesizer by Zamaster]] - -{{anchor name="TEXT"}}{{fbdoc item="section" value="Text/Parser Code"}} - [[http://hmcsoft.org/p/libini.php|Cross Platform INI library by SirMud]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7437|XML Parser by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5693|Expression Parser by yetifoot]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8680|Turing Machine by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7321|Roman Numeral to Integer Conversion by stylin]] - [[http://www.freebasic.net/forum/viewtopic.php?p=35589|Unicode console calender, by zippy and voodooattack]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8636|FB source to highlighted HTML by Kristopher Windsor]] - [[http://www.execulink.com/~coder/freebasic/docs.html|Portable help (not .chm) viewer by coderjeff]] - [[http://www.execulink.com/~coder/freebasic/lisp.html|Lisp interpreter by coderjeff]] - - ==Cryptography== - [[http://www.freebasic.net/forum/viewtopic.php?t=7379|MARS encryption by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7667|AES Encryption/Decryption by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7273|DES/LUCIFER Encryption/Decryption by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5288|MD5 Calculator by DOS386]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9496|Tiger Hash by Mindless]] - -{{anchor name="WEB"}}{{fbdoc item="section" value="Networking- Web Code"}} - [[http://www.freebasic.net/forum/viewtopic.php?t=4199|FB Web Server (Win) by parakeet]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7913|FB Server side scripting (uses the server above) by fishhf]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8454|ChiSock portable sockets library by cha0s]] - [[http://www.freebasic.net/forum/viewtopic.php?t=1608|CenoChat Serverless chat program by cenozoite]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4036|LibIRCClient to create custom IRC clients by voodooattack]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibOSSpecific.wakka b/doc/manual/cache/CodeLibOSSpecific.wakka deleted file mode 100644 index 66b3078dda..0000000000 --- a/doc/manual/cache/CodeLibOSSpecific.wakka +++ /dev/null @@ -1,30 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="OSSPEC"}}{{fbdoc item="section" value="OS Specific Code"}} - ==Windows== - [[http://www.freebasic.net/forum/viewtopic.php?t=1173 Screen Saver Kit (WIN) by jofers]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5942 ServiceFB (Win) by zerospeed]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9498 FBWinPrint 1.0 by vdecampo]] - [[http://www.freebasic.net/forum/viewtopic.php?p=47539 In memory dialogs by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4767 Printing to UTF8 to Windows by Jonathan Brickman]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9495 Talking program usin Win Voice API, by coder guy]] - [[http://www.freebasic.net/forum/viewtopic.php?t=6569 Jpeg and Gif resources using the API by Zippy]] - [[http://www.freebasic.net/forum/viewtopic.php?p=76442 Using GfxLib in Windows API by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?p=69681 Print a bitmap file by MichaelW]] - [[http://www.freebasic.net/forum/viewtopic.php?p=70771 ShellExecute wrapper by RayBritton]] - [[http://www.execulink.com/~coder/freebasic/fbwiki.html FBWiki to chm format converter by coderjeff]] - [[http://www.freebasic.net/forum/viewtopic.php?p=75625 FB ODBC library by KaraK]] - [[http://www.freebasic.net/forum/viewtopic.php?p=119557 Get a file from an URL by Sisophon]] - [[http://www.freebasic.net/forum/viewtopic.php?t=14224 FB Windows GUI Toolkit by eodor]] - [[http://www.freebasic.net/forum/viewtopic.php?t=13468 Screen to AVI lib by vdecampo]] - - ==Linux== - [[http://www.freebasic.net/forum/viewtopic.php?t=8040 Printing on Linux by coderJeff]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7611 Using GfxLib on Gtk by caseih]] - - ==DOS== - [[http://www.freebasic.net/forum/viewtopic.php?p=70185 Detect system codepage by DrV]] - [[http://www.freebasic.net/forum/viewtopic.php?p=5993 Calling an Interrupt requiring a pointer by DrV]] - [[http://www.freebasic.net/forum/viewtopic.php?p=2766 Access BTRIEVE files by mjs]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8981 "GetDiskFreeSpaceEx" Check for disk total/free space on FAT32 by DOS386]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4899 DPMI host detection version/capabilities by DrV]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibSound.wakka b/doc/manual/cache/CodeLibSound.wakka deleted file mode 100644 index 99c3087346..0000000000 --- a/doc/manual/cache/CodeLibSound.wakka +++ /dev/null @@ -1,7 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="SND"}}{{fbdoc item="section" value="Sound Code"}} - [[http://www.freebasic.net/forum/viewtopic.php?t=2294 Mic Input using FMod by mambazo]] - [[http://www.freebasic.net/forum/viewtopic.php?t=11 Using FMod In-Game by shiftlynx]] - [[http://www.freebasic.net/forum/viewtopic.php?p=20477 Using the PC Speaker by several]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9226 Wave synthesizer by Zamaster]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibText.wakka b/doc/manual/cache/CodeLibText.wakka deleted file mode 100644 index c4bb8183b5..0000000000 --- a/doc/manual/cache/CodeLibText.wakka +++ /dev/null @@ -1,19 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="TEXT"}}{{fbdoc item="section" value="Text/Parser Code"}} - [[http://hmcsoft.org/p/libini.php Cross Platform INI library by SirMud]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7437 XML Parser by Pritchard]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5693 Expression Parser by yetifoot]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8680 Turing Machine by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7321 Roman Numeral to Integer Conversion by stylin]] - [[http://www.freebasic.net/forum/viewtopic.php?p=35589 Unicode console calender, by zippy and voodooattack]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8636 FB source to highlighted HTML by Kristopher Windsor]] - [[http://www.execulink.com/~coder/freebasic/docs.html Portable help (not .chm) viewer by coderjeff]] - [[http://www.execulink.com/~coder/freebasic/lisp.html Lisp interpreter by coderjeff]] - - ==Cryptography== - [[http://www.freebasic.net/forum/viewtopic.php?t=7379 MARS encryption by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7667 AES Encryption/Decryption by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7273 DES/LUCIFER Encryption/Decryption by Zamaster]] - [[http://www.freebasic.net/forum/viewtopic.php?t=5288 MD5 Calculator by DOS386]] - [[http://www.freebasic.net/forum/viewtopic.php?t=9496 Tiger Hash by Mindless]] \ No newline at end of file diff --git a/doc/manual/cache/CodeLibWeb.wakka b/doc/manual/cache/CodeLibWeb.wakka deleted file mode 100644 index 73a8b4aecf..0000000000 --- a/doc/manual/cache/CodeLibWeb.wakka +++ /dev/null @@ -1,8 +0,0 @@ -!!! DELETE ME !!! - -{{anchor name="WEB"}}{{fbdoc item="section" value="Networking- Web Code"}} - [[http://www.freebasic.net/forum/viewtopic.php?t=4199 FB Web Server (Win) by parakeet]] - [[http://www.freebasic.net/forum/viewtopic.php?t=7913 FB Server side scripting (uses the server above) by fishhf]] - [[http://www.freebasic.net/forum/viewtopic.php?t=8454 ChiSock portable sockets library by cha0s]] - [[http://www.freebasic.net/forum/viewtopic.php?t=1608 CenoChat Serverless chat program by cenozoite]] - [[http://www.freebasic.net/forum/viewtopic.php?t=4036 LibIRCClient to create custom IRC clients by voodooattack]] \ No newline at end of file diff --git a/doc/manual/cache/DevIL.wakka b/doc/manual/cache/DevIL.wakka deleted file mode 100644 index ccc6426e51..0000000000 --- a/doc/manual/cache/DevIL.wakka +++ /dev/null @@ -1,7 +0,0 @@ -!!! DELETE ME !!! - -DevIL is a cross-platform image library which aims to provide a common API for different image file formats. - -{{fbdoc item="see"}} -- Wikipedia:DevIL -- [[http://openil.sf.net/|Home page]] \ No newline at end of file diff --git a/doc/manual/cache/DirectMedia.wakka b/doc/manual/cache/DirectMedia.wakka deleted file mode 100644 index 8dc2d64858..0000000000 --- a/doc/manual/cache/DirectMedia.wakka +++ /dev/null @@ -1,7 +0,0 @@ -!!! DELETE ME !!! - -Simple DirectMedia Layer (SDL) is a library that creates an abstraction over various platforms' graphics, sound, and input APIs, allowing a developer to write a computer game or other multimedia application once and run it on GNU/Linux, Windows, Mac OS Classic, Mac OS X, BeOS and a few other unofficially ported platforms. It manages video, events, numeric audio, CD-ROM sound, threads, and timers. - -{{fbdoc item="see"}} -- Wikipedia:Simple_DirectMedia_Layer -- SDL Website: http://www.libsdl.org/ \ No newline at end of file diff --git a/doc/manual/cache/ExtLibfbsound.wakka b/doc/manual/cache/ExtLibfbsound.wakka deleted file mode 100644 index 1bcd40af83..0000000000 --- a/doc/manual/cache/ExtLibfbsound.wakka +++ /dev/null @@ -1,15 +0,0 @@ -!!! DELETE ME !!! - -{{fbdoc item="title" value="FBSOUND"}}---- -Free cross platform Sound and DSP Library. -Written in FreeBASIC and optimized Assembly using SSE and MMX -Platforms supported: Win32 and x86 Linux - -Downloads: 3 -FreeBASIC Version>=0.18.4 (Win32 and x86 Linux) -http://alice-dsl.net/d.j.peters/fbsound/fbsound0.03h.zip - -FreeBASIC Version<=0.18.2 (Win32 and x86 Linux) -http://sourceforge.net/project/showfiles.php?group_id=149199 - -{{fbdoc item="back" value="ExtLibTOC|External Library Table of Contents"}} \ No newline at end of file diff --git a/doc/manual/cache/ExtLibmini.wakka b/doc/manual/cache/ExtLibmini.wakka deleted file mode 100644 index f975d0d7a2..0000000000 --- a/doc/manual/cache/ExtLibmini.wakka +++ /dev/null @@ -1,11 +0,0 @@ -!!! DELETE ME !!! - -{{fbdoc item="title" value="The Mini Library"}}---- -The Mini Library is a real-time terrain rendering system - -Website: http://www.stereofx.org/terrain.html -Platforms supported: Win32, Linux -Headers to include: mini.bi - - -{{fbdoc item="back" value="ExtLibTOC|External Library Table of Contents"}} \ No newline at end of file diff --git a/doc/manual/cache/FormattingRules.wakka b/doc/manual/cache/FormattingRules.wakka deleted file mode 100644 index 15aeb8e898..0000000000 --- a/doc/manual/cache/FormattingRules.wakka +++ /dev/null @@ -1,276 +0,0 @@ -!!! DELETE ME !!! - - -======Wikka Formatting Guide======---<<===General Guidelines===If a markup sequence is not in these guidelines, then it is not officially supported. Use caution when implementing markup that is not officially supported by this document, as undocumented functionality may change with version updates.--- ---Unless otherwise stated in these guidelines, all markup is line based, that is, a newline character should not intervene. These are identified as 'inline' markup.<<::c::---===Escaping Markup===---Anything between 2 sets of double-quotes is not formatted. -This is the equivalent of escaping a character(s):--- ---<< -~##""**two bold ""**"" stars**""## - -~**two bold ""**"" stars** -<~~This text is double-indented
    This text is also indented""## <<::c::<< -~This text is indented -~~This text is double-indented -~This text is also indented -<<::c::---To create bulleted/ordered lists, use the following markup (you can always use 4 spaces instead of a tilde):--- ---**Bulleted lists**---<< -##""~- Line one""## -##""~- Line two""## -<<::c::<< -~- Line one -~- Line two -<<::c::---**Numbered lists**---<< -##""~1) Line one""## -##""~1) Line two""## -<<::c::<< -~1) Line one -~1) Line two -<<::c::---**Ordered lists using uppercase characters**---<< -##""~A) Line one""## -##""~A) Line two""## -<<::c::<< -~A) Line one -~A) Line two -<<::c::---**Ordered lists using lowercase characters**---<< -##""~a) Line one""## -##""~a) Line two""## -<<::c::<< -~a) Line one -~a) Line two -<<::c::---**Ordered lists using uppercase Roman numerals**---<< -##""~I) Line one""## -##""~I) Line two""## -<<::c::<< -~I) Line one -~I) Line two -<<::c::---**Ordered lists using lowercase Roman numerals**---<< -##""~i) Line one""## -##""~i) Line two""## -<<::c::<< -~i) Line one -~i) Line two -<<::c::---===6. Inline comments===---To format some text as an inline comment, use an indent (tilde, tab, or four spaces) followed by a **""&""**.--- ---<< -##""~& Comment""## -##""~~& Subcomment""## -##""~~~& Subsubcomment""## -<<::c::<< -~& Comment -~~& Subcomment -~~~& Subsubcomment -<<::c::--- ---===7. Images===---To place images on a Wiki page, you can use the ##image## action.--- ---Image links can be external or internal Wiki links. You don't need to enter a link at all, and in that case just an image will be inserted. You can use the optional classes ##left## and ##right## to float images left and right. You don't need to use all those attributes, only ##url## is required while ##alt## is recommended for -accessibility.--- ---<< -~##""{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif" link="RecentChanges"}}""## ---- -~{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif" link="RecentChanges"}} -<<::c::---===8. Links===---To create a ** link to a wiki page ** you can use any of the -following options:--- --- -~- Type a ##""WikiName""## (works only for page names with no whitespace): --- --- ##""FormattingRules""## --- FormattingRules --- --- ---- -~- Add a forced link surrounding the page name by ##""[[""## and ##""]]""## (everything after the | will be shown as description): --- --- ##""[[SandBox|Test -your formatting skills]]""## --- [[SandBox|Test your formatting skills]] --- --- ##""[[SandBox|沙箱]]""## --- [[SandBox|沙箱]] --- --- ---- -~- Add an image with a link (see instructions above) ---- ---To ** link to external pages **, you can do any of the following:--- --- -~- Type a URL inside the page: --- --- ##""http://blog.wikkawiki.org""## --- http://blog.wikkawiki.org --- --- ---- -~- Add a forced link surrounding the URL by ##""[[""## and ##""]]""## (everything after the | will be shown as description): --- --- ##""[[http://docs.wikkawiki.org|Wikka documentation]]""## --- [[http://docs.wikkawiki.org|Wikka documentation]] --- --- ##""[[community@wikkawiki.org|Wikka community list]]""## --- [[community@wikkawiki.org|Wikka community list]] --- --- ---- -~- Add an image with a link (see instructions above) ---- -~- Add an interwiki link ([[InterWiki browse the list of available interwiki tags]]): --- --- ##""WikiPedia:WikkaWiki""## --- WikiPedia:WikkaWiki --- --- ##""Google:CSS""## --- Google:CSS --- --- ##""Thesaurus:Happy""## --- Thesaurus:Happy --- --- ---- ---===9. Tables===---<## characters before and after the block.--- ---**Example:**--- --- -~##"">> Some text in a right-floated box hanging around. >> Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler.""##--- --->> Some text in a right-floated box hanging around. >> Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. -::c:: -** Note: Use ##""::c::""## to clear floated blocks. **--- ---===12. Code formatters===---You can easily embed code blocks in a wiki page using a simple markup. Anything within a code block is displayed literally. To create a ** generic code block ** you can use the following markup:--- --- -~##""%% This is a code block %%""##. - -%% This is a code block %% ----To create a ** code block with syntax highlighting **, you need to specify a // code formatter // (see below for a list of available code formatters).--- --- -~##""%%(""{{color c="red" text="php"}}"")
echo "Hello, World!";
?>
%%""## ---- -%%(php) - -%% ---- ---You can also specify an optional // starting line // number.--- -~##""%%(php;""{{color c="red" text="15"}}"")
echo "Hello, World!";
?>
%%""## ---- -%%(php;15) - -%% ---- ---If you specify a // filename //, this will be used for downloading the code.--- -~##""%%(php;15;""{{color c="red" text="test.php"}}"")
echo "Hello, World!";
?>
%%""## ---- -%%(php;15;test.php) - -%% ---- --- -|?|List of available code formatters|| -|| -|=|Language|=|Formatter|=|Language|=|Formatter|=|Language|=|Formatter|| -|#| -|=|Actionscript||##actionscript##|=|ABAP||##abap##|=|ADA||##ada##|| -|=|Apache Log||##apache##|=|""AppleScript""||##applescript##|=|ASM||##asm##|| -|=|ASP||##asp##|=|""AutoIT""||##autoit##|=|Bash||##bash##|| -|=|""BlitzBasic""||##blitzbasic##|=|""Basic4GL""||##basic4gl##|=|bnf||##bnf##|| -|=|C||##c##|=|C for Macs||##c_mac##|=|C#||##csharp##|| -|=|C""++""||##cpp##|=|C""++"" (+QT)||##cpp-qt##|=|CAD DCL||##caddcl##|| -|=|""CadLisp""||##cadlisp##|=|CFDG||##cfdg##|=|""ColdFusion""||##cfm##|| -|=|CSS||##css##|=|D||##d##|=|Delphi||##delphi##|| -|=|Diff-Output||##diff##|=|DIV||##div##|=|DOS||##dos##|| -|=|Dot||##dot##|=|Eiffel||##eiffel##|=|Fortran||##fortran##|| -|=|""FreeBasic""||##freebasic##|=|FOURJ's Genero 4GL||##genero##|=|GML||##gml##|| -|=|Groovy||##groovy##|=|Haskell||##haskell##|=|HTML||##html4strict##|| -|=|INI||##ini##|=|Inno Script||##inno##|=|Io||##io##|| -|=|Java 5||##java5##|=|Java||##java##|=|Javascript||##javascript##|| -|=|""LaTeX""||##latex##|=|Lisp||##lisp##|=|Lua||##lua##|| -|=|Matlab||##matlab##|=|mIRC Scripting||##mirc##|=|Microchip Assembler||##mpasm##|| -|=|Microsoft Registry||##reg##|=|Motorola 68k Assembler||##m68k##|=|""MySQL""||##mysql##|| -|=|NSIS||##nsis##|=|Objective C||##objc##|=|""OpenOffice"" BASIC||##oobas##|| -|=|Objective Caml||##ocaml##|=|Objective Caml (brief)||##ocaml-brief##|=|Oracle 8||##oracle8##|| -|=|Pascal||##pascal##|=|Per (FOURJ's Genero 4GL)||##per##|=|Perl||##perl##|| -|=|PHP||##php##|=|PHP (brief)||##php-brief##|=|PL/SQL||##plsql##|| -|=|Python||##phyton##|=|Q(uick)BASIC||##qbasic##|=|robots.txt||##robots##|| -|=|Ruby on Rails||##rails##|=|Ruby||##ruby##|=|SAS||##sas##|| -|=|Scheme||##scheme##|=|sdlBasic||##sdlbasic##|=|Smarty||##smarty##|| -|=|SQL||##sql##|=|TCL/iTCL||##tcl##|=|T-SQL||##tsql##|| -|=|Text||##text##|=|thinBasic||##thinbasic##|=|Unoidl||##idl##|| -|=|VB.NET||##vbnet##|=|VHDL||##vhdl##|=|Visual BASIC||##vb##|| -|=|Visual Fox Pro||##visualfoxpro##|=|""WinBatch""||##winbatch##|=|XML||##xml##|| -|=|X""++""||##xpp##|=|""ZiLOG"" Z80 Assembler||##z80##|=| || ---- ---===13. Mindmaps===---Wikka has native support for [[Wikka:FreeMind|mindmaps]]. There are two options for embedding a mindmap in a wiki page.--- --- **Option 1:** Upload a ""FreeMind"" file to a webserver, and then place a link to it on a wikka page: ##""http://yourdomain.com/freemind/freemind.mm""## No special formatting is necessary. --- ---**Option 2:** Paste the ""FreeMind"" data directly into a wikka page: - -~-Open a ""FreeMind"" file with a text editor. -~-Select all, and copy the data. -~-Browse to your Wikka site and paste the Freemind data into a page. -::c:: ----===14. Embedded HTML===---You can easily paste HTML in a wiki page by wrapping it into two sets of doublequotes.--- --- -~##""[html code]""## -<< -~##""y = xn+1""## -~""y = xn+1"" -<<::c::<< -~##""CSS""## -~""CSS"" -<<::c::---By default, some HTML tags are removed by the ""SafeHTML"" parser to protect against potentially dangerous code. The list of tags that are stripped can be found on the Wikka:SafeHTML page.--- ---It is possible to allow // all // HTML tags to be used, see Wikka:UsingHTML for more information.--- --- ----CategoryWiki \ No newline at end of file diff --git a/doc/manual/cache/GD.wakka b/doc/manual/cache/GD.wakka deleted file mode 100644 index 119b206232..0000000000 --- a/doc/manual/cache/GD.wakka +++ /dev/null @@ -1,9 +0,0 @@ -!!! DELETE ME !!! - -GD is a graphics library for dynamically manipulating images. It can create GIFs, JPEGs, PNGs, and WBMPs. - -GD can create images composed of lines, arcs, text (using program-selected fonts), other images, and multiple colors. Version 2.0 adds support for truecolor images, alpha channels, resampling (for smooth resizing of truecolor images), and many other features. - -{{fbdoc item="see"}} -- Wikipedia:GD_Graphics_Library -- [[http://www.libgd.org/|Home page]] \ No newline at end of file diff --git a/doc/manual/cache/GFXLib2.wakka b/doc/manual/cache/GFXLib2.wakka deleted file mode 100644 index f40f164c98..0000000000 --- a/doc/manual/cache/GFXLib2.wakka +++ /dev/null @@ -1,6 +0,0 @@ -!!! DELETE ME !!! - -{{fbdoc item="title" value="GfxLib2"}}---- -{{delete}} [[GfxLib]] is the built-in graphics library included in ""FreeBASIC"". As well as re-creating every ""QuickBASIC"" graphics command, ""GfxLib"" has built-in commands to handle input from the keyboard and mouse. - -see [[GfxLib]] diff --git a/doc/manual/cache/TableMarkup.wakka b/doc/manual/cache/TableMarkup.wakka deleted file mode 100644 index 7ba3c03ef6..0000000000 --- a/doc/manual/cache/TableMarkup.wakka +++ /dev/null @@ -1,395 +0,0 @@ -!!! DELETE ME !!! - -=====Wikka Table Markup Guide===== ->>==See also:== -~-For earlier Wikka versions, check the [[Docs:TableActionInfo table]] action -~-Updated versions of this page can be found on the [[Docs:TableMarkup Wikka documentation server]] -~-For a more formal description, check this server's TableMarkupReference page. ->> -As of ##1.2##, Wikka introduces a flexible markup for data tables. Any kind of tables allowed by XHTML can be created using this markup, from the most basic examples (e.g. simple rows of cells) to complex tables with full support for accessibility options.::c:: - -====1. Table basics: cells, rows, columns==== - -The most basic element of a table is a **cell**. Single cells can be created using the standard delimiter ##""||""##, e.g.: - -##""||Hello||""## - -||Hello|| - -Note that a cell must always be open and closed by delimiters. - -**Rows** can be created by adding on the same line multiple cells: - -##""||Cell 1||Cell 2||Cell 3||""## - -||Cell 1||Cell 2||Cell 3|| - -**Columns** can be created by adding rows on separate lines: - -##""||Cell 1||""## -##""||Cell 2||""## -##""||Cell 3||""## - -||Cell 1|| -||Cell 2|| -||Cell 3|| - -By now you should be able to create simple tables with **multiple rows and columns**. - -##""||Cell 1||Cell 2||Cell 3||""## -##""||Cell 4||Cell 5||Cell 6||""## -##""||Cell 7||Cell 8||Cell 9||""## - -||Cell 1||Cell 2||Cell 3|| -||Cell 4||Cell 5||Cell 6|| -||Cell 7||Cell 8||Cell 9|| - -====2. Headings==== - -As soon as you create slightly more complex data tables, you will need to specify column and row **headings**. Headings are special cells that specify what kind of data rows and columns contain. The most basic way of creating a heading is by using ##""|=|""## as a delimiter. - -The following is an example of a simple table with **column headings**: - -##""|=|Apples|=|Pears|=|""## -##""||300Kg||480Kg||""## - -|=|Apples|=|Pears|=| -||300Kg||480Kg|| - -**Row headings** are created in the same way. Since they are usually followed by normal cells, they must be terminated with the ##""||""## standard delimiter if the next element in the row is a simple cell: - -##""|=|Apples||300Kg||""## -##""|=|Pears||480Kg||""## - -|=|Apples||300Kg|| -|=|Pears||480Kg|| - -You should be able by now to create simple tables with row and column headings: - -##""|=| |=|Apples|=|Pears|=|""## -##""|=|Mary||300Kg||320Kg||""## -##""|=|John||400Kg||630Kg||""## - -|=| |=|Apples|=|Pears|=| -|=|Mary||300Kg||320Kg|| -|=|John||400Kg||630Kg|| - -We will describe later how to add accessibility parameters for row and column headings. - -====3. Captions==== - -Usually tables are introduced with a caption that describes what the table contains. A caption element is introduced with a ##""|?|""## delimiter and terminated with a standard delimiter ##""||""##. - -##""|?|Fruit production in 2006||""## -##""|=| |=|Apples|=|Pears|=|""## -##""|=|Mary||300Kg||320Kg||""## -##""|=|John||400Kg||630Kg||""## - -|?|Fruit production in 2006|| -|=| |=|Apples|=|Pears|=| -|=|Mary||300Kg||320Kg|| -|=|John||400Kg||630Kg|| - -====4. Spans==== - -**Spans** are used to combine multiple cells or multiple headings vertically or horizontally and are created using the following [[TableMarkupReference attribute parameters]]: - -##""||""(''span options'')Element content""||""## - -A **cell spanning multiple columns** is generated by prefixing the cell content with a ##(x:''n'')## parameter, where ##''n''## is the number of columns to be spanned. The following example shows how to create a cell spanning two columns: - -##""||(x:2)Cell spanning 2 columns||Cell 3||""## -##""||Cell 4||Cell 5||Cell 6||""## -##""||Cell 7||Cell 8||Cell 9||""## - -||(x:2)Cell spanning 2 columns||Cell 3|| -||Cell 4||Cell 5||Cell 6|| -||Cell 7||Cell 8||Cell 9|| - -Spans can also be applied to rows. A **cell spanning multiple rows** is generated by prefixing the cell content with a ##(y:''n'')## parameter, where ##''n''## is the number of rows to be spanned. The following example shows how to create a cell spanning two rows: - -##""||(y:2)Cell spanning 2 rows||Cell 2||Cell 3||""## -##""||Cell 5||Cell 6||""## -##""||Cell 7||Cell 8||Cell 9||""## - -||(y:2)Cell spanning 2 rows||Cell 2||Cell 3|| -||Cell 5||Cell 6|| -||Cell 7||Cell 8||Cell 9|| - -Spans are particularly useful to create **subheadings**: - -##""|?|Fruit production in the last two years||""## -##""|=| |=|(x:2)Apples|=|(x:2)Pears|=|""## -##""|=| |=|2005|=|2006|=|2005|=|2006|=|""## -##""|=|Mary||300Kg||320Kg||400kg||280Kg||""## -##""|=|John||400Kg||630Kg||210Kg||300Kg||""## - -|?|Fruit production in the last two years|| -|=| |=|(x:2)Apples|=|(x:2)Pears|=| -|=| |=|2005|=|2006|=|2005|=|2006|=| -|=|Mary||300Kg||320Kg||400kg||280Kg|| -|=|John||400Kg||630Kg||210Kg||300Kg|| - -Column and row spans can be combined to created funky table layouts: - -##""||(x:2;y:2)2x2||(x:2)2x1||(y:2)1x2||""## -##""||(y:2)1x2||1x1||""## -##""||1x1||1x1||(x:2)2x1||""## - -||(x:2;y:2)2x2||(x:2)2x1||(y:2)1x2|| -||(y:2)1x2||1x1|| -||1x1||1x1||(x:2)2x1|| - - -====5. Formatting text within tables==== - -You can use any kind of basic [[Docs:TextFormatting Wikka markup]] to render text within tables. -The following example adds basic formatting to cell content: - -##""|?|Using text formatting within tables||""## -##""||##Monospaced##||//Italics//||**Bold**||__Underlined__||""## -##""||''Highlighted''||++Strikethrough++||(x:2)**//Bold italics//**||""## - -|?|Using text formatting within tables|| -||##Monospaced##||//Italics//||**Bold**||__Underlined__|| -||''Highlighted''||++Strikethrough++||(x:2)**//Bold italics//**|| - -====6. Adding actions and images within tables==== - -Simple, content-generating [[Docs:UsingActions actions]] (including [[Docs:AddingImages images]]) can be added within table cells and headings. - -##""|?|Using actions within tables||""## -##""||This wiki contains {{countpages}} pages||""## -##""||{{image url="images/wikka_logo.jpg" class="center" alt="a w" title="w image"}}||""## -##""||{{color c="red" text="some colored text"}}||""## - -|?|Using actions within tables|| -||This wiki contains {{countpages}} pages|| -||{{image url="images/wikka_logo.jpg" class="center" alt="a w" title="w image"}}|| -||{{color c="red" text="some colored text"}}|| - -====7. Adding links within tables==== - -All the available options to create [[Docs:AddingLinks links]] can be used within table cells or headings: - -##""|?|Adding links within tables||""## -##""||Camelcase links: SandBox||""## -##""||Escaped camelcase links: ""SandBox"" escaped||""## -##""||Forced links: [[HomePage main]]||""## -##""||Interwiki links: Wikipedia:Wikka||""## -##""||Forced interwiki links: [[Wikipedia:Wikka Wikka article on Wikipedia]]||""## -##""||External links: http://www.example.com ||""## -##""||Forced external links: [[http://www.example.com Example.com]]||""## -##""||Image links: {{image url="images/wizard.gif" alt="wizard" title="Display an index of pages on this wiki" link="PageIndex"}}||""## - -|?|Adding links within tables|| -||Camelcase links: SandBox|| -||Escaped camelcase links: ""SandBox escaped""|| -||Forced links: [[HomePage main]]|| -||Interwiki links: Wikipedia:Wikka|| -||Forced interwiki links: [[Wikipedia:Wikka Wikka article on Wikipedia]]|| -||External links: http://www.example.com || -||Forced external links: [[http://www.example.com Example.com]]|| -||Image links: {{image url="images/wizard.gif" alt="wizard" title="Display an index of pages on this wiki" link="PageIndex"}}|| - -====8. Adding HTML within tables==== - -You can also use [[Docs:UsingHTML embedded HTML]] in table elements: - -##""|?|Embedding HTML within tables||""## -##""||Here's some superscript: ""a2+1""||""## -##""||And here's some subscript too: ""a2k""||""## -##""||I love acronyms: ""WYSIWYG""||""## - -|?|Embedding HTML within tables|| -||Here's some superscript: ""a2+1""|| -||And here's some subscript too: ""a2k""|| -||I love acronyms: ""WYSIWYG""|| - -====9. Adding a touch of style==== - -The table markup introduces a new [[TableMarkupReference style selector]]. CSS style options can be added to any element by enclosing them within **single braces**, right before the element content, e.g.: -##""||""{''style options''}Element content""||""## - -For example, to render a cell with **red background** and **white text color**, you can do the following: - -##""||{background-color:red; color:white}Hello||""## - -||{background-color:red; color:white}Hello|| - -You can play with **font size** and **text alignment**: - -##""|?|Adding some more style||""## -##""||{font-size:190%; text-align:right}Please scale me!||""## -##""||{font-size:170%; text-align:right}Please scale me!||""## -##""||{font-size:150%; text-align:right}Please scale me!||""## -##""||{font-size:130%; text-align:right}Please scale me!||""## -##""||{font-size:110%; text-align:right}Please scale me!||""## -##""||{font-size:90%; text-align:right}Please scale me!||""## -##""||{font-size:70%; text-align:right}Please scale me!||""## - -|?|Adding some more style|| -||{font-size:190%; text-align:right}Please scale me!|| -||{font-size:170%; text-align:right}Please scale me!|| -||{font-size:150%; text-align:right}Please scale me!|| -||{font-size:130%; text-align:right}Please scale me!|| -||{font-size:110%; text-align:right}Please scale me!|| -||{font-size:90%; text-align:right}Please scale me!|| -||{font-size:70%; text-align:right}Please scale me!|| - -You can also apply style to **headings** and **captions**: - -##""|?|{border:1px dotted red; color:red}Style can be applied anywhere||""## -##""|=|{color:#000; font-size:150%; font-style:italic; font-family:Georgia, Hoefler Text, Georgia, serif; font-weight:normal; line-height:150%}Emphemeral Quibus|=|""## -##""||Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis auctor auctor pede.||""## - -|?|{border:1px dotted red; color:red}Style can be applied anywhere|| -|=|{color:#000; font-size:150%; font-style:italic; font-family:Georgia, Hoefler Text, Georgia, serif; font-weight:normal; line-height:150%}Emphemeral Quibus|=| -||Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis auctor auctor pede.|| - -Please note that **style parameters should always follow attribute parameters**, when both are specified for an element (see the [[TableMarkupReference table markup reference]]): - -##""|?|Give priority||""## -##""||(x:2;y:2){background-color:pink}2x2||(x:2){background-color:lightblue}2x1||(y:2){background-color:lightyellow}1x2||""## -##""||(y:2){background-color:lightyellow}1x2||{background-color:#333;color:white}1x1||""## -##""||{background-color:lightblue}1x1||{background-color:#333;color:white}1x1||(x:2){background-color:pink}2x1||""## - -|?|Give priority|| -||(x:2;y:2){background-color:pink}2x2||(x:2){background-color:lightblue}2x1||(y:2){background-color:lightyellow}1x2|| -||(y:2){background-color:lightyellow}1x2||{background-color:#333;color:white}1x1|| -||{background-color:lightblue}1x1||{background-color:#333;color:white}1x1||(x:2){background-color:pink}2x1|| - -====10. Adding style through classes==== - -You can apply existing classes from your stylesheet to any element using the class parameter ##(c:''class'')##. Note that custom style declarations specified through braced markup override class attributes. - -The following example applies to table cells two class selectors defined in the stylesheet. The third row shows how to override a class selector with custom style attributes: - -##""|?|Using class selectors to add style to table elements||""## -##""||(c:highlight)This cell uses the ##.highlight## class||""## -##""||(c:smaller)This cell uses the ##.smaller## class||""## -##""||(c:smaller){font-size:150%}This cell uses the ##.smaller## class overridden by custom style settings||""## - -|?|Using class selectors to add style to table elements|| -||(c:highlight)This cell uses the ##.highlight## class|| -||(c:smaller)This cell uses the ##.smaller## class|| -||(c:smaller){font-size:150%}This cell uses a ##.smaller## class overridden by custom style settings|| - -====11. Global table attributes==== - -Table-level attributes can be specified by adding at the beginning of the table the following element: ##""|!| ||""##, which is used as a container for global table attributes. For example, you can specify **global style options** for a table by adding them to this element: - -##""|!|{border:3px solid blue; background-color: black; color: white; width: 300px; text-align: center}||""## -##""||Cell 1||""## -##""||Cell 2||""## -##""||Cell 3||""## - -|!|{border:3px solid blue; background-color: black; color: white; width: 300px; text-align: center}|| -||Cell 1|| -||Cell 2|| -||Cell 3|| - -====12. Referring to elements: the ##id## attribute==== - -##id## attributes are used to refer to unique elements in a page and to provide an anchor for styling and linking. You can specify an ##id## for any table element by using the ##(i:''id'')## parameter. - -For example, the following markup creates a table with the ##id## "main_table" containing two cells with ##id##'s "cell_1" and "cell_2" - -##""|!|(i:main_table)||""## -##""|?|Using id to refer to table elements||""## -##""||(i:cell_1)This cell can be referred to by using the ##cell_1## id||""## -##""||(i:cell_2)This cell can be referred to by using the ##cell_2## id||""## - -|!|(i:main_table)|| -|?|Using id to refer to table elements|| -||(i:cell_1)This cell can be referred to by using the ##cell_1## id|| -||(i:cell_2)This cell can be referred to by using the ##cell_2## id|| - -====13. Accessibility options: adding titles==== - -Any table element can be given a ##title## attribute to enhance its accessibility. Titles are typically displayed in graphical browsers by hovering over the corresponding element and are useful to display unobtrusive descriptions about specific elements. You can specify a ##title## for any table element by using the ##(t:''title'')## parameter. - -The following example adds titles to several table elements (you can hover over the table to display them): - -##""|!|(t:Comparative figures for fruit production in the last year){width: 350px}||""## -##""|?|Fruit production in 2006||""## -##""|=| |=|(t:yearly production of apples)Apples|=|(t:yearly production of pears)Pears|=|""## -##""|=|(t:Mary's contribution to 2006 production)Mary||(t:Mary's production of apples in 2006){text-align:center}300Kg||(t:Mary's production of pears in 2006){text-align:center}320Kg||""## -##""|=|(t:John's contribution to 2006 production)John||(t:John's production of apples in 2006){text-align:center}400Kg||(t:John's production of pears in 2006){text-align:center}630Kg||""## - -|!|(t:Comparative figures for fruit production in the last year){width: 350px}|| -|?|Fruit production in 2006|| -|=| |=|(t:yearly production of apples)Apples|=|(t:yearly production of pears)Pears|=| -|=|(t:Mary's contribution to 2006 production)Mary||(t:Mary's production of apples in 2006){text-align:center}300Kg||(t:Mary's production of pears in 2006){text-align:center}320Kg|| -|=|(t:John's contribution to 2006 production)John||(t:John's production of apples in 2006){text-align:center}400Kg||(t:John's production of pears in 2006){text-align:center}630Kg|| - -====14. Accessibility options: adding a summary==== - -Tables can take an optional ##summary## attribute to describe the purpose and/or structure of the table. The description provided by the summary attribute is particularly helpful to users of non-visual browsers. You can specify a summary by adding a ##(u:''Summary'')## parameter in the table global attributes. - -For example, the following line: -##""|!|(u:This is a summary)||""## -will add to the table a ##summary## attribute with the value ##This is a summary##. - -====15. Accessibility options: table head, table body and table foot==== - -Rows in a table can be grouped in a table head, table body and table foot. This division enables browsers to support scrolling of table bodies independently of the table head and foot. When long tables are printed, the table head and foot information may be repeated on each page that contains table data. The table head and table foot should contain information about the table's columns. The table body should contain rows of table data. - -Wikka allows you to create groups of rows with special markers: -~- The ##""|[|""## marker groups the rows it precedes as a **table head** block; -~- The ##""|]|""## marker groups the rows it precedes as a **table foot** block; -~- The ##""|#|""## marker groups the rows it precedes as a **table body**; - -The following example shows how to use these elements to create row groups. Note that Wikka uses different backgrounds to differentiate column headings in the table head and foot from row headings in the table body: - -##""|!|(u:A table with summary, caption, head, foot and body){width: 400px}||""## -##""|?|Here's how you can group rows||""## -##""|[|""## -##""|=|Name|=|Place|=|Telephone||""## -##""|]|""## -##""|=|Name|=|Place|=|Telephone||""## -##""|#|""## -##""|=|John Smith||New York||555-1234||""## -##""|=|Jane Smith||Los Angeles||555-2345||""## -##""|=|John Doe||Unknown||Unknown||""## -##""|=|Jane Doe||Unknown||Unknown||""## - -|!|(u:A table with summary, caption, head, foot and body){width: 400px}|| -|?|Here's how you can group rows|| -|[| -|=|Name|=|Place|=|Telephone|| -|]| -|=|Name|=|Place|=|Telephone|| -|#| -|=|John Smith||New York||555-1234|| -|=|Jane Smith||Los Angeles||555-2345|| -|=|John Doe||Unknown||Unknown|| -|=|Jane Doe||Unknown||Unknown|| - -====16. Accessibility options: heading scope==== - -To be semantically correct and accessible to users with non-visual browsers, headings should contain scope attributes describing the cell range they refer to. -~-Column heading scopes can be specified using the ##(o:col)## parameter in the corresponding column heading; -~-Row heading scopes can be specified using the ##(o:row)## parameter in the corresponding row heading; - -The following example shows how to correctly add column and row scopes to a table to make it accessible: - -##""|!|(u:The number of employees and the foundation year of some imaginary companies.)||""## -##""|?|Table 1: Company data||""## -##""|[|""## -##""|||=|(o:col)Employees|=|(o:col)Founded||""## -##""|#|""## -##""|=|(o:row)ACME Inc||1000||1947||""## -##""|=|(o:row)XYZ Corp||2000||1973||""## - -|!|(u:The number of employees and the foundation year of some imaginary companies.)|| -|?|Table 1: Company data|| -|[| -|||=|(o:col)Employees|=|(o:col)Founded|| -|#| -|=|(o:row)ACME Inc||1000||1947|| -|=|(o:row)XYZ Corp||2000||1973|| - - ----- -CategoryWiki \ No newline at end of file diff --git a/doc/manual/cache/TableMarkupReference.wakka b/doc/manual/cache/TableMarkupReference.wakka deleted file mode 100644 index 69e7dd26b9..0000000000 --- a/doc/manual/cache/TableMarkupReference.wakka +++ /dev/null @@ -1,74 +0,0 @@ -!!! DELETE ME !!! - -======Wikka Table Markup Reference====== ->>==See also:== -~-For an informal introduction to this markup and several examples consult this server's TableMarkup page. -~-Updated versions of this page can be found on the [[Docs:TableMarkupReference|Wikka documentation server]]. ->> -==== 1. Table Markup Scheme ==== - -The generic markup for table elements follows this scheme: - -~**##{{color fg="#F00" text="|*|"}}{{color fg="blue" text="(attribute parameters)"}}{{color fg="green" text="{style parameters}"}}content{{color fg="#F00" text="||"}}##** - -==Example:== - -~##""|=|(i:main_heading){text-size: 120%}This is the main heading||""## - -===Understanding the Table Markup Scheme=== - -~1)**Opening delimiter** --- **##{{color fg="#F00" text="|*|"}}##** is any of the delimiters described in the //elements table// below. -~1)**Attributes** --- **##{{color fg="blue" text="(attribute parameters)"}}##** is an optional series of ##parameter:value## declarations enclosed in brackets. Valid parameters are described in the //attribute table// below. Multiple parameter declarations can be separated with a semicolon (**##;##**). -~1)**Style** --- **##{{color fg="green" text="{style parameters}"}}##** is an optional series of CSS style declarations enclosed in braces. Multiple style declarations can be separated with a semicolon (**##;##**). -~1)**Content** --- **##content##** can be any valid content for that element (including [[Docs:TextFormatting|formatted text]]). -~1)**Closing delimiter** --- **##{{color fg="#F00" text="||"}}##** is the standard delimiter. - -==Note:== -Some elements are //self closing// and do not accept any attributes, style parameters or content. See the notes in the //elements table// below. - -==== 2. Elements ==== - -|!|{width: 80%}|| -|?|Table Elements|| -|=|""XHTML Elements""|=|Delimiter|=|Notes|| -||####||##""|!|""##||Optional, only useful for adding attributes. **Must** be first in table markup if used. Should be on a line by itself.|| -||####||##""|_|""##|||| -||####||##""|-|""##||Selfclosing - must not be closed!|| -||####||##""|[|""##|||| -||####||##""|]|""##|||| -||####||##""|#|""##|||| -||####||none||Will be opened for each row of table cells.|| -||##" ) loghtml( "
##||##""|?|""##|||| -||##
##||##""|=|""##|||| -||####||##""||""##|||| - -==== 3. Attributes ==== - -|?|Table Attributes|| -|[| -|=|Attribute|=|Markup key|| -|]| -|=|Attribute|=|Markup key|| -|#| -|=|(x:2)Core|| -||##id##||##i##|| -||##title##||##t##|| -||##class##||##c##|| -||##style##||##s##|| -|=|(x:2)i18n|| -||##xml:lang##||##l##|| -||##dir##||##d##|| -|=|(x:2)Table cells|| -||##colspan##||##x##|| -||##rowspan##||##y##|| -||##scope##||##o##|| -||##headers##||##h##|| -||##abbr##||##a##|| -||##axis##||##z##|| -|=|(x:2)Other Table elements|| -||##span##||##p##|| -||##summary##||##u##|| - - ----- -CategoryWiki \ No newline at end of file diff --git a/doc/manual/cache/TestPage.wakka b/doc/manual/cache/TestPage.wakka deleted file mode 100644 index f058f65441..0000000000 --- a/doc/manual/cache/TestPage.wakka +++ /dev/null @@ -1,10 +0,0 @@ -Testing the table cell parsing: Chars like ##&## will become ##&##, but the ##;## also is used as delimiter in the ##""{{table cells="..."}}""## string. - -{{table columns="3" cellpadding="2" cells="&"}} -{{table columns="3" cellpadding="2" cells="&,"}} -{{table columns="3" cellpadding="2" cells="&"}} -{{table columns="3" cellpadding="2" cells="&,"}} -{{table columns="3" cellpadding="2" cells="a;&;b"}} -{{table columns="3" cellpadding="2" cells="a;&,;b"}} -{{table columns="3" cellpadding="2" cells="a;&b"}} -{{table columns="3" cellpadding="2" cells="a;&,;b"}} \ No newline at end of file diff --git a/doc/manual/cache/TutGettingStarted.wakka b/doc/manual/cache/TutGettingStarted.wakka deleted file mode 100644 index 9a80021862..0000000000 --- a/doc/manual/cache/TutGettingStarted.wakka +++ /dev/null @@ -1,7 +0,0 @@ -!!! DELETE ME !!! - -{{fbdoc item="title" value="Getting Started"}}---- - -See also: TutGettingStartedQB - -A detailed getting started guide should be here: > . < (but it's not). diff --git a/doc/manual/cache/WikkaFormattingRules.wakka b/doc/manual/cache/WikkaFormattingRules.wakka deleted file mode 100644 index c8e358057b..0000000000 --- a/doc/manual/cache/WikkaFormattingRules.wakka +++ /dev/null @@ -1,275 +0,0 @@ -!!! DELETE ME !!! - -======Wikka Formatting Guide======---<<===General Guidelines===If a markup sequence is not in these guidelines, then it is not officially supported. Use caution when implementing markup that is not officially supported by this document, as undocumented functionality may change with version updates.--- ---Unless otherwise stated in these guidelines, all markup is line based, that is, a newline character should not intervene. These are identified as 'inline' markup.<<::c::---===Escaping Markup===---Anything between 2 sets of double-quotes is not formatted. -This is the equivalent of escaping a character(s):--- ---<< -~##""**two bold ""**"" stars**""## - -~**two bold ""**"" stars** -<~~This text is double-indented
This text is also indented""## <<::c::<< -~This text is indented -~~This text is double-indented -~This text is also indented -<<::c::---To create bulleted/ordered lists, use the following markup (you can always use 4 spaces instead of a tilde):--- ---**Bulleted lists**---<< -##""~- Line one""## -##""~- Line two""## -<<::c::<< -~- Line one -~- Line two -<<::c::---**Numbered lists**---<< -##""~1) Line one""## -##""~1) Line two""## -<<::c::<< -~1) Line one -~1) Line two -<<::c::---**Ordered lists using uppercase characters**---<< -##""~A) Line one""## -##""~A) Line two""## -<<::c::<< -~A) Line one -~A) Line two -<<::c::---**Ordered lists using lowercase characters**---<< -##""~a) Line one""## -##""~a) Line two""## -<<::c::<< -~a) Line one -~a) Line two -<<::c::---**Ordered lists using uppercase Roman numerals**---<< -##""~I) Line one""## -##""~I) Line two""## -<<::c::<< -~I) Line one -~I) Line two -<<::c::---**Ordered lists using lowercase Roman numerals**---<< -##""~i) Line one""## -##""~i) Line two""## -<<::c::<< -~i) Line one -~i) Line two -<<::c::---===6. Inline comments===---To format some text as an inline comment, use an indent (tilde, tab, or four spaces) followed by a **""&""**.--- ---<< -##""~& Comment""## -##""~~& Subcomment""## -##""~~~& Subsubcomment""## -<<::c::<< -~& Comment -~~& Subcomment -~~~& Subsubcomment -<<::c::--- ---===7. Images===---To place images on a Wiki page, you can use the ##image## action.--- ---Image links can be external or internal Wiki links. You don't need to enter a link at all, and in that case just an image will be inserted. You can use the optional classes ##left## and ##right## to float images left and right. You don't need to use all those attributes, only ##url## is required while ##alt## is recommended for -accessibility.--- ---<< -~##""{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif" link="RecentChanges"}}""## ---- -~{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif" link="RecentChanges"}} -<<::c::---===8. Links===---To create a ** link to a wiki page ** you can use any of the -following options:--- --- -~- Type a ##""WikiName""## (works only for page names with no whitespace): --- --- ##""FormattingRules""## --- FormattingRules --- --- ---- -~- Add a forced link surrounding the page name by ##""[[""## and ##""]]""## (everything after the | will be shown as description): --- --- ##""[[SandBox|Test -your formatting skills]]""## --- [[SandBox|Test your formatting skills]] --- --- ##""[[SandBox|沙箱]]""## --- [[SandBox|沙箱]] --- --- ---- -~- Add an image with a link (see instructions above) ---- ---To ** link to external pages **, you can do any of the following:--- --- -~- Type a URL inside the page: --- --- ##""http://blog.wikkawiki.org""## --- http://blog.wikkawiki.org --- --- ---- -~- Add a forced link surrounding the URL by ##""[[""## and ##""]]""## (everything after the | will be shown as description): --- --- ##""[[http://docs.wikkawiki.org|Wikka documentation]]""## --- [[http://docs.wikkawiki.org|Wikka documentation]] --- --- ##""[[community@wikkawiki.org|Wikka community list]]""## --- [[community@wikkawiki.org|Wikka community list]] --- --- ---- -~- Add an image with a link (see instructions above) ---- -~- Add an interwiki link ([[InterWiki browse the list of available interwiki tags]]): --- --- ##""WikiPedia:WikkaWiki""## --- WikiPedia:WikkaWiki --- --- ##""Google:CSS""## --- Google:CSS --- --- ##""Thesaurus:Happy""## --- Thesaurus:Happy --- --- ---- ---===9. Tables===---<## characters before and after the block.--- ---**Example:**--- --- -~##"">> Some text in a right-floated box hanging around. >> Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler.""##--- --->> Some text in a right-floated box hanging around. >> Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. Some more text as a filler. -::c:: -** Note: Use ##""::c::""## to clear floated blocks. **--- ---===12. Code formatters===---You can easily embed code blocks in a wiki page using a simple markup. Anything within a code block is displayed literally. To create a ** generic code block ** you can use the following markup:--- --- -~##""%% This is a code block %%""##. - -%% This is a code block %% ----To create a ** code block with syntax highlighting **, you need to specify a // code formatter // (see below for a list of available code formatters).--- --- -~##""%%(""{{color c="red" text="php"}}"")
echo "Hello, World!";
?>
%%""## ---- -%%(php) - -%% ---- ---You can also specify an optional // starting line // number.--- -~##""%%(php;""{{color c="red" text="15"}}"")
echo "Hello, World!";
?>
%%""## ---- -%%(php;15) - -%% ---- ---If you specify a // filename //, this will be used for downloading the code.--- -~##""%%(php;15;""{{color c="red" text="test.php"}}"")
echo "Hello, World!";
?>
%%""## ---- -%%(php;15;test.php) - -%% ---- --- -|?|List of available code formatters|| -|| -|=|Language|=|Formatter|=|Language|=|Formatter|=|Language|=|Formatter|| -|#| -|=|Actionscript||##actionscript##|=|ABAP||##abap##|=|ADA||##ada##|| -|=|Apache Log||##apache##|=|""AppleScript""||##applescript##|=|ASM||##asm##|| -|=|ASP||##asp##|=|""AutoIT""||##autoit##|=|Bash||##bash##|| -|=|""BlitzBasic""||##blitzbasic##|=|""Basic4GL""||##basic4gl##|=|bnf||##bnf##|| -|=|C||##c##|=|C for Macs||##c_mac##|=|C#||##csharp##|| -|=|C""++""||##cpp##|=|C""++"" (+QT)||##cpp-qt##|=|CAD DCL||##caddcl##|| -|=|""CadLisp""||##cadlisp##|=|CFDG||##cfdg##|=|""ColdFusion""||##cfm##|| -|=|CSS||##css##|=|D||##d##|=|Delphi||##delphi##|| -|=|Diff-Output||##diff##|=|DIV||##div##|=|DOS||##dos##|| -|=|Dot||##dot##|=|Eiffel||##eiffel##|=|Fortran||##fortran##|| -|=|""FreeBasic""||##freebasic##|=|FOURJ's Genero 4GL||##genero##|=|GML||##gml##|| -|=|Groovy||##groovy##|=|Haskell||##haskell##|=|HTML||##html4strict##|| -|=|INI||##ini##|=|Inno Script||##inno##|=|Io||##io##|| -|=|Java 5||##java5##|=|Java||##java##|=|Javascript||##javascript##|| -|=|""LaTeX""||##latex##|=|Lisp||##lisp##|=|Lua||##lua##|| -|=|Matlab||##matlab##|=|mIRC Scripting||##mirc##|=|Microchip Assembler||##mpasm##|| -|=|Microsoft Registry||##reg##|=|Motorola 68k Assembler||##m68k##|=|""MySQL""||##mysql##|| -|=|NSIS||##nsis##|=|Objective C||##objc##|=|""OpenOffice"" BASIC||##oobas##|| -|=|Objective Caml||##ocaml##|=|Objective Caml (brief)||##ocaml-brief##|=|Oracle 8||##oracle8##|| -|=|Pascal||##pascal##|=|Per (FOURJ's Genero 4GL)||##per##|=|Perl||##perl##|| -|=|PHP||##php##|=|PHP (brief)||##php-brief##|=|PL/SQL||##plsql##|| -|=|Python||##phyton##|=|Q(uick)BASIC||##qbasic##|=|robots.txt||##robots##|| -|=|Ruby on Rails||##rails##|=|Ruby||##ruby##|=|SAS||##sas##|| -|=|Scheme||##scheme##|=|sdlBasic||##sdlbasic##|=|Smarty||##smarty##|| -|=|SQL||##sql##|=|TCL/iTCL||##tcl##|=|T-SQL||##tsql##|| -|=|Text||##text##|=|thinBasic||##thinbasic##|=|Unoidl||##idl##|| -|=|VB.NET||##vbnet##|=|VHDL||##vhdl##|=|Visual BASIC||##vb##|| -|=|Visual Fox Pro||##visualfoxpro##|=|""WinBatch""||##winbatch##|=|XML||##xml##|| -|=|X""++""||##xpp##|=|""ZiLOG"" Z80 Assembler||##z80##|=| || ---- ---===13. Mindmaps===---Wikka has native support for [[Wikka:FreeMind|mindmaps]]. There are two options for embedding a mindmap in a wiki page.--- --- **Option 1:** Upload a ""FreeMind"" file to a webserver, and then place a link to it on a wikka page: ##""http://yourdomain.com/freemind/freemind.mm""## No special formatting is necessary. --- ---**Option 2:** Paste the ""FreeMind"" data directly into a wikka page: - -~-Open a ""FreeMind"" file with a text editor. -~-Select all, and copy the data. -~-Browse to your Wikka site and paste the Freemind data into a page. -::c:: ----===14. Embedded HTML===---You can easily paste HTML in a wiki page by wrapping it into two sets of doublequotes.--- --- -~##""[html code]""## -<< -~##""y = xn+1""## -~""y = xn+1"" -<<::c::<< -~##""CSS""## -~""CSS"" -<<::c::---By default, some HTML tags are removed by the ""SafeHTML"" parser to protect against potentially dangerous code. The list of tags that are stripped can be found on the Wikka:SafeHTML page.--- ---It is possible to allow // all // HTML tags to be used, see Wikka:UsingHTML for more information.--- --- ----CategoryWiki \ No newline at end of file From 8f315040676db11eaa254c0ce6b8485b27b80ff8 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Wed, 14 Feb 2018 18:00:33 -0500 Subject: [PATCH 08/15] fbdoc: wiki snapshot 2018-02-14 --- doc/manual/cache/CatagoryKeywords.wakka | 1 - doc/manual/cache/CodeLibrary.wakka | 1 + doc/manual/cache/CommunityTutorials.wakka | 2 +- doc/manual/cache/CompilerHelp.wakka | 8 +- doc/manual/cache/CompilerWelcome.wakka | 10 +- doc/manual/cache/DocToc.wakka | 1 - doc/manual/cache/KeyPgByrefVariables.wakka | 2 +- doc/manual/cache/KeyPgPalette.wakka | 3 +- doc/manual/cache/KeyPgRandom.wakka | 2 +- doc/manual/cache/KeyPgShared.wakka | 1 + doc/manual/cache/MissingDocs.wakka | 4 +- doc/manual/cache/ProPgPointers.wakka | 3 + doc/manual/cache/ProPgProfiling.wakka | 2 +- doc/manual/cache/ProPgTypeObjects.wakka | 134 +++++++++++++++--- doc/manual/cache/RyanSzrama.wakka | 3 - doc/manual/cache/TutConstQualifiers.wakka | 6 +- doc/manual/cache/TutDynaArrayType.wakka | 4 +- doc/manual/cache/TutIfStatement.wakka | 2 +- doc/manual/cache/TutInterfacingWithC.wakka | 2 +- doc/manual/cache/TutIntroArrays.wakka | 8 +- doc/manual/cache/TutIntroScope.wakka | 2 +- doc/manual/cache/TutMessageIntro.wakka | 14 +- .../cache/TutOOPInNonOOPLanguages.wakka | 4 +- doc/manual/cache/TutPointers.wakka | 10 +- doc/manual/cache/TutPortingFromQB.wakka | 16 +-- doc/manual/cache/TutPterDataType.wakka | 16 +-- doc/manual/cache/TutSimPolymorphism.wakka | 8 +- doc/manual/cache/TutUsingMouse.wakka | 8 +- doc/manual/cache/notthecheatr.wakka | 2 +- 29 files changed, 184 insertions(+), 95 deletions(-) delete mode 100644 doc/manual/cache/CatagoryKeywords.wakka delete mode 100644 doc/manual/cache/RyanSzrama.wakka diff --git a/doc/manual/cache/CatagoryKeywords.wakka b/doc/manual/cache/CatagoryKeywords.wakka deleted file mode 100644 index 56649431dd..0000000000 --- a/doc/manual/cache/CatagoryKeywords.wakka +++ /dev/null @@ -1 +0,0 @@ - {{Category}} \ No newline at end of file diff --git a/doc/manual/cache/CodeLibrary.wakka b/doc/manual/cache/CodeLibrary.wakka index bf5fbf785d..e114243735 100644 --- a/doc/manual/cache/CodeLibrary.wakka +++ b/doc/manual/cache/CodeLibrary.wakka @@ -1,3 +1,4 @@ +{{fbdoc item="title" value="Community Code Library"}}---- ""FreeBASIC"" Code, Games, and Libraries. Written in ""FreeBASIC"", by ""FreeBASIC"" Community Members. <<{{anchor name="EDITOR"}}{{fbdoc item="section" value="Code Editors & IDEs "}} diff --git a/doc/manual/cache/CommunityTutorials.wakka b/doc/manual/cache/CommunityTutorials.wakka index 95e3b86cbe..fe2f289698 100644 --- a/doc/manual/cache/CommunityTutorials.wakka +++ b/doc/manual/cache/CommunityTutorials.wakka @@ -1,4 +1,4 @@ -{{image url="/images/fbwct.png"}} ---- +{{image url="/images/fbwct.png"}}{{fbdoc item="title" value="Community Tutorials"}}---- Tutorials submitted by the FreeBASIC community: << {{fbdoc item="section" value="Getting Started"}} -[[TutGettingStartedQB|Getting Started with FreeBASIC]] //by [[JasonFirth|SJ Zero]]// diff --git a/doc/manual/cache/CompilerHelp.wakka b/doc/manual/cache/CompilerHelp.wakka index e94b90eaf5..b455b8c18b 100644 --- a/doc/manual/cache/CompilerHelp.wakka +++ b/doc/manual/cache/CompilerHelp.wakka @@ -4,7 +4,7 @@ There are several options available for getting help with ""FreeBASIC"". {{fbdoc item="section" value="The Manual"}} This huge user's manual is full of information that can help you learn to write programs using ""FreeBASIC"". - The manual is available online at [[http://www.freebasic.net/wiki]]. There is a search box at the bottom of every page to help you find what you're looking for. + The manual is available online at [[https://www.freebasic.net/wiki]]. There is a search box at the top of every page to help you find what you're looking for. If you are unfamiliar with ""FreeBASIC"" or the documentation, you may find these pages a good place to start: - [[DocToc|Table of Contents]] @@ -15,7 +15,7 @@ There are several options available for getting help with ""FreeBASIC"". - [[FaqPggfxlib2|Graphics Library FAQ]] - [[FaqPgrtlib|Runtime Library FAQ]] - A downloadable manual (in CHM format) is available from the sourceforge project page at [[http://sourceforge.net/projects/fbc|http://sourceforge.net/projects/fbc]] which features a full table of contents, searching capabilities, an index, plus all the same content as the online version. + A downloadable manual (in CHM format) is available from the sourceforge project page at [[https://sourceforge.net/projects/fbc|https://sourceforge.net/projects/fbc]] which features a full table of contents, searching capabilities, an index, plus all the same content as the online version. Searching the manual on or offline is an excellent place to start finding help about how to write and use ""FreeBASIC"" programs. @@ -26,12 +26,12 @@ There are several options available for getting help with ""FreeBASIC"". Community created tutorials about ""FreeBASIC"" can be found at [[CommunityTutorials]]. Some selected tutorials are included in this manual. {{fbdoc item="section" value="FreeBASIC Forum"}} - An active community forum can be found at [[http://www.freebasic.net/forum|http://www.freebasic.net/forum]] with several sub-forums. The forum has a search feature that can help you find answers to questions or problems that may have already been asked and solved. First do a search for your problem, if you can't find the answer then post a message in one of the sub-forums. + An active community forum can be found at [[https://www.freebasic.net/forum|https://www.freebasic.net/forum]] with several sub-forums. The forum has a search feature that can help you find answers to questions or problems that may have already been asked and solved. First do a search for your problem, if you can't find the answer then post a message in one of the sub-forums. {{fbdoc item="section" value="Chat"}} IRC or Internet Relay Chat is a great way to chat with the developers and other users, some of whom are very knowledgeable. There are several ways to connect to IRC, if you know what you're doing simply join #freebasic on ""FreeNode"". - If you haven't the foggiest what IRC is and you have Java installed, you can simply go [[http://www.freebasic.net/index.php/chat|here]]. + If you haven't the foggiest what IRC is and you have Java installed, you can simply go [[https://www.freebasic.net/index.php/chat.html|here]]. If you're trying to get help, the most important thing is to be patient. Sometimes you won't get a reply right away. Stick around or check back and the Community will try and assist you. diff --git a/doc/manual/cache/CompilerWelcome.wakka b/doc/manual/cache/CompilerWelcome.wakka index 5ba8aa3f58..540a40732e 100644 --- a/doc/manual/cache/CompilerWelcome.wakka +++ b/doc/manual/cache/CompilerWelcome.wakka @@ -2,10 +2,10 @@ Welcome to our world! This page is an overview of our online warehouse of knowledge. Enjoy your surfing and we hope this will be the first of many visits. {{fbdoc item="section" value="Introduction"}} - ""FreeBASIC"" is a free 32-bit compiler for the BASIC language. It is open source and //[[GnuLicenses|licensed under the GPL]]//. It is designed to be syntax compatible with QuickBASIC, while expanding on the language and capabilities. It can create programs for MS-Windows, DOS and Linux, and is being ported to other platforms. See //[[CompilerAbout|About FreeBASIC]]// and //[[CompilerFeatures|Main Features]]//. + ""FreeBASIC"" is a free, BASIC compiler for Windows (32-bit and 64-bit), 32 bit protected-mode DOS (COFF executables, like DJGPP), and Linux (x86, x86_64, and ARM). It is open source and //[[GnuLicenses|licensed under the GPL]]//. It is designed to be syntax compatible with QuickBASIC, while expanding on the language and capabilities. It can create programs for MS-Windows, DOS and Linux, and is being ported to other platforms. See //[[CompilerAbout|About FreeBASIC]]// and //[[CompilerFeatures|Main Features]]//. {{fbdoc item="section" value="Latest Version"}} - ""FreeBASIC"" is a beta release compiler and development is ongoing. With each full update, many features are added, and bugs from previous releases are fixed. To see the latest version available, visit [[http://www.freebasic.net/forum/viewforum.php?f=1|the News section on the forum]]. + ""FreeBASIC"" is a beta release compiler and development is ongoing. With each full update, many features are added, and bugs from previous releases are fixed. To see the latest version available, visit [[https://www.freebasic.net/forum/viewforum.php?f=1|the News section on the forum]]. {{fbdoc item="section" value="Requirements and Installation"}} Minimum hardware is listed on the //[[CompilerRequirements|Requirements]]// page. Visit our //[[CompilerRequirements|Installation]]// page for setting up ""FreeBASIC"" on your computer. @@ -17,7 +17,7 @@ Welcome to our world! This page is an overview of our online warehouse of knowl ""FreeBASIC"" is designed to be syntax compatible with [[QuickBASIC]]. For best code-compatibility with ""QuickBASIC"", the //[[CompilerDialects|QB dialect]]// can be used when compiling source code. See //[[CompilerDialects|FreeBASIC Dialects]]// and //[[LangQB|Differences from QB]]//. {{fbdoc item="section" value="Documentation"}} - All official documentation can be found online in the wiki at [[http://www.freebasic.net/wiki]]. The online documentation is the most up-to-date resource available. In all cases it can be regarded as the correct version. The downloadable versions of the manual are snapshots of the documentation available at a particular time and should be mostly correct for a specific released version of the compiler. However, we do not maintain multiple versions of the documentation so there may be some discrepancies. + All official documentation can be found online in the wiki at [[https://www.freebasic.net/wiki]]. The online documentation is the most up-to-date resource available. In all cases it can be regarded as the correct version. The downloadable versions of the manual are snapshots of the documentation available at a particular time and should be mostly correct for a specific released version of the compiler. However, we do not maintain multiple versions of the documentation so there may be some discrepancies. {{fbdoc item="section" value="Starting points in the Manual"}} - [[DocToc|Table of Contents]] @@ -25,8 +25,8 @@ Welcome to our world! This page is an overview of our online warehouse of knowl - [[CatPgProgrammer|Programmer's Guide]] {{fbdoc item="section" value="Starting points on the Web"}} - - Official Website at [[http://www.freebasic.net|http://www.freebasic.net]] - - Official Forums at [[http://www.freebasic.net/forum|http://www.freebasic.net/forum]] + - Official Website at [[https://www.freebasic.net|https://www.freebasic.net]] + - Official Forums at [[https://www.freebasic.net/forum|https://www.freebasic.net/forum]] Thank you for using ""FreeBASIC"". Happy coding! diff --git a/doc/manual/cache/DocToc.wakka b/doc/manual/cache/DocToc.wakka index ca892e28c3..72ab40d278 100644 --- a/doc/manual/cache/DocToc.wakka +++ b/doc/manual/cache/DocToc.wakka @@ -74,7 +74,6 @@ {{fbdoc item="keyword" value="CompilerErrMsg|Compiler Error Messages"}} {{fbdoc item="keyword" value="CompilerTools|Tools used by fbc"}} - {{fbdoc item="keyword" value="CompilerTools|Tools used by fbc"}} {{fbdoc item="keyword" value="CompilerInstallingGcc|Installing gcc for -gen gcc"}} {{fbdoc item="section" value="FreeBASIC dialects and QBASIC"}} diff --git a/doc/manual/cache/KeyPgByrefVariables.wakka b/doc/manual/cache/KeyPgByrefVariables.wakka index 9147ba76c8..04e4b2b409 100644 --- a/doc/manual/cache/KeyPgByrefVariables.wakka +++ b/doc/manual/cache/KeyPgByrefVariables.wakka @@ -164,7 +164,7 @@ Sleep %% {{fbdoc item="lang"}} - - Only supported in -lang fb, -lang fblite and -lang deprecated dialects. + - Only supported in //[[CompilerOptlang|-lang fb]]//, //[[CompilerOptlang|-lang fblite]]// and //[[CompilerOptlang|-lang deprecated]]// dialects. {{fbdoc item="diff"}} - New to ""FreeBASIC"". diff --git a/doc/manual/cache/KeyPgPalette.wakka b/doc/manual/cache/KeyPgPalette.wakka index c78841f5a5..df4a43231c 100644 --- a/doc/manual/cache/KeyPgPalette.wakka +++ b/doc/manual/cache/KeyPgPalette.wakka @@ -86,6 +86,7 @@ sleep - ##[[KeyPgScreengraphics|Screen (Graphics)]]## - ##[[KeyPgColor|Color]]## - ##[[KeyPgUsing|Using]]## - - ##[[GfxInternalFormats|Internal Pixel Formats]]## + - [[GfxInternalFormats|Internal Pixel Formats]] + - [[GfxDefPalettes|Default Palettes]] {{fbdoc item="back" value="CatPgGfx2D|2D Drawing Functions"}} \ No newline at end of file diff --git a/doc/manual/cache/KeyPgRandom.wakka b/doc/manual/cache/KeyPgRandom.wakka index 231798e112..1a76febc88 100644 --- a/doc/manual/cache/KeyPgRandom.wakka +++ b/doc/manual/cache/KeyPgRandom.wakka @@ -108,7 +108,7 @@ close #1 %% {{fbdoc item="diff"}} - - Care must be taken with dynamic or fixed length strings inside user defined types (UDT), see the warning at KeyPgType. + - Care must be taken with dynamic or fixed length strings inside user defined types (UDT), see the warning at [[KeyPgType|Type]]. - The keyword ##[[KeyPgField|Field]]## can only be used with ##[[KeyPgType|Type]]## to specify the packing of the UDT. {{fbdoc item="see"}} diff --git a/doc/manual/cache/KeyPgShared.wakka b/doc/manual/cache/KeyPgShared.wakka index 9ad5c663e8..2e5a74174f 100644 --- a/doc/manual/cache/KeyPgShared.wakka +++ b/doc/manual/cache/KeyPgShared.wakka @@ -6,6 +6,7 @@ Variable declaration modifier specifying visibility throughout a module [[KeyPgRedim|Redim]] **Shared** ... [[KeyPgCommon|Common]] **Shared** ... [[KeyPgStatic|Static]] **Shared** ... + [[KeyPgVar|Var]] **Shared** ... ## {{fbdoc item="desc"}} ##**Shared**## makes module-level variables visible inside ##[[KeyPgSub|Sub]]##s and ##[[KeyPgFunction|Function]]##s. diff --git a/doc/manual/cache/MissingDocs.wakka b/doc/manual/cache/MissingDocs.wakka index 613bbbd846..2bc9d62596 100644 --- a/doc/manual/cache/MissingDocs.wakka +++ b/doc/manual/cache/MissingDocs.wakka @@ -10,19 +10,17 @@ Please edit this page to remove items when they are written or add items when th Expressions (Add to "Statements and Expressions" on CatPgProgrammer) See [[CatPgProgrammer|Programmer's Guide]] (W.I.P.) Need to split Return-from-gosub and Return-from-proc (See KeyPgReturn) - Dedicated page for ##[[KeyPgScreengraphics|Screen]]##'s QB/page-choosing mode - perhaps KeyPgScreenqb or KeyPgScreenpage...? (quick fb example added to KeyPgPcopy for now...) + Dedicated page for ##[[KeyPgScreengraphics|Screen]]##'s QB/page-choosing mode - perhaps KeyPgScreenqb ++or KeyPgScreenpage...++? (quick fb example added to KeyPgPcopy for now...) {{fbdoc item="section" value="Pages missing/incorrect examples"}} None known (but if found, please edit this page) {{fbdoc item="section" value="Misc wishlist"}} - CVS SNV GIT (many pages about former CVS SVN stuff, little about GIT) Warn in all non-portable or "evil" examples File I/O: FB commands vs "CRT" Consistent policy about "FB version diff" [[KeyPgImageInfo]] [[KeyPgRem]] FB source file size limit "returning references" stuff (PEEK, (), [], ... total 7 pages BUMP'ed today) - Various outdated pages {delete} or update them [[FBWikiDownloads]] [[GFXLib2]] "-gen GCC" document how to get it working (esp. in DOS) {{fbdoc item="back" value="FBWiki|Main Page"}} diff --git a/doc/manual/cache/ProPgPointers.wakka b/doc/manual/cache/ProPgPointers.wakka index cd24626bb0..9275a75695 100644 --- a/doc/manual/cache/ProPgPointers.wakka +++ b/doc/manual/cache/ProPgPointers.wakka @@ -4,6 +4,9 @@ Data types whose values are addresses in memory. {{fbdoc item="section" value="Declaration"}} Pointers are [[ProPgVariables|Variables]] whose values are addresses in memory, and they are said to 'point' to this memory. The type of data that is pointed to depends on the type of pointer (an ##[[KeyPgInteger|Integer]] [[KeyPgPointer|Pointer]]## points to ##[[KeyPgInteger|Integer]]## data). Pointers are declared like any other variable, with the suffix "##pointer##" or "##ptr##" following the type name. +{{fbdoc item="section" value="Assigning pointer variables"}} + A pointer is a memory address and the value of the pointer itself is that memory address. To assign a pointer variable is to assign it a memory address to something. One way to assign a pointer a memory address is to take the address of some other variable in the program using ##[[KeyPgOpAt|Operator @]]## (Address of). + {{fbdoc item="section" value="Accessing pointed to data"}} The data pointed to by a pointer can be accessed with ##[[KeyPgOpValueOf|Operator *]]## (Value of). This operator returns a reference to the data that its operand points to. The following, diff --git a/doc/manual/cache/ProPgProfiling.wakka b/doc/manual/cache/ProPgProfiling.wakka index acc92d47a1..7d75b91b5b 100644 --- a/doc/manual/cache/ProPgProfiling.wakka +++ b/doc/manual/cache/ProPgProfiling.wakka @@ -10,7 +10,7 @@ The three basic steps to profiling a program are: - 2) Run the program to collection information ( stored in ##gmon.out## ). - 3) Analyze the information collected using GPROF. -Full documentation on GPROF is available here: [[http://www.gnu.org/software/binutils/manual/gprof-2.9.1/gprof.html|http://www.gnu.org/software/binutils/manual/gprof-2.9.1/gprof.html]]. If the documentation has moved from that location, simply search the web for "GNU GPROF" and a relevant link should be returned. +Full documentation on GPROF is available here: [[https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_mono/gprof.html|https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_mono/gprof.html]]. If the documentation has moved from that location, simply search the web for "GNU GPROF" and a relevant link should be returned. ""FreeBASIC"" supports function profiling; not basic-block or line-by-line profiling. diff --git a/doc/manual/cache/ProPgTypeObjects.wakka b/doc/manual/cache/ProPgTypeObjects.wakka index 62e0b69f5d..590e733b99 100644 --- a/doc/manual/cache/ProPgTypeObjects.wakka +++ b/doc/manual/cache/ProPgTypeObjects.wakka @@ -8,10 +8,10 @@ An example of the overloadable operators and member procedures '' Sample Type showing available methods and operators '' Practically this is a pointless example, as the only '' data member is an Integer. It serves only as a -'' demonstration and guide. +'' guide to syntax. '' '' There are many other combinations that can be -'' used in pass parameters. For simplicity +'' used in passed parameters. For simplicity '' This example only uses byref and type T '' where ever possible. @@ -70,6 +70,13 @@ type T '' Nonstatic Member Declarations: + '' Memory Allocation/Deallocation + + declare operator new ( byval size as uinteger ) as any ptr + declare operator new[] ( byval size as uinteger ) as any ptr + declare operator delete ( byval buf as any ptr ) + declare operator delete[] ( byval buf as any ptr ) + '' Assignment declare operator let ( byref rhs as T ) @@ -84,7 +91,6 @@ type T declare operator += ( byref rhs as T ) declare operator += ( byref rhs as DataType ) - declare operator -= ( byref rhs as DataType ) declare operator *= ( byref rhs as DataType ) declare operator /= ( byref rhs as DataType ) @@ -98,30 +104,31 @@ type T declare operator imp= ( byref rhs as DataType ) declare operator eqv= ( byref rhs as DataType ) declare operator ^= ( byref rhs as DataType ) - + declare operator &= ( byref rhs as DataType ) + '' Address of declare operator @ () as DataType ptr '' Constructors can be overloaded - declare constructor() - declare constructor( byref rhs as T ) - declare constructor( byref rhs as DataType ) + declare constructor () + declare constructor ( byref rhs as T ) + declare constructor ( byref rhs as DataType ) '' There can be only one destructor - declare destructor() + declare destructor () '' Nonstatic member functions and subs '' overloaded procs must have different parameters - declare function f( ) as DataType - declare function f( byref arg1 as DataType ) as DataType + declare function f ( ) as DataType + declare function f ( byref arg1 as DataType ) as DataType - declare sub s( ) - declare sub s( byref arg1 as T ) - declare sub s( byref arg1 as DataType ) + declare sub s ( ) + declare sub s ( byref arg1 as T ) + declare sub s ( byref arg1 as DataType ) '' Properties @@ -131,6 +138,16 @@ type T declare property pidx ( byval index as DataType ) as DataType declare property pidx ( byval index as DataType, byref new_value as DataType ) + '' Iterator + + declare operator for () + declare operator step () + declare operator next ( byref cond as T ) as integer + + declare operator for ( byref stp as T ) + declare operator step ( byref stp as T ) + declare operator next ( byref cond as T, byref stp as T ) as integer + end type '' These must be global procedures @@ -166,6 +183,13 @@ declare operator < ( byref lhs as T, byref rhs as DataType ) as DataType declare operator > ( byref lhs as T, byref rhs as DataType ) as DataType declare operator <= ( byref lhs as T, byref rhs as DataType ) as DataType declare operator >= ( byref lhs as T, byref rhs as DataType ) as DataType +declare operator & ( byref lhs as T, byref rhs as DataType ) as DataType + +declare operator abs ( byref arg as UDT ) as double +declare operator fix ( byref arg as UDT ) as double +declare operator frac ( byref arg as UDT ) as double +declare operator int ( byref arg as UDT ) as double +declare operator sgn ( byref arg as UDT ) as double '' Global procedures (subs and funcs) can also accept the TYPE '' as a parameter or return it as a value, as could be done @@ -180,6 +204,22 @@ declare operator >= ( byref lhs as T, byref rhs as DataType ) as DataType '' Name resolution in a NAMESPACE is same as other '' subs/funcs. Use USING or prefix the namespace name +operator T.new ( byval size as uinteger ) as any ptr + operator = allocate( size ) +end operator + +operator T.new[] ( byval size as uinteger ) as any ptr + operator = allocate( size ) +end operator + +operator T.delete ( byval buf as any ptr ) + deallocate buf +end operator + +operator T.delete[] ( byval buf as any ptr ) + deallocate buf +end operator + operator T.let ( byref rhs as T ) value = rhs.value end operator @@ -256,6 +296,11 @@ operator T.^= ( byref rhs as DataType ) value ^= rhs end operator +operator T.&= ( byref rhs as DataType ) + dim tmp as string + tmp &= str( rhs ) +end operator + operator T.@ () as DataType ptr return( cast( DataType ptr, @this )) end operator @@ -263,21 +308,24 @@ end operator '' Constructors: -constructor T() +constructor T () + '' default constructor value = 0 end constructor -constructor T( byref rhs as T ) +constructor T ( byref rhs as T ) + '' copy constructor value = rhs.value end constructor -constructor T( byref rhs as DataType ) +constructor T ( byref rhs as DataType ) + '' custom constructor value = rhs end constructor '' There can be only one destructor -destructor T() +destructor T () '' clean-up, none in this example end destructor @@ -381,20 +429,43 @@ operator >= ( byref lhs as T, byref rhs as DataType ) as DataType return (lhs.value >= rhs) end operator +operator & ( byref lhs as T, byref rhs as DataType ) as DataType + return val(lhs.value & rhs) +end operator + +operator abs ( byref arg as UDT ) as double + return abs(arg.value) +end operator + +operator fix ( byref arg as UDT ) as double + return fix(arg.value) +end operator + +operator frac ( byref arg as UDT ) as double + return frac(arg.value) +end operator + +operator int ( byref arg as UDT ) as double + return int(arg.value) +end operator + +operator sgn ( byref arg as UDT ) as double + return sgn(arg.value) +end operator '' Nonstatic member methods -function T.f( ) as DataType +function T.f ( ) as DataType dim x as DataType return x end function -function T.f( byref arg1 as DataType ) as DataType +function T.f ( byref arg1 as DataType ) as DataType arg1 = this.value return value end function -sub T.s( ) +sub T.s ( ) '' refer to the type using '' with block @@ -410,11 +481,11 @@ sub T.s( ) end sub -sub T.s( byref arg1 as T ) +sub T.s ( byref arg1 as T ) value = arg1.value end sub -sub T.s( byref arg1 as DataType ) +sub T.s ( byref arg1 as DataType ) value = arg1 end sub @@ -438,6 +509,25 @@ property T.pidx ( byval index as DataType, byref new_value as DataType ) value_array( index ) = new_value end property +operator T.for () +end operator + +operator T.step () +end operator + +operator T.next ( byref cond as T ) as integer + return 0 +end operator + +operator T.for ( byref stp as T ) +end operator + +operator T.step ( byref stp as T ) +end operator + +operator T.next ( byref cond as T, byref stp as T ) as integer + return 0 +end operator '' new, delete, delete[] diff --git a/doc/manual/cache/RyanSzrama.wakka b/doc/manual/cache/RyanSzrama.wakka deleted file mode 100644 index e5f4b61b9f..0000000000 --- a/doc/manual/cache/RyanSzrama.wakka +++ /dev/null @@ -1,3 +0,0 @@ -I've been on the scene at least since high school (graduated in 2001), starting off at QB News and migrating to FreeBASIC as soon as was possible. My personal site is currently http://www.bywombats.com, but I have yet to move my coding content over from my old site, http://www.geocities.com/szrrya. My main contribution has been Red Jumpy Ball, though I authored Numbervold and The Hungry Jocke Game. Numbervold took the prize in a QBE contest for text game, and back in the days of RPG-dev.net I nabbed the prize for Blackfurl, the start of a QB strategy RPG engine. I'd love to go back to it, but... - -My main programming now centers on PHP/MySQL for development of database driven web applications. My current project is Ubercart, an e-commerce suite built on the Drupal CMS, found at http://www.ubercart.org. \ No newline at end of file diff --git a/doc/manual/cache/TutConstQualifiers.wakka b/doc/manual/cache/TutConstQualifiers.wakka index 3e1a068013..d237069e66 100644 --- a/doc/manual/cache/TutConstQualifiers.wakka +++ b/doc/manual/cache/TutConstQualifiers.wakka @@ -3,9 +3,9 @@ Note: As with all things regarding scope, Const qualifiers may be a bit difficu Also note my cliche title, which I chose because of it's clicheness. -What the heck are Const qualifiers? Const qualifiers are a feature recently added to the language (fbc 0.18.3); they're a standard part of C""++"" and now they exist in FreeBasic too. Const qualifiers are yet another form of protection - they allow some "variables" to act like constants to certain parts of your program, in other words some parts of the program are allowed to access (read) them but not modify them. Just another kind of type safety, really, but an extremely useful one. In particular, they are very useful in OO situations, but you can probably benefit from them to some degree even if you aren't interested in OOP. +What the heck are Const qualifiers? Const qualifiers are a feature recently added to the language (fbc 0.18.3); they're a standard part of C""++"" and now they exist in ""FreeBASIC"" too. Const qualifiers are yet another form of protection - they allow some "variables" to act like constants to certain parts of your program, in other words some parts of the program are allowed to access (read) them but not modify them. Just another kind of type safety, really, but an extremely useful one. In particular, they are very useful in OO situations, but you can probably benefit from them to some degree even if you aren't interested in OOP. -The Const qualifier in FreeBasic is essentially an extension to data type declarations, and they may be used with Dim, UDT members, and procedure parameters. Generally you put it right after the "As" part of the variables's data type declaration: +The Const qualifier in ""FreeBASIC"" is essentially an extension to data type declarations, and they may be used with Dim, UDT members, and procedure parameters. Generally you put it right after the "As" part of the variables's data type declaration: %%(freebasic) Dim As Const Integer my_const_int = 5 @@ -166,7 +166,7 @@ If you have any other difficulties with Const qualifiers, remember that even tho If you still don't understand Const qualifiers, you probably are a newbie who doesn't know much about scope yet anyways - and that's fine, you'll learn as you go. Eventually some decent documentation for this feature will be created, but until then this is all you have. Bear in mind: if you don't understand how they work, you probably won't need them. I for one have written fine programs long before they were around, and I'll probably continue to do so without using them anywhere they aren't needed. There are specific instances when they're useful, and if you understand those instances then you may as well use them when those instances arise. But if you don't understand, that's fine! -Finally, here are some links that should be helpful. The first is a C""++"" documentation page about Const qualifiers in C""++"" - of course, it only makes sense if you understand C""++"", and they also talk about things we don't have yet (i.e., Const methods). Nevertheless it's a fine place to start if you know any C""++"", so check it out if you like. There is also a link to a forum topic in which I asked about FreeBasic development (and learned about Const qualifiers), and a link to the original ""SourceForge"" Feature Request page in which Const qualifiers were originally requested as a feature: +Finally, here are some links that should be helpful. The first is a C""++"" documentation page about Const qualifiers in C""++"" - of course, it only makes sense if you understand C""++"", and they also talk about things we don't have yet (i.e., Const methods). Nevertheless it's a fine place to start if you know any C""++"", so check it out if you like. There is also a link to a forum topic in which I asked about ""FreeBASIC"" development (and learned about Const qualifiers), and a link to the original ""SourceForge"" Feature Request page in which Const qualifiers were originally requested as a feature: https://isocpp.org/wiki/faq/const-correctness http://www.freebasic.net/forum/viewtopic.php?t=9975&postdays=0&postorder=asc&start=0 diff --git a/doc/manual/cache/TutDynaArrayType.wakka b/doc/manual/cache/TutDynaArrayType.wakka index 33722d8f1c..f7c09ab8ee 100644 --- a/doc/manual/cache/TutDynaArrayType.wakka +++ b/doc/manual/cache/TutDynaArrayType.wakka @@ -3,9 +3,9 @@ === Introduction === -A dynamic array in a type definition is a very useful feature, but FreeBasic doesn't support it before version 1.00.0. Or rather, it doesn't support it directly before that version. However, you can create dynamic arrays by using pointers and the associated memory functions. +A dynamic array in a type definition is a very useful feature, but ""FreeBASIC"" doesn't support it before version 1.00.0. Or rather, it doesn't support it directly before that version. However, you can create dynamic arrays by using pointers and the associated memory functions. -An array is simply a contiguous block of memory that holds a certain data type. Arrays in FreeBasic use an array descriptor to describe the data contained within the array, and you can use this same technique to build a dynamic array within a type. The two elements you need within your type-def are a pointer to a particular data type, and a size indicator. +An array is simply a contiguous block of memory that holds a certain data type. Arrays in ""FreeBASIC"" use an array descriptor to describe the data contained within the array, and you can use this same technique to build a dynamic array within a type. The two elements you need within your type-def are a pointer to a particular data type, and a size indicator. You can then use the ptr field to allocate a block of memory to the needed size, and save that size in the size indicator field. The size field is used to tell you how many elements are currently in the array. Once the array has been initialized, you can then use pointer indexing to access each element in the array. diff --git a/doc/manual/cache/TutIfStatement.wakka b/doc/manual/cache/TutIfStatement.wakka index 1ded7a07cf..7208c261f0 100644 --- a/doc/manual/cache/TutIfStatement.wakka +++ b/doc/manual/cache/TutIfStatement.wakka @@ -89,7 +89,7 @@ If either of the statements within the parenthesis evaluate to 0, then And will === The Not Problem === -The Not bitwise operator can be a problem in an If statement. You may be used to writing //If Not var Then//, with Not performing a logical, rather than a bitwise operation. In FreeBasic Not performs a bitwise operation, not a logical operation. +The Not bitwise operator can be a problem in an If statement. You may be used to writing //If Not var Then//, with Not performing a logical, rather than a bitwise operation. In ""FreeBASIC"" Not performs a bitwise operation, not a logical operation. If var were to contain the value of 3, then Not 3 is -4, which will be regarded as a True result and the code following the Then will be executed, which is probably not what you wanted. Instead of writing //If Not var Then//, you should write //If var <> 0 Then//. diff --git a/doc/manual/cache/TutInterfacingWithC.wakka b/doc/manual/cache/TutInterfacingWithC.wakka index 0265e2473e..9c5294ebcd 100644 --- a/doc/manual/cache/TutInterfacingWithC.wakka +++ b/doc/manual/cache/TutInterfacingWithC.wakka @@ -8,7 +8,7 @@ This is a tiny basic tutorial on how to write a simple library in C and then use ===What is a library=== ===Prerequisite=== -This tutorial was written and tested with FreeBASIC 0.16b and the latest Current release of MinGW32 at the time. As a note Dev-cpp uses MinGW32 as it's compiler tool chain. You also get code::blocks with a mingw32 bundle. +This tutorial was written and tested with FreeBASIC 0.16b and the latest Current release of ""MinGW32"" at the time. As a note Dev-cpp uses ""MinGW32"" as it's compiler tool chain. You also get code::blocks with a mingw32 bundle. ===Formal description of the task at hand=== diff --git a/doc/manual/cache/TutIntroArrays.wakka b/doc/manual/cache/TutIntroArrays.wakka index 9b89e7e858..fbe124be2c 100644 --- a/doc/manual/cache/TutIntroArrays.wakka +++ b/doc/manual/cache/TutIntroArrays.wakka @@ -1,13 +1,13 @@ {{fbdoc item="title" value="Introduction To Arrays"}}---- //Written by [[WikiRick|rdc]]// -Arrays are probably the single most useful programming construct that is available to you in FreeBasic. Many problems that you will try to solve with a programming solution involve data arranged in tabular format, and arrays are perfect for managing this type of data. Understanding arrays is a crucial skill in becoming a competent programmer. +Arrays are probably the single most useful programming construct that is available to you in ""FreeBASIC"". Many problems that you will try to solve with a programming solution involve data arranged in tabular format, and arrays are perfect for managing this type of data. Understanding arrays is a crucial skill in becoming a competent programmer. -Arrays are contiguous memory segments of a single or composite data type. You can think of an array as a table, with rows and columns of data. An array can have one or more rows, and each row can have one or more columns. The number of rows and columns define the dimensions of the array. FreeBasic uses the row-major scheme for arrays, which means that the first dimension references the row in an array that has more than one dimension. FreeBasic supports up to eight dimensions in an array. +Arrays are contiguous memory segments of a single or composite data type. You can think of an array as a table, with rows and columns of data. An array can have one or more rows, and each row can have one or more columns. The number of rows and columns define the dimensions of the array. ""FreeBASIC"" uses the row-major scheme for arrays, which means that the first dimension references the row in an array that has more than one dimension. ""FreeBASIC"" supports up to eight dimensions in an array. === One-Dimensional Arrays === -An array with a single row is called a one-dimensional array. If an array is a single-dimensional array, then the row is not defined in the declaration, only the number of columns in the row. Since an array requires a minimum of one row, the row is understood to exist in this case. The following code snippets create a single-dimension integer array using the different array definition schemes available in FreeBasic. +An array with a single row is called a one-dimensional array. If an array is a single-dimensional array, then the row is not defined in the declaration, only the number of columns in the row. Since an array requires a minimum of one row, the row is understood to exist in this case. The following code snippets create a single-dimension integer array using the different array definition schemes available in ""FreeBASIC"". %%(freebasic) Dim myArray(10) as Integer @@ -208,7 +208,7 @@ You can also dimension multidimensional arrays in the same manner, by specifying Dim bArray(1 to 2, 1 to 5) As Integer => {{1, 2, 3, 4, 5},{6, 7, 8, 9, 10}} %% -In this example, the first block, ##{1, 2, 3, 4, 5}##, corresponds to row 1, and the second block, ##{6, 7, 8, 9, 10}##, corresponds to row 2. Remember that FreeBasic arrays are row-major, so the row is specified before the column. When you initialize an array in this manner, you must be sure that the number of elements defined will fit into the array. +In this example, the first block, ##{1, 2, 3, 4, 5}##, corresponds to row 1, and the second block, ##{6, 7, 8, 9, 10}##, corresponds to row 2. Remember that ""FreeBASIC"" arrays are row-major, so the row is specified before the column. When you initialize an array in this manner, you must be sure that the number of elements defined will fit into the array. === Type Array Initialization === diff --git a/doc/manual/cache/TutIntroScope.wakka b/doc/manual/cache/TutIntroScope.wakka index 4208453808..08a603d5ed 100644 --- a/doc/manual/cache/TutIntroScope.wakka +++ b/doc/manual/cache/TutIntroScope.wakka @@ -3,7 +3,7 @@ === Variable Scope === -Scope refers to the visibility of a variable, where you can access a variable within a program. Before you can understand the different levels of scope, you need to understand the structure of a program in FreeBasic. +Scope refers to the visibility of a variable, where you can access a variable within a program. Before you can understand the different levels of scope, you need to understand the structure of a program in ""FreeBASIC"". == Program Structure == diff --git a/doc/manual/cache/TutMessageIntro.wakka b/doc/manual/cache/TutMessageIntro.wakka index 13a8f3704e..ad810d79fe 100644 --- a/doc/manual/cache/TutMessageIntro.wakka +++ b/doc/manual/cache/TutMessageIntro.wakka @@ -1,11 +1,11 @@ {{fbdoc item="title" value="Introduction to Message-Based Programming"}}---- //Written by [[WikiRick|rdc]]// -Historically, programming languages have been categorized as procedural and message-based. For example, QuickBasic could be categorized as a procedural language and Visual Basic could be categorized as a message-based (or event-driven) language. In a procedural language you generally start at the top, do some things and exit in a somewhat linear manner. In a message-based language, you generally initialize the system and then the program sits in an idle loop and waits for something to happen. When something happens, you handle it and then the program returns to the idle loop, eventually exiting the loop when the user closes the program. +Historically, programming languages have been categorized as procedural and message-based. For example, ""QuickBasic"" could be categorized as a procedural language and Visual Basic could be categorized as a message-based (or event-driven) language. In a procedural language you generally start at the top, do some things and exit in a somewhat linear manner. In a message-based language, you generally initialize the system and then the program sits in an idle loop and waits for something to happen. When something happens, you handle it and then the program returns to the idle loop, eventually exiting the loop when the user closes the program. In a procedural language you have full control over what the user sees and does. In a message-based system, you work in cooperation with the operating system and user, handling only those messages that you are interested in, and letting the operating system handle the rest. The real stumbling block for programmers that come to a message-based language from a procedural language is the concept of responding only to messages. However, we are really talking about shades of gray, rather than black and white. In most languages, including procedural, messages play an important role. -If you have ever used a language that supports subroutine and function calls, then you have used message-based programming. For example, say you have written a game in QuickBasic that sits in a loop waiting for one of the arrow keys to be pressed. If the up arrow key is pressed, you call a subroutine that updates the position of a sprite on the screen. If the A key is pressed, you ignore it, since you don't care about the A key. This is message-based programming. The message is the key press and the sprite update subroutine is the message handler. +If you have ever used a language that supports subroutine and function calls, then you have used message-based programming. For example, say you have written a game in ""QuickBasic"" that sits in a loop waiting for one of the arrow keys to be pressed. If the up arrow key is pressed, you call a subroutine that updates the position of a sprite on the screen. If the A key is pressed, you ignore it, since you don't care about the A key. This is message-based programming. The message is the key press and the sprite update subroutine is the message handler. Any structured programming language could be categorized as a message-based programming language. Message-based programming is a concept, a way to handle user input and react to that input. It is more methodology than it is a type of language. It became the dominant feature of some programming languages when operating systems evolved from the command line to graphical user interfaces (GUIs). @@ -15,9 +15,9 @@ The Windows SDK is a collection of application programming interfaces (APIs) in While RAD languages enable the programmer to quickly build GUI-based programs, it also means that the finer details of the SDK are not accessible. For example, it is quite difficult to subclass a control using VB, but is quite straightforward using the SDK. However, the SDK is huge, and the shear size of the API is enough to make many programmers give up on the idea of SDK programming. The common thought is that it is too complicated and hard to use, but the opposite is true. Because the operating system handles all the graphical elements for the program, the programmer can concentrate on the most important aspect of program design, user interaction. After all, a GUI program is all about user interaction. -FreeBasic doesn't have a RAD system for Windows programming. To create a Windows program in FreeBasic, you will have to use the SDK, as this is the only option. While the SDK is massive, and would probably take a lifetime to fully understand, for 99% of all Windows programs, only a small subset of the SDK needs to be used. The reality is that Windows SDK programming is no harder than any other type of programming, and for GUI-based programs, is actually easier than a language where you would have to create all the GUI elements yourself. +""FreeBASIC"" doesn't have a RAD system for Windows programming. To create a Windows program in ""FreeBASIC"", you will have to use the SDK, as this is the only option. While the SDK is massive, and would probably take a lifetime to fully understand, for 99% of all Windows programs, only a small subset of the SDK needs to be used. The reality is that Windows SDK programming is no harder than any other type of programming, and for GUI-based programs, is actually easier than a language where you would have to create all the GUI elements yourself. -Putting aside all the gritty details of the Windows API for the moment, it is important to understand the mechanism of messages in an SDK program. This is best accomplished by looking at our old friend, the Hello World program. In the examples\Windows\gui folder of the FreeBasic .15b distribution (which is required for the code in this article), there is a nice Hello World program that I am going to steal--I mean borrow, as the base for this example. +Putting aside all the gritty details of the Windows API for the moment, it is important to understand the mechanism of messages in an SDK program. This is best accomplished by looking at our old friend, the Hello World program. In the examples\Windows\gui folder of the ""FreeBASIC"" .15b distribution (which is required for the code in this article), there is a nice Hello World program that I am going to steal--I mean borrow, as the base for this example. ##%%(freebasic) #include once "windows.bi" @@ -186,9 +186,9 @@ end function If you have successfully compiled and run the program, you will see a standard window with a message printed on the form. If you click the form, a message box will be displayed, and if you press the Escape key, the program will close. -Take a moment to examine the window. You will see that the form has the max, min and restore buttons, a system menu and can be resized. Now look at the code above. There isn't any code needed to handle the mentioned window properties, the OS handles all that for you. It also only takes a single line of code to display the messagebox, which in itself, is a rather complex object. The ratio of result to amount of code, is quite remarkable. If you were to try and recreate this simple program using FreeBasic's standard graphical commands, the program would be a hundred times larger. +Take a moment to examine the window. You will see that the form has the max, min and restore buttons, a system menu and can be resized. Now look at the code above. There isn't any code needed to handle the mentioned window properties, the OS handles all that for you. It also only takes a single line of code to display the messagebox, which in itself, is a rather complex object. The ratio of result to amount of code, is quite remarkable. If you were to try and recreate this simple program using ""FreeBASIC""'s standard graphical commands, the program would be a hundred times larger. -The first thing you should notice about the code listed above is the format. This is the basic format of any FreeBasic Windows program. Every Windows program, no matter how simple or complex, will follow this same basic format. The two key ingredients of this program are the **""WinMain""** and **""WinProc""** procedures. +The first thing you should notice about the code listed above is the format. This is the basic format of any ""FreeBASIC"" Windows program. Every Windows program, no matter how simple or complex, will follow this same basic format. The two key ingredients of this program are the **""WinMain""** and **""WinProc""** procedures. The ""WinMain"" procedure is the procedure Windows calls when a program is started. It is the entry point of a Windows program. In ""WinMain"", you build and register the main program window and then enter into the message loop to process messages. Once the program enters the message loop, it will start processing messages with the ""WinProc"" procedure. Since this article is about the message model in a Windows program, we will only discuss the message loop in ""WinMain"" and the ""WinProc"" procedure. @@ -250,7 +250,7 @@ Before we discuss the ""WinProc"" procedure however, we need to ask a question: end with %%## -As you can see, the WNDCLASS structure holds all of the information pertaining to a particular window. In relation to messages, the important item is the **.lpfnWndProc** field. This field holds the address of our message handler for this window. The @ operator in FreeBasic returns the address of an object, in this case the address of our ""WinProc"" procedure. Once this window is registered using the **""RegisterClass""** method, Windows will know what procedure to use to process messages. +As you can see, the WNDCLASS structure holds all of the information pertaining to a particular window. In relation to messages, the important item is the **.lpfnWndProc** field. This field holds the address of our message handler for this window. The @ operator in ""FreeBASIC"" returns the address of an object, in this case the address of our ""WinProc"" procedure. Once this window is registered using the **""RegisterClass""** method, Windows will know what procedure to use to process messages. As you can see, there is no special significance to the name ""WinProc"". ""WinProc"" could be called ""MyWinProc"", or ""WinHandler"". The actual SDK name is ""WindowProc"", which is just a placeholder for the user defined message handler name. The important piece of information is that whatever you call it, the message handler has to have the same parameters as we have defined in our ""WinProc"", and the address of that procedure has to be stored in .lpfnWndProc. diff --git a/doc/manual/cache/TutOOPInNonOOPLanguages.wakka b/doc/manual/cache/TutOOPInNonOOPLanguages.wakka index 2c179e7fe8..e99d2c6159 100644 --- a/doc/manual/cache/TutOOPInNonOOPLanguages.wakka +++ b/doc/manual/cache/TutOOPInNonOOPLanguages.wakka @@ -10,13 +10,13 @@ In order to demonstrate that it is not necessary to have an OO language this exa The code was tested using FB 0.16 for win32. -If you have to concatenate a lot of strings in most Basics you usually find that it is a time consuming process. Actually FreeBasic string operations are remarkably quick but you can still do better using a string builder. +If you have to concatenate a lot of strings in most Basics you usually find that it is a time consuming process. Actually ""FreeBASIC"" string operations are remarkably quick but you can still do better using a string builder. A string builder is simply a class that maintains a string buffer in such a way as to avoid repeated calls to the memory allocation function because this is a relatively expensive operation. The methods of the class provide ways of manipulating the buffer and converting between it and the native string type. The trick that makes it faster than the built type for large strings and large numbers of appends is that the string is held in a heap allocated buffer that is always larger than the actual length of the string. This means that appending to the end of the string usually simply means copying the contents of the new string to the memory location following the last character of the current string. In this implementation the buffer is a ZString so it is easy to convert it to an ordinary dynamic string. -The FreeBasic module encapsulates a type definition for a struct. Instances of this struct hold the attributes of the object. The methods are simply normal FreeBasic public functions and subs defined in the same module. When you want to call a method you use the normal FreeBasic syntax: +The ""FreeBASIC"" module encapsulates a type definition for a struct. Instances of this struct hold the attributes of the object. The methods are simply normal ""FreeBASIC"" public functions and subs defined in the same module. When you want to call a method you use the normal ""FreeBASIC"" syntax: %%(freebasic) s = StringB_ToString(AStringBInstance)%% By convention all methods names begin with the name of the class and an underscore and the first argument is always the instance of the type. This argument should always be passed by reference to ensure that changes to the state are permanent and also to avoid unnecessary, time-consuming, copying. diff --git a/doc/manual/cache/TutPointers.wakka b/doc/manual/cache/TutPointers.wakka index 23cd9878ef..f30b2e9009 100644 --- a/doc/manual/cache/TutPointers.wakka +++ b/doc/manual/cache/TutPointers.wakka @@ -11,7 +11,7 @@ Normally, you would access the data directly through the use of variables. When Using pointers is a bit different. Imagine you have a little scrap of paper that will represent our pointer. Right now it is blank and doesn't point to anything. This undefined pointer can't be used until it is initialized. To initialize the pointer, write a 1 on it. Now our pointer is "pointing" to hole 1 in our egg carton. To put data (an egg) in hole 1, we look at our scrap of paper, match it to hole 1 and place the egg in the hole. To retrieve the egg we do just the opposite. We match our slip of paper to hole 1 and then grab the egg. All the putting and getting of the egg has to be done through the slip of paper and is called dereferencing the pointer. That is, we get to the data through the reference contained in the pointer, the number 1. The pointer doesn't contain the data; it contains a reference to the data. -In FreeBasic we define a pointer using the [[KeyPgDim|Dim]] and [[KeyPgPtr|Ptr]] statements: +In ""FreeBASIC"" we define a pointer using the [[KeyPgDim|Dim]] and [[KeyPgPtr|Ptr]] statements: ##%%(freebasic) dim aptr as integer ptr @@ -54,9 +54,9 @@ The [[KeyPgDeallocate|deallocate]] function frees the memory pointed at by aptr, **What Good are Pointers?** -A major reason for adding pointers to FreeBasic is that many external libraries require pointers to type structures and pointers to strings. For example, the Win32 API has many structures that must be filled out and then passed to a function through a pointer. +A major reason for adding pointers to ""FreeBASIC"" is that many external libraries require pointers to type structures and pointers to strings. For example, the Win32 API has many structures that must be filled out and then passed to a function through a pointer. -Another use of a pointer is in a [[KeyPgType|Type]] definition. [[KeyPgType|Type]] defs in FreeBasic can only contain fixed length strings, but what if you don't know the length of a string until the program is running? A pointer can serve this purpose. +Another use of a pointer is in a [[KeyPgType|Type]] definition. [[KeyPgType|Type]] defs in ""FreeBASIC"" can only contain fixed length strings, but what if you don't know the length of a string until the program is running? A pointer can serve this purpose. (It should be stated that the Type definitions can now support variable length strings.) @@ -73,7 +73,7 @@ declare function pSetString(byval s as string) as zstring ptr dim mytype as mytptr 'Set a variable string into the type def -mytype.sptr = pSetString("Hello World From FreeBasic!") +mytype.sptr = pSetString("Hello World From FreeBASIC!") print "aptr: "; *mytype.sptr deallocate(mytype.sptr) sleep @@ -100,7 +100,7 @@ dim mytype as mytptr We then call our function pSetString to get the address of the variable length string we want in our [[KeyPgType|type]] def. ##%%(freebasic) -mytype.sptr = pSetString("Hello World From FreeBasic!") +mytype.sptr = pSetString("Hello World From FreeBASIC!") %%## Remember sptr is defined as a pointer, not a string variable, so pSetString is returning a pointer (memory address) to the string not the string itself. In other words, if the string is in hole #1, pSetString returns 1. diff --git a/doc/manual/cache/TutPortingFromQB.wakka b/doc/manual/cache/TutPortingFromQB.wakka index 6503a9f71f..ec042dd914 100644 --- a/doc/manual/cache/TutPortingFromQB.wakka +++ b/doc/manual/cache/TutPortingFromQB.wakka @@ -1,6 +1,6 @@ {{fbdoc item="title" value="Compiling a Big QB program in FB"}}---- -Let's try to compile a big (4000+ lines) graphical QB program in FreeBasic, to see how compatible FB is with QB. +Let's try to compile a big (4000+ lines) graphical QB program in ""FreeBASIC"", to see how compatible FB is with QB. As an example I will use Jark's TCRay a great raytracer with quadric, cubic and quadratic shapes, perlin noise programmed in 2004. You can get TCRay.zip from http://www.petesqbsite.com/downloads/graphics.shtml @@ -19,22 +19,22 @@ The program is made of has 3 files: **In ""TCLib17.bas""** It is a "pure QB" SVGA library. Most of its functions are obsoleted by FB as they are implemented as QB-style keywords. I had my share in developing that lib so you can trust me for this part ;) -Comment out the contents of the ClearScreen sub and add this +Comment out the contents of the ""ClearScreen"" sub and add this ##CLS## -Comment out the contents of the Point24 sub and add this: +Comment out the contents of the ""Point24"" sub and add this: ##a& = Point(x%,y%) red% = a& Shr 16 green% = (a& Shr 8) And 255 blue% = a& And 255## -Comment out the contents of the Pset24 sub and add this: +Comment out the contents of the ""Pset24"" sub and add this: ##PSet (x%,y%), red% Shl 16 Or green Shl 8 Or blue## Comment out the contents of the Screenshot sub and add this: ##BSave Name$+".bmp"## -Comment out the contents of the ""SelectVga"" sub, we will work with a fixed size most pc's will support. Comment out the contents of the ""SetText sub"", we are able to output text in HiRes graphics so mode switching is not required. +Comment out the contents of the ""SelectVga"" sub, we will work with a fixed size most pc's will support. Comment out the contents of the ""SetText sub"", we are able to output text in ""HiRes"" graphics so mode switching is not required. Comment out the contents of the ""SetVGA"" Sub excluding the Powers of two calculation at the end and add these four lines: ##Screen 20,32 '1024x768, 32 bits @@ -43,7 +43,7 @@ scrwidth=1024 Fullscreen## -**In TCRay17.bas** +**In ""TCRay17"".bas** Add a ""SetSVGA"" as the first line in the Menu sub (we are not switching modes so mode must be set before outputting text), ==Compiling== @@ -61,7 +61,7 @@ Add: ## #undefine RGB## Before the line giving the error. -ERROR: Duplicated definition, found 'ScreenRes' ([[KeyPgScreenres|ScreenRes]] is a keyword in FB) +ERROR: Duplicated definition, found '""ScreenRes""' ([[KeyPgScreenres|ScreenRes]] is a keyword in FB) Add: ## #undefine ""ScreenRes""## Before the line giving the error. @@ -101,7 +101,7 @@ Ok. At this point all modules compile. We're now going to fix a few linker error After compiling the linker ties together all the modules with a runtime library, finds the final addresses of every sub/function and substitutes the labels in the calls with these addresses. If a sub/function is called in the code and its nowhere to be found, the linker complains and gives us the name of the offending function. It can't give us the line numbers (the linker doesn't work with the source) so we will have to do a text search to find where the problem occurs. Notice the linker gives us "mangled" function names (an ampersand and the size of the parameters passed is added to the end), just ignore the ampersand and what's after. ""TcRay21C.o:fake:(.text+0x174d):"" undefined reference to `LINE24@20' -A call to an undefined Line24 sub is made in the program, you can find this call inside Draw.Axis, in ""TCRay21.bas"", a sub that's it's never called (you can do a search to confirrm it) +A call to an undefined ""Line24"" sub is made in the program, you can find this call inside Draw.Axis, in ""TCRay21.bas"", a sub that's it's never called (you can do a search to confirrm it) Probably the QB4.5 compiler would complain too about this. (Remember: this program never compiled in QB4.5) Just comment out the contents of the sub Draw.Axis ""TcRay21C.o:fake:(.text+0x181b3):"" undefined reference to `FFIX@0' diff --git a/doc/manual/cache/TutPterDataType.wakka b/doc/manual/cache/TutPterDataType.wakka index 44e65001f0..76f1764930 100644 --- a/doc/manual/cache/TutPterDataType.wakka +++ b/doc/manual/cache/TutPterDataType.wakka @@ -1,15 +1,15 @@ {{fbdoc item="title" value="The Pointer Data Type"}}---- //Written by [[WikiRick|rdc]]// -The pointer data type is unique among the FreeBasic numeric data types. Instead of containing data, like the other numeric types, a pointer contains the memory address of data. +The pointer data type is unique among the ""FreeBASIC"" numeric data types. Instead of containing data, like the other numeric types, a pointer contains the memory address of data. -On a 32-bit system, the pointer data type is 4 bytes (8 bytes on a 64-bit system). FreeBasic uses pointers for a number of functions such as [[KeyPgImagecreate|ImageCreate]], and pointers are used heavily in external libraries such as the Windows API. Pointers are also quite fast, since the compiler can directly access the memory location that a pointer points to. A proper understanding of pointers is essential to effective programming in FreeBasic. +On a 32-bit system, the pointer data type is 4 bytes (8 bytes on a 64-bit system). ""FreeBASIC"" uses pointers for a number of functions such as [[KeyPgImagecreate|ImageCreate]], and pointers are used heavily in external libraries such as the Windows API. Pointers are also quite fast, since the compiler can directly access the memory location that a pointer points to. A proper understanding of pointers is essential to effective programming in ""FreeBASIC"". For many beginning programmers, pointers seem like a strange and mysterious beast. However, if you keep one rule in mind, you should not have any problems using pointers in your program. The rule is very simple: a pointer contains an address, not data. If you keep this simple rule in mind, you should have no problems using pointers. === Pointers and Memory === -You can think of the memory in your computer as a set of post office boxes (P.O. Box) at your local post office. When you go in to rent a P.O. Box, the clerk will give you a number, such as 100. This is the address of your P.O. Box. You decide to write the number down an a slip of paper and put it in your wallet. The next day you go to the post office and pull out the slip of paper. You locate box 100 and look inside the box and find a nice stack of junk mail. Of course, you want to toss the junk mail, but there isn't a trash can handy, so you decide to just put the mail back in the box and toss it later. Working with pointers in FreeBasic is very similar to using a P.O. Box. +You can think of the memory in your computer as a set of post office boxes (P.O. Box) at your local post office. When you go in to rent a P.O. Box, the clerk will give you a number, such as 100. This is the address of your P.O. Box. You decide to write the number down an a slip of paper and put it in your wallet. The next day you go to the post office and pull out the slip of paper. You locate box 100 and look inside the box and find a nice stack of junk mail. Of course, you want to toss the junk mail, but there isn't a trash can handy, so you decide to just put the mail back in the box and toss it later. Working with pointers in ""FreeBASIC"" is very similar to using a P.O. Box. When you declare a pointer, it isn't pointing to anything which is analogous to the blank slip of paper. In order to use a pointer, it must be initialized to a memory address, which is the same as writing down the number 100 on the slip of paper. Once you have the address, find the right P.O. Box, you can dereference the pointer, open the mail box, to add or retrieve data from the pointed-to memory location. As you can see there are three basic steps to using pointers. @@ -21,7 +21,7 @@ This isn't really any different than using a standard variable, and you use poin === Typed and Untyped Pointers === -FreeBasic has two types of pointers, typed and untyped. A typed pointer is declared with an asscoaited data type. +""FreeBASIC"" has two types of pointers, typed and untyped. A typed pointer is declared with an asscoaited data type. %%(freebasic) Dim myPointer as Integer Ptr @@ -39,13 +39,13 @@ Untyped pointers have no type checking and default to size of byte. Untyped poin === Pointer Operators === -FreeBasic has the following [[CatPgOpPoint|pointer operators]]. +""FreeBASIC"" has the following [[CatPgOpPoint|pointer operators]]. You will notice that the addressof operator not only returns the memory address of a variable, but it can also return the address of a subroutine or function. You would use the address of a subroutine or function to create a callback function such as used in the CRT QSort function. === Memory Functions === -FreeBasic also has a number of [[CatPgMemory|memory functions]] that are used with pointers. +""FreeBASIC"" also has a number of [[CatPgMemory|memory functions]] that are used with pointers. These functions are useful for creating a number of dynamic structures such as linked lists, ragged or dynamic arrays and buffers used with third party libraries. @@ -63,7 +63,7 @@ All of these functions will return a memory address if successful. If the functi === Pointer Arithmetic and Pointer Indexing === -When you create a memory segment using the allocation functions, you will need a way to access the data contained within the segment. In FreeBasic there are two methods for accessing data in the segment; using the indirection operator with pointer arithmetic, and pointer indexing. +When you create a memory segment using the allocation functions, you will need a way to access the data contained within the segment. In ""FreeBASIC"" there are two methods for accessing data in the segment; using the indirection operator with pointer arithmetic, and pointer indexing. Pointer arithmetic, as the name suggests, adds and subtracts values to a pointer to access individual elements within a memory segment. When you create a typed pointer such as Dim myPointer as Integer ptr, the compiler knows that the data being used with this pointer is of size Integer or 4 bytes. The pointer, when initialized, points to the first element of the segment. You can express this as *(myPtr + 0). To access the second element, you need to add 1 to the pointer, which can be expressed as *(myPtr + 1). @@ -189,7 +189,7 @@ qsort @myArray(0), 10, SizeOf(Integer), @QCompare === Pointer to Pointer === -In FreeBasic you can create a pointer to any of the supported data types, including the pointer data type. A pointer to a pointer is useful in situations where you need to return a pointer to a function or in creating specialized data structures such as linked-lists and ragged arrays. A pointer to a pointer is called multi-level indirection. +In ""FreeBASIC"" you can create a pointer to any of the supported data types, including the pointer data type. A pointer to a pointer is useful in situations where you need to return a pointer to a function or in creating specialized data structures such as linked-lists and ragged arrays. A pointer to a pointer is called multi-level indirection. One application of a pointer to pointer is the creation of a memory segment that behaves just like an array. For example, suppose you want to create a memory segment to hold an unknown number of integers. You can create a dynamic memory segment that you can resize as needed during runtime to handle as many integers as you need. You would start by creating a pointer-to-pointer variable. diff --git a/doc/manual/cache/TutSimPolymorphism.wakka b/doc/manual/cache/TutSimPolymorphism.wakka index ff32b41902..12dcdb44ef 100644 --- a/doc/manual/cache/TutSimPolymorphism.wakka +++ b/doc/manual/cache/TutSimPolymorphism.wakka @@ -3,11 +3,11 @@ === Introduction=== -Polymorphism is a powerful tool in object-oriented program. A polymorphic method (Sub or Function) behaves differently depending on the definition of the object. For example, an animal object may have a speak method that will issue a bark for a dog and a meow for a cat. FreeBasic doesn't support true polymorphism before version 0.90.0. However, you can simulate polymorphic methods using method pointers. +Polymorphism is a powerful tool in object-oriented program. A polymorphic method (Sub or Function) behaves differently depending on the definition of the object. For example, an animal object may have a speak method that will issue a bark for a dog and a meow for a cat. ""FreeBASIC"" doesn't support true polymorphism before version 0.90.0. However, you can simulate polymorphic methods using method pointers. === Polymorphism=== -Polymorphic methods are subroutines or functions that have the same type and parameter list, but behave differently when bound to different objects. An animal object may have a Speak method that will issue a bark for a dog and a meow for a cat. Since FreeBasic doesn't yet have classes, you cannot implement true polymorphic methods, but you can simulate the behavior by using method pointers. +Polymorphic methods are subroutines or functions that have the same type and parameter list, but behave differently when bound to different objects. An animal object may have a Speak method that will issue a bark for a dog and a meow for a cat. Since ""FreeBASIC"" doesn't yet have classes, you cannot implement true polymorphic methods, but you can simulate the behavior by using method pointers. The following listing shows a couple of defines and an extended type declaration: %%(freebasic) @@ -72,7 +72,7 @@ Here is the complete program listing: %%(freebasic) 'Simulated Polymorphism Using Method Pointers 'Richard D. Clark -'Requires the CVS version of FreeBasic +'Requires the CVS version of FreeBASIC '********************************************** #define isdog 1 @@ -125,7 +125,7 @@ End Previous example transposed for fbc version 0.90.0 or greater, by using polymorphism through inheritance with abstract/virtual methods (feature now supported): %%(freebasic) -'Requires FreeBasic version >= 0.90.0 +'Requires FreeBASIC version >= 0.90.0 'Base-type animal Type animal Extends Object diff --git a/doc/manual/cache/TutUsingMouse.wakka b/doc/manual/cache/TutUsingMouse.wakka index 41a2b0cf5c..02b2f5917d 100644 --- a/doc/manual/cache/TutUsingMouse.wakka +++ b/doc/manual/cache/TutUsingMouse.wakka @@ -1,6 +1,6 @@ {{fbdoc item="title" value="Using the Mouse in FreeBASIC"}}---- -After doing some searches, I quickly noticed that there simply wasn't an official tutorial or technique for manipulating the mouse in a windows console application in FreeBasic. Therefore, I decided to write this technique in order to give such an example to the FreeBasic Community. As you know A Windows Console is already mouse aware by ways of the fact that it is a windows console, which means it's created with the use of the Windows API, which means that the mouse can be accessed from the Console Window. So There's no need to turn the mouse on or off in your code. All you need to do is Get or Set the X and Y coordinates and get the states of the mouse buttons. We will be covering the following subjects in this tutorial. +After doing some searches, I quickly noticed that there simply wasn't an official tutorial or technique for manipulating the mouse in a windows console application in ""FreeBASIC"". Therefore, I decided to write this technique in order to give such an example to the ""FreeBASIC"" Community. As you know A Windows Console is already mouse aware by ways of the fact that it is a windows console, which means it's created with the use of the Windows API, which means that the mouse can be accessed from the Console Window. So There's no need to turn the mouse on or off in your code. All you need to do is Get or Set the X and Y coordinates and get the states of the mouse buttons. We will be covering the following subjects in this tutorial. -Getting Mouse Coordinates: The mouse cursor, when the mouse is moved, continuously updates its position. You can get these values to determine where the pointer currently is on the screen. @@ -17,9 +17,9 @@ As with most tutorials, this one too can be better explained with the use of an ==THE SAMPLE PROGRAM DESCRIPTION== -For the sake of a demonstration program, things will be quite simple and as straightforward as it possibly can. The program will show 3 items at the top of the screen and depending on which one you click a different message will be displayed on the screen. This should give you enough information to know how to work with the mouse in FreeBasic. +For the sake of a demonstration program, things will be quite simple and as straightforward as it possibly can. The program will show 3 items at the top of the screen and depending on which one you click a different message will be displayed on the screen. This should give you enough information to know how to work with the mouse in ""FreeBASIC"". -In FreeBasic, there's basically 2 commands that you need to worry about when trying to handle the mouse in your projects. Here they are with their syntax explained as per the documentation. +In ""FreeBASIC"", there's basically 2 commands that you need to worry about when trying to handle the mouse in your projects. Here they are with their syntax explained as per the documentation. -------------------------------------------------------------------------------- {{fbdoc item="title" value="GETMOUSE"}} @@ -161,7 +161,7 @@ You can see the many IF statements in this last piece of code. The numbers that ==IN CONCLUSION== -As you can see, using the mouse has been made very simple in FreeBasic. You can use simple statement like the print command to draw your screens or you can use graphics command like LINE to draw your screens graphically. No matter which way you choose to draw your screens with, the SETMOUSE and GETMOUSE statement will work the same way and return the very same values. All you have to do is get that information and make your programs do what you want them to do if they press a button, select an option, or even in the case of a game, you could easily make the main character move towards the location where you clicked on the screen as well. The choice is up to you. +As you can see, using the mouse has been made very simple in ""FreeBASIC"". You can use simple statement like the print command to draw your screens or you can use graphics command like LINE to draw your screens graphically. No matter which way you choose to draw your screens with, the SETMOUSE and GETMOUSE statement will work the same way and return the very same values. All you have to do is get that information and make your programs do what you want them to do if they press a button, select an option, or even in the case of a game, you could easily make the main character move towards the location where you clicked on the screen as well. The choice is up to you. As always, if you have any questions regarding this tutorial or any other I've written, feel free to email me and we'll see what we can do about solving your particular problem. diff --git a/doc/manual/cache/notthecheatr.wakka b/doc/manual/cache/notthecheatr.wakka index 7935df2a2f..1158f6f7a0 100644 --- a/doc/manual/cache/notthecheatr.wakka +++ b/doc/manual/cache/notthecheatr.wakka @@ -9,5 +9,5 @@ On the forum: I spend a disturbing amount of time there. notthecheatr -TheMysteriousStrangerFromMars@yahoo.com +""TheMysteriousStrangerFromMars@yahoo.com"" notthecheatr@nerdshack.com \ No newline at end of file From 97b8f5f5bf840f62f7591a34bedf3822a0188e28 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Wed, 14 Feb 2018 19:57:29 -0500 Subject: [PATCH 09/15] fbchkdoc: add a common module for command line processing and standardize options --- doc/fbchkdoc/chkdocs.bas | 129 +++++++++++++++++++++++--------------- doc/fbchkdoc/cmd_opts.bas | 124 +++++++++++++++++++++++++++++++----- doc/fbchkdoc/delextra.bas | 16 +++-- doc/fbchkdoc/funcs.bi | 2 + doc/fbchkdoc/getimage.bas | 3 + doc/fbchkdoc/getindex.bas | 11 +--- doc/fbchkdoc/getpage.bas | 15 +---- doc/fbchkdoc/mkimglst.bas | 7 +-- doc/fbchkdoc/mkprntoc.bas | 10 +-- doc/fbchkdoc/putpage.bas | 12 +--- doc/fbchkdoc/rebuild.bas | 7 +-- doc/fbchkdoc/replace.bas | 9 ++- doc/fbchkdoc/spell.bas | 7 +-- 13 files changed, 215 insertions(+), 137 deletions(-) diff --git a/doc/fbchkdoc/chkdocs.bas b/doc/fbchkdoc/chkdocs.bas index d31cfaf162..e739c68a71 100644 --- a/doc/fbchkdoc/chkdocs.bas +++ b/doc/fbchkdoc/chkdocs.bas @@ -76,6 +76,7 @@ end enum '' from cmd_opts.bas extern cache_dir as string extern image_dir as string +extern cmd_opt_verbose as boolean const PageIndex_File = hardcoded.default_index_file const DocPages_File = "DocPages.txt" @@ -365,11 +366,20 @@ dim shared Special_Pages_tbl( 1 to ... ) as zstring ptr = _ ( @"CatPgCompOpt" ) _ } +enum PAGEINFO_HEADER_MSG + PAGEINFO_HEADER_MSG_INVALID + PAGEINFO_HEADER_MSG_NONE + PAGEINFO_HEADER_MSG_NO_TITLE + PAGEINFO_HEADER_MSG_NO_HORZLINE + PAGEINFO_HEADER_MSG_NO_NEWLINE + PAGEINFO_HEADER_MSG_NO_INTRO_TEXT +end enum + type PageInfo_t sName as string flags as integer sTitle as string - msg as integer + header_msg as PAGEINFO_HEADER_MSG End type redim shared sPages() as PageInfo_t @@ -382,6 +392,7 @@ dim shared pagehash_keypg as HASH dim shared pagehash_catpg as HASH dim shared pagehash_devpg as HASH dim shared pagehash_scanned as HASH +dim shared pagehash_ops as HASH ''::::: sub Pages_Clear () @@ -394,6 +405,7 @@ sub Pages_Clear () pagehash_keypg.clear() pagehash_devpg.clear() pagehash_scanned.clear() + pagehash_ops.clear() end sub ''::::: @@ -876,16 +888,17 @@ function is_fbdoc_title( byval token as WikiToken ptr ) as integer '' ((fbdoc item="title" ...}} if( token <> NULL ) then if( token->id = WIKI_TOKEN_ACTION ) then + '' normally expect all pages to start with {{{fbdoc item="title" ... }} if lcase(token->action->name) = "fbdoc" then sItem = token->action->GetParam( "item" ) sValue = token->action->GetParam( "value" ) if( lcase(sItem) = "title" ) then - return 0 + return PAGEINFO_HEADER_MSG_NONE end if end if end if end if - return 1 + return PAGEINFO_HEADER_MSG_NO_TITLE end function ''::::: @@ -893,10 +906,10 @@ function is_horzline( byval token as WikiToken ptr ) as integer '' ---- if( token <> NULL ) then if( token->id = WIKI_TOKEN_HORZLINE ) then - return 0 + return PAGEINFO_HEADER_MSG_NONE end if end if - return 2 + return PAGEINFO_HEADER_MSG_NO_HORZLINE end function ''::::: @@ -904,10 +917,10 @@ function is_newline( byval token as WikiToken ptr ) as integer '' NEWLINE if( token <> NULL ) then if( token->id = WIKI_TOKEN_NEWLINE ) then - return 0 + return PAGEINFO_HEADER_MSG_NONE end if end if - return 3 + return PAGEINFO_HEADER_MSG_NO_NEWLINE end function ''::::: @@ -915,17 +928,17 @@ function is_header_text( byval token as WikiToken ptr ) as integer '' TEXT if( token <> NULL ) then if( ( token->id = WIKI_TOKEN_TEXT ) or ( token->id = WIKI_TOKEN_RAW ) )then - return 0 + return PAGEINFO_HEADER_MSG_NONE end if end if - return 4 + return PAGEINFO_HEADER_MSG_NO_INTRO_TEXT end function ''::::: #macro CHK_TOKEN( f ) if( token <> NULL ) then - if( msg = 0 ) then - if( msg = 0 ) then msg = f( token ) + if( msg = PAGEINFO_HEADER_MSG_NONE ) then + if( msg = PAGEINFO_HEADER_MSG_NONE ) then msg = f( token ) token = tokenlist->GetNext( token ) end if end if @@ -949,10 +962,12 @@ function Links_LoadFromPage_ScanHeader _ tokenlist = wiki->GetTokenList() - msg = 0 + msg = PAGEINFO_HEADER_MSG_NONE token = tokenlist->GetHead() if lcase(left(sName,5)) = "keypg" _ + or lcase(left(sName,5)) = "propg" _ + or lcase(left(sName,6)) = "fbwiki" _ or lcase(left(sName,3)) = "gfx" _ or lcase(left(sName,3)) = "src" then @@ -966,12 +981,7 @@ function Links_LoadFromPage_ScanHeader _ CHK_TOKEN( is_horzline ) CHK_TOKEN( is_newline ) - elseif lcase(left(sName,8)) = "compiler" then - CHK_TOKEN( is_fbdoc_title ) - CHK_TOKEN( is_horzline ) - CHK_TOKEN( is_newline ) - - elseif lcase(left(sName,5)) = "propg" _ + elseif lcase(left(sName,8)) = "compiler" _ or lcase(left(sName,3)) = "dev" _ or lcase(left(sName,3)) = "tbl" then @@ -985,11 +995,11 @@ function Links_LoadFromPage_ScanHeader _ CHK_TOKEN( is_horzline ) CHK_TOKEN( is_newline ) - elseif lcase(left(sName,3)) = "tut" _ or lcase(left(sName,3)) = "cvs" _ or lcase(left(sName,3)) = "svn" _ or lcase(left(sName,3)) = "faq" _ + or lcase(left(sName,3)) = "ext" _ then CHK_TOKEN( is_fbdoc_title ) @@ -997,7 +1007,7 @@ function Links_LoadFromPage_ScanHeader _ CHK_TOKEN( is_newline ) else - msg = -1 + msg = PAGEINFO_HEADER_MSG_INVALID end if @@ -1037,7 +1047,7 @@ sub Links_LoadFromPage _ if sBody > "" then wiki->Parse( sPages(j).sName, sBody ) Links_LoadFromPage_Scan( j, exflags, wiki, sPageTitle ) - sPages(j).msg = Links_LoadFromPage_ScanHeader( sPages(j).sName, wiki ) + sPages(j).header_msg = Links_LoadFromPage_ScanHeader( sPages(j).sName, wiki ) end if delete wiki @@ -1212,9 +1222,11 @@ sub Check_DeletedPages() if( left( ucase( ltrim( sBody, any " " & chr(9))), len( chk ) ) = chk ) then n_delete_pages += 1 Temps_Add( sPages(i).sName ) + logprint "marked for delete '" + sPages(i).sName + "'" elseif( trim( sBody, any chr(9, 10, 13, 32) ) = "" ) then n_empty_pages += 1 Temps_Add( sPages(i).sName ) + logprint "empty page '" + sPages(i).sName + "'" else n_keep_pages += 1 keep_pages( 1, n_keep_pages ) = sPages(i).sName @@ -1225,9 +1237,6 @@ sub Check_DeletedPages() if nTemps = 0 then logprint "No pages marked for delete and no pages empty" else - for i = 1 to nTemps - logprint "marked for delete or empty '" + sTemps(i).text + "'" - next logprint "Found " + str( n_delete_pages ) + " pages marked for delete, removed from scan" logprint "Found " + str( n_empty_pages ) + " empty pages, removed from scan" end if @@ -1395,24 +1404,24 @@ sub Check_Headers() Temps_Clear() - logprint "Checking wikka topic headers:" + logprint "Checking topic headers:" for j = 1 to nPages - select case sPages(j).msg - case 1 + select case sPages(j).header_msg + case PAGEINFO_HEADER_MSG_NO_TITLE logprint "'" + sPages(j).sName + "' has invalid title" c += 1 - case 2 + case PAGEINFO_HEADER_MSG_NO_HORZLINE logprint "'" + sPages(j).sName + "' has invalid horzline" c += 1 - case 3 + case PAGEINFO_HEADER_MSG_NO_NEWLINE logprint "'" + sPages(j).sName + "' has invalid newline" c += 1 - case 4 + case PAGEINFO_HEADER_MSG_NO_INTRO_TEXT logprint "'" + sPages(j).sName + "' has invalid starting text" c += 1 - case -1 + case PAGEINFO_HEADER_MSG_INVALID Temps_Add( sPages(j).sName ) end select @@ -1421,16 +1430,16 @@ sub Check_Headers() logprint "Found " + str(c) + " invalid headers" logprint -/' - logprint "Pages not checked for headers" - if nTemps > 0 then - for i = 1 to nTemps - logprint "'" + sTemps(i).text + "'" - next + if( cmd_opt_verbose ) then + logprint "Pages not checked for valid topic headers" + if nTemps > 0 then + for i = 1 to nTemps + logprint "'" + sTemps(i).text + "'" + next + end if + logprint str(nTemps) + " pages(s) not checked." + logprint end if - logprint str(nTemps) + " pages(s) not checked." - logprint -'/ end sub @@ -1520,8 +1529,18 @@ end sub sub Check_IndexLinks( byref mode as string ) /' - check that the index topics CatPgFullIndex or CatPgFunctIndex - fully include links to all the KepPg pages. + check that the index topics: + + CatPgFullIndex + - has a link to all KeyPg* pages + - do not report pages already linked from CatPgOp* + + CatPgFunctIndex + - has a link to all KeyPg* pages + - do not report pages already linked from CatPgOp* + + CatPgOpIndex + - links to CatPgOp* pages that link to KeyPgOp* pages '/ dim as integer i @@ -1870,6 +1889,8 @@ sub Check_TokenUnescapedCamelCase() select case as const token->id case WIKI_TOKEN_TEXT + '' Search text for CamelCase words + dim text as zstring ptr = strptr( token->text ) if( re->Search( text ) ) then dim as integer ofs = 0 @@ -1891,18 +1912,29 @@ sub Check_TokenUnescapedCamelCase() next + if( nTemps = 0 ) then + logprint "No pages with unescaped CamelCase links to missing pages" + else + logprint "Found " + str(nTemps) + " pages with unescaped CamelCase links to missing pages" + end if + logprint + + delete re delete wiki wiki = NULL - logprint - - logprint "Wiki pages linked by CamelCase wiki link" + logprint "Wiki pages linked only by CamelCase wiki links" for i = 1 to nTemps logprint "'" + sTemps(i).text + "'" next + if( nTemps = 0 ) then + logprint "No wiki pages linked only by CamelCase wiki links" + else + logprint "Found " + str(nTemps) + " wiki pages linked only by CamelCase wiki links" + end if logprint end sub @@ -2057,11 +2089,6 @@ if( cmd_opt_help ) then print "chkdocs [options]" print print "options:" - print " -web check cache dir" - print " -web+ check web cache dir" - print " -dev check cache dir" - print " -dev+ check dev cache dir" - print print " z load links from files instead of scanning pages" print print " a perform all link checks ( m full func ops n b k q c p d f i )" @@ -2089,6 +2116,8 @@ if( cmd_opt_help ) then print print " e check everything! ( a t del o )" print + cmd_opts_show_help( "check" ) + print end 0 end if diff --git a/doc/fbchkdoc/cmd_opts.bas b/doc/fbchkdoc/cmd_opts.bas index 9b0fc6f6d6..c9c908f3b4 100644 --- a/doc/fbchkdoc/cmd_opts.bas +++ b/doc/fbchkdoc/cmd_opts.bas @@ -34,12 +34,13 @@ using fbdoc '' ------------------------------------ '' scan the command line options: we need to save these for later. -'' we might have '-ini file' option on the command line which we +'' we might have '-ini FILE' option on the command line which we '' need to know first, because we are going to 1) read the ini '' file, then 2) override the values with any other options given '' on the command line extern cmd_opt_help as boolean +extern cmd_opt_verbose as boolean dim shared cmd_opt_enable_url as boolean dim shared cmd_opt_enable_cache as boolean @@ -134,7 +135,7 @@ sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) cmd_opt_verbose = false '' -v given on command line cmd_opt_print = false '' -print options given cmd_opt_ini = false '' -ini given on command line - cmd_opt_ini_file = "" '' value of '-ini file' given on command line + cmd_opt_ini_file = "" '' value of '-ini FILE' given on command line '' url & cache options @@ -146,7 +147,7 @@ sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) cmd_opt_cache_dir = "" '' value of '-cache DIR' given on command line cmd_opt_url = false '' -url given on command line - cmd_opt_url_name = "" '' value of '-url name' given on command line + cmd_opt_url_name = "" '' value of '-url URL' given on command line cmd_opt_ca = false '' -certificate given on command line cmd_opt_ca_file = "" '' value of '-certificate FILE' given on command line @@ -221,7 +222,7 @@ function cmd_opts_read( byref i as integer ) as boolean case "-v" cmd_opt_verbose = true - case "-print" + case "-printopts" cmd_opt_print = true case "-web", "-dev", "-web+", "-dev+" @@ -265,31 +266,31 @@ function cmd_opts_read( byref i as integer ) as boolean return false end if - case "-cache" + case "-certificate" - if( cmd_opt_enable_cache ) then + if( cmd_opt_enable_url ) then - if( cmd_opt_cache ) then + if( cmd_opt_ca ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_cache = true + cmd_opt_ca = true i += 1 - cmd_opt_cache_dir = command(i) + cmd_opt_ca_file = command(i) else return false end if - case "-certificate" + case "-cache" - if( cmd_opt_enable_url ) then + if( cmd_opt_enable_cache ) then - if( cmd_opt_ca ) then + if( cmd_opt_cache ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_ca = true + cmd_opt_cache = true i += 1 - cmd_opt_ca_file = command(i) + cmd_opt_cache_dir = command(i) else return false @@ -439,7 +440,7 @@ function cmd_opts_resolve() as boolean dim as string def_image_dir = hardcoded.default_image_dir dim as string def_manual_dir = hardcoded.default_manual_dir - '' -ini file on the command line overrides the hardcoded value + '' -ini FILE on the command line overrides the hardcoded value if( cmd_opt_ini ) then ini_file = cmd_opt_ini_file end if @@ -464,7 +465,7 @@ function cmd_opts_resolve() as boolean def_manual_dir = opts->Get( "manual_dir" ) delete opts elseif( cmd_opt_ini ) then - '' if we explicitly gave the -ini file option, report the error + '' if we explicitly gave the -ini FILE option, report the error cmd_opts_die( "Warning: unable to load options file '" + ini_file + "'" ) end if end scope @@ -583,3 +584,94 @@ function cmd_opts_check() as boolean function = true end function + +'' +sub cmd_opts_show_help_item _ + ( _ + byref opt_name as const string, _ + byref opt_desc as const string _ + ) + + const indent as integer = 3 + const col1 as integer = 20 + + if( (len(opt_name) + indent) > col1 - 2 ) then + print space(indent); opt_name + print space(col1); opt_desc + else + print space(indent); opt_name; space( col1 - len(opt_name) - indent ); opt_desc + end if + +end sub + +'' +sub cmd_opts_show_help( byref action as const string = "", locations as boolean = true ) + + dim a as string = "use" + + if( action <> "" ) then + a = action + end if + + print "general options:" + print " -h, -help show the help information" + print " -ini FILE set ini file name (instead of '" & hardcoded.default_ini_file & "')" + print " -printopts print active options and quit" + print " -v be verbose" + print + + if( cmd_opt_enable_pagelist ) then + print " pages list of wiki pages on the command line" + print " @pagelist text file with a list of pages, one per line" + print + end if + + if( locations ) then + + if( cmd_opt_enable_url and cmd_opt_enable_cache ) then + print " -web " & a & " web server url and cache_dir files" + print " -web+ " & a & " web server url and web_cache_dir files" + print " -dev " & a & " development server url and cache_dir files" + print " -dev+ " & a & " development server url and dev_cache_dir files" + print + elseif( cmd_opt_enable_url ) then + print " -web " & a & " web server url" + print " -web+ " & a & " web server url" + print " -dev " & a & " development server url" + print " -dev+ " & a & " development server url" + print + elseif( cmd_opt_enable_cache ) then + print " -web " & a & " cache_dir files" + print " -web+ " & a & " web_cache_dir files" + print " -dev " & a & " cache_dir files" + print " -dev+ " & a & " dev_cache_dir files" + print + end if + + end if + + if( cmd_opt_enable_url ) then + print " -url URL get pages from URL (overrides other options)" + print " -certificate FILE" + print " certificate to use to authenticate server (.pem)" + end if + + if( cmd_opt_enable_login ) then + print " -u user specifiy wiki account username" + print " -p pass specifiy wiki account password" + end if + + if( cmd_opt_enable_cache ) then + print " -cache DIR override the cache directory location" + end if + + if( cmd_opt_enable_image) then + print " -image_dir DIR override the image directory location" + end if + + if( cmd_opt_enable_manual ) then + print " -manual_dir DIR override the manual directory location" + end if + + +end sub \ No newline at end of file diff --git a/doc/fbchkdoc/delextra.bas b/doc/fbchkdoc/delextra.bas index 17d90d4441..a66bcbe4cf 100644 --- a/doc/fbchkdoc/delextra.bas +++ b/doc/fbchkdoc/delextra.bas @@ -195,16 +195,14 @@ wend if( cmd_opt_help ) then print "delextra [options]" print - print " -n only print what would happen but don't" - print " actually delete any files" - print " -scan scan page for !!! DELETE ME !!!" - print " -html write delete.html helper file" - print " -git use 'git rm' instead of file system delete" + print "options:" + cmd_opts_show_help_item( "-n", "only print what would happen but don't actually delete any files" ) + cmd_opts_show_help_item( "-scan", "scan page for !!! DELETE ME !!!" ) + cmd_opts_show_help_item( "-html", "write 'delete.html' helper file" ) + cmd_opts_show_help_item( "-git", "use 'git rm' instead of file system delete" ) + print + cmd_opts_show_help( "delete extra files in" ) print - print " -web delete extra files in cache_dir" - print " -web+ delete extra files in web cache_dir" - print " -dev delete extra files in cache_dir" - print " -dev+ delete extra files in dev cache_dir" end 0 end if diff --git a/doc/fbchkdoc/funcs.bi b/doc/fbchkdoc/funcs.bi index 8a188b1267..1c05f58a72 100644 --- a/doc/fbchkdoc/funcs.bi +++ b/doc/fbchkdoc/funcs.bi @@ -66,5 +66,7 @@ declare sub cmd_opts_unexpected_die( byval i as const integer ) declare function cmd_opts_read( byref i as integer ) as boolean declare function cmd_opts_resolve() as boolean declare function cmd_opts_check() as boolean +declare sub cmd_opts_show_help( byref action as const string = "", byval locations as boolean = true ) +declare sub cmd_opts_show_help_item( byref opt_name as const string, byref opt_desc as const string ) #endif diff --git a/doc/fbchkdoc/getimage.bas b/doc/fbchkdoc/getimage.bas index 0eba9980e0..e2b625be94 100644 --- a/doc/fbchkdoc/getimage.bas +++ b/doc/fbchkdoc/getimage.bas @@ -164,6 +164,9 @@ if( cmd_opt_help ) then print " following format, one image per line:" print print " PageName,URL" + print + cmd_opts_show_help( "" ) + print end 0 end if diff --git a/doc/fbchkdoc/getindex.bas b/doc/fbchkdoc/getindex.bas index 907abb670c..c86407c22f 100644 --- a/doc/fbchkdoc/getindex.bas +++ b/doc/fbchkdoc/getindex.bas @@ -276,10 +276,6 @@ if( cmd_opt_help ) then print " -web+ get index from the web server url" print " -dev get index from the development server url" print " -dev+ get index from the development server url" - print " -url URL get index from URL (overrides other options)" - print " -certificate FILE" - print " certificate to use to authenticate server (.pem)" - print " -cache DIR override the cache directory location" print print "options:" print " -local use local cache only, don't query server, just" @@ -291,11 +287,8 @@ if( cmd_opt_help ) then print " -dev get page names from cache_dir" print " -dev+ get page names from dev_cache_dir" print - print "general options:" - print " -h, -help show the help information" - print " -ini file set ini file name (instead of" & hardcoded.default_ini_file & ")" - print " -print print active options and quit" - print " -v be verbose" + cmd_opts_show_help( "get index from", false ) + print end 0 end if diff --git a/doc/fbchkdoc/getpage.bas b/doc/fbchkdoc/getpage.bas index 93acd8122f..9edca3251d 100644 --- a/doc/fbchkdoc/getpage.bas +++ b/doc/fbchkdoc/getpage.bas @@ -80,21 +80,8 @@ if( cmd_opt_help ) then print " -web+ get pages from the web server in to web_cache_dir" print " -dev get pages from the development server in to cache_dir" print " -dev+ get pages from the development server in to dev_cache_dir" - print " -url URL get pages from URL (overrides other options)" - print " -certificate FILE" - print " certificate to use to authenticate server (.pem)" - print " -cache DIR override the cache directory location" print - print "options:" - print " pages list of wiki pages on the command line" - print " @pagelist text file with a list of pages, one per line" - print " -auto don't ask for user input, don't retry failed downloads" - print - print "general options:" - print " -h, -help, show the help information" - print " -ini file set ini file name (instead of" & hardcoded.default_ini_file & ")" - print " -print print active options and quit" - print " -v be verbose" + cmd_opts_show_help( "get page from", false ) print end 1 end if diff --git a/doc/fbchkdoc/mkimglst.bas b/doc/fbchkdoc/mkimglst.bas index 31da4881b8..8623253686 100644 --- a/doc/fbchkdoc/mkimglst.bas +++ b/doc/fbchkdoc/mkimglst.bas @@ -117,13 +117,8 @@ wend if( cmd_opt_help ) then print "mkimglst [pages] [@pagelist] [options]" print - print " pages list of wiki pages on the command line" - print " @pagelist text file with a list of pages, one per line" + cmd_opts_show_help( "scan for image files in" ) print - print " -web rebuild files in cache_dir" - print " -web+ rebuild files in web cache_dir" - print " -dev rebuild files in cache_dir" - print " -dev+ rebuild files in dev cache_dir" end 0 end if diff --git a/doc/fbchkdoc/mkprntoc.bas b/doc/fbchkdoc/mkprntoc.bas index 2d86b385ee..29f487f745 100644 --- a/doc/fbchkdoc/mkprntoc.bas +++ b/doc/fbchkdoc/mkprntoc.bas @@ -317,13 +317,13 @@ wend if( cmd_opt_help ) then print "mkprntoc [options]" print - print " -web use files in cache_dir" - print " -web+ use files in web cache_dir" - print " -dev use files in cache_dir" - print " -dev+ use files in dev cache_dir" + print "options:" print " -with-tut-pages include tutorial pages" print " -with-dev-pages include developer pages" - end 0 + print + cmd_opts_show_help() + print + end 0 end if cmd_opts_resolve() diff --git a/doc/fbchkdoc/putpage.bas b/doc/fbchkdoc/putpage.bas index 16b20fe81c..207e1f8847 100644 --- a/doc/fbchkdoc/putpage.bas +++ b/doc/fbchkdoc/putpage.bas @@ -85,24 +85,14 @@ if( cmd_opt_help ) then print " -web+ put pages on the web server from web_cache_dir" print " -dev put pages on the development server from cache_dir" print " -dev+ put pages on the development server from dev_cache_dir" - print " -url URL put pages on URL from cache_dir (overrides other options)" - print " -certificate FILE" - print " certificate to use to authenticate server (.pem)" - print " -cache DIR override the cache directory location" print print "options:" - print " pages list of wiki pages on the command line" - print " @pagelist text file with a list of pages, one per line" print " -comment prompt for comment line when storing pages" print " -comment1 prompt for comment line only once" print " -u user specifiy wiki account username" print " -p pass specifiy wiki account password" print - print "general options:" - print " -h, -help show the help information" - print " -ini file set ini file name (instead of" & hardcoded.default_ini_file & ")" - print " -print print active options and quit" - print " -v be verbose" + cmd_opts_show_help( "put page to", false ) print end 1 end if diff --git a/doc/fbchkdoc/rebuild.bas b/doc/fbchkdoc/rebuild.bas index c137495f27..1cb14509a1 100644 --- a/doc/fbchkdoc/rebuild.bas +++ b/doc/fbchkdoc/rebuild.bas @@ -92,13 +92,8 @@ wend if( cmd_opt_help ) then print "rebuild [pages] [@pagelist] [options]" print - print " pages list of wiki pages on the command line" - print " @pagelist text file with a list of pages, one per line" + cmd_opts_show_help( "rebuild files in" ) print - print " -web rebuild files in cache_dir" - print " -web+ rebuild files in web cache_dir" - print " -dev rebuild files in cache_dir" - print " -dev+ rebuild files in dev cache_dir" end 0 end if diff --git a/doc/fbchkdoc/replace.bas b/doc/fbchkdoc/replace.bas index 3c422021f9..0ffc1f4dcd 100644 --- a/doc/fbchkdoc/replace.bas +++ b/doc/fbchkdoc/replace.bas @@ -149,21 +149,20 @@ wend if( cmd_opt_help ) then print "replace [-f] file.txt [-c comment] [-n] [-r] [-s] [options...]" print + print "options:" print " -f file.txt specifies a file in the following format:" print " page,oldtext,newtext" print print " -c comment specifies the comment" print " -s skip processing" - print " -n don't save the changes." + print " -n don't save the changes" print " -r create html page with clone and delete links" print - print " -web replace files in cache_dir" - print " -web+ replace files in web cache_dir" - print " -dev replace files in cache_dir" - print " -dev+ replace files in dev cache_dir" + cmd_opts_show_help( "replace files in" ) print print " automatically writes 'changed.txt' with a list of changed page names" print " (i.e. can then use 'putpage -web @changed.txt')" + print end 0 end if diff --git a/doc/fbchkdoc/spell.bas b/doc/fbchkdoc/spell.bas index 9818f7fe98..202bb39315 100644 --- a/doc/fbchkdoc/spell.bas +++ b/doc/fbchkdoc/spell.bas @@ -377,13 +377,8 @@ wend if( cmd_opt_help ) then print "spell [pages] [@pagelist] [options]" print - print " pages list of wiki pages on the command line" - print " @pagelist text file with a list of pages, one per line" + cmd_opts_show_help( "spellcheck" ) print - print " -web spellcheck files in cache_dir" - print " -web+ spellcheck files in web cache_dir" - print " -dev spellcheck files in cache_dir" - print " -dev+ spellcheck files in dev cache_dir" end 0 end if From af27dc7462a2a76f0db49c102ac3a8af91cfcb31 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Wed, 14 Feb 2018 20:15:36 -0500 Subject: [PATCH 10/15] fbdoc: wiki snapshot 2018-02-24 --- doc/manual/cache/CompilerFAQ.wakka | 2 +- doc/manual/cache/CompilerInstallingGcc.wakka | 2 +- doc/manual/cache/FBWikiFormatting.wakka | 4 ++++ doc/manual/cache/KeyPgBoolean.wakka | 3 ++- doc/manual/cache/KeyPgDim.wakka | 4 ++-- doc/manual/cache/KeyPgInteger.wakka | 8 ++++---- doc/manual/cache/KeyPgVaFirst.wakka | 2 +- doc/manual/cache/TblVarTypes.wakka | 2 +- doc/manual/cache/TutMathIntroTrig.wakka | 6 +++++- 9 files changed, 21 insertions(+), 12 deletions(-) diff --git a/doc/manual/cache/CompilerFAQ.wakka b/doc/manual/cache/CompilerFAQ.wakka index 0e922a4d3e..766a9547e9 100644 --- a/doc/manual/cache/CompilerFAQ.wakka +++ b/doc/manual/cache/CompilerFAQ.wakka @@ -24,7 +24,7 @@ ==- {{anchor name="item22|Can I have an offline version of the documentation?"}}== ==- {{anchor name="item23|What's the idea behind the FB dialects?"}}== ==- {{anchor name="item24|Why does my program crash when I define an array larger than xx?"}}== - ==- {{anchor name="item25|Why does my program fail to compile with the message 'cannot find -llibname'"?}}== + ==- {{anchor name="item25|Why does my program fail to compile with the message 'cannot find -llibname'?"}}== **Advanced ""FreeBASIC""** diff --git a/doc/manual/cache/CompilerInstallingGcc.wakka b/doc/manual/cache/CompilerInstallingGcc.wakka index ebdb0513be..d0aae94de4 100644 --- a/doc/manual/cache/CompilerInstallingGcc.wakka +++ b/doc/manual/cache/CompilerInstallingGcc.wakka @@ -7,7 +7,7 @@ If you are using the ##""FreeBASIC-x.xx.x-win32""## package, you can use our pre - ##bin\win32\gcc.exe## - ##bin\libexec\gcc\i686-w64-mingw32\x.x.x\cc1.exe## -You can also download ""Win32"" versions of gcc directly from the [[http://www.mingw.org/|""MinGW.org""]] or [[http://sourceforge.net/projects/mingw-w64/|""MinGW-w64""]] projects. +You can also download ""Win32"" versions of gcc directly from the [[http://www.mingw.org/|MinGW.org]] or [[http://sourceforge.net/projects/mingw-w64/|MinGW-w64]] projects. {{fbdoc item="section" value="Windows 64bit"}} diff --git a/doc/manual/cache/FBWikiFormatting.wakka b/doc/manual/cache/FBWikiFormatting.wakka index a9c7e41799..89e1f2a38b 100644 --- a/doc/manual/cache/FBWikiFormatting.wakka +++ b/doc/manual/cache/FBWikiFormatting.wakka @@ -118,6 +118,10 @@ In all of the examples following, the markup line with the formatting codes is f ##""{{table columns="4" cellpadding="2" cells="A;B;A and B;A or B;0;0;0;0;0;1;0;1;1;0;0;1;1;1;1;1"}}""## {{table columns="4" cellpadding="2" cells="A;B;A and B;A or B;0;0;0;0;0;1;0;1;1;0;0;1;1;1;1;1"}} + Some characters have special meaning to HTML and may be escapedin the ##""{{table}}""## action. **Notice that the HTML escapes do not have the semicolon '##;##' suffix shown in this table**. They need the semicolon suffix, however, it is currently impossible to display a semicolon in a table because the semicolon is the cell delimiter. + ##""{{table columns="3" cellpadding="2" cells="Display;Escape;Description;&;&amp;Ampersand;>;&gt;Greater Than;<;&lt;Less Than;";&quot;Double Quote;A;&#065;Character value [0-255]"}}""## + {{table columns="3" cellpadding="2" cells="Display;Escape;Description;&;&amp;Ampersand;>;&gt;Greater Than;<;&lt;Less Than;";&quot;Double Quote;A;&#065;Character value [0-255]"}} + {{fbdoc item="section" value="Left and Right Columns of Text"}} To create a left and right columns of text, use two ##<## characters before and after the left block, and use two ##>## characters before and after the right block. diff --git a/doc/manual/cache/KeyPgBoolean.wakka b/doc/manual/cache/KeyPgBoolean.wakka index 327e5a9da7..e5ff879424 100644 --- a/doc/manual/cache/KeyPgBoolean.wakka +++ b/doc/manual/cache/KeyPgBoolean.wakka @@ -5,7 +5,8 @@ Standard data type [[KeyPgDim|dim]] //variable// [[KeyPgAs|as]] **Boolean** ## {{fbdoc item="desc"}} - Boolean data type. Can hold the values ##[[KeyPgTrue|True]]## or ##[[KeyPgFalse|False]]##. + Boolean data type. Can hold the values ##[[KeyPgTrue|True]]## or ##[[KeyPgFalse|False]]## + Default value on initialization is ##[[KeyPgFalse|False]]## **Notes on definition of boolean data type:** //Ideally, the definition of the boolean data type is that it holds the value of ##[[KeyPgTrue|True]]## or ##[[KeyPgFalse|False]]##, and that's it. However, to make this concept a reality, we need a definition that uses real world connections. A more realistic definition is that the boolean data type is a 1-bit integer, having the value 0 to indicate ##[[KeyPgFalse|False]]## and 1 to indicate ##[[KeyPgTrue|True]]##. diff --git a/doc/manual/cache/KeyPgDim.wakka b/doc/manual/cache/KeyPgDim.wakka index 3622ddb260..00aa033afc 100644 --- a/doc/manual/cache/KeyPgDim.wakka +++ b/doc/manual/cache/KeyPgDim.wakka @@ -102,12 +102,12 @@ Dim array(1 To 2, 6, 3 To 5) As Single {{fbdoc item="section" value="Initializers"}} Arrays, variables, strings, and user defined types (UDTs) are initialized to zero (or ##[[KeyPgFalse|False]]## for ##[[KeyPgBoolean|Boolean]]##) or null strings by default when they are created. - + To avoid the overhead of default variable initialization, the ##**Any**## initializer can be used with ##**Dim**## to tell the compiler to only reserve the place for the variable in memory but not initialize it, so the variable will contain garbage. In this case the programmer should not make assumptions about the initial values. Fixed-length arrays, variables, zstrings and UDTs may be given a value at the time of their declaration by following the variable declaration with an initializer. Note the difference between initializing different types. Arrays, variables and UDTs are initialized as they would in a normal assignment, using an equal ( ##=## ) sign. The ##=>## sign can be used, allowing to avoid the declaration resembling an expression when declaring fixed length strings. - Array values are given in comma-delimited values enclosed by curly brackets, and UDT values are given in comma delimited values enclosed by parenthesis. These methods of initializing variables can be nested within one another for complex assignments. Nesting allows for arrays of any dimension to be initialized. + Array values are given in comma-delimited values enclosed by curly brackets, and UDT values are given in comma delimited values enclosed by parenthesis. These methods of initializing variables can be nested within one another for complex assignments. Nesting allows for arrays of any dimension to be initialized. {{fbdoc item="filename" value="examples/manual/check/KeyPgDim_5.bas"}}%%(freebasic) '' Declare an array of 2 by 5 elements diff --git a/doc/manual/cache/KeyPgInteger.wakka b/doc/manual/cache/KeyPgInteger.wakka index 21a129b9ca..bb0c89f69c 100644 --- a/doc/manual/cache/KeyPgInteger.wakka +++ b/doc/manual/cache/KeyPgInteger.wakka @@ -10,11 +10,11 @@ Standard data type: 32-bit or 64-bit signed, same size as ##[[KeyPgSizeof|SizeOf A numeric constant expression indicating the size in bits of integer desired. The values allowed are ##8##, ##16##, ##32## or ##64##. {{fbdoc item="desc"}} - 32-bit or 64-bit signed whole-number data type, depending on the platform. - **Integer** is the main data type ""FreeBASIC"" uses for integer math and bitwise operations. It is the default type for number literals. - If an explicit bit size is given, a data type is provided that can hold values from ##-1LL [[KeyPgOpShiftLeft|Shl]] (//bits//-1)## up to ##(1LL [[KeyPgOpShiftLeft|Shl]] (//bits//-1)) - 1##. The selected data type is ##[[KeyPgByte|Byte]]## for **Integer<8>**, ##[[KeyPgShort|Short]]## for **Integer<16>**, ##[[KeyPgLong|Long]]## for **Integer<32>** and ##[[KeyPgLongint|LongInt]]## for **Integer<64>**. + In the first form Integer is a 32-bit or 64-bit signed whole-number data type, depending on the target platform. + + If an explicit bit size is given (the second form), a data type is provided that can hold values from ##-1LL [[KeyPgOpShiftLeft|Shl]] (//bits//-1)## up to ##(1LL [[KeyPgOpShiftLeft|Shl]] (//bits//-1)) - 1##. The selected data type is ##[[KeyPgByte|Byte]]## for **Integer<8>**, ##[[KeyPgShort|Short]]## for **Integer<16>**, ##[[KeyPgLong|Long]]## for **Integer<32>** and ##[[KeyPgLongint|LongInt]]## for **Integer<64>**. {{fbdoc item="ex"}} {{fbdoc item="filename" value="examples/manual/datatype/integer.bas"}}%%(freebasic) @@ -30,7 +30,7 @@ Standard data type: 32-bit or 64-bit signed, same size as ##[[KeyPgSizeof|SizeOf %% {{fbdoc item="lang"}} - - In the //[[CompilerOptlang|-lang fb]]// and //[[CompilerOptlang|-lang fblite]]// dialects, the ##**Integer**## data type is 32-bit. + - In the //[[CompilerOptlang|-lang fb]]// and //[[CompilerOptlang|-lang fblite]]// dialects, the ##**Integer**## data type is 32-bit or 64-bit depending on target platform - In the //[[CompilerOptlang|-lang qb]]// dialect, the ##**Integer**## data type is 16-bit, regardless of platform. {{fbdoc item="diff"}} diff --git a/doc/manual/cache/KeyPgVaFirst.wakka b/doc/manual/cache/KeyPgVaFirst.wakka index 027121c4b7..331e92b579 100644 --- a/doc/manual/cache/KeyPgVaFirst.wakka +++ b/doc/manual/cache/KeyPgVaFirst.wakka @@ -37,7 +37,7 @@ The output would look like: 259.927405 %% -{{fbdoc item="filename" value="examples/manual/procs/vararg2.bas}}%%(freebasic) +{{fbdoc item="filename" value="examples/manual/procs/vararg2.bas"}}%%(freebasic) '' Example of a simple custom printf sub myprintf cdecl(byref formatstring as string, ...) '' Get the pointer to the first var-arg diff --git a/doc/manual/cache/TblVarTypes.wakka b/doc/manual/cache/TblVarTypes.wakka index 1785cba4e3..2012a2854d 100644 --- a/doc/manual/cache/TblVarTypes.wakka +++ b/doc/manual/cache/TblVarTypes.wakka @@ -10,7 +10,7 @@ Standard variable types and limits. {{fbdoc item="section" value="String Types"}} -~~{{table columns="5" cellpadding="2" cells="Type ; Character Size (in bytes) ; Minimum Size (in characters) ; Maximum Size (in characters) ; Literal Suffix ; String ; 1 ; 0 ; [**]32bit: +2147483647, 64bit: +9223372036854775807 ; $ ; Zstring ; 1 ; 0 ; [**]32bit: +2147483647, 64bit: +9223372036854775807 ; [N/A] ; Wstring ; [*] ; [*]0 ; [*,**]32bit: +2147483647, 64bit: +9223372036854775807 ; [N/A]""}} +~~{{table columns="5" cellpadding="2" cells="Type ; Character Size (in bytes) ; Minimum Size (in characters) ; Maximum Size (in characters) ; Literal Suffix ; String ; 1 ; 0 ; [**]32bit: +2147483647, 64bit: +9223372036854775807 ; $ ; Zstring ; 1 ; 0 ; [**]32bit: +2147483647, 64bit: +9223372036854775807 ; [N/A] ; Wstring ; [*] ; [*]0 ; [*,**]32bit: +2147483647, 64bit: +9223372036854775807 ; [N/A]"}} ~&[*] //Unicode, or "wide", characters vary in both size and availability with platform.// ~&[""**""] //All runtime library string procedures take and produce ##[[KeyPgInteger|Integer]]## values for sizes and positions. The actual maximum size will vary (smaller) with storage location and/or platform.// diff --git a/doc/manual/cache/TutMathIntroTrig.wakka b/doc/manual/cache/TutMathIntroTrig.wakka index 5fd4ad31ff..39ba9e6e2a 100644 --- a/doc/manual/cache/TutMathIntroTrig.wakka +++ b/doc/manual/cache/TutMathIntroTrig.wakka @@ -126,6 +126,10 @@ This gives an angle of about 0.6435 radians, or around 36.9 degrees. The FreeBAS - {{fbdoc item="keyword" value="KeyPgAsin|ASIN"}} (arcsine) - {{fbdoc item="keyword" value="KeyPgCos|ACOS"}} (arccosine) - {{fbdoc item="keyword" value="KeyPgAtn|ATN"}} (arctan, there is also {{fbdoc item="keyword" value="KeyPgAtan2|ATAN2"}} which takes the opposite and adjacent sides of the triangle, not their ratio) +//Editors note: +ATN returns the arctangent of the argument number as a Double within the range of -Pi/2 to Pi/2. +ATAN2 returns the arctangent of the ratio y/x as a Double within the range of -Pi to Pi +// **Other Trigonometric functions** @@ -156,4 +160,4 @@ This means the same as {{fbdoc item="keyword" value="KeyPgSin|SIN"}}(y)*{{fbdoc There are several more useful identities out there. Search for trigonometric identities or consult any higher mathematical reference. -//Last reviewed by ""sancho3"" on February 08, 2018// \ No newline at end of file +//Last reviewed by ""sancho3"" on February 15, 2018 Note: Added clarification of ATN and ATAN2 funcitons as requested// \ No newline at end of file From 0272b85f326c422480893ff019da6c893df49249 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 24 Feb 2018 20:10:40 -0500 Subject: [PATCH 11/15] fbchkdoc: check for unescaped HTML in normal text --- doc/fbchkdoc/chkdocs.bas | 126 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 4 deletions(-) diff --git a/doc/fbchkdoc/chkdocs.bas b/doc/fbchkdoc/chkdocs.bas index e739c68a71..3a29f150cf 100644 --- a/doc/fbchkdoc/chkdocs.bas +++ b/doc/fbchkdoc/chkdocs.bas @@ -1939,6 +1939,113 @@ sub Check_TokenUnescapedCamelCase() end sub +''::::: +function TestForUnescapedHtml _ + ( _ + byref text as const string _ + ) as boolean + + '' Search text for unescaped html + '' & > < " � + + dim as string HtmlCodes(0 to ...) = { "amp", "quot", "lt", "gt" } + dim i as integer = 1 + + do + i = instr(i, text, "&") + if i = 0 then + return false + end if + + if( asc( text , i + 1 ) = asc( "#" ) ) then + dim as integer j = i + 2 + dim as integer c = 0 + do + select case asc( text, j ) + case asc("0") to asc("9") + if( c <= 255 ) then c = c * 10 + asc( text, j ) - asc("0") + case else + exit do + end select + j += 1 + loop + if c > 0 then + return true + end if + else + for q as integer = 0 to ubound(HtmlCodes) step 2 + if( mid( text, i + 1, len( HtmlCodes(q) )) = HtmlCodes(q) ) then + dim as integer j = i + len( HtmlCodes(q) ) + 1 + if( mid( text, j, 1) = ";" ) then + return true + end if + i += len( HtmlCodes(q+1) ) - 1 + exit for + end if + next + end if + + i += 1 + loop + + return false + +end function + +''::::: +sub Check_TokenHtml() + + dim i as integer + dim f as string + dim sBody as string + dim text as string + dim wiki as CWiki Ptr + dim token as WikiToken ptr + + logprint "Checking pages for unescaped HTML:" + + Temps_Clear() + + wiki = new CWiki + + for i = 1 to nPages + + '' if( ( sPages(i).flags and FLAG_PAGE_DOCPAGE ) <> 0 ) then + + f = cache_dir + sPages(i).sName + ".wakka" + sBody = LoadFileAsString( f ) + wiki->Parse( sPages(i).sName, sBody ) + + token = wiki->GetTokenList()->GetHead() + do while( token <> NULL ) + + select case as const token->id + case WIKI_TOKEN_TEXT, WIKI_TOKEN_RAW + + if( TestForUnescapedHtml( token->text ) ) then + Temps_Add( sPages(i).sName ) + logprint "'" & sPages(i).sName & "'" + exit do + end if + end select + + token = wiki->GetTokenList()->GetNext( token ) + loop + + '' end if + + next + + if( nTemps = 0 ) then + logprint "No pages with unescaped HTML" + else + logprint "Found " + str(nTemps) + " pages with some unescaped HTML" + end if + logprint + + +end sub + ''::::: sub Report_TokenCounts() @@ -1978,9 +2085,10 @@ enum OPTIONS OPT_OPS_INDEX = 1 shl 15 OPT_TOKEN_COUNTS = 1 shl 16 OPT_TOKEN_CAMEL_CASE = 1 shl 17 - OPT_DELETED_PAGES = 1 shl 18 - OPT_ORPHAN_PAGES = 1 shl 19 - OPT_FILENAMES = 1 shl 20 + OPT_TOKEN_HTML = 1 shl 18 + OPT_DELETED_PAGES = 1 shl 19 + OPT_ORPHAN_PAGES = 1 shl 20 + OPT_FILENAMES = 1 shl 21 OPT_ALL_LINKS = _ OPT_MISSING_PAGES _ @@ -1999,7 +2107,8 @@ enum OPTIONS OPT_ALL_TOKEN = _ OPT_HEADERS _ or OPT_DUP_SAMPLE_FILE _ - or OPT_TOKEN_CAMEL_CASE + or OPT_TOKEN_CAMEL_CASE _ + or OPT_TOKEN_HTML OPT_ALL = _ OPT_ALL_LINKS _ @@ -2077,6 +2186,8 @@ while( command(i) > "" ) opt or= OPT_TOKEN_COUNTS case "cc" opt or= OPT_TOKEN_CAMEL_CASE + case "html" + opt or= OPT_TOKEN_HTML case else print "option '"; command(i); "' ignored" @@ -2110,6 +2221,7 @@ if( cmd_opt_help ) then print " n check name case in links" print " tc report token counts" print " cc report unescaped camel case word" + print " html report unescaped html in normal text" print print " del check deleted pages" print " o check orphaned pages" @@ -2269,6 +2381,12 @@ if( (opt and OPT_TOKEN_CAMEL_CASE) <> 0 ) then Timer_Mark("Check_TokenUnescapedCamelCase()") end if +if( (opt and OPT_TOKEN_HTML) <> 0 ) then + '' find html escapes in text + Check_TokenHtml() + Timer_Mark("Check_TokenHtml()") +end if + logprint logprint "Execution time: " + str(cint(timer - timers(1).value)) + " seconds." From 11693ac2d74fc5ec9de2bbeda776aaa4f482a07a Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sun, 25 Feb 2018 13:52:47 -0500 Subject: [PATCH 12/15] fbchkdoc: move extern declarations for global options to cmd_opts.bi header to prevent mismatches in signatures --- doc/fbchkdoc/chkdocs.bas | 9 +----- doc/fbchkdoc/cmd_opts.bas | 16 +--------- doc/fbchkdoc/cmd_opts.bi | 62 +++++++++++++++++++++++++++++++++++++++ doc/fbchkdoc/delextra.bas | 6 +--- doc/fbchkdoc/funcs.bi | 25 ---------------- doc/fbchkdoc/getimage.bas | 5 +--- doc/fbchkdoc/getindex.bas | 7 +---- doc/fbchkdoc/getpage.bas | 10 +------ doc/fbchkdoc/mkimglst.bas | 8 +---- doc/fbchkdoc/mkprntoc.bas | 5 +--- doc/fbchkdoc/putpage.bas | 12 +------- doc/fbchkdoc/rebuild.bas | 8 +---- doc/fbchkdoc/replace.bas | 6 +--- doc/fbchkdoc/spell.bas | 9 +----- 14 files changed, 74 insertions(+), 114 deletions(-) create mode 100644 doc/fbchkdoc/cmd_opts.bi diff --git a/doc/fbchkdoc/chkdocs.bas b/doc/fbchkdoc/chkdocs.bas index 3a29f150cf..9e38d138cf 100644 --- a/doc/fbchkdoc/chkdocs.bas +++ b/doc/fbchkdoc/chkdocs.bas @@ -36,6 +36,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' libs #inclib "pcre" @@ -73,11 +74,6 @@ enum LINK_FLAGS end enum -'' from cmd_opts.bas -extern cache_dir as string -extern image_dir as string -extern cmd_opt_verbose as boolean - const PageIndex_File = hardcoded.default_index_file const DocPages_File = "DocPages.txt" const LinkList_File = "linklist.csv" @@ -2119,9 +2115,6 @@ enum OPTIONS end enum -'' froms cmd_opts.bas -extern cmd_opt_help as boolean - '' private options dim opt as OPTIONS = OPT_NONE diff --git a/doc/fbchkdoc/cmd_opts.bas b/doc/fbchkdoc/cmd_opts.bas index c9c908f3b4..ad65a50a65 100644 --- a/doc/fbchkdoc/cmd_opts.bas +++ b/doc/fbchkdoc/cmd_opts.bas @@ -28,6 +28,7 @@ using fbdoc #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' ------------------------------------ '' command line options @@ -39,9 +40,6 @@ using fbdoc '' file, then 2) override the values with any other options given '' on the command line -extern cmd_opt_help as boolean -extern cmd_opt_verbose as boolean - dim shared cmd_opt_enable_url as boolean dim shared cmd_opt_enable_cache as boolean dim shared cmd_opt_enable_login as boolean @@ -89,18 +87,6 @@ dim shared cmd_opt_manual_dir as string '' resolved options '' ------------------------------------ -extern wiki_url as string -extern cache_dir as string -extern ca_file as string -extern wiki_username as string -extern wiki_password as string -extern image_dir as string -extern manual_dir as string - -extern webPageCount as integer -extern webPageList() as string -extern webPageComments() as string - dim shared wiki_url as string dim shared cache_dir as string dim shared ca_file as string diff --git a/doc/fbchkdoc/cmd_opts.bi b/doc/fbchkdoc/cmd_opts.bi new file mode 100644 index 0000000000..3384074e54 --- /dev/null +++ b/doc/fbchkdoc/cmd_opts.bi @@ -0,0 +1,62 @@ +#ifndef __FBCHKDOC_CMD_OPTS_BI__ +#define __FBCHKDOC_CMD_OPTS_BI__ + +'' fbchkdoc - FreeBASIC Wiki Management Tools +'' Copyright (C) 2018 Jeffery R. Marshall (coder[at]execulink[dot]com) +'' +'' This program is free software; you can redistribute it and/or modify +'' it under the terms of the GNU General Public License as published by +'' the Free Software Foundation; either version 2 of the License, or +'' (at your option) any later version. +'' +'' This program is distributed in the hope that it will be useful, +'' but WITHOUT ANY WARRANTY; without even the implied warranty of +'' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'' GNU General Public License for more details. +'' +'' You should have received a copy of the GNU General Public License +'' along with this program; if not, write to the Free Software +'' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA. + +'' cmd_opts.bas +enum CMD_OPTS_ENABLE_FLAGS + CMD_OPTS_ENABLE_NONE = 0 + CMD_OPTS_ENABLE_URL = 1 + CMD_OPTS_ENABLE_CACHE = 2 + CMD_OPTS_ENABLE_LOGIN = 4 + CMD_OPTS_ENABLE_IMAGE = 8 + CMD_OPTS_ENABLE_PAGELIST = 16 + CMD_OPTS_ENABLE_MANUAL = 32 + + CMD_OPTS_ENABLE_AUTOCACHE = &h1000 + +end enum + +declare sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) +declare sub cmd_opts_die( byref msg as const string ) +declare sub cmd_opts_unrecognized_die( byval i as const integer ) +declare sub cmd_opts_unexpected_die( byval i as const integer ) +declare function cmd_opts_read( byref i as integer ) as boolean +declare function cmd_opts_resolve() as boolean +declare function cmd_opts_check() as boolean +declare sub cmd_opts_show_help( byref action as const string = "", byval locations as boolean = true ) +declare sub cmd_opts_show_help_item( byref opt_name as const string, byref opt_desc as const string ) + +'' command line options +extern cmd_opt_help as boolean +extern cmd_opt_verbose as boolean + +''resolved options +extern wiki_url as string +extern cache_dir as string +extern ca_file as string +extern wiki_username as string +extern wiki_password as string +extern image_dir as string +extern manual_dir as string + +extern webPageCount as integer +extern webPageList(any) as string +extern webPageComments(any) as string + +#endif diff --git a/doc/fbchkdoc/delextra.bas b/doc/fbchkdoc/delextra.bas index a66bcbe4cf..eb29b6fa74 100644 --- a/doc/fbchkdoc/delextra.bas +++ b/doc/fbchkdoc/delextra.bas @@ -28,6 +28,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" using fb using fbdoc @@ -155,11 +156,6 @@ end sub '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern cache_dir as string -extern wiki_url as string - '' private options dim isgit as boolean = false dim nodelete as boolean = false diff --git a/doc/fbchkdoc/funcs.bi b/doc/fbchkdoc/funcs.bi index 1c05f58a72..535fadadef 100644 --- a/doc/fbchkdoc/funcs.bi +++ b/doc/fbchkdoc/funcs.bi @@ -44,29 +44,4 @@ declare function ScanSourceDirsAndFiles( byref path as string, dirs() as string, declare function FormatFbCode( byref txt as string ) as string declare function FormatFbCodeLoadKeywords( byref filename as string ) as boolean - -'' cmd_opts.bas -enum CMD_OPTS_ENABLE_FLAGS - CMD_OPTS_ENABLE_NONE = 0 - CMD_OPTS_ENABLE_URL = 1 - CMD_OPTS_ENABLE_CACHE = 2 - CMD_OPTS_ENABLE_LOGIN = 4 - CMD_OPTS_ENABLE_IMAGE = 8 - CMD_OPTS_ENABLE_PAGELIST = 16 - CMD_OPTS_ENABLE_MANUAL = 32 - - CMD_OPTS_ENABLE_AUTOCACHE = &h1000 - -end enum - -declare sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) -declare sub cmd_opts_die( byref msg as const string ) -declare sub cmd_opts_unrecognized_die( byval i as const integer ) -declare sub cmd_opts_unexpected_die( byval i as const integer ) -declare function cmd_opts_read( byref i as integer ) as boolean -declare function cmd_opts_resolve() as boolean -declare function cmd_opts_check() as boolean -declare sub cmd_opts_show_help( byref action as const string = "", byval locations as boolean = true ) -declare sub cmd_opts_show_help_item( byref opt_name as const string, byref opt_desc as const string ) - #endif diff --git a/doc/fbchkdoc/getimage.bas b/doc/fbchkdoc/getimage.bas index e2b625be94..29049bb77b 100644 --- a/doc/fbchkdoc/getimage.bas +++ b/doc/fbchkdoc/getimage.bas @@ -28,6 +28,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' const MAX_IMAGEFILES = 100 @@ -135,10 +136,6 @@ end function '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern image_dir as string - '' private options dim f as string diff --git a/doc/fbchkdoc/getindex.bas b/doc/fbchkdoc/getindex.bas index c86407c22f..f29f642c29 100644 --- a/doc/fbchkdoc/getindex.bas +++ b/doc/fbchkdoc/getindex.bas @@ -26,6 +26,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' libs #inclib "pcre" @@ -239,12 +240,6 @@ end sub '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern wiki_url as string -extern cache_dir as string -extern ca_file as string - '' private options dim as boolean blocal = false '' -local given on command line diff --git a/doc/fbchkdoc/getpage.bas b/doc/fbchkdoc/getpage.bas index 9edca3251d..97fd3a20c6 100644 --- a/doc/fbchkdoc/getpage.bas +++ b/doc/fbchkdoc/getpage.bas @@ -28,6 +28,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' libs #inclib "pcre" @@ -40,15 +41,6 @@ using fbdoc '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern wiki_url as string -extern cache_dir as string -extern ca_file as string -extern webPageCount as integer -extern webPageList() as string -extern webCommentList() as string - '' private options dim allow_retry as boolean = true diff --git a/doc/fbchkdoc/mkimglst.bas b/doc/fbchkdoc/mkimglst.bas index 8623253686..f14fb644a2 100644 --- a/doc/fbchkdoc/mkimglst.bas +++ b/doc/fbchkdoc/mkimglst.bas @@ -31,6 +31,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' libs #inclib "pcre" @@ -92,13 +93,6 @@ end function '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern cache_dir as string -extern webPageCount as integer -extern webPageList() as string -extern webCommentList() as string - '' enable url and cache cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE or CMD_OPTS_ENABLE_PAGELIST ) diff --git a/doc/fbchkdoc/mkprntoc.bas b/doc/fbchkdoc/mkprntoc.bas index 29f487f745..4ca5fd8eca 100644 --- a/doc/fbchkdoc/mkprntoc.bas +++ b/doc/fbchkdoc/mkprntoc.bas @@ -30,6 +30,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' libs #inclib "pcre" @@ -289,10 +290,6 @@ end sub '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern cache_dir as string - cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE ) dim i as integer = 1 diff --git a/doc/fbchkdoc/putpage.bas b/doc/fbchkdoc/putpage.bas index 207e1f8847..89e8e5059f 100644 --- a/doc/fbchkdoc/putpage.bas +++ b/doc/fbchkdoc/putpage.bas @@ -28,6 +28,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' libs #inclib "pcre" @@ -41,17 +42,6 @@ using fbdoc '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern wiki_url as string -extern cache_dir as string -extern ca_file as string -extern wiki_username as string -extern wiki_password as string -extern webPageCount as integer -extern webPageList() as string -extern webPageComments() as string - '' private options dim as integer iComment = 0 diff --git a/doc/fbchkdoc/rebuild.bas b/doc/fbchkdoc/rebuild.bas index 1cb14509a1..96c94f22ec 100644 --- a/doc/fbchkdoc/rebuild.bas +++ b/doc/fbchkdoc/rebuild.bas @@ -26,6 +26,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" '' libs #inclib "fbdoc" @@ -67,13 +68,6 @@ end sub '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern cache_dir as string -extern webPageCount as integer -extern webPageList() as string -extern webCommentList() as string - '' enable url and cache cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE or CMD_OPTS_ENABLE_PAGELIST ) diff --git a/doc/fbchkdoc/replace.bas b/doc/fbchkdoc/replace.bas index 0ffc1f4dcd..aa14e77c4d 100644 --- a/doc/fbchkdoc/replace.bas +++ b/doc/fbchkdoc/replace.bas @@ -29,6 +29,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" using fb using fbdoc @@ -99,11 +100,6 @@ end sub '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern wiki_url as string -extern cache_dir as string - '' private options dim f as string dim sComment as string diff --git a/doc/fbchkdoc/spell.bas b/doc/fbchkdoc/spell.bas index 202bb39315..d8b7a3cb84 100644 --- a/doc/fbchkdoc/spell.bas +++ b/doc/fbchkdoc/spell.bas @@ -32,6 +32,7 @@ '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" +#include once "cmd_opts.bi" #include once "spellcheck.bi" '' libs @@ -351,14 +352,6 @@ end function '' MAIN '' -------------------------------------------------------- -'' from cmd_opts.bas -extern cmd_opt_help as boolean -extern cache_dir as string -extern manual_dir as string -extern webPageCount as integer -extern webPageList() as string -extern webCommentList() as string - '' enable url and cache cmd_opts_init( CMD_OPTS_ENABLE_CACHE or CMD_OPTS_ENABLE_AUTOCACHE or CMD_OPTS_ENABLE_MANUAL ) From 42e7a3df3f1a2fc57ed36edc457c57b899ddeabf Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sun, 25 Feb 2018 16:14:47 -0500 Subject: [PATCH 13/15] fbchkdoc: wrap the private options in cmd_opts.bas in a type --- doc/fbchkdoc/cmd_opts.bas | 294 ++++++++++++++++++++------------------ 1 file changed, 152 insertions(+), 142 deletions(-) diff --git a/doc/fbchkdoc/cmd_opts.bas b/doc/fbchkdoc/cmd_opts.bas index ad65a50a65..663cbb972d 100644 --- a/doc/fbchkdoc/cmd_opts.bas +++ b/doc/fbchkdoc/cmd_opts.bas @@ -40,48 +40,8 @@ using fbdoc '' file, then 2) override the values with any other options given '' on the command line -dim shared cmd_opt_enable_url as boolean -dim shared cmd_opt_enable_cache as boolean -dim shared cmd_opt_enable_login as boolean -dim shared cmd_opt_enable_image as boolean -dim shared cmd_opt_enable_autocache as boolean -dim shared cmd_opt_enable_pagelist as boolean -dim shared cmd_opt_enable_manual as boolean - dim shared cmd_opt_help as boolean dim shared cmd_opt_verbose as boolean -dim shared cmd_opt_print as boolean - -dim shared cmd_opt_web as boolean -dim shared cmd_opt_dev as boolean -dim shared cmd_opt_alt as boolean - -dim shared cmd_opt_cache as boolean -dim shared cmd_opt_cache_dir as string - -dim shared cmd_opt_url as boolean -dim shared cmd_opt_url_name as string - -dim shared cmd_opt_ini as boolean -dim shared cmd_opt_ini_file as string - -dim shared cmd_opt_ca as boolean -dim shared cmd_opt_ca_file as string - -dim shared cmd_opt_user as boolean -dim shared cmd_opt_username as string - -dim shared cmd_opt_pass as boolean -dim shared cmd_opt_password as string - -dim shared cmd_opt_image as boolean -dim shared cmd_opt_image_dir as string - -dim shared cmd_opt_page as boolean -dim shared cmd_opt_pagefile as string - -dim shared cmd_opt_manual as boolean -dim shared cmd_opt_manual_dir as string '' ------------------------------------ '' resolved options @@ -99,6 +59,56 @@ dim shared webPageCount as integer dim shared webPageList() as string dim shared webPageComments() as string +'' ------------------------------------ +'' private options +'' ------------------------------------ + +type CMD_OPTS_PRIVATE + + enable_url as boolean '' enable use of url to connect to or choose location of a wiki + enable_cache as boolean '' enable use of a cache (local file location) + enable_login as boolean '' enable user and password options + enable_image as boolean '' enable the image dir option + enable_autocache as boolean '' automatically select a cache if none given on the command line + enable_pagelist as boolean '' enable reading in a text file with a list of page names + enable_manual as boolean '' enable the manual dir option + + print as boolean '' -printopts option on command line + + web as boolean '' -web or -web+ given on command line + dev as boolean '' -dev or -dev+ given on command line + alt as boolean '' -web+ or -dev+ given on command line + + cache as boolean '' -cache DIR option on command line + cache_dir as string '' value of '-cache DIR' given on command line + + url as boolean '' -url given on command line + url_name as string '' value of '-url URL' given on command line + + ini as boolean '' -ini FILE option on command line + ini_file as string '' value of '-ini FILE' given on command line + + ca as boolean '' -certificate given on command line + ca_file as string '' value of '-certificate FILE' given on command line + + user as boolean '' -u given on command line + username as string '' value of -u NAME given on command line + + pass as boolean '' -p given on command line + password as string '' value of -p WORD given on command line + + image as boolean '' -image_dir given on command line + image_dir as string '' value of '-image_dir DIR' given on command line + + page as boolean '' @FILE option given on command line + pagefile as string '' value of filename for '@FILE' given on command line + + manual as boolean '' -manual_dir given on command line + manual_dir as string '' value of '-manual_dir DIR' given on command line + +end type + +dim shared cmd_opt as CMD_OPTS_PRIVATE '' ------------------------------------ '' API @@ -107,50 +117,50 @@ dim shared webPageComments() as string '' sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) - cmd_opt_enable_url = cbool( opts_flags and CMD_OPTS_ENABLE_URL ) - cmd_opt_enable_cache = cbool( opts_flags and CMD_OPTS_ENABLE_CACHE ) - cmd_opt_enable_login = cbool( opts_flags and CMD_OPTS_ENABLE_LOGIN ) - cmd_opt_enable_image = cbool( opts_flags and CMD_OPTS_ENABLE_IMAGE ) - cmd_opt_enable_autocache = cbool( opts_flags and CMD_OPTS_ENABLE_AUTOCACHE ) - cmd_opt_enable_pagelist = cbool( opts_flags and CMD_OPTS_ENABLE_PAGELIST ) - cmd_opt_enable_manual = cbool( opts_flags and CMD_OPTS_ENABLE_MANUAL ) + cmd_opt.enable_url = cbool( opts_flags and CMD_OPTS_ENABLE_URL ) + cmd_opt.enable_cache = cbool( opts_flags and CMD_OPTS_ENABLE_CACHE ) + cmd_opt.enable_login = cbool( opts_flags and CMD_OPTS_ENABLE_LOGIN ) + cmd_opt.enable_image = cbool( opts_flags and CMD_OPTS_ENABLE_IMAGE ) + cmd_opt.enable_autocache = cbool( opts_flags and CMD_OPTS_ENABLE_AUTOCACHE ) + cmd_opt.enable_pagelist = cbool( opts_flags and CMD_OPTS_ENABLE_PAGELIST ) + cmd_opt.enable_manual = cbool( opts_flags and CMD_OPTS_ENABLE_MANUAL ) '' general options cmd_opt_help = false '' -h, -help given on command line cmd_opt_verbose = false '' -v given on command line - cmd_opt_print = false '' -print options given - cmd_opt_ini = false '' -ini given on command line - cmd_opt_ini_file = "" '' value of '-ini FILE' given on command line + cmd_opt.print = false '' -printopts options given + cmd_opt.ini = false '' -ini given on command line + cmd_opt.ini_file = "" '' value of '-ini FILE' given on command line '' url & cache options - cmd_opt_web = false '' -web or -web+ given on command line - cmd_opt_dev = false '' -dev or -dev+ given on command line - cmd_opt_alt = false '' -web+ or -dev+ given on command line + cmd_opt.web = false '' -web or -web+ given on command line + cmd_opt.dev = false '' -dev or -dev+ given on command line + cmd_opt.alt = false '' -web+ or -dev+ given on command line - cmd_opt_cache = false '' -cache given on command line - cmd_opt_cache_dir = "" '' value of '-cache DIR' given on command line + cmd_opt.cache = false '' -cache given on command line + cmd_opt.cache_dir = "" '' value of '-cache DIR' given on command line - cmd_opt_url = false '' -url given on command line - cmd_opt_url_name = "" '' value of '-url URL' given on command line + cmd_opt.url = false '' -url given on command line + cmd_opt.url_name = "" '' value of '-url URL' given on command line - cmd_opt_ca = false '' -certificate given on command line - cmd_opt_ca_file = "" '' value of '-certificate FILE' given on command line + cmd_opt.ca = false '' -certificate given on command line + cmd_opt.ca_file = "" '' value of '-certificate FILE' given on command line '' login options - cmd_opt_user = false '' -u given on command line - cmd_opt_username = "" '' value of -u NAME given on command line + cmd_opt.user = false '' -u given on command line + cmd_opt.username = "" '' value of -u NAME given on command line - cmd_opt_pass = false '' -p given on command line - cmd_opt_password = "" '' value of -p WORD given on command line + cmd_opt.pass = false '' -p given on command line + cmd_opt.password = "" '' value of -p WORD given on command line - cmd_opt_image = false '' -image_dir given on command line - cmd_opt_image_dir = "" '' value of '-image_dir DIR' given on command line + cmd_opt.image = false '' -image_dir given on command line + cmd_opt.image_dir = "" '' value of '-image_dir DIR' given on command line - cmd_opt_manual = false '' -manual_dir given on command line - cmd_opt_manual_dir = "" '' value of '-manual_dir DIR' given on command line + cmd_opt.manual = false '' -manual_dir given on command line + cmd_opt.manual_dir = "" '' value of '-manual_dir DIR' given on command line '' resolved options @@ -209,28 +219,28 @@ function cmd_opts_read( byref i as integer ) as boolean cmd_opt_verbose = true case "-printopts" - cmd_opt_print = true + cmd_opt.print = true case "-web", "-dev", "-web+", "-dev+" - if( cmd_opt_enable_url or cmd_opt_enable_cache ) then + if( cmd_opt.enable_url or cmd_opt.enable_cache ) then - if( cmd_opt_dev or cmd_opt_web ) then + if( cmd_opt.dev or cmd_opt.web ) then print "-web, -web+, -dev, -dev+ option can only be specified once" end 1 end if select case lcase(command(i)) case "-dev" - cmd_opt_dev = true + cmd_opt.dev = true case "-web" - cmd_opt_web = true + cmd_opt.web = true case "-dev+" - cmd_opt_dev = true - cmd_opt_alt = true + cmd_opt.dev = true + cmd_opt.alt = true case "-web+" - cmd_opt_web = true - cmd_opt_alt = true + cmd_opt.web = true + cmd_opt.alt = true end select else @@ -239,14 +249,14 @@ function cmd_opts_read( byref i as integer ) as boolean case "-url" - if( cmd_opt_enable_url ) then + if( cmd_opt.enable_url ) then - if( cmd_opt_url ) then + if( cmd_opt.url ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_url = true + cmd_opt.url = true i += 1 - cmd_opt_url_name = command(i) + cmd_opt.url_name = command(i) else return false @@ -254,14 +264,14 @@ function cmd_opts_read( byref i as integer ) as boolean case "-certificate" - if( cmd_opt_enable_url ) then + if( cmd_opt.enable_url ) then - if( cmd_opt_ca ) then + if( cmd_opt.ca ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_ca = true + cmd_opt.ca = true i += 1 - cmd_opt_ca_file = command(i) + cmd_opt.ca_file = command(i) else return false @@ -269,14 +279,14 @@ function cmd_opts_read( byref i as integer ) as boolean case "-cache" - if( cmd_opt_enable_cache ) then + if( cmd_opt.enable_cache ) then - if( cmd_opt_cache ) then + if( cmd_opt.cache ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_cache = true + cmd_opt.cache = true i += 1 - cmd_opt_cache_dir = command(i) + cmd_opt.cache_dir = command(i) else return false @@ -284,14 +294,14 @@ function cmd_opts_read( byref i as integer ) as boolean case "-u" - if( cmd_opt_enable_login ) then + if( cmd_opt.enable_login ) then - if( cmd_opt_user ) then + if( cmd_opt.user ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_user = true + cmd_opt.user = true i += 1 - cmd_opt_username = command(i) + cmd_opt.username = command(i) else return false @@ -299,14 +309,14 @@ function cmd_opts_read( byref i as integer ) as boolean case "-p" - if( cmd_opt_enable_login ) then + if( cmd_opt.enable_login ) then - if( cmd_opt_pass ) then + if( cmd_opt.pass ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_pass = true + cmd_opt.pass = true i += 1 - cmd_opt_password = command(i) + cmd_opt.password = command(i) else return false @@ -314,14 +324,14 @@ function cmd_opts_read( byref i as integer ) as boolean case "-image_dir" - if( cmd_opt_enable_image ) then + if( cmd_opt.enable_image ) then - if( cmd_opt_image ) then + if( cmd_opt.image ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_image = true + cmd_opt.image = true i += 1 - cmd_opt_image_dir = command(i) + cmd_opt.image_dir = command(i) else return false @@ -329,33 +339,33 @@ function cmd_opts_read( byref i as integer ) as boolean case "-manual_dir" - if( cmd_opt_enable_manual ) then + if( cmd_opt.enable_manual ) then - if( cmd_opt_manual ) then + if( cmd_opt.manual ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_manual = true + cmd_opt.manual = true i += 1 - cmd_opt_manual_dir = command(i) + cmd_opt.manual_dir = command(i) else return false end if case "-ini" - if( cmd_opt_ini ) then + if( cmd_opt.ini ) then cmd_opts_duplicate_die( i ) end if - cmd_opt_ini = true + cmd_opt.ini = true i += 1 - cmd_opt_ini_file = command(i) + cmd_opt.ini_file = command(i) case else return false end select else - if( cmd_opt_enable_pagelist ) then + if( cmd_opt.enable_pagelist ) then if left( command(i), 1) = "@" then scope dim h as integer, x as string, cmt as string @@ -427,8 +437,8 @@ function cmd_opts_resolve() as boolean dim as string def_manual_dir = hardcoded.default_manual_dir '' -ini FILE on the command line overrides the hardcoded value - if( cmd_opt_ini ) then - ini_file = cmd_opt_ini_file + if( cmd_opt.ini ) then + ini_file = cmd_opt.ini_file end if '' read defaults from the configuration file (if it exists) @@ -450,15 +460,15 @@ function cmd_opts_resolve() as boolean def_image_dir = opts->Get( "image_dir" ) def_manual_dir = opts->Get( "manual_dir" ) delete opts - elseif( cmd_opt_ini ) then + elseif( cmd_opt.ini ) then '' if we explicitly gave the -ini FILE option, report the error cmd_opts_die( "Warning: unable to load options file '" + ini_file + "'" ) end if end scope '' now apply the command line overrides - if( cmd_opt_web ) then - if( cmd_opt_alt ) then + if( cmd_opt.web ) then + if( cmd_opt.alt ) then cache_dir = web_cache_dir else cache_dir = def_cache_dir @@ -469,8 +479,8 @@ function cmd_opts_resolve() as boolean wiki_password = web_pass end if - if( cmd_opt_dev ) then - if( cmd_opt_alt ) then + if( cmd_opt.dev ) then + if( cmd_opt.alt ) then cache_dir = dev_cache_dir else cache_dir = def_cache_dir @@ -481,43 +491,43 @@ function cmd_opts_resolve() as boolean wiki_password = dev_pass end if - if( cmd_opt_cache ) then - cache_dir = cmd_opt_cache_dir + if( cmd_opt.cache ) then + cache_dir = cmd_opt.cache_dir end if - if( cache_dir = "" and cmd_opt_enable_autocache ) then + if( cache_dir = "" and cmd_opt.enable_autocache ) then cache_dir = def_cache_dir end if - if( cmd_opt_url ) then - wiki_url = cmd_opt_url_name + if( cmd_opt.url ) then + wiki_url = cmd_opt.url_name end if - if( cmd_opt_ca ) then - ca_file = cmd_opt_ca_file + if( cmd_opt.ca ) then + ca_file = cmd_opt.ca_file end if - if( cmd_opt_user ) then - wiki_username = cmd_opt_username + if( cmd_opt.user ) then + wiki_username = cmd_opt.username end if - if( cmd_opt_pass ) then - wiki_password = cmd_opt_password + if( cmd_opt.pass ) then + wiki_password = cmd_opt.password end if - if( cmd_opt_image ) then - image_dir = cmd_opt_image_dir + if( cmd_opt.image ) then + image_dir = cmd_opt.image_dir else image_dir = def_image_dir end if - if( cmd_opt_manual ) then - manual_dir = cmd_opt_manual_dir + if( cmd_opt.manual ) then + manual_dir = cmd_opt.manual_dir else manual_dir = def_manual_dir end if - if( cmd_opt_print ) then + if( cmd_opt.print ) then print "ini_file = " & ini_file print @@ -554,14 +564,14 @@ end function '' function cmd_opts_check() as boolean - if( cmd_opt_enable_cache ) then + if( cmd_opt.enable_cache ) then '' check that we have the values we need if( cache_dir = "" ) then cmd_opts_die( "no cache directory specified" ) end if end if - if( cmd_opt_enable_url ) then + if( cmd_opt.enable_url ) then if( wiki_url = "" ) then cmd_opts_die( "no url specified" ) end if @@ -606,7 +616,7 @@ sub cmd_opts_show_help( byref action as const string = "", locations as boolean print " -v be verbose" print - if( cmd_opt_enable_pagelist ) then + if( cmd_opt.enable_pagelist ) then print " pages list of wiki pages on the command line" print " @pagelist text file with a list of pages, one per line" print @@ -614,19 +624,19 @@ sub cmd_opts_show_help( byref action as const string = "", locations as boolean if( locations ) then - if( cmd_opt_enable_url and cmd_opt_enable_cache ) then + if( cmd_opt.enable_url and cmd_opt.enable_cache ) then print " -web " & a & " web server url and cache_dir files" print " -web+ " & a & " web server url and web_cache_dir files" print " -dev " & a & " development server url and cache_dir files" print " -dev+ " & a & " development server url and dev_cache_dir files" print - elseif( cmd_opt_enable_url ) then + elseif( cmd_opt.enable_url ) then print " -web " & a & " web server url" print " -web+ " & a & " web server url" print " -dev " & a & " development server url" print " -dev+ " & a & " development server url" print - elseif( cmd_opt_enable_cache ) then + elseif( cmd_opt.enable_cache ) then print " -web " & a & " cache_dir files" print " -web+ " & a & " web_cache_dir files" print " -dev " & a & " cache_dir files" @@ -636,26 +646,26 @@ sub cmd_opts_show_help( byref action as const string = "", locations as boolean end if - if( cmd_opt_enable_url ) then + if( cmd_opt.enable_url ) then print " -url URL get pages from URL (overrides other options)" print " -certificate FILE" print " certificate to use to authenticate server (.pem)" end if - if( cmd_opt_enable_login ) then + if( cmd_opt.enable_login ) then print " -u user specifiy wiki account username" print " -p pass specifiy wiki account password" end if - if( cmd_opt_enable_cache ) then + if( cmd_opt.enable_cache ) then print " -cache DIR override the cache directory location" end if - if( cmd_opt_enable_image) then + if( cmd_opt.enable_image) then print " -image_dir DIR override the image directory location" end if - if( cmd_opt_enable_manual ) then + if( cmd_opt.enable_manual ) then print " -manual_dir DIR override the manual directory location" end if From 92a9885f91a16ceb3d60bc1f04a2e99a3b3cc1fc Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sun, 25 Feb 2018 16:45:23 -0500 Subject: [PATCH 14/15] fbchkdoc: wrap the global options in a type to make usage obvious throughout all the tools --- doc/fbchkdoc/chkdocs.bas | 21 +++--- doc/fbchkdoc/cmd_opts.bas | 142 +++++++++++++++++--------------------- doc/fbchkdoc/cmd_opts.bi | 40 ++++++----- doc/fbchkdoc/delextra.bas | 7 +- doc/fbchkdoc/getimage.bas | 7 +- doc/fbchkdoc/getindex.bas | 17 +++-- doc/fbchkdoc/getpage.bas | 37 +++++----- doc/fbchkdoc/mkimglst.bas | 20 +++--- doc/fbchkdoc/mkprntoc.bas | 16 ++--- doc/fbchkdoc/putpage.bas | 33 +++++---- doc/fbchkdoc/rebuild.bas | 15 ++-- doc/fbchkdoc/replace.bas | 19 +++-- doc/fbchkdoc/spell.bas | 19 +++-- 13 files changed, 182 insertions(+), 211 deletions(-) diff --git a/doc/fbchkdoc/chkdocs.bas b/doc/fbchkdoc/chkdocs.bas index 9e38d138cf..30438d7433 100644 --- a/doc/fbchkdoc/chkdocs.bas +++ b/doc/fbchkdoc/chkdocs.bas @@ -31,7 +31,6 @@ #include once "list.bi" #include once "CWiki.bi" #include once "hash.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -1035,7 +1034,7 @@ sub Links_LoadFromPage _ pagehash_scanned.add( lcase(sPages(j).sName), cast(any ptr, j) ) - f = cache_dir + sPages(j).sName + ".wakka" + f = app_opt.cache_dir + sPages(j).sName + ".wakka" print "."; @@ -1213,7 +1212,7 @@ sub Check_DeletedPages() Temps_Clear() for i = 1 to nPages - f = cache_dir + sPages(i).sName + ".wakka" + f = app_opt.cache_dir + sPages(i).sName + ".wakka" sBody = LoadFileAsString( f ) if( left( ucase( ltrim( sBody, any " " & chr(9))), len( chk ) ) = chk ) then n_delete_pages += 1 @@ -1426,7 +1425,7 @@ sub Check_Headers() logprint "Found " + str(c) + " invalid headers" logprint - if( cmd_opt_verbose ) then + if( app_opt.verbose ) then logprint "Pages not checked for valid topic headers" if nTemps > 0 then for i = 1 to nTemps @@ -1739,7 +1738,7 @@ sub Check_PrintToc() logprint "Checking PrintToc for missing pages:" - f = cache_dir + "PrintToc.wakka" + f = app_opt.cache_dir + "PrintToc.wakka" logprint "Reading '" + f + "'" sBody = LoadFileAsString( f ) @@ -1875,7 +1874,7 @@ sub Check_TokenUnescapedCamelCase() if( ( sPages(i).flags and FLAG_PAGE_DOCPAGE ) <> 0 ) then - f = cache_dir + sPages(i).sName + ".wakka" + f = app_opt.cache_dir + sPages(i).sName + ".wakka" sBody = LoadFileAsString( f ) wiki->Parse( sPages(i).sName, sBody ) @@ -2008,7 +2007,7 @@ sub Check_TokenHtml() '' if( ( sPages(i).flags and FLAG_PAGE_DOCPAGE ) <> 0 ) then - f = cache_dir + sPages(i).sName + ".wakka" + f = app_opt.cache_dir + sPages(i).sName + ".wakka" sBody = LoadFileAsString( f ) wiki->Parse( sPages(i).sName, sBody ) @@ -2189,7 +2188,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "chkdocs [options]" print print "options:" @@ -2240,7 +2239,7 @@ Timer_Begin() logopen() logprint "chkdocs: " + format( now(), "yyyy/mm/dd hh:mm:ss" ) -logprint "cache: " & cache_dir +logprint "cache: " & app_opt.cache_dir logprint Timer_Mark("Startup") @@ -2250,7 +2249,7 @@ Pages_Clear Files_Clear Samps_Clear -Files_LoadFromCache( cache_dir ) +Files_LoadFromCache( app_opt.cache_dir ) Pages_LoadFromFile( PageIndex_File ) logprint @@ -2358,7 +2357,7 @@ end if if( (opt and OPT_IMAGES) <> 0 ) then '' Image file names - Check_ImageFilenames( image_dir ) + Check_ImageFilenames( app_opt.image_dir ) Timer_Mark("Check_ImageFilenames()") end if diff --git a/doc/fbchkdoc/cmd_opts.bas b/doc/fbchkdoc/cmd_opts.bas index 663cbb972d..928626be00 100644 --- a/doc/fbchkdoc/cmd_opts.bas +++ b/doc/fbchkdoc/cmd_opts.bas @@ -40,24 +40,7 @@ using fbdoc '' file, then 2) override the values with any other options given '' on the command line -dim shared cmd_opt_help as boolean -dim shared cmd_opt_verbose as boolean - -'' ------------------------------------ -'' resolved options -'' ------------------------------------ - -dim shared wiki_url as string -dim shared cache_dir as string -dim shared ca_file as string -dim shared wiki_username as string -dim shared wiki_password as string -dim shared image_dir as string -dim shared manual_dir as string - -dim shared webPageCount as integer -dim shared webPageList() as string -dim shared webPageComments() as string +dim shared app_opt as CMD_OPTS_GLOBAL '' ------------------------------------ '' private options @@ -127,8 +110,9 @@ sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) '' general options - cmd_opt_help = false '' -h, -help given on command line - cmd_opt_verbose = false '' -v given on command line + app_opt.help = false '' -h, -help given on command line + app_opt.verbose = false '' -v given on command line + cmd_opt.print = false '' -printopts options given cmd_opt.ini = false '' -ini given on command line cmd_opt.ini_file = "" '' value of '-ini FILE' given on command line @@ -164,20 +148,20 @@ sub cmd_opts_init( byval opts_flags as const CMD_OPTS_ENABLE_FLAGS ) '' resolved options - wiki_url = "" '' export: resolved wiki url - cache_dir = "" '' export: resolved cache directory - ca_file = "" '' export: resolved certificate _file - wiki_username = "" '' export: resolved user - wiki_password = "" '' export: resolved pass - image_dir = "" '' export: image directory - manual_dir = "" '' export: manual directory + app_opt.wiki_url = "" '' export: resolved wiki url + app_opt.cache_dir = "" '' export: resolved cache directory + app_opt.ca_file = "" '' export: resolved certificate _file + app_opt.wiki_username = "" '' export: resolved user + app_opt.wiki_password = "" '' export: resolved pass + app_opt.image_dir = "" '' export: image directory + app_opt.manual_dir = "" '' export: manual directory - webPageCount = 0 - redim webPageList(1 to 1) as string - redim webPageComments(1 to 1) as string + app_opt.webPageCount = 0 + redim app_opt.webPageList(1 to 1) as string + redim app_opt.webPageComments(1 to 1) as string if( command(1) = "" ) then - cmd_opt_help = true + app_opt.help = true end if end sub @@ -203,6 +187,20 @@ sub cmd_opts_unexpected_die( byval i as const integer ) cmd_opts_die( "Unrecognized option '" + command(i) + "'" ) end sub +'' +sub cmd_opts_add_webpage( byref pagename as const string, byref cmt as const string ) + with app_opt + .webPageCount += 1 + if( .webPageCount > ubound(.webPageList) ) then + redim preserve .webPageList(1 to Ubound(.webPageList) * 2) + redim preserve .webPageComments(1 to Ubound(.webPageComments) * 2) + end if + .webPageList(.webPageCount) = pagename + .webPageComments(.webPageCount) = cmt + end with +end sub + + '' function cmd_opts_read( byref i as integer ) as boolean @@ -213,10 +211,10 @@ function cmd_opts_read( byref i as integer ) as boolean select case lcase(command(i)) case "-h", "-help" - cmd_opt_help = true + app_opt.help = true case "-v" - cmd_opt_verbose = true + app_opt.verbose = true case "-printopts" cmd_opt.print = true @@ -377,26 +375,14 @@ function cmd_opts_read( byref i as integer ) as boolean line input #h, x x = ParsePageName( x, cmt ) if( x > "" ) then - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - redim preserve webPageComments(1 to Ubound(webPageComments) * 2) - end if - webPageList(webPageCount) = x - webPageComments(webPageCount) = cmt + cmd_opts_add_webpage( x, cmt ) end if wend close #h end if end scope else - webPageCount += 1 - if( webPageCount > ubound(webPageList) ) then - redim preserve webPageList(1 to Ubound(webPageList) * 2) - redim preserve webPageComments(1 to Ubound(webPageComments) * 2) - end if - webPageList(webPageCount) = command(i) - webPageComments(webPageCount) = "" + cmd_opts_add_webpage( command(i), "" ) end if else @@ -469,62 +455,62 @@ function cmd_opts_resolve() as boolean '' now apply the command line overrides if( cmd_opt.web ) then if( cmd_opt.alt ) then - cache_dir = web_cache_dir + app_opt.cache_dir = web_cache_dir else - cache_dir = def_cache_dir + app_opt.cache_dir = def_cache_dir end if - wiki_url = web_wiki_url - ca_file = web_ca_file - wiki_username = web_user - wiki_password = web_pass + app_opt.wiki_url = web_wiki_url + app_opt.ca_file = web_ca_file + app_opt.wiki_username = web_user + app_opt.wiki_password = web_pass end if if( cmd_opt.dev ) then if( cmd_opt.alt ) then - cache_dir = dev_cache_dir + app_opt.cache_dir = dev_cache_dir else - cache_dir = def_cache_dir + app_opt.cache_dir = def_cache_dir end if - wiki_url = dev_wiki_url - ca_file = dev_ca_file - wiki_username = dev_user - wiki_password = dev_pass + app_opt.wiki_url = dev_wiki_url + app_opt.ca_file = dev_ca_file + app_opt.wiki_username = dev_user + app_opt.wiki_password = dev_pass end if if( cmd_opt.cache ) then - cache_dir = cmd_opt.cache_dir + app_opt.cache_dir = cmd_opt.cache_dir end if - if( cache_dir = "" and cmd_opt.enable_autocache ) then - cache_dir = def_cache_dir + if( app_opt.cache_dir = "" and cmd_opt.enable_autocache ) then + app_opt.cache_dir = def_cache_dir end if if( cmd_opt.url ) then - wiki_url = cmd_opt.url_name + app_opt.wiki_url = cmd_opt.url_name end if if( cmd_opt.ca ) then - ca_file = cmd_opt.ca_file + app_opt.ca_file = cmd_opt.ca_file end if if( cmd_opt.user ) then - wiki_username = cmd_opt.username + app_opt.wiki_username = cmd_opt.username end if if( cmd_opt.pass ) then - wiki_password = cmd_opt.password + app_opt.wiki_password = cmd_opt.password end if if( cmd_opt.image ) then - image_dir = cmd_opt.image_dir + app_opt.image_dir = cmd_opt.image_dir else - image_dir = def_image_dir + app_opt.image_dir = def_image_dir end if if( cmd_opt.manual ) then - manual_dir = cmd_opt.manual_dir + app_opt.manual_dir = cmd_opt.manual_dir else - manual_dir = def_manual_dir + app_opt.manual_dir = def_manual_dir end if if( cmd_opt.print ) then @@ -544,13 +530,13 @@ function cmd_opts_resolve() as boolean print "def_image_dir = " & def_image_dir print "def_manual_dir = " & def_manual_dir print - print "wiki_url = " & wiki_url - print "cache_dir = " & cache_dir - print "ca_file = " & ca_file - print "wiki_username = " & wiki_username + print "wiki_url = " & app_opt.wiki_url + print "cache_dir = " & app_opt.cache_dir + print "ca_file = " & app_opt.ca_file + print "wiki_username = " & app_opt.wiki_username print "wiki_password = " & "*****" - print "image_dir = " & image_dir - print "manual_dir = " & manual_dir + print "image_dir = " & app_opt.image_dir + print "manual_dir = " & app_opt.manual_dir print end 1 @@ -566,13 +552,13 @@ function cmd_opts_check() as boolean if( cmd_opt.enable_cache ) then '' check that we have the values we need - if( cache_dir = "" ) then + if( app_opt.cache_dir = "" ) then cmd_opts_die( "no cache directory specified" ) end if end if if( cmd_opt.enable_url ) then - if( wiki_url = "" ) then + if( app_opt.wiki_url = "" ) then cmd_opts_die( "no url specified" ) end if end if diff --git a/doc/fbchkdoc/cmd_opts.bi b/doc/fbchkdoc/cmd_opts.bi index 3384074e54..b6e093c48d 100644 --- a/doc/fbchkdoc/cmd_opts.bi +++ b/doc/fbchkdoc/cmd_opts.bi @@ -42,21 +42,27 @@ declare function cmd_opts_check() as boolean declare sub cmd_opts_show_help( byref action as const string = "", byval locations as boolean = true ) declare sub cmd_opts_show_help_item( byref opt_name as const string, byref opt_desc as const string ) -'' command line options -extern cmd_opt_help as boolean -extern cmd_opt_verbose as boolean - -''resolved options -extern wiki_url as string -extern cache_dir as string -extern ca_file as string -extern wiki_username as string -extern wiki_password as string -extern image_dir as string -extern manual_dir as string - -extern webPageCount as integer -extern webPageList(any) as string -extern webPageComments(any) as string - +type CMD_OPTS_GLOBAL + + '' command line options + help as boolean + verbose as boolean + + ''resolved options + wiki_url as string + cache_dir as string + ca_file as string + wiki_username as string + wiki_password as string + image_dir as string + manual_dir as string + + webPageCount as integer + webPageList(any) as string + webPageComments(any) as string + +end type + +extern app_opt as CMD_OPTS_GLOBAL + #endif diff --git a/doc/fbchkdoc/delextra.bas b/doc/fbchkdoc/delextra.bas index eb29b6fa74..c89ea4c352 100644 --- a/doc/fbchkdoc/delextra.bas +++ b/doc/fbchkdoc/delextra.bas @@ -22,7 +22,6 @@ '' fbdoc headers #include once "fbdoc_defs.bi" #include once "fbdoc_string.bi" -#include once "COptions.bi" #include once "hash.bi" '' fbchkdoc headers @@ -188,7 +187,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "delextra [options]" print print "options:" @@ -207,7 +206,7 @@ cmd_opts_check() '' -------------------------------------------------------- -print "cache: "; cache_dir +print "cache: "; app_opt.cache_dir print "Reading '" + def_index_file + "' ..." if( ReadIndex( def_index_file ) = FALSE ) then @@ -215,4 +214,4 @@ if( ReadIndex( def_index_file ) = FALSE ) then end 1 end if -DeleteExtraFiles( cache_dir, isgit, nodelete, doscan, bHTML, wiki_url ) +DeleteExtraFiles( app_opt.cache_dir, isgit, nodelete, doscan, bHTML, app_opt.wiki_url ) diff --git a/doc/fbchkdoc/getimage.bas b/doc/fbchkdoc/getimage.bas index 29049bb77b..c104184da1 100644 --- a/doc/fbchkdoc/getimage.bas +++ b/doc/fbchkdoc/getimage.bas @@ -22,9 +22,6 @@ #include once "curl.bi" #include once "crt/stdio.bi" -'' fbdoc headers -#include once "COptions.bi" - '' fbchkdoc headers #include once "fbchkdoc.bi" #include once "funcs.bi" @@ -154,7 +151,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "getimage imagelist.txt" print print " imagelist.txt text file listing images to get in the" @@ -191,7 +188,7 @@ while eof(h) = 0 if( (lcase(left( url, 7 )) = "http://") or (lcase(left( url, 8 )) = "https://") ) then filename = GetFileName( url ) if( filename > "" ) then - AddImageFile( url, image_dir + filename ) + AddImageFile( url, app_opt.image_dir + filename ) end if end if diff --git a/doc/fbchkdoc/getindex.bas b/doc/fbchkdoc/getindex.bas index f29f642c29..75f4144c73 100644 --- a/doc/fbchkdoc/getindex.bas +++ b/doc/fbchkdoc/getindex.bas @@ -21,7 +21,6 @@ '' fbdoc headers #include once "CWikiCon.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -263,7 +262,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "getindex {server} [options]" print print "{server}:" @@ -299,11 +298,11 @@ sPage = "PageIndex" if( blocal ) then - ScanCacheDir( cache_dir ) + ScanCacheDir( app_opt.cache_dir ) else - if( len( wiki_url ) = 0 ) then + if( len( app_opt.wiki_url ) = 0 ) then print "wiki_url not set. use -url, -web, -web+, -dev, or -dev+" end 1 end if @@ -312,16 +311,16 @@ else scope dim as CWikiCon ptr wikicon = NULL - wikicon = new CWikiCon( wiki_url, ca_file ) + wikicon = new CWikiCon( app_opt.wiki_url, app_opt.ca_file ) if wikicon = NULL then - print "Unable to create connection " + wiki_url + print "Unable to create connection " + app_opt.wiki_url end 1 end if - print "URL: "; wiki_url + print "URL: "; app_opt.wiki_url - if( ca_file > "" ) then - print "Certificate: "; ca_file + if( app_opt.ca_file > "" ) then + print "Certificate: "; app_opt.ca_file else print "Certificate: none" end if diff --git a/doc/fbchkdoc/getpage.bas b/doc/fbchkdoc/getpage.bas index 97fd3a20c6..2c95646b5d 100644 --- a/doc/fbchkdoc/getpage.bas +++ b/doc/fbchkdoc/getpage.bas @@ -23,7 +23,6 @@ #include once "fbdoc_cache.bi" #include once "fbdoc_loader.bi" #include once "fbdoc_loader_web.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -64,7 +63,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "getpage {server} [options] [pages] [@pagelist]" print print "{server}:" @@ -82,7 +81,7 @@ cmd_opts_resolve() cmd_opts_check() '' no pages? nothing to do... -if( webPageCount = 0 ) then +if( app_opt.webPageCount = 0 ) then print "no pages specified." end 1 end if @@ -96,42 +95,42 @@ redim failedpages(1 to 1) as string do '' Initialize the cache - if LocalCache_Create( cache_dir, CWikiCache.CACHE_REFRESH_ALL ) = FALSE then - print "Unable to use local cache dir " + cache_dir + if LocalCache_Create( app_opt.cache_dir, CWikiCache.CACHE_REFRESH_ALL ) = FALSE then + print "Unable to use local cache dir " + app_opt.cache_dir end 1 end if '' Initialize the wiki connection - Connection_SetUrl( wiki_url, ca_file ) + Connection_SetUrl( app_opt.wiki_url, app_opt.ca_file ) - print "URL: "; wiki_url - if( ca_file > "" ) then - print "Certificate: "; ca_file + print "URL: "; app_opt.wiki_url + if( app_opt.ca_file > "" ) then + print "Certificate: "; app_opt.ca_file else print "Certificate: none" end if - print "cache: "; cache_dir + print "cache: "; app_opt.cache_dir nfailedpages = 0 - if( webPageCount > 0 ) then + if( app_opt.webPageCount > 0 ) then dim as integer i, j dim as string ret - for i = 1 to webPageCount - ret = LoadPage( webPageList(i), FALSE, TRUE ) + for i = 1 to app_opt.webPageCount + ret = LoadPage( app_opt.webPageList(i), FALSE, TRUE ) if( ret = "" ) then - print "Failed to load '" & webPageList(i) & "'" + print "Failed to load '" & app_opt.webPageList(i) & "'" nfailedpages += 1 redim preserve failedpages( 1 to nfailedpages ) - failedpages(nfailedpages) = webPageList(i) + failedpages(nfailedpages) = app_opt.webPageList(i) end if if( inkey = chr(27) ) then - for j = i + 1 to webPageCount + for j = i + 1 to app_opt.webPageCount nfailedpages += 1 redim preserve failedpages( 1 to nfailedpages ) - failedpages(nfailedpages) = webPageList(j) + failedpages(nfailedpages) = app_opt.webPageList(j) next exit for @@ -163,9 +162,9 @@ do case "y" for i = 1 to nfailedpages - webPageList(i) = failedpages(i) + app_opt.webPageList(i) = failedpages(i) next - webPageCount = nfailedpages + app_opt.webPageCount = nfailedpages exit do diff --git a/doc/fbchkdoc/mkimglst.bas b/doc/fbchkdoc/mkimglst.bas index f14fb644a2..f476378357 100644 --- a/doc/fbchkdoc/mkimglst.bas +++ b/doc/fbchkdoc/mkimglst.bas @@ -22,11 +22,7 @@ '' fbdoc headers #include once "CWiki.bi" #include once "CWikiCache.bi" -#include once "CRegex.bi" -#include once "list.bi" -#include once "fbdoc_defs.bi" #include once "fbdoc_string.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -108,7 +104,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "mkimglst [pages] [@pagelist] [options]" print cmd_opts_show_help( "scan for image files in" ) @@ -120,7 +116,7 @@ cmd_opts_resolve() cmd_opts_check() '' no pages? nothing to do... -if( webPageCount = 0 ) then +if( app_opt.webPageCount = 0 ) then print "no pages specified." end 1 end if @@ -130,16 +126,16 @@ end if dim as CWikiCache ptr wikicache dim as string sPage, sBody -print "cache: "; cache_dir +print "cache: "; app_opt.cache_dir '' Initialize the cache -wikicache = new CWikiCache( cache_dir, CWikiCache.CACHE_REFRESH_NONE ) +wikicache = new CWikiCache( app_opt.cache_dir, CWikiCache.CACHE_REFRESH_NONE ) if wikicache = NULL then - print "Unable to use local cache dir " + cache_dir + print "Unable to use local cache dir " + app_opt.cache_dir end 1 end if -if( webPageCount > 0 ) then +if( app_opt.webPageCount > 0 ) then dim as integer i, h, h2 dim as string ret @@ -148,9 +144,9 @@ if( webPageCount > 0 ) then h2 = freefile open "imagepages.txt" for output as #h2 - for i = 1 to webPageCount + for i = 1 to app_opt.webPageCount - sPage = webPageList(i) + sPage = app_opt.webPageList(i) print "Loading '" + sPage + "':" ; if( wikicache->LoadPage( sPage, sBody ) ) = FALSE then diff --git a/doc/fbchkdoc/mkprntoc.bas b/doc/fbchkdoc/mkprntoc.bas index 4ca5fd8eca..996906afb1 100644 --- a/doc/fbchkdoc/mkprntoc.bas +++ b/doc/fbchkdoc/mkprntoc.bas @@ -22,10 +22,6 @@ '' fbdoc headers #include once "CWiki.bi" #include once "CWikiCache.bi" -#include once "CRegex.bi" -#include once "list.bi" -#include once "CWakka2fbhelp.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -311,7 +307,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "mkprntoc [options]" print print "options:" @@ -331,18 +327,18 @@ cmd_opts_check() dim as string sPage, sBody dim as integer h -print "cache: "; cache_dir +print "cache: "; app_opt.cache_dir '' Initialize the cache -wikicache = new CWikiCache( cache_dir, CWikiCache.CACHE_REFRESH_NONE ) +wikicache = new CWikiCache( app_opt.cache_dir, CWikiCache.CACHE_REFRESH_NONE ) if wikicache = NULL then - print "Unable to use local cache dir " + cache_dir + print "Unable to use local cache dir " + app_opt.cache_dir end 1 end if h = Freefile -print "Writing " + cache_dir + "PrintToc.wakka" -open cache_dir + "PrintToc.wakka" for output as #h +print "Writing " + app_opt.cache_dir + "PrintToc.wakka" +open app_opt.cache_dir + "PrintToc.wakka" for output as #h MakeTOC( h, "DocToc", 0 ) diff --git a/doc/fbchkdoc/putpage.bas b/doc/fbchkdoc/putpage.bas index 89e8e5059f..c2accddd25 100644 --- a/doc/fbchkdoc/putpage.bas +++ b/doc/fbchkdoc/putpage.bas @@ -23,7 +23,6 @@ #include once "fbdoc_cache.bi" #include once "fbdoc_loader.bi" #include once "fbdoc_loader_web.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -67,7 +66,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "putpage {server} [options] [pages] [@pagelist]" print print "{server}:" @@ -100,38 +99,38 @@ sNoteDef = "" dim as CWikiCache ptr wikicache = NULL dim as CWikiCon ptr wikicon = NULL -if( webPageCount = 0 ) then +if( app_opt.webPageCount = 0 ) then print "No pages specified" end if '' Initialize the cache -wikicache = new CWikiCache( cache_dir, CWikiCache.CACHE_REFRESH_NONE ) +wikicache = new CWikiCache( app_opt.cache_dir, CWikiCache.CACHE_REFRESH_NONE ) if wikicache = NULL then - print "Unable to use local cache dir " + cache_dir + print "Unable to use local cache dir " + app_opt.cache_dir end 1 end if -wikicon = new CWikiCon( wiki_url, ca_file ) +wikicon = new CWikiCon( app_opt.wiki_url, app_opt.ca_file ) if wikicon = NULL then - print "Unable to create connection " + wiki_url + print "Unable to create connection " + app_opt.wiki_url delete wikicache end 1 end if '' we have web pages? go to work... -if( webPageCount > 0 ) then +if( app_opt.webPageCount > 0 ) then dim as integer i dim as string ret - print "URL: "; wiki_url - if( ca_file > "" ) then - print "Certificate: "; ca_file + print "URL: "; app_opt.wiki_url + if( app_opt.ca_file > "" ) then + print "Certificate: "; app_opt.ca_file else print "Certificate: none" end if - print "cache: "; cache_dir - for i = 1 to webPageCount - sPage = webPageList(i) - sComment = webPageComments(i) + print "cache: "; app_opt.cache_dir + for i = 1 to app_opt.webPageCount + sPage = app_opt.webPageList(i) + sComment = app_opt.webPageComments(i) sBody = "" print "Loading '" + sPage + "': "; if( wikicache->LoadPage( sPage, sBody ) ) = FALSE then @@ -140,7 +139,7 @@ if( webPageCount > 0 ) then print "OK" if( wikicon->LoadPage( sPage, TRUE, TRUE, sBodyOld ) <> FALSE ) then if( wikicon->GetPageID() > 0 ) then - if( wikicon->Login( wiki_username, wiki_password ) ) = FALSE then + if( wikicon->Login( app_opt.wiki_username, app_opt.wiki_password ) ) = FALSE then print "Unable to login" else if( iComment > 0 ) then @@ -172,7 +171,7 @@ if( webPageCount > 0 ) then end if else print "Unable to get existing page ID - will try to store as a new page .." - if( wikicon->Login( wiki_username, wiki_password ) ) = FALSE then + if( wikicon->Login( app_opt.wiki_username, app_opt.wiki_password ) ) = FALSE then print "Unable to login" else print "Storing '" + sPage + "': "; diff --git a/doc/fbchkdoc/rebuild.bas b/doc/fbchkdoc/rebuild.bas index 96c94f22ec..b0f510615e 100644 --- a/doc/fbchkdoc/rebuild.bas +++ b/doc/fbchkdoc/rebuild.bas @@ -21,7 +21,6 @@ '' fbdoc headers #include once "CWiki.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -83,7 +82,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "rebuild [pages] [@pagelist] [options]" print cmd_opts_show_help( "rebuild files in" ) @@ -95,7 +94,7 @@ cmd_opts_resolve() cmd_opts_check() '' no pages? nothing to do... -if( webPageCount = 0 ) then +if( app_opt.webPageCount = 0 ) then print "no pages specified." end 1 end if @@ -105,22 +104,22 @@ end if dim as string sPage, sBody1, sBody2, f dim as CWiki ptr wiki -print "cache: "; cache_dir +print "cache: "; app_opt.cache_dir -for i = 1 to webpagecount +for i = 1 to app_opt.webpagecount wiki = new CWiki - sPage = webpagelist(i) + sPage = app_opt.webpagelist(i) - f = cache_dir + sPage + ".wakka" + f = app_opt.cache_dir + sPage + ".wakka" sBody1 = ReadTextFile( f ) wiki->Parse( sPage, sBody1 ) sBody2 = "" sBody2 = wiki->Build() - f = cache_dir + sPage + ".wakka" + f = app_opt.cache_dir + sPage + ".wakka" if( sBody1 <> sBody2 ) then print "Rewriting '" + sPage + "'" WriteTextFile( f, sBody2 ) diff --git a/doc/fbchkdoc/replace.bas b/doc/fbchkdoc/replace.bas index aa14e77c4d..2f81f830d3 100644 --- a/doc/fbchkdoc/replace.bas +++ b/doc/fbchkdoc/replace.bas @@ -24,7 +24,6 @@ '' fbdoc headers #include "fbdoc_string.bi" -#include "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -142,7 +141,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "replace [-f] file.txt [-c comment] [-n] [-r] [-s] [options...]" print print "options:" @@ -168,14 +167,14 @@ if f = "" then print "filename not specified" end if -if( cache_dir = "" ) then +if( app_opt.cache_dir = "" ) then cmd_opts_die( "no cache directory specified" ) end if '' generating HTML? if( bHTML ) then '' URL must be set - if( len( wiki_url ) = 0 ) then + if( len( app_opt.wiki_url ) = 0 ) then cmd_opts_die( "wiki_url not set." ) end if end if @@ -218,7 +217,7 @@ if( bProcess ) then kill "changed.txt" end if - print "cache: "; cache_dir + print "cache: "; app_opt.cache_dir if( open( def_index_file for input as #1 ) <> 0 ) then print "Unable to open '" + def_index_file + "'" @@ -229,7 +228,7 @@ if( bProcess ) then line input #1, x x = Trim(x) if( x > "" ) then - f = cache_dir + x + ".wakka" + f = app_opt.cache_dir + x + ".wakka" text = LoadFileAsString( f ) newtext = text @@ -272,16 +271,16 @@ if( bHTML ) then loghtml( "
" ) - loghtml( "" + replace(i).sOld + "/clone
" ) + loghtml( "" + replace(i).sOld + "/clone
" ) loghtml( "
" ) - loghtml( "" + replace(i).sNew + "
" ) + loghtml( "" + replace(i).sNew + "
" ) loghtml( "
" ) - loghtml( "" + replace(i).sOld + "
" ) + loghtml( "" + replace(i).sOld + "
" ) loghtml( "
" ) - loghtml( "" + replace(i).sOld + "/delete
" ) + loghtml( "" + replace(i).sOld + "/delete
" ) next loghtml( "
" ) diff --git a/doc/fbchkdoc/spell.bas b/doc/fbchkdoc/spell.bas index d8b7a3cb84..375847b719 100644 --- a/doc/fbchkdoc/spell.bas +++ b/doc/fbchkdoc/spell.bas @@ -22,12 +22,9 @@ '' fbdoc headers #include once "CWiki.bi" #include once "CWikiCache.bi" -#include once "CRegex.bi" -#include once "list.bi" #include once "hash.bi" #include once "fbdoc_defs.bi" #include once "fbdoc_keywords.bi" -#include once "COptions.bi" '' fbchkdoc headers #include once "fbchkdoc.bi" @@ -367,7 +364,7 @@ while( command(i) > "" ) i += 1 wend -if( cmd_opt_help ) then +if( app_opt.help ) then print "spell [pages] [@pagelist] [options]" print cmd_opts_show_help( "spellcheck" ) @@ -379,7 +376,7 @@ cmd_opts_resolve() cmd_opts_check() '' no pages? nothing to do... -if( webPageCount = 0 ) then +if( app_opt.webPageCount = 0 ) then print "no pages specified." end 1 end if @@ -390,13 +387,13 @@ dim as CWikiCache ptr wikicache dim as string sPage, sBody '' Initialize the cache -wikicache = new CWikiCache( cache_dir, CWikiCache.CACHE_REFRESH_NONE ) +wikicache = new CWikiCache( app_opt.cache_dir, CWikiCache.CACHE_REFRESH_NONE ) if wikicache = NULL then - print "Unable to use local cache dir " + cache_dir + print "Unable to use local cache dir " + app_opt.cache_dir end 1 end if -if( webPageCount > 0 ) then +if( app_opt.webPageCount > 0 ) then dim as integer i, h, h2 dim as string ret @@ -433,15 +430,15 @@ if( webPageCount > 0 ) then end if end scope - FormatFbCodeLoadKeywords( manual_dir & "templates/default/keywords.lst" ) + FormatFbCodeLoadKeywords( app_opt.manual_dir & "templates/default/keywords.lst" ) SpellCheck_Init( "en_US" ) '' h = freefile '' open "spellcheck.txt" for output as #h - for i = 1 to webPageCount + for i = 1 to app_opt.webPageCount - sPage = webPageList(i) + sPage = app_opt.webPageList(i) CurrentPage = sPage haveTitle = FALSE From fdfb10bd3b1636c98d42983b713726a5ce605fc2 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sun, 25 Feb 2018 17:44:49 -0500 Subject: [PATCH 15/15] fbchkdoc: code review of delextra tool, simplify and test --- doc/fbchkdoc/delextra.bas | 73 +++++++++++++++++++-------------------- doc/fbchkdoc/makefile | 3 +- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/doc/fbchkdoc/delextra.bas b/doc/fbchkdoc/delextra.bas index c89ea4c352..da06cb0f88 100644 --- a/doc/fbchkdoc/delextra.bas +++ b/doc/fbchkdoc/delextra.bas @@ -33,8 +33,10 @@ using fb using fbdoc const def_index_file = hardcoded.default_index_file +const def_output_file = "delete.html" +const wakka_extension = "wakka" +const DELETE_ME_SENTINEL = "!!! DELETE ME !!!" -dim shared pagehash as HASH dim shared filehash as HASH '' -------------------------------------------------------- @@ -43,9 +45,9 @@ dim shared filehash as HASH sub loghtml( byref x as string, byval bNew as integer = FALSE ) dim h as integer = freefile if( bNew ) then - open "delete.html" for output as #h + open def_output_file for output as #h else - open "delete.html" for append as #h + open def_output_file for append as #h end if print #h, x close #h @@ -54,15 +56,13 @@ end sub '' function ReadIndex( byref f as const string ) as boolean dim as string x - dim as integer h - h = freefile + dim as integer h = freefile if( open( f for input access read as #h ) = 0 ) then while eof(h) = 0 line input #h, x x = trim(x) if( len(x) > 0 ) then - pagehash.add( x ) - filehash.add( lcase(x) + ".wakka" ) + filehash.add( lcase(x) + "." + wakka_extension ) end if wend close #h @@ -72,21 +72,23 @@ function ReadIndex( byref f as const string ) as boolean end function '' -function ScanForDeleteMe _ +function ShouldRemove _ ( _ - filename as const string _ + byref path as const string, _ + byref filename as const string, _ + byval doscan as const boolean _ ) as boolean - dim sBody as string - dim chk as string = "!!! DELETE ME !!!" - - sBody = LoadFileAsString( filename ) - if( left( ucase( ltrim( sBody, any " " & chr(9))), len( chk ) ) = chk ) then - function = true - else - function = false + if( filehash.test( lcase(filename) ) ) then + if( doscan ) then + dim sBody as string = LoadFileAsString( path + filename ) + return left( ucase( ltrim( sBody, any " " & chr(9))), len( DELETE_ME_SENTINEL ) ) = DELETE_ME_SENTINEL + end if + return false end if + return true + end function '' @@ -100,41 +102,36 @@ sub DeleteExtraFiles _ byref wiki_url as const string _ ) - dim d as string, i as integer - dim remove as boolean - dim pagename as string - if( bHTML ) then loghtml( "", TRUE ) loghtml( "" ) end if - d = dir( path + "*.wakka" ) + dim d as string = dir( path + "*." + wakka_extension ) while( d > "" ) - pagename = left( d, len(d) - len(".wakka") ) - - if( filehash.test( lcase(d) ) = FALSE ) then - remove = true - elseif( ScanForDeleteMe( path + d ) ) then - remove = true - else - remove = false - end if + if( ShouldRemove( path, d, doscan ) ) then - if( bHTML and remove ) then - loghtml( "" + pagename + "/delete
" ) - end if + if( bHTML ) then + dim pagename as string = left( d, len(d) - len("." + wakka_extension) ) + loghtml( "" + pagename + "/delete
" ) + end if - if( remove ) then dim n as string = ReplacePathChar( path + d, asc("/") ) if( isgit ) then print "Removing '" + n + "'" + dim cmd as string = !"git -C \"" & path & !"\" rm \"" + n + !"\"" + if( app_opt.verbose ) then + print " SHELL: " & cmd + end if if( nodelete = FALSE ) then - shell !"git -C \"" & path & !"\" rm \"" + n + !"\"" + shell cmd end if else print "Deleting '" + path + d + "'" + if( app_opt.verbose ) then + print " KILL: " & n + end if if( nodelete = FALSE ) then kill n end if @@ -192,8 +189,8 @@ if( app_opt.help ) then print print "options:" cmd_opts_show_help_item( "-n", "only print what would happen but don't actually delete any files" ) - cmd_opts_show_help_item( "-scan", "scan page for !!! DELETE ME !!!" ) - cmd_opts_show_help_item( "-html", "write 'delete.html' helper file" ) + cmd_opts_show_help_item( "-scan", "scan page for " + DELETE_ME_SENTINEL ) + cmd_opts_show_help_item( "-html", "write '" + def_output_file + "' helper file" ) cmd_opts_show_help_item( "-git", "use 'git rm' instead of file system delete" ) print cmd_opts_show_help( "delete extra files in" ) diff --git a/doc/fbchkdoc/makefile b/doc/fbchkdoc/makefile index 914e51f8a4..baca92656e 100644 --- a/doc/fbchkdoc/makefile +++ b/doc/fbchkdoc/makefile @@ -50,7 +50,8 @@ TEMP_FILES := \ mkerrtxt$(EXEEXT) \ mkerrtxt.bas \ imagelist.txt \ - imagepages.txt + imagepages.txt \ + delete.html HEADERS := $(wildcard *.bi) DEPS = ../libfbdoc/libfbdoc.a $(HEADERS)