diff --git a/ChangeLog.txt b/ChangeLog.txt index f78c1e96bd..8ff8d35637 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,14 +1,73 @@ -/* - * $Id$ - */ - -/* Read doc/howtorep.txt and use this format for entry headers: - YYYY-MM-DD HH:MM UTC[-|+]hhmm Your Full Name (your_email address) - 2013-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) - See copyright/license at the end of the file. - Encoding: UTF-8 (No BOM) Notation (in 5th position): +/* Encoding: UTF-8 (No BOM) Notation (in 5th position): * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment - */ + Entries may not always be in chronological/commit order. + See license at the end of file. */ + +2017-09-08 18:22 UTC Viktor Szakats (vszakats users.noreply.github.com) + * bin/commit.hb + * config/detect.mk + * config/detfun.mk + * config/detplat.mk + * config/dir.mk + * config/dirsh.mk + * config/global.mk + * config/globsh.mk + * config/instsh.mk + * config/lang.hb + * config/lang2po.hb + * config/po2lang.hb + * config/postinst.hb + * contrib/hbexpat/tests/tohash.prg + * contrib/hbformat/utils/hbformat.ini + * contrib/hbmisc/hbedit.prg + * contrib/hbmxml/tests/testmxml.prg + * contrib/hbnetio/utils/hbnetio/_console.prg + * contrib/hbnetio/utils/hbnetio/_winsvc.prg + * contrib/hbnetio/utils/hbnetio/hbnetio.prg + * contrib/hbnetio/utils/hbnetio/netiomgm.hb + * contrib/hbwin/tests/ole.prg + * contrib/hbwin/tests/oletst2.js + * contrib/hbwin/tests/oletst2.vbs + * contrib/hbxpp/doc/en/binnumx.txt + * contrib/hbxpp/doc/en/dbcmdx.txt + * contrib/xhb/htmutil.prg + * contrib/xhb/tfile.prg + * contrib/xhb/tframe.prg + * contrib/xhb/thtm.prg + * ChangeLog.txt + * debian/copyright + * doc/class_tp.txt + * doc/hdr_tpl.txt + * doc/xhb-diff.txt + * LICENSE.txt + * package/harbour-wce.spec.in + * package/harbour-win.spec.in + * package/harbour.spec + * package/mpkg_rpm_wce.sh + * package/mpkg_rpm_win.sh + * package/mpkg_rpm.sh + * package/mpkg_src.sh + * package/mpkg_ver.sh + * src/rtl/achoice.prg + * src/rtl/getsys53.prg + * src/rtl/tgetlist.prg + * src/rtl/tlabel.prg + * src/rtl/tmenusys.prg + * tests/hbdoc.prg + * tests/langmsg.prg + * tests/rto_get.prg + * tests/rto_tb.prg + + doc/en/ati.txt + + doc/en/dirdrive.txt + + doc/en/hashfunc.txt + + doc/en/hbtoken.txt + + doc/en/left.txt + + doc/en/proc.txt + + doc/en/strtran.txt + + doc/en/transfrm.txt + + doc/en/typefile.txt + * doc/en/* + * more partial sync with 3.4 fork 2017-09-08 16:00 UTC Viktor Szakats (vszakats users.noreply.github.com) * * @@ -28,7 +87,8 @@ include. No 3rd party code, no make files, and with just a few exceptions, no 'tests' code was touched. - certain components were not touched were 3.4 diverged too much - already, like f.e. hbmk2, hbssl, hbcurl, hbexpat + already, like f.e. hbmk2, hbssl, hbcurl, hbexpat, hbnf, hbhttpd, + etc. - the goal was that no actual program logic should be altered by these changes. Except some possible minor exceptions, any such change is probably a bug in this patch. diff --git a/LICENSE.txt b/LICENSE.txt index 14f857708c..3968e98a9f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -39,7 +39,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this software; see the file LICENSE.txt. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/). +Boston, MA 02111-1307 USA (or visit the website https://www.gnu.org/). As a special exception, the Harbour Project gives permission for additional uses of the text contained in its release of Harbour. @@ -73,7 +73,7 @@ There is no one single license that applies to the Harbour Project contrib files. Some files use the Harbour Project Compiler license. Some files use the Harbour Project Library license. Some files use the old Harbour Project Library license. Some files may even use other -types of free software or open source software licenses. Some files +types of free software or open source software licenses. Some files have been donated to the public domain. If you use any of the contrib files, you need to investigate the license that applies to each file. diff --git a/bin/commit.hb b/bin/commit.hb index 71f049b111..2c4bb90163 100755 --- a/bin/commit.hb +++ b/bin/commit.hb @@ -1,6 +1,6 @@ -#!/usr/bin/hbmk2 +#!/usr/bin/env hbmk2 /* - * Commit preparer + * Commit preparer and source checker/fixer * * Copyright 2012-2013 Viktor Szakats (vszakats.net/harbour) * @@ -15,9 +15,9 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA (or visit - * their web site at https://www.gnu.org/). + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). * */ diff --git a/config/detect.mk b/config/detect.mk index 7bb1ea7cf9..17ca748644 100644 --- a/config/detect.mk +++ b/config/detect.mk @@ -1,11 +1,11 @@ # --------------------------------------------------------------- # Copyright 2009 Viktor Szakats (vszakats.net/harbour) -# See COPYING.txt for licensing terms. -# -# This make file will detect optional 3rd party components -# used in Harbour core code. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- +# This makefile will detect optional 3rd party components +# used in Harbour core code. + # config/conf.mk if present, is able to override HB_HAS_* values. ifeq ($(DETECT_MK_),) diff --git a/config/detfun.mk b/config/detfun.mk index e728d65ed2..ea441f2d22 100644 --- a/config/detfun.mk +++ b/config/detfun.mk @@ -1,11 +1,11 @@ # --------------------------------------------------------------- # Copyright 2009 Viktor Szakats (vszakats.net/harbour) -# See COPYING.txt for licensing terms. -# -# This make file will detect optional 3rd party components -# used in Harbour core code. Generic function. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- +# This makefile will detect optional 3rd party components +# used in Harbour core code. Generic function. + # USAGE: # ON CALL: # _DET_DSP_NAME - human readable name of 3rd party component. @@ -32,7 +32,7 @@ # - _DET_RES_TEXT with human readable detection result. # - variable name specified in _DET_VAR_HAS_ (typically "HB_HAS_*") will # have any these values: -# (empty) - we can't use this component +# (empty) - we cannot use this component # - component headers were found at these locations (typically one) # - variable name specified in _DET_VAR_HAS_ + "_LOCAL" (typically "HB_HAS_*_LOCAL") will # be non-empty if we're using the locally hosted version of the package. diff --git a/config/detplat.mk b/config/detplat.mk index f5eedd107b..66f7975990 100644 --- a/config/detplat.mk +++ b/config/detplat.mk @@ -1,6 +1,6 @@ # --------------------------------------------------------------- # Copyright 2009 Viktor Szakats (vszakats.net/harbour) -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- ifneq ($(findstring MINGW,$(_DETPLAT_STR)),) diff --git a/config/dir.mk b/config/dir.mk index 0d29cb3542..ec27b63c60 100644 --- a/config/dir.mk +++ b/config/dir.mk @@ -20,7 +20,7 @@ ifeq ($(JOB_SRV),NO) else - # NOTE: The empty line directly before 'endef' HAVE TO exist! + # NOTE: The empty line directly before 'endef' HAS TO exist! # It causes that every command will be separated by LF define dir_mk @$(MK) $(MKFLAGS) -C $(dir) $@ diff --git a/config/dirsh.mk b/config/dirsh.mk index d0539893d0..a1a69a69d1 100644 --- a/config/dirsh.mk +++ b/config/dirsh.mk @@ -26,7 +26,7 @@ endif ifeq ($(HB_SHELL),dos) -# NOTE: The empty line directly before 'endef' HAVE TO exist! +# NOTE: The empty line directly before 'endef' HAS TO exist! # It causes that every command will be separated by LF define dir_mk @$(MK_OS) $(MKFLAGS) -C $(file) $@ diff --git a/config/global.mk b/config/global.mk index 7d5eca2362..58f2c799a7 100644 --- a/config/global.mk +++ b/config/global.mk @@ -3,22 +3,20 @@ # See LICENSE.txt for licensing terms. # --------------------------------------------------------------- -# --------------------------------------------------------------- # GNU make docs: # https://www.gnu.org/software/make/manual/make.html -# http://www.wanderinghorse.net/computing/make/ -# http://www.jgc.org/feeds/topic-gnumake.xml -# http://lists.gnu.org/archive/html/help-make/ -# http://make.paulandlesley.org/ +# http://wanderinghorse.net/computing/make/ +# https://blog.jgc.org/2013/02/updated-list-of-my-gnu-make-articles.html +# https://lists.gnu.org/archive/html/help-make/ +# http://make.mad-scientist.net/ # Portable shell programming: # https://www.gnu.org/software/autoconf/manual/html_node/Portable-Shell.html # https://www.gnu.org/software/bash/manual/bashref.html -# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html +# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html # GNU coding standards: # https://www.gnu.org/prep/standards/standards.html # GNU Make NEWS: -# http://cvs.savannah.gnu.org/viewvc/make/NEWS?root=make&view=markup -# --------------------------------------------------------------- +# https://git.savannah.gnu.org/cgit/make.git/tree/NEWS # NOTE: $(realpath/abspath) need GNU Make 3.81 or upper # NOTE: $(eval) needs GNU Make 3.80 or upper @@ -43,7 +41,7 @@ endif # Arbitrary pattern which we do not expect to occur in real-world path names substpat := !@!@ -# This is not strictly necessary, but it does signficantly reduce +# This is not strictly necessary, but it does significantly reduce # the number of rules that make has to evaluate otherwise, which may give # a performance boost on a slow system. .SUFFIXES: @@ -326,7 +324,7 @@ else endif # NOTE: This can be need if we want to run some internal command which are -# missing from GNU Make's internal autodetection list. Like 'move' on +# missing from GNU Make's internal auto-detection list. Like 'move' on # non-*nix shells. [vszakats] CMDPREF := ifneq ($(HB_SHELL),sh) @@ -517,13 +515,13 @@ ifeq ($(HB_PLATFORM),) endif endif ifneq ($(HB_PLATFORM),) - HB_PLAT_AUTO := (autodetected) + HB_PLAT_AUTO := (auto-detected) endif endif HB_COMPILER_ORI := $(HB_COMPILER) -# enable CC autodetection in *nix cross builds +# enable CC auto-detection in *nix cross builds HB_CC_DET := ifneq ($(HB_HOST_PLAT),$(HB_PLATFORM)) ifeq ($(filter $(HB_HOST_PLAT),win dos os2),) @@ -983,7 +981,7 @@ ifeq ($(HB_COMPILER),) endif endif - # autodetect watcom platform by looking at the header path config + # auto-detect watcom platform by looking at the header path config ifeq ($(HB_COMPILER),watcom) ifneq ($(call find_in_path_prw,os2.h,$(INCLUDE)),) HB_PLATFORM := os2 @@ -999,7 +997,7 @@ ifeq ($(HB_COMPILER),) endif endif -# autodetect CC values for given platform/compiler +# auto-detect CC values for given platform/compiler ifneq ($(HB_CC_DET),) ifeq ($(HB_PLATFORM)-$(HB_COMPILER),win-mingw) @@ -1265,7 +1263,7 @@ endif ifeq ($(HB_COMPILER_ORI),) ifneq ($(HB_COMPILER),) HB_COMP_PATH := $(subst $(substpat), ,$(dir $(firstword $(subst $(subst x, ,x),$(substpat),$(HB_COMP_PATH))))) - HB_COMP_AUTO := (autodetected$(if $(HB_COMP_PATH),: $(HB_COMP_PATH),)$(if $(HB_CCPREFIX), [$(HB_CCPREFIX)*],)$(if $(HB_CCSUFFIX), [*$(HB_CCSUFFIX)],)) + HB_COMP_AUTO := (auto-detected$(if $(HB_COMP_PATH),: $(HB_COMP_PATH),)$(if $(HB_CCPREFIX), [$(HB_CCPREFIX)*],)$(if $(HB_CCSUFFIX), [*$(HB_CCSUFFIX)],)) HB_COMP_VERD := $(if $(HB_COMPILER_VER), (v$(HB_COMPILER_VER)),) endif endif @@ -1274,10 +1272,10 @@ export HB_CCPREFIX export HB_CCSUFFIX ifeq ($(HB_PLATFORM),) - $(error ! HB_PLATFORM not set, could not autodetect) + $(error ! HB_PLATFORM not set, could not auto-detect) endif ifeq ($(HB_COMPILER),) - $(error ! HB_COMPILER not set, could not autodetect) + $(error ! HB_COMPILER not set, could not auto-detect) endif export HB_PLATFORM @@ -1289,7 +1287,7 @@ ifneq ($(HB_COMP_PATH),) export HB_COMP_PATH_PUB := $(HB_COMP_PATH) endif -# Always autodetect bcc location (hack) +# Always auto-detect bcc location (hack) ifeq ($(HB_COMP_PATH_PUB),) ifeq ($(HB_PLATFORM)-$(HB_COMPILER),win-bcc) HB_COMP_PATH := $(call find_in_path_raw,bcc32.exe) @@ -1415,10 +1413,10 @@ ifeq ($(HB_INIT_DONE),) ifeq ($(HB_COMPILER),djgpp) # NOTE: We do need DJGPP build of GNU Make on Windows # systems. The reason is that this uses special - # trick to pass command lines to other DJGPP tools - # (like gcc) to overcome 126 chars MS-DOS command + # trick to pass command-lines to other DJGPP tools + # (f.e. to gcc) to overcome 126 chars MS-DOS command # line length limitation. IOW: mingw32-make.exe - # wo not work with DJGPP on Windows hosts. + # will not work with DJGPP on Windows hosts. # [vszakats] ifeq ($(HB_HOST_PLAT),win) ifneq ($(HB_MAKE_PLAT),dos) @@ -1507,7 +1505,7 @@ ifneq ($(HB_HOST_PLAT)$(HB_HOST_CPU),$(HB_PLATFORM)$(HB_CPU)) # 'Windows host, Cygwin target' ifneq ($(HB_HOST_PLAT)-$(HB_PLATFORM),win-cygwin) HB_CROSS_BUILD := yes - # Try to autosetup + # Try to auto-setup ifneq ($(HB_SRC_ROOTPATH),) _HB_ROOT_BIN := $(HB_SRC_ROOTPATH) else @@ -1698,10 +1696,11 @@ ifeq ($(HB_BUILD_PKG),yes) endif endif - # HB_TOP - dir where packages will be created (root of Harbour source tree) + # HB_TOP - dir where release packages will be + # created (root of Harbour source tree) # HB_INSTALL_PKG_ROOT - dir which has to be packed - # HB_PKGNAME - name of the install package - # HB_INSTALL_PREFIX - dir where Harbour dirs will be created + # HB_PKGNAME - name of the release package + # HB_INSTALL_PREFIX - dir where Harbour subdirectories will be created # # # @@ -1763,7 +1762,7 @@ else else HB_INSTALL_PREFIX := /usr/local endif - # Add postfix for cross builds + # Add suffix for cross builds ifneq ($(HB_HOST_PLAT),$(HB_PLATFORM)) HB_INSTALL_PREFIX := $(HB_INSTALL_PREFIX)/harbour-$(HB_PLATFORM)-$(HB_COMPILER) endif diff --git a/config/globsh.mk b/config/globsh.mk index eafb7591b4..1d628c94d1 100644 --- a/config/globsh.mk +++ b/config/globsh.mk @@ -1,13 +1,11 @@ # --------------------------------------------------------------- # Copyright 2009 Viktor Szakats (vszakats.net/harbour) (rework) -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- -# --------------------------------------------------------------- # See batch docs here: -# http://www.computerhope.com/batch.htm +# https://www.computerhope.com/batch.htm # http://www.robvanderwoude.com/batchcommands.php -# --------------------------------------------------------------- ifneq ($(HB_SHELL),sh) diff --git a/config/instsh.mk b/config/instsh.mk index 2f4e3bfb5f..c674c38f41 100644 --- a/config/instsh.mk +++ b/config/instsh.mk @@ -6,7 +6,7 @@ INSTALL_DIR := $(strip $(INSTALL_DIR)) ifneq ($(INSTALL_FILES),) # Empty install list ifeq ($(INSTALL_DIR),) # Empty install dir - INSTALL_RULE := @$(ECHO) $(ECHOQUOTE)! Can't install, install dir isn't set$(ECHOQUOTE) + INSTALL_RULE := @$(ECHO) $(ECHOQUOTE)! Cannot install, install dir is not set$(ECHOQUOTE) else _SAME_DIR := @@ -40,7 +40,7 @@ ifeq ($(HB_SHELL),sh) @$(MDP) $(INSTALL_DIR_OS); \ if [ ! -d "$(INSTALL_DIR_OS)" ]; \ then \ - $(ECHO) "! Can't install, path not found: '$(INSTALL_DIR_OS)'" 1>&2; \ + $(ECHO) "! Cannot install, path not found: '$(INSTALL_DIR_OS)'" 1>&2; \ $(FALSE); \ else \ for i in $(INSTALL_FILES); \ @@ -51,7 +51,7 @@ ifeq ($(HB_SHELL),sh) $(CP) $$i $(INSTALL_DIR_OS); \ true; \ else \ - $(ECHO) "! Can't install $$i, not found" 1>&2; \ + $(ECHO) "! Cannot install $$i, not found" 1>&2; \ fi \ done \ fi @@ -76,7 +76,7 @@ ifeq ($(HB_SHELL),os2) $(foreach file,$(INSTALL_FILES_OS),$(inst_file)) endef - # NOTE: The empty line directly before 'endef' HAVE TO exist! + # NOTE: The empty line directly before 'endef' HAS TO exist! # It causes that every command will be separated by LF define inst_file -@$(CP) $(file) $(INSTALL_DIR_OS) @@ -94,7 +94,7 @@ ifeq ($(HB_SHELL),dos) $(foreach file,$(INSTALL_FILES_OS),$(inst_file)) endef - # NOTE: The empty line directly before 'endef' HAVE TO exist! + # NOTE: The empty line directly before 'endef' HAS TO exist! # It causes that every command will be separated by LF define inst_file -@$(CP) $(file) $(INSTALL_DIR_OS) diff --git a/config/lang.hb b/config/lang.hb index 5f99f6d46c..2996c95b11 100644 --- a/config/lang.hb +++ b/config/lang.hb @@ -1,3 +1,4 @@ +#!/usr/bin/env hbmk2 /* * Manage translations and automatic doc generation * @@ -14,18 +15,17 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA (or visit - * their web site at https://www.gnu.org/). + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). * */ -/* - * Requires: +/* Requires: * - curl (built with SSL) * - hbmk2 and hbi18n in PATH * - the target .prg be runnable as script (for doc_make only) - * Reference: http://help.transifex.com/features/api/api-v2.1.html + * Reference: https://docs.transifex.com/api/introduction */ #pragma -w3 @@ -54,12 +54,12 @@ PROCEDURE Main( cCommand, cMain, ... ) iif( Empty( hb_FNameName( cMain := hb_DirSepToOS( cMain ) ) ), cMain + hb_FNameName( hb_DirSepDel( cMain ) ) + ".prg", cMain ), ; ... ) ELSE - ? "unknown command or missing target" + ? "unrecognized command or missing target" ENDIF RETURN -/* --------------------------------------------- */ +/* --- */ STATIC PROCEDURE doc_make( cMain ) @@ -101,7 +101,7 @@ STATIC PROCEDURE doc_make( cMain ) STATIC FUNCTION FToNativeEOL( cFile ) RETURN hb_MemoWrit( cFile, StrTran( hb_MemoRead( cFile ), e"\n", hb_eol() ) ) -/* --------------------------------------------- */ +/* --- */ STATIC PROCEDURE src_push( cMain ) @@ -133,7 +133,7 @@ STATIC PROCEDURE src_push( cMain ) #endif ELSE cContent := hb_StrFormat( ; - '#, c-format' + hb_eol() + ; + "#, c-format" + hb_eol() + ; 'msgid ""' + hb_eol() + ; 'msgstr ""' + hb_eol() + ; '"Project-Id-Version: %1$s\n"' + hb_eol() + ; @@ -183,7 +183,7 @@ STATIC FUNCTION POT_Sort( cFileName ) RETURN .F. -/* --------------------------------------------- */ +/* --- */ STATIC PROCEDURE trs_pull( cMain ) @@ -344,7 +344,7 @@ STATIC FUNCTION StrUnspace( cString ) cChar := SubStr( cString, tmp, 1 ) - IF !( cChar == " " ) .OR. !( cCharPrev == " " ) + IF ! cChar == " " .OR. ! cCharPrev == " " cResult += cChar ENDIF @@ -367,7 +367,7 @@ STATIC FUNCTION PO_Clean( cFNSource, cFNTarget, ... ) RETURN .F. -/* --------------------------------------------- */ +/* --- */ STATIC PROCEDURE trs_push( cMain ) @@ -420,7 +420,7 @@ STATIC PROCEDURE trs_push( cMain ) RETURN -/* --------------------------------------------- */ +/* --- */ STATIC FUNCTION GetJSON( cString ) @@ -519,7 +519,7 @@ STATIC FUNCTION LoadPar( cMain ) RETURN hPar -/* --------------------------------------------- */ +/* --- */ #include "lang2po.hb" #include "po2lang.hb" diff --git a/config/lang2po.hb b/config/lang2po.hb index 6bc0746a46..a1beae60fc 100644 --- a/config/lang2po.hb +++ b/config/lang2po.hb @@ -1,7 +1,24 @@ +#!/usr/bin/env hbmk2 + /* * Converts core lang modules to standard .po files * - * Copyright 2013 Viktor Szakats (vszakats.net/harbour) + * Copyright 2013-2017 Viktor Szakats (vszakats.net/harbour) + * + * 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 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). * */ @@ -116,7 +133,7 @@ STATIC FUNCTION ISO_TimeStamp() LOCAL nOffset := hb_UTCOffset() RETURN hb_StrFormat( "%1$s%2$s%3$02d%4$02d", ; - hb_TToC( hb_DateTime(), "YYYY-MM-DD", "HH:MM" ), ; + hb_TToC( hb_DateTime(), "yyyy-mm-dd", "hh:mm" ), ; iif( nOffset < 0, "-", "+" ), ; Int( Abs( nOffset ) / 3600 ), ; Int( Abs( nOffset ) % 3600 / 60 ) ) @@ -159,7 +176,7 @@ STATIC FUNCTION ConvToC_2( cStr ) STATIC FUNCTION Comment( nPos ) SWITCH nPos - CASE 22 ; RETURN "Colums must be aligned to positions: 1, 19, 32, 48" + CASE 22 ; RETURN "Columns must be aligned to character positions: 1, 19, 32, 48" CASE 25 CASE 26 CASE 27 ; RETURN "Keep the '*' decorations and internal space padding intact." diff --git a/config/po2lang.hb b/config/po2lang.hb index 24c14858d4..ff169886c7 100644 --- a/config/po2lang.hb +++ b/config/po2lang.hb @@ -1,8 +1,25 @@ +#!/usr/bin/env hbmk2 + /* * Converts .po files to core lang modules * * Copyright 2013 Viktor Szakats (vszakats.net/harbour) * + * 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 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). + * */ #pragma -w3 @@ -35,7 +52,7 @@ STATIC FUNCTION POToLang( cFileIn, cFileOut, cLang ) __i18n_potArrayClean( aTrans,,, {| cTrs, cOri | ProcessTrs( @cContent, cTrs, cOri, @cTranslator, @nPos, cLang ) } ) cContent := "/* Last Translator: " + MaskEMail( cTranslator ) + " */" + hb_eol() + ; - Left( cContent, Len( cContent ) - Len( "," ) - Len( hb_eol() ) ) + hb_eol() + ; + hb_StrShrink( cContent, Len( "," ) + Len( hb_eol() ) ) + hb_eol() + ; StrTran( StrTran( _end(), e"\n", hb_eol() ), "{LNG}", Upper( cLang ) ) hb_MemoWrit( cFileOut, cContent ) @@ -48,14 +65,12 @@ STATIC FUNCTION POToLang( cFileIn, cFileOut, cLang ) RETURN .F. STATIC FUNCTION MaskEMail( cEMail ) + RETURN hb_StrReplace( cEMail, { ; + "@" => " " , ; + "<" => "(" , ; + ">" => ")" } ) - cEMail := StrTran( cEMail, "@", " " ) - cEMail := StrTran( cEMail, "<", "(" ) - cEMail := StrTran( cEMail, ">", ")" ) - - RETURN cEMail - -STATIC FUNCTION ProcessTrs( /* @ */ cContent, cTrs, cOri, /* @ */ cTranslator, /* @ */ nPos, cLang ) +STATIC PROCEDURE ProcessTrs( /* @ */ cContent, cTrs, cOri, /* @ */ cTranslator, /* @ */ nPos, cLang ) STATIC sc_hEmpty := { ; 3 => { "", "UTF8", "" }, ; @@ -78,32 +93,32 @@ STATIC FUNCTION ProcessTrs( /* @ */ cContent, cTrs, cOri, /* @ */ cTranslator, / ENDSWITCH IF tmp != NIL - cContent += iif( nPos > 0, hb_eol(), "" ) + Space( 6 ) + tmp + hb_eol() + hb_eol() + cContent += iif( nPos > 0, hb_eol(), "" ) + Space( 2 * 3 ) + tmp + hb_eol() + hb_eol() ENDIF IF nPos == 0 cTranslator := hb_regexAll( "Last-Translator: ([^\n]*)", cTrs,,,,, .T. )[ 1 ][ 2 ] - IF cTranslator == "foo bar " + IF cTranslator == "foo bar " cTranslator := "" ENDIF - cContent += Space( 6 ) + ConvToC( cLang ) + "," + hb_eol() + cContent += Space( 2 * 3 ) + ConvToC( cLang ) + "," + hb_eol() ++nPos ELSE - IF Len( cTrs ) == 0 + IF cTrs == "" cTrs := cOri ENDIF - cContent += Space( 6 ) + ConvToC( cTrs ) + "," + hb_eol() + cContent += Space( 2 * 3 ) + ConvToC( cTrs ) + "," + hb_eol() ++nPos IF nPos $ sc_hEmpty - FOR tmp := 1 TO Len( sc_hEmpty[ nPos ] ) - cContent += Space( 6 ) + ConvToC( sc_hEmpty[ nPos ][ tmp ] ) + "," + hb_eol() + FOR EACH tmp IN sc_hEmpty[ nPos ] + cContent += Space( 2 * 3 ) + ConvToC( tmp ) + "," + hb_eol() NEXT nPos += Len( sc_hEmpty[ nPos ] ) ENDIF ENDIF - RETURN NIL + RETURN STATIC FUNCTION ConvToC( cStr ) RETURN '"' + hb_StrReplace( cStr, { '"' => '\"' } ) + '"' diff --git a/config/postinst.hb b/config/postinst.hb index 93386a4ea7..09026eb3fa 100644 --- a/config/postinst.hb +++ b/config/postinst.hb @@ -1,10 +1,27 @@ +#!/usr/bin/env hbmk2 + /* * This Harbour script is part of the GNU Make-based build system. * WARNING: Running it separately is not supported. * * Copyright 2009-2010 Viktor Szakats (vszakats.net/harbour) * Copyright 2003 Przemyslaw Czerpak (druzus/at/priv.onet.pl) (embedded autoinstall bash script) - * See LICENSE.txt for licensing terms. + * + * 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 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). + * */ #pragma -w3 @@ -51,7 +68,7 @@ PROCEDURE Main( ... ) /* Installing some misc files */ tmp := GetEnvC( "HB_INSTALL_DOC" ) - IF !( tmp == "no" ) + IF ! tmp == "no" IF GetEnvC( "HB_PLATFORM" ) $ "win|wce|os2|dos" tmp := GetEnvC( "HB_INSTALL_PREFIX" ) ENDIF @@ -130,7 +147,7 @@ PROCEDURE Main( ... ) ENDIF ENDIF - IF !( GetEnvC( "HB_PLATFORM" ) $ "win|wce|os2|dos|cygwin" ) .AND. ; + IF ! GetEnvC( "HB_PLATFORM" ) $ "win|wce|os2|dos|cygwin" .AND. ; ! Empty( GetEnvC( "HB_INSTALL_DYN" ) ) .AND. ; hb_FileExists( hb_DirSepToOS( GetEnvC( "HB_DYNLIB_DIR" ) ) + hb_ps() + GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_BASE" ) + GetEnvC( "HB_DYNLIB_POST" ) + GetEnvC( "HB_DYNLIB_EXT" ) + GetEnvC( "HB_DYNLIB_PEXT" ) ) @@ -193,7 +210,7 @@ PROCEDURE Main( ... ) /* Creating docs for core */ - IF ! Empty( tmp := GetEnvC( "HB_INSTALL_DOC" ) ) .AND. !( tmp == "no" ) + IF ! Empty( tmp := GetEnvC( "HB_INSTALL_DOC" ) ) .AND. ! tmp == "no" OutStd( "! Compiling core documentation (.hbd)..." + hb_eol() ) @@ -209,7 +226,7 @@ PROCEDURE Main( ... ) mk_hbr( tmp ) ENDIF - /* Creating install packages */ + /* Creating release packages */ IF GetEnvC( "HB_BUILD_PKG" ) == "yes" .AND. ; ! Empty( GetEnvC( "HB_TOP" ) ) @@ -290,7 +307,7 @@ PROCEDURE Main( ... ) hb_cwd( cOldDir ) - IF !( GetEnvC( "HB_PLATFORM" ) == "dos" ) + IF ! GetEnvC( "HB_PLATFORM" ) == "dos" tmp := GetEnvC( "HB_TOP" ) + hb_ps() + cTar_Name + ".inst.sh" @@ -331,10 +348,8 @@ PROCEDURE Main( ... ) /* Executing user postinst configuration script */ IF ! Empty( tmp := GetEnvC( "HB_INSTALL_SCRIPT" ) ) - mk_hb_processRun( tmp ) ENDIF - ELSE /* Regenerating extern headers */ @@ -504,7 +519,7 @@ STATIC FUNCTION mk_extern_core() IF GetEnvC( "HB_REBUILD_EXTERN" ) == "yes" .AND. ; ! Empty( GetEnvC( "HB_DYNLIB_BASE" ) ) - /* TOFIX: Use list of libs instead of dynamic lib */ + /* FIXME: Use list of libs instead of dynamic lib */ IF ( aExtern := __hb_extern_get_list( hb_DirSepToOS( GetEnvC( "HB_DYNLIB_DIR" ) ) + hb_ps() + GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_BASE" ) + GetEnvC( "HB_DYNLIB_POST" ) + GetEnvC( "HB_DYNLIB_EXT" ) + GetEnvC( "HB_DYNLIB_PEXT" ) ) ) != NIL OutStd( "! Generating core extern headers..." + hb_eol() ) diff --git a/contrib/hbexpat/tests/tohash.prg b/contrib/hbexpat/tests/tohash.prg index f3c1405722..59bf2b8c14 100644 --- a/contrib/hbexpat/tests/tohash.prg +++ b/contrib/hbexpat/tests/tohash.prg @@ -1,9 +1,4 @@ -/* - * - * Copyright 2010 Viktor Szakats (vszakats.net/harbour) - * - * See COPYING.txt for licensing terms. - */ +/* Copyright 2010 Viktor Szakats (vszakats.net/harbour) */ #require "hbexpat" diff --git a/contrib/hbformat/utils/hbformat.ini b/contrib/hbformat/utils/hbformat.ini index 2f24711ed0..d1caf58ce3 100644 --- a/contrib/hbformat/utils/hbformat.ini +++ b/contrib/hbformat/utils/hbformat.ini @@ -1,4 +1,3 @@ - # Eol: -1 - no change, 0 - OS default, 1 - DOS, 2 - UNIX #nEol = -1 diff --git a/contrib/hbmisc/hbedit.prg b/contrib/hbmisc/hbedit.prg index 90b69d5e90..dcb7e02490 100644 --- a/contrib/hbmisc/hbedit.prg +++ b/contrib/hbmisc/hbedit.prg @@ -105,12 +105,10 @@ FUNCTION EditorTitle( oEdit, cTitle ) RETURN _cTitle -// // Sets // EDIT_EDIT - full edit mode // EDIT_VIEW - view only mode (no changes in text are allowed) // - FUNCTION EditorMode( oEdit, lMode ) LOCAL _lMode := oEdit[ E_MODE ] @@ -131,30 +129,24 @@ FUNCTION EditorSize( nSize ) RETURN _nSize -// // Appends passed text to the text already stored in editor // - PROCEDURE EditorAddText( oEdit, cText ) ed_AddText( oEdit[ E_EDIT ], cText ) RETURN -// // Sets new text in editor // - PROCEDURE EditorSetText( oEdit, cText ) ed_SetText( oEdit[ E_EDIT ], cText ) RETURN -// // Inserts passed text into editor starting from passed line number // - PROCEDURE EditorInsText( oEdit, cText, nLine ) IF nLine == NIL @@ -165,9 +157,8 @@ PROCEDURE EditorInsText( oEdit, cText, nLine ) RETURN -// // Retrieves the text from editor -// nCarret - specifies if soft carriage return (141/10) should be replaced by +// nCarRet - specifies if soft carriage return (141/10) should be replaced by // hard carriage returns (13/10) // @@ -180,38 +171,29 @@ FUNCTION EditorGetText( oEdit, nCarret ) // // Returns the line count stored in editor // - FUNCTION EditorLCount( oEdit ) - RETURN ed_LCount( oEdit[ E_EDIT ] ) -// // Returns the specified line of text from the editor // - FUNCTION EditorGetLine( oEdit, nLine ) - RETURN ed_GetLine( oEdit[ E_EDIT ], nLine ) -// // Returns the next line of text // // It can be used: // nLCount := EditorLCount( oEdit ) // cLine := EditorGetLine( oEdit, 1 ) // FOR i := 2 TO nLCount -// cLine := EditorNextLine( oEdit ) +// cLine := EditorNextLine( oEdit ) // NEXT // - FUNCTION EditorNextLine( oEdit ) - RETURN ed_GetNext( oEdit[ E_EDIT ] ) -// // Edit the specified file // -// xInput - the filename to edit or a handle to a file retrned by FOPEN +// xInput - the filename to edit or a handle to a file returned by FOpen() // cOutput - the name of the file created in 'save' operation // nLineLen - the line length // nHelp - the index into help subsystem @@ -263,7 +245,6 @@ FUNCTION EditorFile( xInput, cOutput, nLineLen, ; RETURN lSaved -// // Reads a text from a file into the editor // // oEditor - existing editor @@ -271,7 +252,7 @@ FUNCTION EditorFile( xInput, cOutput, nLineLen, ; // nOffset - the starting offset // nLen - the number of characters to read // lConv - specifies if some unprintable characters should be converted -// (NOTE: it was used to allow display charcters with ASCII code 27 and 26) +// (NOTE: it was used to allow display characters with ASCII code 27 and 26) // FUNCTION EditorRead( oEditor, nHandle, nOffset, nLen, lConv ) @@ -279,7 +260,6 @@ FUNCTION EditorRead( oEditor, nHandle, nOffset, nLen, lConv ) RETURN ed_ReadText( oEditor[ E_EDIT ], nHandle, nOffset, nLen, ; iif( lConv == NIL, .T., lConv ) ) -// // Start the editor // // oEdit - the editor object @@ -287,7 +267,6 @@ FUNCTION EditorRead( oEditor, nHandle, nOffset, nLen, lConv ) // lFrame - specifies if the frame around the editor should be displayed // nHelp - the help index into help subsystem // - FUNCTION EditorEdit( oEdit, lEdit, lFrame ) LOCAL nRow, nCol := 0, nKey, bKey, oBox, nCursor, nState @@ -331,13 +310,12 @@ FUNCTION EditorEdit( oEdit, lEdit, lFrame ) by oEditor[ E_EDIT ] - it is tricky solution to speed access (we don't need to pass the editor handle with every ed_*() call (Well... this editor was created when AT-286 computers worked in - its full glory :) - */ + its full glory :) */ ed_Config( oEdit[ E_EDIT ], nTop, nLeft, nBottom, nRight, 0, 0 ) DO WHILE .T. nRow := ed_Stabilize( oEdit[ E_EDIT ] ) // displays all visible lines - // It doesn't uses incremantal stabilization for performance reasons + // It doesn't uses incremental stabilization for performance reasons IF nRow != ed_Row( oEdit[ E_EDIT ] ) nRow := ed_Row( oEdit[ E_EDIT ] ) @@ -392,7 +370,6 @@ FUNCTION EditorEdit( oEdit, lEdit, lFrame ) SetCursor( nCursor ) RestBox( oBox ) - // HELPREST. RETURN lSaved diff --git a/contrib/hbmxml/tests/testmxml.prg b/contrib/hbmxml/tests/testmxml.prg index 43267cb4bc..9c3c9e1e48 100644 --- a/contrib/hbmxml/tests/testmxml.prg +++ b/contrib/hbmxml/tests/testmxml.prg @@ -5,11 +5,11 @@ * * These coded instructions, statements, and computer programs are the * property of Michael R Sweet and are protected by Federal copyright - * law. Distribution and use rights are outlined in the file "COPYING.txt" + * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is * missing or damaged, see the license at: * - * http://www.minixml.org/ + * https://www.msweet.org/projects.php?Z3 * * Harbour port Copyright (c) 2011 Tamas TEVESZ * @@ -30,10 +30,7 @@ STATIC s_aTypes := { ; STATIC s_aSAXEventCounts := { 0, 0, 0, 0, 0, 0 } -/* - * 'main()' - Main entry for test program. - */ - +/* Main entry for test program. */ PROCEDURE Main( cFileArg ) LOCAL hTree /* XML tree */ @@ -52,9 +49,7 @@ PROCEDURE Main( cFileArg ) QUIT ENDIF - /* - * Test the basic functionality... - */ + /* Test the basic functionality */ hTree := mxmlNewElement( MXML_NO_PARENT, "element" ) IF Empty( hTree ) diff --git a/contrib/hbnetio/utils/hbnetio/_console.prg b/contrib/hbnetio/utils/hbnetio/_console.prg index 69099fc0ad..1604692904 100644 --- a/contrib/hbnetio/utils/hbnetio/_console.prg +++ b/contrib/hbnetio/utils/hbnetio/_console.prg @@ -1,5 +1,5 @@ /* - * Harbour NETIO server management cmdline tool + * Harbour NETIO server management command-line tool * * Copyright 2009-2011 Viktor Szakats (vszakats.net/harbour) * @@ -14,9 +14,9 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA (or visit - * their web site at https://www.gnu.org/). + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). * */ @@ -57,7 +57,7 @@ PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword ) Set( _SET_SCOREBOARD, .F. ) Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) - Set( _SET_TIMEFORMAT, "HH:MM:SS" ) + Set( _SET_TIMEFORMAT, "hh:mm:ss" ) SetCancel( .F. ) @@ -143,11 +143,11 @@ PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword ) ELSE IF Left( cCommand, Len( netcliID ) + 1 ) == netcliID + "." IF ! Eval( netclictrl[ "cmd" ], netclictx, SubStr( cCommand, Len( netcliID ) + 2 ) ) - hbnetiocon_ToConsole( hb_StrFormat( "Error: Unknown command '%1$s'.", cCommand ) ) + hbnetiocon_ToConsole( hb_StrFormat( "Error: Unrecognized command '%1$s'.", cCommand ) ) ENDIF ELSE IF ! Eval( netclictrl[ "cmd" ], netclictx, cCommand ) - hbnetiocon_ToConsole( hb_StrFormat( "Error: Unknown command '%1$s'.", cCommand ) ) + hbnetiocon_ToConsole( hb_StrFormat( "Error: Unrecognized command '%1$s'.", cCommand ) ) ENDIF ENDIF ENDIF @@ -168,7 +168,7 @@ STATIC PROCEDURE ManageCursor( cCommand ) RETURN -/* Complete the command line, based on the first characters that the user typed. [vailtom] */ +/* Complete the command-line, based on the first characters that the user typed. [vailtom] */ STATIC PROCEDURE CompleteCmd( cCommand, hCommands ) LOCAL s := Lower( AllTrim( cCommand ) ) @@ -221,7 +221,7 @@ STATIC PROCEDURE ShowHelp( hCommands ) QQOut( "Press any key to continue..." ) Inkey( 0 ) - hb_Scroll( Row(), 0, Row(), MaxCol(), 0 ) + Scroll( Row(), 0, Row(), MaxCol() ) SetPos( Row(), 0 ) ENDIF NEXT diff --git a/contrib/hbnetio/utils/hbnetio/_winsvc.prg b/contrib/hbnetio/utils/hbnetio/_winsvc.prg index e17aac8ea1..9866123b40 100644 --- a/contrib/hbnetio/utils/hbnetio/_winsvc.prg +++ b/contrib/hbnetio/utils/hbnetio/_winsvc.prg @@ -14,9 +14,9 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA (or visit - * their web site at https://www.gnu.org/). + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). * */ @@ -73,20 +73,20 @@ PROCEDURE WinMain( ... ) OTHERWISE - netiosrv_Main( .T., ... ) /* Interactive */ + netiosrv_Main( .T., ... ) /* Interactive */ EXIT ENDSWITCH RETURN -PROCEDURE hbnetio_WinServiceEntry( ... ) +STATIC PROCEDURE hbnetio_WinServiceEntry( ... ) #if 0 LOCAL bSignal := {|| win_serviceGetStatus() != WIN_SERVICE_RUNNING } #endif - netiosrv_Main( .F., ... ) /* Non-interactive */ + netiosrv_Main( .F., ... ) /* Non-interactive */ win_serviceSetExitCode( 0 ) win_serviceStop() diff --git a/contrib/hbnetio/utils/hbnetio/hbnetio.prg b/contrib/hbnetio/utils/hbnetio/hbnetio.prg index a7d6b71952..331167a345 100644 --- a/contrib/hbnetio/utils/hbnetio/hbnetio.prg +++ b/contrib/hbnetio/utils/hbnetio/hbnetio.prg @@ -15,9 +15,9 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA (or visit - * their web site at https://www.gnu.org/). + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). * */ @@ -100,7 +100,7 @@ PROCEDURE netiosrv_Main( lUI, ... ) ENDIF Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) - Set( _SET_TIMEFORMAT, "HH:MM:SS.FFF" ) + Set( _SET_TIMEFORMAT, "hh:mm:ss.fff" ) HB_Logo() @@ -201,7 +201,7 @@ PROCEDURE netiosrv_Main( lUI, ... ) HB_Usage() RETURN OTHERWISE - netiosrv_LogEvent( hb_StrFormat( "Warning: Unknown command line parameter ignored: %1$s", cParam ) ) + netiosrv_LogEvent( hb_StrFormat( "Warning: Unrecognized command-line parameter ignored: %1$s", cParam ) ) ENDCASE NEXT @@ -423,7 +423,7 @@ STATIC FUNCTION netiosrv_callback( netiomgm, netiosrv, pConnectionSocket, lManag /* Handle positive filter */ IF ! Empty( netiosrv[ _NETIOSRV_hAllow ] ) hb_mutexLock( netiosrv[ _NETIOSRV_mtxFilters ] ) - IF !( cAddressPeer $ netiosrv[ _NETIOSRV_hAllow ] ) + IF ! cAddressPeer $ netiosrv[ _NETIOSRV_hAllow ] IF hb_HScan( netiosrv[ _NETIOSRV_hAllow ], {| tmp | hb_WildMatch( tmp, cAddressPeer ) } ) == 0 lBlocked := .T. ENDIF @@ -493,7 +493,7 @@ STATIC PROCEDURE netiosrv_conn_register( netiosrv, pConnectionSocket ) hb_mutexLock( netiosrv[ _NETIOSRV_mtxConnection ] ) - IF !( pConnectionSocket $ netiosrv[ _NETIOSRV_hConnection ] ) + IF ! pConnectionSocket $ netiosrv[ _NETIOSRV_hConnection ] netiosrv[ _NETIOSRV_hConnection ][ pConnectionSocket ] := nconn ENDIF @@ -733,7 +733,7 @@ STATIC FUNCTION netiomgm_rpc_filtermod( netiosrv, hList, lAdd, cAddress ) hb_mutexLock( netiosrv[ _NETIOSRV_mtxFilters ] ) IF lAdd - IF !( cAddress $ hList ) + IF ! cAddress $ hList hList[ cAddress ] := NIL ELSE lSuccess := .F. diff --git a/contrib/hbnetio/utils/hbnetio/netiomgm.hb b/contrib/hbnetio/utils/hbnetio/netiomgm.hb index fd8f31aad7..e037f1e4be 100644 --- a/contrib/hbnetio/utils/hbnetio/netiomgm.hb +++ b/contrib/hbnetio/utils/hbnetio/netiomgm.hb @@ -14,9 +14,9 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA (or visit - * their web site at https://www.gnu.org/). + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * (or visit their website at https://www.gnu.org/licenses/). * */ @@ -185,7 +185,7 @@ STATIC PROCEDURE hbnetiocon_waitStream( netiocli, bBlock ) /* in separate thread IF ! Empty( netiocli[ _NETIOCLI_pConnection ] ) IF hb_MilliSeconds() > nLastPing + 5000 /* Is connection alive? */ - BEGIN SEQUENCE WITH {| oError | Break( oError ) } + BEGIN SEQUENCE WITH __BreakBlock() netio_FuncExec( netiocli[ _NETIOCLI_pConnection ], "hbnetiomgm_ping" ) RECOVER hbnetiocon_dispevent( netiocli, "Connection lost." ) diff --git a/contrib/hbwin/tests/ole.prg b/contrib/hbwin/tests/ole.prg index 0c171b7d43..fd99081252 100644 --- a/contrib/hbwin/tests/ole.prg +++ b/contrib/hbwin/tests/ole.prg @@ -1,11 +1,10 @@ /* - * hbole library demo/test code + * OLE demo/test code * * Copyright 2007 Enrico Maria Giordano e.m.giordano at emagsoftware.it - * Copyright 2009 Mindaugas Kavaliauskas - * Copyright 2008 Viktor Szakats (vszakats.net/harbour) + * Copyright 2008-2017 Viktor Szakats (vszakats.net/harbour) * Exm_CDO(), Exm_OOOpen(), Exm_CreateShortcut() - * + * Copyright 2009 Mindaugas Kavaliauskas */ #require "hbwin" @@ -204,7 +203,7 @@ STATIC PROCEDURE Exm_MSOutlook2() FOR i := 1 TO 10 oMail:Recipients:Add( "Contact" + hb_ntos( i ) + ; - "" ) + "" ) NEXT oLista := oOL:CreateItem( 7 /* olDistributionListItem */ ) @@ -227,7 +226,7 @@ STATIC PROCEDURE Exm_IExplorer() oIE:Visible := .T. oIE:Navigate( "http://harbour-project.org" ) ELSE - ? "Error. IExplorer not available.", win_oleErrorText() + ? "Error. Internet Explorer not available.", win_oleErrorText() ENDIF RETURN @@ -244,7 +243,7 @@ STATIC PROCEDURE Exm_IExplorer2() hb_idleSleep( 0 ) ENDDO ELSE - ? "Error. IExplorer not available.", win_oleErrorText() + ? "Error. Internet Explorer not available.", win_oleErrorText() ENDIF RETURN @@ -386,13 +385,17 @@ STATIC FUNCTION OO_ConvertToURL( cString ) RETURN "file:" + cString -STATIC PROCEDURE Exm_CDO() +STATIC PROCEDURE Exm_CDO() /* STARTTLS not supported by CDO */ LOCAL oCDOMsg LOCAL oCDOConf + LOCAL cFrom + IF ( oCDOMsg := win_oleCreateObject( "CDO.Message" ) ) != NIL + cFrom := "from@example.org" + oCDOConf := win_oleCreateObject( "CDO.Configuration" ) oCDOConf:Fields( "http://schemas.microsoft.com/cdo/configuration/sendusing" ):Value := 2 // ; cdoSendUsingPort @@ -402,13 +405,13 @@ STATIC PROCEDURE Exm_CDO() oCDOConf:Fields:Update() oCDOMsg:Configuration := oCDOConf - oCDOMsg:BodyPart:Charset := "iso-8859-2" // "iso-8859-1" "utf-8" - oCDOMsg:To := "test@localhost" - oCDOMsg:From := "sender@localhost" + oCDOMsg:BodyPart:Charset := "utf-8" + oCDOMsg:To := "to@example.org" + oCDOMsg:From := cFrom oCDOMsg:Subject := "Test message" oCDOMsg:TextBody := "Test message body" - BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } + BEGIN SEQUENCE WITH __BreakBlock() oCDOMsg:Send() RECOVER ? "Error: CDO send error.", win_oleErrorText() @@ -440,7 +443,7 @@ STATIC PROCEDURE Exm_ADODB() IF ( oRs := win_oleCreateObject( "ADODB.Recordset" ) ) != NIL oRs:Open( "SELECT * FROM test ORDER BY First", ; - "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + hb_DirBase() + "\..\..\hbodbc\tests\test.mdb", ; + "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + hb_DirBase() + "..\..\hbodbc\tests\test.mdb", ; adOpenForwardOnly, ; adLockReadOnly ) @@ -460,7 +463,7 @@ STATIC PROCEDURE Exm_SOAP() IF ! Empty( oSoapClient := win_oleCreateObject( "MSSOAP.SoapClient30" ) ) - oSoapClient:msSoapInit( "http://www.dataaccess.com/webservicesserver/textcasing.wso?WSDL" ) + oSoapClient:msSoapInit( "https://www.dataaccess.com/webservicesserver/textcasing.wso?WSDL" ) ? oSoapClient:InvertStringCase( "lower UPPER" ) ELSE @@ -477,9 +480,9 @@ STATIC PROCEDURE Exm_PocketSOAP() IF ! Empty( oHttp ) .OR. ! Empty( oEnvelope ) oEnvelope:EncodingStyle := "" - oEnvelope:SetMethod( "InvertStringCase", "http://www.dataaccess.com/webservicesserver/" ) + oEnvelope:SetMethod( "InvertStringCase", "http:" + "//www.dataaccess.com/webservicesserver/" ) oEnvelope:Parameters:Create( "sAString", "lower UPPER" ) - oHttp:Send( "http://www.dataaccess.com/webservicesserver/textcasing.wso?WSDL", oEnvelope:Serialize() ) + oHttp:Send( "https://www.dataaccess.com/webservicesserver/textcasing.wso?WSDL", oEnvelope:Serialize() ) oEnvelope:Parse( oHttp ) ? oEnvelope:Parameters:Item( 0 ):Value diff --git a/contrib/hbwin/tests/oletst2.js b/contrib/hbwin/tests/oletst2.js index 10c498576a..e125e9a4d1 100644 --- a/contrib/hbwin/tests/oletst2.js +++ b/contrib/hbwin/tests/oletst2.js @@ -1,12 +1,6 @@ -/* - * Copyright 2010 Viktor Szakats (vszakats.net/harbour) - * www - http://harbour-project.org - * - * See COPYING.txt for licensing terms. - */ - +/* Copyright 2010 Viktor Szakats (vszakats.net/harbour) */ { - var tst2 = new ActiveXObject( "MyOleTimeServer" ); + var tst2 = new ActiveXObject("MyOleTimeServer"); - WScript.CreateObject("Wscript.Shell").Popup( ">" + tst2.TIME() + "<" ); + WScript.CreateObject("Wscript.Shell").Popup(">" + tst2.TIME() + "<"); } diff --git a/contrib/hbwin/tests/oletst2.vbs b/contrib/hbwin/tests/oletst2.vbs index 1e3735bd42..9d89489b4f 100644 --- a/contrib/hbwin/tests/oletst2.vbs +++ b/contrib/hbwin/tests/oletst2.vbs @@ -1,8 +1,4 @@ -' ' Copyright 2010 Viktor Szakats (vszakats.net/harbour) -' -' See COPYING.txt for licensing terms. -' Dim tst2 : Set tst2 = WScript.CreateObject("MyOleTimeServer") diff --git a/contrib/hbxpp/doc/en/binnumx.txt b/contrib/hbxpp/doc/en/binnumx.txt index 5050be2a42..070b9ff947 100644 --- a/contrib/hbxpp/doc/en/binnumx.txt +++ b/contrib/hbxpp/doc/en/binnumx.txt @@ -1,70 +1,6 @@ -/* - * Copyright 2000 Chen Kedem - * Documentation for: Bin2W(), Bin2U(), W2Bin(), U2Bin() - * - * See COPYING.txt for licensing terms. - * - */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - Bin2W() - $CATEGORY$ - API - $SUBCATEGORY$ - Conversion - $ONELINER$ - Convert unsigned short encoded bytes into Harbour numeric - $SYNTAX$ - Bin2W( ) --> nNumber - $ARGUMENTS$ - is a character string that contains 16-bit encoded unsigned - short integer (least significant byte first). The first two bytes - are taken into account, the rest if any are ignored. - $RETURNS$ - Bin2W() return numeric integer (or 0 if is not a string). - $DESCRIPTION$ - Bin2W() is one of the low level binary conversion functions, those - functions convert between Harbour numeric and a character - representation of numeric value. Bin2W() take two bytes of encoded - 16-bit unsigned short integer and convert it into standard Harbour - numeric value. - - You might ask what is the need for such functions, well, first of - all it allow you to read/write information from/to a binary file - (like extracting information from DBF header), it is also a useful - way to share information from source other than Harbour (C for - instance). - - Bin2W() is the opposite of W2Bin() - $EXAMPLES$ - // Show header length of a DBF - #include "fileio.ch" - PROCEDURE Main() - LOCAL hFile, cBuffer := Space( 2 ) - IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL - hb_vfSeek( hFile, 8 ) - hb_vfRead( hFile, @cBuffer, hb_BLen( cBuffer ) ) - ? "Length of DBF header in bytes:", Bin2W( cBuffer ) - hb_vfClose( hFile ) - ELSE - ? "Can not open file" - ENDIF - RETURN - $STATUS$ - R - $COMPLIANCE$ - C - $FILES$ - Library is core - $SEEALSO$ - Bin2I(), Bin2L(), Bin2U(), I2Bin(), L2Bin(), W2Bin(), Word(), U2Bin() - $END$ - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -84,7 +20,7 @@ $RETURNS$ Bin2U() return numeric integer (or 0 if is not a string). $DESCRIPTION$ - Bin2U() is one of the low level binary conversion functions, those + Bin2U() is one of the low-level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. Bin2U() take four bytes of encoded 32-bit unsigned long integer and convert it into standard Harbour @@ -100,17 +36,15 @@ $EXAMPLES$ // Show number of records in DBF #include "fileio.ch" - PROCEDURE Main() - LOCAL hFile, cBuffer := Space( 4 ) - IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL - hb_vfSeek( hFile, 4 ) - hb_vfRead( hFile, @cBuffer, hb_BLen( cBuffer ) ) - ? "Number of records in file:", Bin2U( cBuffer ) - hb_vfClose( hFile ) - ELSE - ? "Can not open file" - ENDIF - RETURN + LOCAL hFile, cBuffer := Space( 4 ) + IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL + hb_vfSeek( hFile, 4 ) + hb_vfRead( hFile, @cBuffer, hb_BLen( cBuffer ) ) + ? "Number of records in file:", Bin2U( cBuffer ) + hb_vfClose( hFile ) + ELSE + ? "Cannot open file" + ENDIF $STATUS$ R $COMPLIANCE$ @@ -123,6 +57,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -141,7 +77,7 @@ W2Bin() return two bytes character string that contains 16-bit encoded unsigned short integer (least significant byte first). $DESCRIPTION$ - W2Bin() is one of the low level binary conversion functions, those + W2Bin() is one of the low-level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. W2Bin() take a numeric integer value and convert it into two bytes of encoded 16-bit unsigned short @@ -166,6 +102,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -184,7 +122,7 @@ U2Bin() return four bytes character string that contains 32-bit encoded unsigned long integer (least significant byte first). $DESCRIPTION$ - U2Bin() is one of the low level binary conversion functions, those + U2Bin() is one of the low-level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. U2Bin() take a numeric integer value and convert it into four bytes of encoded 32-bit unsigned long diff --git a/contrib/hbxpp/doc/en/dbcmdx.txt b/contrib/hbxpp/doc/en/dbcmdx.txt index b05347af58..64140ac431 100644 --- a/contrib/hbxpp/doc/en/dbcmdx.txt +++ b/contrib/hbxpp/doc/en/dbcmdx.txt @@ -1,12 +1,6 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: dbSkipper() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -32,13 +26,12 @@ actual records skipped. $EXAMPLES$ // open a file and find if we've got enough records in it - USE month_sales + USE test IF dbSkipper( 100 ) == 100 ? "Good work! You can party now" ELSE ? "Too bad, you should really work harder" ENDIF - dbCloseArea() $STATUS$ R $COMPLIANCE$ diff --git a/contrib/xhb/htmutil.prg b/contrib/xhb/htmutil.prg index 688ab0bd34..2ddc5327ca 100644 --- a/contrib/xhb/htmutil.prg +++ b/contrib/xhb/htmutil.prg @@ -1,7 +1,8 @@ /* - * Misc Suport Functions for HTMLLIB + * Misc Support Functions for HTMLLIB * * Copyright 2000 Manos Aspradakis + * Copyright 2000 Luiz Rafael Culik (Porting this library to Harbour) * * 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 @@ -44,27 +45,13 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2000 Luiz Rafael Culik - * Porting this library to Harbour - * - * See COPYING.txt for licensing terms. - * - */ +#include "html.ch" #include "html.ch" #include "hbclass.ch" THREAD STATIC t_aGreek := {} -/**** -* -* BackButton() -* -*/ - PROCEDURE BackButton( cImage, oHtm ) __defaultNIL( @cImage, "back.gif" ) @@ -80,12 +67,6 @@ PROCEDURE BackButton( cImage, oHtm ) RETURN -/**** -* -* BackFormButton() -* -*/ - PROCEDURE BackFormButton( cImage, oForm ) LOCAL oBut @@ -110,12 +91,6 @@ PROCEDURE BackFormButton( cImage, oForm ) RETURN -/**** -* -* PutCounter() -* -*/ - FUNCTION PutCounter( oHtm, nNumber, cDir, nDigits, nWidth, bgColor, nBorder ) LOCAL i diff --git a/contrib/xhb/tfile.prg b/contrib/xhb/tfile.prg index a17d8e7b67..860b8a1b2e 100644 --- a/contrib/xhb/tfile.prg +++ b/contrib/xhb/tfile.prg @@ -2,6 +2,7 @@ * Base fileIO class. * * Copyright 2000 Manos Aspradakis + * Copyright 2000 Luiz Rafael Culik (Porting this library to Harbour) * * 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 @@ -44,16 +45,6 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2000 Luiz Rafael Culik - * Porting this library to Harbour - * - * See COPYING.txt for licensing terms. - * - */ - #include "hbclass.ch" #include "fileio.ch" #include "cgi.ch" diff --git a/contrib/xhb/tframe.prg b/contrib/xhb/tframe.prg index 59bf7155af..e63ce28f8c 100644 --- a/contrib/xhb/tframe.prg +++ b/contrib/xhb/tframe.prg @@ -2,6 +2,7 @@ * HTMLLIB Frame Class * * Copyright 2000 Manos Aspradakis + * Copyright 2000 Luiz Rafael Culik (Porting this library to Harbour) * * 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 @@ -44,16 +45,6 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2000 Luiz Rafael Culik - * Porting this library to Harbour - * - * See COPYING.txt for licensing terms. - * - */ - #include "hbclass.ch" #include "cgi.ch" diff --git a/contrib/xhb/thtm.prg b/contrib/xhb/thtm.prg index 1b867daa5e..adc56446d4 100644 --- a/contrib/xhb/thtm.prg +++ b/contrib/xhb/thtm.prg @@ -2,6 +2,7 @@ * Main HTML CLASS for HTMLLIB * * Copyright 2000 Manos Aspradakis + * Copyright 2000 Luiz Rafael Culik (Porting this library to Harbour) * * 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 @@ -44,16 +45,6 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2000 Luiz Rafael Culik - * Porting this library to Harbour - * - * See COPYING.txt for licensing terms. - * - */ - #include "hbclass.ch" #include "cgi.ch" diff --git a/debian/copyright b/debian/copyright index 14f857708c..3968e98a9f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -39,7 +39,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this software; see the file LICENSE.txt. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/). +Boston, MA 02111-1307 USA (or visit the website https://www.gnu.org/). As a special exception, the Harbour Project gives permission for additional uses of the text contained in its release of Harbour. @@ -73,7 +73,7 @@ There is no one single license that applies to the Harbour Project contrib files. Some files use the Harbour Project Compiler license. Some files use the Harbour Project Library license. Some files use the old Harbour Project Library license. Some files may even use other -types of free software or open source software licenses. Some files +types of free software or open source software licenses. Some files have been donated to the public domain. If you use any of the contrib files, you need to investigate the license that applies to each file. diff --git a/doc/class_tp.txt b/doc/class_tp.txt index f46678e1b0..e75e1f0116 100644 --- a/doc/class_tp.txt +++ b/doc/class_tp.txt @@ -5,70 +5,12 @@ FILE HEADER TEMPLATE ==================== -/* - * {one-liner description about the purpose of this source file} - * - * Copyright 2000 {list of individual authors and e-mail addresses} - * - * 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, 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; see the file LICENSE.txt. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -FILE HEADER TEMPLATE (OPTIONAL ADDITION FOR PARTIAL COPYRIGHTS) -=============================================================== - -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2000 {name} <{e-mail address}> - * {function or subsystem name} - * - * See COPYING.txt for licensing terms. - * - */ - - CLASS HEADER TEMPLATE ======================== /* $CLASSDOC$ + $AUTHOR$ + Copyright YYYY FirstName LastName $NAME$ $CATEGORY$ diff --git a/doc/en/1stread.txt b/doc/en/1stread.txt index ceeb945289..72a9467c8b 100644 --- a/doc/en/1stread.txt +++ b/doc/en/1stread.txt @@ -1,11 +1,6 @@ -/* - * Copyright 2009 April White - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2009 April White $TEMPLATE$ Document $NAME$ @@ -26,12 +21,12 @@ Clipper). The goal of Harbour is to produce a cross platform CA-Cl*pper compatible compiler. - The Harbour website is at . - If you have any problems with this copy of Harbour please visit our web + The Harbour website is at . + If you have any problem with this copy of Harbour please visit our web site and ensure that you are using the latest release. If you are reading this file as part of a source distribution of Harbour you - probably want to start by reading `dirstruc.txt` because this is your map to + probably want to start by reading doc/dirstruc.txt because this is your map to the Harbour source directories. Harbour is a superset of Clipper and is backwards compatible with nearly diff --git a/doc/en/arrayshb.txt b/doc/en/arrayshb.txt index 49dba6d03d..056544881e 100644 --- a/doc/en/arrayshb.txt +++ b/doc/en/arrayshb.txt @@ -1,16 +1,6 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: ASort() - * - * Copyright 1999 Luiz Rafael Culik - * Documentation for: Array(), AAdd(), AClone(), ACopy(), ASize(), - * ATail(), AIns(), ADel(), AFill(), AScan(), AEval() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -22,7 +12,7 @@ $ONELINER$ Create an uninitialized array of specified length $SYNTAX$ - Array( [, ...] ) --> aArray + Array( [, ...] ) --> aArray $ARGUMENTS$ is the number of elements in the specified dimension. $RETURNS$ @@ -42,14 +32,11 @@ CA-Cl*pper v5.x compliant except that arrays in Harbour can have an unlimited number of elements. $EXAMPLES$ - PROCEDURE Main() - LOCAL aArray := Array( 10 ) - LOCAL x - FOR x := 1 TO Len( aArray ) - aArray[ x ] := Array( x ) - NEXT - // Result is: { { NIL }, { NIL, NIL }, ... } - RETURN + LOCAL aArray := Array( 10 ), tmp + FOR tmp := 1 TO Len( aArray ) + aArray[ tmp ] := Array( tmp ) + NEXT + ? hb_ValToExp( aArray ) // --> { { NIL }, { NIL, NIL }, ... } $STATUS$ R $COMPLIANCE$ @@ -62,6 +49,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -73,29 +62,28 @@ $ONELINER$ Dynamically add an element to an array $SYNTAX$ - AAdd( [, ] ) --> Value + AAdd( , [] ) --> xValue $ARGUMENTS$ The name of an array Element to add to array $RETURNS$ - if specified , will return , otherwise this - function returns a NIL value. + if specified , will be returned, + otherwise this function returns a NIL value. $DESCRIPTION$ - This function dynamically increases the length of the array named - by one element and stores the value of to that - newly created element. + This function dynamically increases the length of the + by adding one new element to the end of the array and optionally + stores the value to that newly created element. - may be an array reference pointer, which in turn may be - stored to an array's subscript position. + may be of an data type, including an array reference pointer, + which in turn may be stored to an array's subscript position. $EXAMPLES$ - LOCAL aArray := {} - LOCAL x + LOCAL aArray := {}, tmp AAdd( aArray, 10 ) - FOR x := 1 TO 10 - AAdd( aArray, x ) + FOR tmp := 1 TO 10 + AAdd( aArray, tmp ) NEXT - // Result is: { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } + ? hb_ValToExp( aArray ) // --> { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } $STATUS$ R $COMPLIANCE$ @@ -108,6 +96,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -119,25 +109,29 @@ $ONELINER$ Adjust the size of an array $SYNTAX$ - ASize( , ) --> aTarget + ASize( , ) --> aArray $ARGUMENTS$ Name of array to be dynamically altered - Numeric value representing the new size of + Numeric value representing the new size (i.e. number of elements) + of $RETURNS$ - an array pointer reference to . + The function returns a reference to . $DESCRIPTION$ This function will dynamically increase or decrease the size of by adjusting the length of the array to subscript positions. - If the length of the array is shortened, those former - subscript positions are lost. If the length of the array is - lengthened a NIL value is assigned to the new subscript position. + If the length of the array is shortened, the redundant elements + are removed from the end of array. If the length of the array is lengthened + the new elements are added to the end of array and they are assigned a NIL value. $EXAMPLES$ - LOCAL aArray := { 1 } // Result: aArray is { 1 } - ASize( aArray, 3 ) // Result: aArray is { 1, NIL, NIL } - ASize( aArray, 1 ) // Result: aArray is { 1 } + LOCAL aArray := { 1 } + ? hb_ValToExp( aArray ) // --> { 1 } + ASize( aArray, 3 ) + ? hb_ValToExp( aArray ) // --> { 1, NIL, NIL } + ASize( aArray, 1 ) + ? hb_ValToExp( aArray ) // --> { 1 } $STATUS$ R $COMPLIANCE$ @@ -151,6 +145,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -160,20 +156,19 @@ $SUBCATEGORY$ Array $ONELINER$ - Returns the rightmost element of an array + Returns the last element of an array $SYNTAX$ - ATail( ) --> Element + ATail( ) --> xValue $ARGUMENTS$ is the array. $RETURNS$ - the expression of the last element in the array. + the value of the last element in the array. $DESCRIPTION$ This function return the value of the last element in the array - named . This function does not alter the size of the - array or any of the subscript values. + named . Same as `xValue := aArray[ Len( aArray ) ]` $EXAMPLES$ LOCAL aArray := { "Harbour", "is", "Supreme", "Power" } - ? ATail( aArray ) // Result is "Power" + ? ATail( aArray ) // --> "Power" $STATUS$ R $COMPLIANCE$ @@ -186,6 +181,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -197,13 +194,13 @@ $ONELINER$ Insert a NIL value at an array subscript position. $SYNTAX$ - AIns( , ) --> aTarget + AIns( , ) --> aArray $ARGUMENTS$ Array name. Subscript position in $RETURNS$ - an array pointer reference. + a reference to . $DESCRIPTION$ This function inserts a NIL value in the array named at the th position. @@ -215,9 +212,13 @@ position, the element previously in the fifth position would now be located at the sixth position. The length of the array will remain unchanged. + + Note: To avoid loosing last element, you can use hb_AIns() + which supports auto-sizing of array. $EXAMPLES$ LOCAL aArray := { "Harbour", "is", "Power!", "!!!" } AIns( aArray, 4 ) + ? hb_ValToExp( aArray ) $STATUS$ R $COMPLIANCE$ @@ -225,11 +226,67 @@ $FILES$ Library is core $SEEALSO$ - AAdd(), ACopy(), ADel(), AEval(), AFill(), ASize() + hb_AIns(), AAdd(), ACopy(), ADel(), AEval(), AFill(), ASize() $END$ */ /* $DOC$ + $AUTHOR$ + 2016 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_AIns() + $CATEGORY$ + API + $SUBCATEGORY$ + Array + $ONELINER$ + Inserts a value at an array subscript position and optionally increases + the length of array. + $SYNTAX$ + hb_AIns( , [], [], [] ) --> aArray + $ARGUMENTS$ + The array name into which the value will be inserted. + + Subscript position in . Default: 1st position + + Value to be inserted + + Boolean flag to increase or not the size of . + Default value: .F. + $RETURNS$ + A reference to array + $DESCRIPTION$ + This function inserts in the position of the array, + moving all the items one position down in the array list. + If is .T., a new element will be added at the end of array, + making room for the previous last element, which means the length of array + will be increased by 1. + + If is .F. (or is not passed) the function behaves like AIns(), + that is, the size of won't change and the last item of + will be lost. + $EXAMPLES$ + LOCAL aArray := { "Harbour", "Power!" } + hb_AIns( aArray, 2, "is", .F. ) + ? hb_ValToExp( aArray ) // --> { "Harbour", "is" } + hb_AIns( aArray, 2, "is", .T. ) + ? hb_ValToExp( aArray ) // --> { "Harbour", "is", "Power!" } + $STATUS$ + R + $COMPLIANCE$ + H + $FILES$ + Library is core + $SEEALSO$ + AIns(), AAdd(), ADel(), AFill(), ASize() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -239,26 +296,31 @@ $SUBCATEGORY$ Array $ONELINER$ - Delete an element form an array. + Delete an element from an array. $SYNTAX$ - ADel( , ) --> aTarget + ADel( , ) --> aArray $ARGUMENTS$ Name of array from which an element is to be removed. Subscript of the element to be removed. $RETURNS$ - an array pointer reference. + an array pointer reference. $DESCRIPTION$ This function deletes the element found at subscript position in the array . All elements in the array below the - given subscript position will move up one position in the - array. In other words, what was formerly the sixth subscript position + given subscript position will move up one position in the array. + + In other words, what was formerly the sixth subscript position will become the fifth subscript position. The length of the array will remain unchanged, as the last element in the array will become a NIL data type. + + Note: To completely remove an element and decrease the length of array + you can use hb_ADel() that supports auto-sizing. $EXAMPLES$ LOCAL aArray := { "Harbour", "is", "Power" } - ADel( aArray, 2 ) // Result: aArray is { "Harbour", "Power" } + ADel( aArray, 2 ) + ? hb_ValToExp( aArray ) // --> { "Harbour", "Power", NIL } $STATUS$ R $COMPLIANCE$ @@ -266,11 +328,63 @@ $FILES$ Library is core $SEEALSO$ - ACopy(), AIns(), AFill() + hb_ADel(), ACopy(), AIns(), AFill() $END$ */ /* $DOC$ + $AUTHOR$ + 2016 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_ADel() + $CATEGORY$ + API + $SUBCATEGORY$ + Array + $ONELINER$ + Delete an element from an array. + $SYNTAX$ + hb_ADel( , [], [] ) --> aArray + $ARGUMENTS$ + Name of array from which an element is to be removed. + + Subscript of the element to be removed. Default value: 1. + + Boolean flag specifying if the array will be resized or not. + Default value: .F. (no resize). + $RETURNS$ + an array pointer reference. + $DESCRIPTION$ + This function deletes the element value (not the element itself!) + stored in position and shifts all the following values, + one position up. + + If is .T., then the last element is removed and the size + of the array is decreased by one, otherwise the length of the array + remains unchanged and a NIL value will be stored in the last element, + just like in ADel(). + $EXAMPLES$ + LOCAL aArray := { "Harbour", "is", "Power" } + hb_ADel( aArray, 2 ) + ? hb_ValToExp( aArray ) // --> { "Harbour", "Power", NIL } - length unchanged + hb_ADel( aArray, 2, .T. ) + ? hb_ValToExp( aArray ) // --> a{ "Harbour", "Power" } - length decreased + $STATUS$ + R + $COMPLIANCE$ + H + $FILES$ + Library is core + $SEEALSO$ + ADel(), ACopy(), AIns(), AFill() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -282,7 +396,7 @@ $ONELINER$ Fill an array with a specified value $SYNTAX$ - AFill( , , [], [] ) --> aTarget + AFill( , , [], [] ) --> aArray $ARGUMENTS$ Name of array to be filled. @@ -292,23 +406,26 @@ Number of subscript to be filled $RETURNS$ - an array pointer. + pointer to the array. $DESCRIPTION$ This function will fill each element of an array named with the value . If specified, denotes the beginning element to be filled and the array elements will continue to be - filled for positions. If Not specified, the value of - will be 1, and the value of will be the value - of Len( ); thus, all subscript positions in the array - will be filled with the value of . + filled for positions. + + If neither / specified, the value of will be 1, + and the value of will be the value of `Len( )`; + thus, all subscript positions in the array will be filled + with the value of . This function will work on only a single dimension of . If there are array pointer references within a subscript , those values will be lost, since this function will overwrite those values with new values. $EXAMPLES$ - LOCAL aTest := { NIL, 0, 1, 2 } - AFill( aTest, 5 ) + LOCAL aArray := { NIL, 0, 1, 2 } + AFill( aArray, 5 ) + ? hb_ValToExp( aArray ) $STATUS$ R $COMPLIANCE$ @@ -321,6 +438,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -332,9 +451,9 @@ $ONELINER$ Scan array elements for a specified condition $SYNTAX$ - AScan( , , [], [] ) --> nStoppedAt + AScan( , , [], [] ) --> nStoppedAt $ARGUMENTS$ - Array to be scanned. + Array to be scanned. Expression to search for in @@ -345,18 +464,15 @@ A numeric value of subscript position where was found, or 0 if is not found. $DESCRIPTION$ - This function scan the content of array named for the + This function scan the content of array named for the value of . The return value is the position in the array - in which was found. If it was not found, the + in which was found. If it was not found, the return value will be 0. - If specified, the beginning subscript position at which to start - scanning may be set with the value passed as . The default - is 1. - - If specified, the number of array elements to scan may be set with - the value passed as . The default is the number of elements - in the array . + is the position from which to start scanning. The default + is 1. (1st element) + , if specified, is the number of array elements to be scanned. + The default is all elements in the array . If is a code block, the operation of the function is slightly different. Each array subscript pointer reference is @@ -364,12 +480,15 @@ will continue until the value obtained from the code block is a logical true (.T.) or until the end of the array has been reached. $EXAMPLES$ + #include "directry.ch" LOCAL aDir := hb_vfDirectory( "*.prg" ) - AScan( aDir,,, {| x, y | x[ 1 ] := "test.prg", HB_SYMBOL_UNUSED( y ) } ) + ? AScan( aDir,,, ; + {| aFile, nPos | HB_SYMBOL_UNUSED( nPos ), aFile[ F_NAME ] == "test.prg" } ) $STATUS$ R $COMPLIANCE$ - This function is not CA-Cl*pper compatible. CA-Cl*pper AScan() is affected by the SET EXACT ON/OFF Condition + This function is not CA-Cl*pper compatible. + CA-Cl*pper AScan() is affected by the `SET EXACT ON`/`OFF` Condition $FILES$ Library is core $SEEALSO$ @@ -378,6 +497,64 @@ */ /* $DOC$ + $AUTHOR$ + 2016 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_AScan() + $CATEGORY$ + API + $SUBCATEGORY$ + Array + $ONELINER$ + Scan array elements for a specified condition + $SYNTAX$ + hb_AScan( , , [], [], [] ) --> nPosition + $ARGUMENTS$ + Array to be scanned. + + Expression to search for in + + Beginning subscript position at which to start the search. + Default value: 1 + + Number of elements to be scanned within . + Default value: All elements. + + Boolean flag specifying if an "Exact" search will be + performed or not. Default value: .F. + $RETURNS$ + A numeric value > 0 indicating the array position + where was found, or 0 if nothing found. + $DESCRIPTION$ + The function scans (left to right) for into + and returns of in which + was found or 0 (zero) if nothing found. + + If is .T., then an exact search will be performed. + When is a code block, the operation of the function + is slightly different. See AScan() for details. + $EXAMPLES$ + LOCAL a := { "there", "here" } + Set( _SET_EXACT, .F. ) + ? AScan( a, "he" ) // --> 2 + ? hb_AScan( a, "he",,, .F. ) // --> 2 + ? hb_AScan( a, "he",,, .T. ) // --> 0 + $STATUS$ + R + $COMPLIANCE$ + H + $FILES$ + Library is core + $SEEALSO$ + AScan(), AEval() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -401,20 +578,29 @@ $RETURNS$ an array pointer reference. $DESCRIPTION$ - This function will evaluate and process the subscript elements - in . A code block passed as defines the operation - to be executed on each element of the array. All elements in - will be evaluated unless specified by a beginning subscript position - in for elements. + This function evaluates the elements of , and executes for each + of them the processing that's defined with . + By default, all the elements of array are being processed, starting from + 1st and up to the last element. - Two parameters are passed to the code block . The individual - elements in an array are the first parameter and the subscript position - is the second. + If and/or parameters are given, then the processing + starts from element and continues for the next elements + (if defined) or up to the last element of the array. - AEval() does not replace a FOR...NEXT loop for processing arrays. If - an array is an autonomous unit, AEval() is appropriate. If the array - is to be altered or if elements are to be reevaluated, a FOR...NEXT - loop is more appropriate. + The code block receives two parameters: the element value and + element's index (position) into the array. i.e. `{| xValue, nIndex | ... }` + Worth to note that elements are passed to code block 'by value', + thus any change being made to this value doesn't affects the value of + element in the array. + $EXAMPLES$ + LOCAL a := { 10, 20, 30 } + AEval( a, {| e, n | QOut( e * n + 1 , a[ n ] ) } ) + ? a[ 1 ], a[ 2 ], a[ 3 ] // array elements unchanged + ? "----" + AEval( a, {| e, n | QOut( e * n + 1, a[ n ] *= n + 1 ) }, 2, 1 ) + /* Here the 2nd element been changed, because we've explicitly used + its pointer 'a[ n ] *= ...' into array */ + ? a[ 1 ], a[ 2 ], a[ 3 ] $STATUS$ R $COMPLIANCE$ @@ -427,6 +613,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -454,18 +642,15 @@ an array pointer reference $DESCRIPTION$ This function copies array elements from to . - is the beginning element to be copied from ; the default is 1. is the number of elements to be copied from ; the default is the entire array. - is the subscript number in the target array, , - to which array elements are to be copied; the default is 1 + to which array elements are to be copied; the default is 1. This function will copy all data types in to . - If an array element in is a pointer reference to another array, that array pointer will be copied to ; not all subdimensions will be copied from one array to the next. This must @@ -478,10 +663,11 @@ subscript positions to the target array, the size of the target array remains constant. $EXAMPLES$ - LOCAL nCount := 2, nStart := 1, aOne, aTwo - aOne := { "Harbour", " is ", "Power" } - aTwo := { "Clipper", " was ", "Power" } + LOCAL nCount := 2, nStart := 1 + LOCAL aOne := { "Harbour", " is ", "Power" } + LOCAL aTwo := { "Clipper", " was ", "Power" } ACopy( aOne, aTwo, nStart, nCount ) + ? hb_ValToExp( aTwo ) // --> { "Harbour", " is ", "Power" } $STATUS$ R $COMPLIANCE$ @@ -494,6 +680,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -517,13 +705,12 @@ a complete set of arrays values for all dimensions within the original array $EXAMPLES$ - LOCAL aOne, aTwo - aOne := { "Harbour", " is ", "POWER" } - aTwo := AClone( aOne ) // Result: aTwo is { "Harbour", " is ", "POWER" } + LOCAL aOne := { "Harbour", " is ", "POWER" } + LOCAL aTwo := AClone( aOne ) + ? hb_ValToExp( aTwo ) // --> { "Harbour", " is ", "POWER" } aOne[ 1 ] := "The Harbour Compiler" - // Result: - // aOne is { "The Harbour Compiler", " is ", "POWER" } - // aTwo is { "Harbour", " is ", "POWER" } + ? hb_ValToExp( aOne ) // --> { "The Harbour Compiler", " is ", "POWER" } + ? hb_ValToExp( aTwo ) // --> { "Harbour", " is ", "POWER" } $STATUS$ R $COMPLIANCE$ @@ -536,6 +723,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -554,10 +743,10 @@ The first element to start the sort from, default is 1. Number of elements starting from to sort, default - is all elements. + is all elements. Code block for sorting order, default is ascending order - {| x, y | x < y }. The code block should accept two parameters and + `{| x, y | x < y }`. The code block should accept two parameters and must return .T. if the sort is in order, .F. if not. $RETURNS$ reference to the now sorted or NIL if the @@ -569,7 +758,6 @@ this array in ascending order: Character are sorted by their ASCII value, Dates are sorted chronologically, Logical put .F. values before .T., Numeric are sorted by their value. - If is specified, it is used to handle the sorting order. With each time the block is evaluate, two array elements are passed to the code block, and must return a logical value that state if @@ -581,18 +769,23 @@ Codeblock calling frequency and order differs from CA-Cl*pper, since Harbour uses a different (faster) sorting algorithm (quicksort). $EXAMPLES$ - // sort numeric values in ascending order - ASort( { 3, 1, 4, 42, 5, 9 } ) // result: { 1, 3, 4, 5, 9, 42 } + LOCAL aKeys, bSort, aPair - // sort character strings in descending lexical order + // Sort numeric values in ascending order + aKeys := { 3, 1, 4, 42, 5, 9 } + ASort( aKeys ) + ? hb_ValToExp( aKeys ) // --> { 1, 3, 4, 5, 9, 42 } + + // Sort character strings in descending lexical order aKeys := { "Ctrl", "Alt", "Delete" } bSort := {| x, y | Upper( x ) > Upper( y ) } - ASort( aKeys,,, bSort ) // result: { "Delete", "Ctrl", "Alt" } + ASort( aKeys,,, bSort ) + ? hb_ValToExp( aKeys ) // --> { "Delete", "Ctrl", "Alt" } - // sort two-dimensional array according to 2nd element of each pair + // Sort two-dimensional array according to 2nd element of each pair aPair := { { "Sun", 8 }, { "Mon", 1 }, { "Tue", 57 }, { "Wed", -6 } } ASort( aPair,,, {| x, y | x[ 2 ] < y[ 2 ] } ) - // result: { { "Wed", -6 }, { "Mon", 1 }, { "Sun", 8 }, { "Tue", 57 } } + ? hb_ValToExp( aPair ) // --> { { "Wed", -6 }, { "Mon", 1 }, { "Sun", 8 }, { "Tue", 57 } } $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/ati.txt b/doc/en/ati.txt new file mode 100644 index 0000000000..51560af45e --- /dev/null +++ b/doc/en/ati.txt @@ -0,0 +1,50 @@ +/* $DOC$ + $AUTHOR$ + 2016 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_AtI() + $CATEGORY$ + API + $SUBCATEGORY$ + Strings + $ONELINER$ + Locates the position of a substring in a main string. + $SYNTAX$ + hb_AtI( , , [], [] ) --> nPos + $ARGUMENTS$ + the sub-string to search for + + The main string to search into, for + + Beginning search position into , default: 1 + + Ending search position, default: Length of (i.e. entire ) + + $RETURNS$ + hb_AtI() returns the position (if any), into main string, + where first time the substring appears. + $DESCRIPTION$ + This function has same functionality as hb_At() with the significant + difference that it's case Insensitive. + + Optionally, with can be defined the position into main string + from where the search of must begin and with the position + where it must stop. If neither of them is defined, is 1st position + and the ending of . + $EXAMPLES$ + ? hb_At( "AS", "as simple as possible", 5 ) // --> 0 + ? hb_AtI( "AS", "as simple as possible", 5 ) // --> 11 + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + hb_At() + $END$ + */ diff --git a/doc/en/binnum.txt b/doc/en/binnum.txt index 10dc9a98b9..1904198d31 100644 --- a/doc/en/binnum.txt +++ b/doc/en/binnum.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2000 Chen Kedem - * Documentation for: Bin2I(), Bin2L(), I2Bin(), L2Bin() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -26,7 +20,7 @@ $RETURNS$ Bin2I() return numeric integer (or 0 if is not a string). $DESCRIPTION$ - Bin2I() is one of the low level binary conversion functions, those + Bin2I() is one of the low-level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. Bin2I() take two bytes of encoded 16-bit signed short integer and convert it into standard Harbour @@ -42,20 +36,18 @@ $EXAMPLES$ // Show DBF last update date #include "fileio.ch" - PROCEDURE Main() - LOCAL hFile, cYear, cMonth, cDay - IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL - hb_vfSeek( hFile, 1 ) - cYear := cMonth := cDay := " " - hb_vfRead( hFile, @cYear , hb_BLen( cYear ) ) - hb_vfRead( hFile, @cMonth, hb_BLen( cMonth ) ) - hb_vfRead( hFile, @cDay , hb_BLen( cDay ) ) - ? "Last update:", Bin2I( cYear ), Bin2I( cMonth ), Bin2I( cDay ) - hb_vfClose( hFile ) - ELSE - ? "Can not open file" - ENDIF - RETURN + LOCAL hFile, cYear, cMonth, cDay + IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL + hb_vfSeek( hFile, 1 ) + cYear := cMonth := cDay := hb_BChar( 0 ) + hb_vfRead( hFile, @cYear , hb_BLen( cYear ) ) + hb_vfRead( hFile, @cMonth, hb_BLen( cMonth ) ) + hb_vfRead( hFile, @cDay , hb_BLen( cDay ) ) + ? "Last update:", Bin2I( cYear ), Bin2I( cMonth ), Bin2I( cDay ) + hb_vfClose( hFile ) + ELSE + ? "Cannot open file" + ENDIF $STATUS$ R $COMPLIANCE$ @@ -68,6 +60,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -87,7 +81,7 @@ $RETURNS$ Bin2L() return numeric integer (or 0 if is not a string). $DESCRIPTION$ - Bin2L() is one of the low level binary conversion functions, those + Bin2L() is one of the low-level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. Bin2L() take four bytes of encoded 32-bit signed long integer and convert it into standard Harbour @@ -103,17 +97,15 @@ $EXAMPLES$ // Show number of records in DBF #include "fileio.ch" - PROCEDURE Main() - LOCAL hFile, cBuffer := Space( 4 ) - IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL - hb_vfSeek( hFile, 4 ) - hb_vfRead( hFile, @cBuffer, hb_BLen( cBuffer ) ) - ? "Number of records in file:", Bin2L( cBuffer ) - hb_vfClose( hFile ) - ELSE - ? "Can not open file" - ENDIF - RETURN + LOCAL hFile, cBuffer := Space( 4 ) + IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL + hb_vfSeek( hFile, 4 ) + hb_vfRead( hFile, @cBuffer, hb_BLen( cBuffer ) ) + ? "Number of records in file:", Bin2L( cBuffer ) + hb_vfClose( hFile ) + ELSE + ? "Cannot open file" + ENDIF $STATUS$ R $COMPLIANCE$ @@ -126,6 +118,66 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem + $TEMPLATE$ + Function + $NAME$ + Bin2W() + $CATEGORY$ + API + $SUBCATEGORY$ + Conversion + $ONELINER$ + Convert unsigned short encoded bytes into Harbour numeric + $SYNTAX$ + Bin2W( ) --> nNumber + $ARGUMENTS$ + is a character string that contains 16-bit encoded unsigned + short integer (least significant byte first). The first two bytes + are taken into account, the rest if any are ignored. + $RETURNS$ + Bin2W() return numeric integer (or 0 if is not a string). + $DESCRIPTION$ + Bin2W() is one of the low-level binary conversion functions, those + functions convert between Harbour numeric and a character + representation of numeric value. Bin2W() take two bytes of encoded + 16-bit unsigned short integer and convert it into standard Harbour + numeric value. + + You might ask what is the need for such functions, well, first of + all it allow you to read/write information from/to a binary file + (like extracting information from DBF header), it is also a useful + way to share information from source other than Harbour (C for + instance). + + Bin2W() is the opposite of W2Bin() + $EXAMPLES$ + // Show header length of a DBF + #include "fileio.ch" + LOCAL hFile, cBuffer := Space( 2 ) + IF ( hFile := hb_vfOpen( "test.dbf", FO_READ ) ) != NIL + hb_vfSeek( hFile, 8 ) + hb_vfRead( hFile, @cBuffer, hb_BLen( cBuffer ) ) + ? "Length of DBF header in bytes:", Bin2W( cBuffer ) + hb_vfClose( hFile ) + ELSE + ? "Cannot open file" + ENDIF + $STATUS$ + R + $COMPLIANCE$ + C + $FILES$ + Library is core + $SEEALSO$ + Bin2I(), Bin2L(), Bin2U(), I2Bin(), L2Bin(), W2Bin(), Word(), U2Bin() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -144,7 +196,7 @@ I2Bin() return two bytes character string that contains 16-bit encoded signed short integer (least significant byte first). $DESCRIPTION$ - I2Bin() is one of the low level binary conversion functions, those + I2Bin() is one of the low-level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. I2Bin() take a numeric integer value and convert it into two bytes of encoded 16-bit signed short @@ -159,27 +211,26 @@ I2Bin() is the opposite of Bin2I() $EXAMPLES$ // Update DBF "last update" date - PROCEDURE Main() - LOCAL hFile, cYear, cMonth, cDay + #include "fileio.ch" + LOCAL hFile, cYear, cMonth, cDay + USE test + ? "Original update date is:", LUpdate() + dbCloseArea() + IF ( hFile := hb_vfOpen( "test.dbf", FO_READWRITE ) ) != NIL + hb_vfSeek( hFile, 1 ) + cYear := I2Bin( 68 ) + cMonth := I2Bin( 8 ) + cDay := I2Bin( 1 ) + hb_vfWrite( hFile, cYear , 1 ) // write only the first byte + hb_vfWrite( hFile, cMonth, 1 ) + hb_vfWrite( hFile, cDay , 1 ) + hb_vfClose( hFile ) USE test - ? "Original update date is:", LUpdate() + ? "New update date is:", LUpdate() dbCloseArea() - IF ( hFile := hb_vfOpen( "test.dbf", FO_READWRITE ) ) != NIL - hb_vfSeek( hFile, 1 ) - cYear := I2Bin( 68 ) - cMonth := I2Bin( 8 ) - cDay := I2Bin( 1 ) - hb_vfWrite( hFile, cYear , 1 ) // write only the first byte - hb_vfWrite( hFile, cMonth, 1 ) - hb_vfWrite( hFile, cDay , 1 ) - hb_vfClose( hFile ) - USE test - ? "New update date is:", LUpdate() - dbCloseArea() - ELSE - ? "Can not open file" - ENDIF - RETURN + ELSE + ? "Cannot open file" + ENDIF $STATUS$ R $COMPLIANCE$ @@ -192,6 +243,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -210,7 +263,7 @@ L2Bin() return four bytes character string that contains 32-bit encoded signed long integer (least significant byte first). $DESCRIPTION$ - L2Bin() is one of the low level binary conversion functions, those + L2Bin() is one of the low-level binary conversion functions, those functions convert between Harbour numeric and a character representation of numeric value. L2Bin() take a numeric integer value and convert it into four bytes of encoded 32-bit signed long @@ -246,7 +299,7 @@ $ONELINER$ Converts double to integer values. $SYNTAX$ - Word( ) --> + Word( ) --> nInteger $ARGUMENTS$ is a numeric double value. $RETURNS$ diff --git a/doc/en/browse.txt b/doc/en/browse.txt index ff4f0b8c03..94c318ec63 100644 --- a/doc/en/browse.txt +++ b/doc/en/browse.txt @@ -1,12 +1,6 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: Browse(), dbEdit(), TBrowseDB() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -43,22 +37,22 @@ into idle mode. If is a character string, it must contain root name of a valid user define function without parentheses. Both the user define function or the code block should - accept two parameters: nMode, nCurrentColumn. Both should return + accept two parameters: , . Both should return a numeric value that correspond to one of the expected return codes - (see table below for a list of nMode and return codes). + (see table below for a list of and return codes). is an optional picture. If is a character string, all columns would used this value as a picture string. If is an array, each element should be a character string that correspond to a picture string - for the column with the same index. Look at the help for @...SAY + for the column with the same index. Look at the help for `@...SAY` to get more information about picture values. contain the header titles for each column, if this is a character string, all columns would have that same header, if this is an array, each element is a character string that contain the header title for one column. Header may be split to more than - one line by placing semicolon (;) in places where you want to break + one line by placing semicolon `;` in places where you want to break line. If omitted, the default value for each column header is taken from or field name if was not specified. @@ -82,7 +76,7 @@ of each column, if this is a character string, all columns would have that same footer, if this is an array, each element is a character string that contain the footer for one column. Footer may - be split to more than one line by placing semicolon (;) in places + be split to more than one line by placing semicolon `;` in places where you want to break line. If omitted, no footer are displayed. $RETURNS$ dbEdit() return .F. if there is no database in use or if the number @@ -93,26 +87,25 @@ and is the equivalent of one field. Each row is equivalent of one database record. - Following are active keys that handled by dbEdit(): - --------------------------------------------------- + Following are active keys that handled by dbEdit(): - Key Meaning + Key Meaning - Left Move one column to the left (previous field) - Right Move one column to the right (next field) - Up Move up one row (previous record) - Down Move down one row (next record) - Page-Up Move to the previous screen - Page-Down Move to the next screen - Ctrl Page-Up Move to the top of the file - Ctrl Page-Down Move to the end of the file - Home Move to the leftmost visible column - End Move to the rightmost visible column - Ctrl Left Pan one column to the left - Ctrl Right Pan one column to the right - Ctrl Home Move to the leftmost column - Ctrl End Move to the rightmost column + Left Move one column to the left (previous field) + Right Move one column to the right (next field) + Up Move up one row (previous record) + Down Move down one row (next record) + PgUp Move to the previous screen + PgDn Move to the next screen + Ctrl+PgUp Move to the top of the file + Ctrl+PgDn Move to the end of the file + Home Move to the leftmost visible column + End Move to the rightmost visible column + Ctrl+Left Pan one column to the left + Ctrl+Right Pan one column to the right + Ctrl+Home Move to the leftmost column + Ctrl+End Move to the rightmost column
When is omitted, two more keys are active: @@ -125,12 +118,11 @@ When dbEdit() execute it pass the following arguments: - nMode and the index of current record in . If - is omitted, the index number is the FIELD() number of the open + and the index of current record in . If + is omitted, the index number is the FieldName() number of the open database structure. - dbEdit() nMode could be one of the following: - --------------------------------------------- + dbEdit() could be one of the following: dbedit.ch Meaning @@ -145,8 +137,7 @@ The user define function or code block must return a value that tell dbEdit() what to do next. - User function return codes: - --------------------------- + User function return codes:
dbedit.ch Meaning @@ -195,6 +186,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -229,23 +222,23 @@ Right Move one column to the right (next field) Up Move up one row (previous record) Down Move down one row (next record) - Page-Up Move to the previous screen - Page-Down Move to the next screen - Ctrl Page-Up Move to the top of the file - Ctrl Page-Down Move to the end of the file + PgUp Move to the previous screen + PgDn Move to the next screen + Ctrl+PgUp Move to the top of the file + Ctrl+PgDn Move to the end of the file Home Move to the leftmost visible column End Move to the rightmost visible column - Ctrl Left Pan one column to the left - Ctrl Right Pan one column to the right - Ctrl Home Move to the leftmost column - Ctrl End Move to the rightmost column + Ctrl+Left Pan one column to the left + Ctrl+Right Pan one column to the right + Ctrl+Home Move to the leftmost column + Ctrl+End Move to the rightmost column Esc Terminate Browse()
On top of the screen you see a status line with the following indication: - +
Record ###/### Current record number / Total number of records. There are no records, the file is empty. You are in append mode at the bottom of file. @@ -258,7 +251,7 @@ 1, 0, MaxRow(), MaxCol(). $EXAMPLES$ // this one shows you how to browse around - USE around + USE test Browse() $STATUS$ S @@ -272,6 +265,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -297,13 +292,13 @@ and a default :SkipBlock, :GoTopBlock and :GoBottomBlock to browse a database file. $DESCRIPTION$ - TBrowseDB() is a quick way to create a TBrowse object along with + TBrowseDB() is a quick way to create a TBrowse() object along with the minimal support needed to browse a database. Note that the - returned TBrowse object contain no TBColumn objects and you need + returned TBrowse() object contain no TBColumn() objects and you need to add column for each field by your self. $EXAMPLES$ - for a good example, look at the source code for Browse() function - at src/rtl/browse.prg + // For a good example, look at the source code for Browse() function + // at src/rtl/browse.prg $STATUS$ S $COMPLIANCE$ diff --git a/doc/en/command.txt b/doc/en/command.txt index 31f209340b..6236f05a7b 100644 --- a/doc/en/command.txt +++ b/doc/en/command.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2000 Brian Hays - * Documentation for the commands - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -48,7 +42,7 @@ inheritance can extend to many levels. A program uses a Class by calling the Class Constructor, usually the - New() method, to create an object. That object is usually assigned + `:New()` method, to create an object. That object is usually assigned to a variable, which is used to access the VAR elements and methods. @@ -56,6 +50,8 @@ and Delegating, and is largely compatible with Class(y)(tm), TopClass(tm) and Visual Objects(tm). $EXAMPLES$ + #include "hbclass.ch" + CREATE CLASS TBColumn VAR Block // Code block to retrieve data for the column @@ -73,6 +69,9 @@ METHOD New() // Constructor ENDCLASS + + METHOD New() CLASS TBColumn + RETURN Self $STATUS$ R $COMPLIANCE$ @@ -80,11 +79,13 @@ $PLATFORMS$ All $SEEALSO$ - HBClass(), Object Oriented Programming, VAR, METHOD + HBClass(), VAR, METHOD $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -102,7 +103,7 @@ Name of the VAR Optional data type specification from the following: - Character, Numeric, Date, Logical, Codeblock, Nil. + Character, Numeric, Date, Logical, Codeblock, NIL. Optional initial value when creating a new object. @@ -124,19 +125,21 @@ VAR elements can also be thought of as the "properties" of an object. They can be of any data type, including codeblock. Once an object has been created, the VAR elements are referenced - with the colon (:) as in MyObject:Heading := "Last name". + with the colon `:` as in `MyObject:Heading := "Last name"`. Usually a class also defines methods to manipulate the VAR. - You can use the "AS " clause to enforce that the VAR is + You can use the `AS ` clause to enforce that the VAR is maintained as a certain type. Otherwise it will take on the type of whatever value is first assigned to it. - Use the "INIT " clause to initialize that VAR to + Use the `INIT ` clause to initialize that VAR to whenever a new object is created. VAR can be a synonym for VAR, or it can use a slightly different syntax for compatibility with other dialects. $EXAMPLES$ + #include "hbclass.ch" + CREATE CLASS TBColumn VAR Block // Code block to retrieve data for the column @@ -154,6 +157,9 @@ METHOD New() // Constructor ENDCLASS + + METHOD New() CLASS TBColumn + RETURN Self $STATUS$ R $COMPLIANCE$ @@ -161,11 +167,13 @@ $PLATFORMS$ All $SEEALSO$ - Object Oriented Programming, CLASS, METHOD, CLASS VAR, VAR + CLASS, METHOD, CLASS VAR, VAR $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -182,23 +190,24 @@ Name of the VAR Optional data type specification from the following: - Character, Numeric, Date, Logical, Codeblock, Nil + Character, Numeric, Date, Logical, Codeblock, NIL Optional initial value at program startup $DESCRIPTION$ - CLASS VAR variables can also be thought of as the "properties" of an - entire class. Each CLASS VAR exists only once, no matter how many + `CLASS VAR` variables can also be thought of as the "properties" of an + entire class. Each `CLASS VAR` exists only once, no matter how many objects are created. A common usage is for a counter that is incremented whenever an object is created and decremented when one is destroyed, thus monitoring the number of objects in existence for this class. - You can use the "AS " clause to enforce that the CLASS VAR is + You can use the `AS ` clause to enforce that the `CLASS VAR` is maintained as a certain type. Otherwise it will take on the type of whatever value is first assigned to it. - Use the "INIT " clause to initialize that VAR to + Use the `INIT ` clause to initialize that `VAR` to whenever the class is first used. $EXAMPLES$ + #include "hbclass.ch" CREATE CLASS TWindow VAR hWnd, nOldProc CLASS VAR lRegistered AS LOGICAL @@ -210,11 +219,13 @@ $PLATFORMS$ All $SEEALSO$ - Object Oriented Programming, CLASS, METHOD, VAR + CLASS, METHOD, VAR $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -227,19 +238,12 @@ Declare a METHOD for a class in the class header $SYNTAX$ METHOD ( [] ) [CONSTRUCTOR] - METHOD ( [] ) INLINE - METHOD ( [] ) BLOCK - METHOD ( [] ) EXTERN ( [] ) - METHOD ( [] ) SETGET - METHOD ( [] ) VIRTUAL - METHOD ( [] ) OPERATOR - METHOD ( [] ) CLASS $ARGUMENTS$ Name of the method to define @@ -254,8 +258,8 @@ METHOD ( [] ) CLASS - Methods can reference the current object with the keyword "Self:" or - its shorthand version "::". + Methods can reference the current object with the keyword `Self:` or + its shorthand version `::`. CLAUSES: @@ -268,7 +272,7 @@ code for the method immediately within the definition of the Class. Any methods not declared INLINE or BLOCK must be fully defined after the ENDCLASS command. - The following INLINE receives a parameter + The following INLINE receives a parameter of Self. If you need to receive more parameters, use the BLOCK clause instead. @@ -276,7 +280,7 @@ methods that need parameters. The first parameter to must be Self, as in: - METHOD BLOCK {| Self, , , ..., | ... } + METHOD ` BLOCK {| Self, , , ..., | ... }` EXTERN If an external function does what the method needs, use this clause to make an optimized call to that @@ -296,21 +300,23 @@ Use this syntax only for defining a full method after the ENDCLASS command. $EXAMPLES$ + // FIXME + #include "hbclass.ch" CREATE CLASS TWindow VAR hWnd, nOldProc - METHOD New( ) CONSTRUCTOR + METHOD New() CONSTRUCTOR METHOD Capture() INLINE SetCapture( ::hWnd ) METHOD End() BLOCK {| Self, lEnd | iif( lEnd := ::lValid(), ; - ::PostMsg( WM_CLOSE ), ), lEnd } + ::PostMsg( "close" ), ), lEnd } METHOD EraseBkGnd( hDC ) METHOD cTitle( cNewTitle ) SETGET METHOD Close() VIRTUAL ENDCLASS - METHOD New( ) CLASS TWindow + METHOD New() CLASS TWindow LOCAL nVar, cStr - ... ... - ... ... + // ... ... + // ... ... RETURN Self $STATUS$ R @@ -319,11 +325,13 @@ $PLATFORMS$ All $SEEALSO$ - HBClass(), Object Oriented Programming, VAR, CLASS + HBClass(), VAR, CLASS $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -336,7 +344,6 @@ Route a method call to another Method $SYNTAX$ MESSAGE METHOD ( [] ) - MESSAGE () METHOD ( [] ) $ARGUMENTS$ The pseudo-method name to define @@ -353,19 +360,21 @@ For example, your app may have a public function called BeginPaint() that is used in painting windows. It would also be natural to have a - Window class method called :BeginPaint() that the application can + Window class method called `:BeginPaint()` that the application can call. But within the class method you would not be able to call the public function because internally methods are based on static functions (which hide public functions of the same name). The MESSAGE command lets you create the true method with a different - name (::xBeginPaint()), yet still allow the ::BeginPaint() syntax - to call ::xBeginPaint(). This is then free to call the public + name (`::xBeginPaint()`), yet still allow the `::BeginPaint()` syntax + to call `::xBeginPaint()`. This is then free to call the public function BeginPaint(). $EXAMPLES$ + // FIXME + #include "hbclass.ch" CREATE CLASS TWindow VAR hWnd, nOldProc - METHOD New( ) CONSTRUCTOR + METHOD New() CONSTRUCTOR MESSAGE BeginPaint METHOD xBeginPaint() ENDCLASS $STATUS$ @@ -375,11 +384,13 @@ $PLATFORMS$ All $SEEALSO$ - METHOD, VAR, CLASS, Object Oriented Programming + METHOD, VAR, CLASS $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -397,12 +408,17 @@ Optional parameter list $DESCRIPTION$ - ERROR HANDLER names the method that should handle errors for the + `ERROR HANDLER` names the method that should handle errors for the class being defined. $EXAMPLES$ + #include "hbclass.ch" + CREATE CLASS TWindow - ERROR HANDLER MyErrHandler() + ERROR HANDLER MyErrHandler() ENDCLASS + + METHOD MyErrHandler() CLASS TWindow + RETURN Self $STATUS$ R $COMPLIANCE$ @@ -410,11 +426,13 @@ $PLATFORMS$ All $SEEALSO$ - Object Oriented Programming, ON ERROR, CLASS, METHOD, VAR + ON ERROR, CLASS, METHOD, VAR $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -432,13 +450,18 @@ Optional parameter list $DESCRIPTION$ - ON ERROR is a synonym for ERROR HANDLER. + `ON ERROR` is a synonym for `ERROR HANDLER`. It names the method that should handle errors for the class being defined. $EXAMPLES$ + #include "hbclass.ch" + CREATE CLASS TWindow - ON ERROR MyErrHandler() + ON ERROR MyErrHandler() ENDCLASS + + METHOD MyErrHandler() CLASS TWindow + RETURN Self $STATUS$ R $COMPLIANCE$ @@ -446,11 +469,13 @@ $PLATFORMS$ All $SEEALSO$ - Object Oriented Programming, ERROR HANDLER, CLASS, METHOD, VAR + ERROR HANDLER, CLASS, METHOD, VAR $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Command $NAME$ @@ -469,6 +494,7 @@ ENDCLASS marks the end of a class declaration. It is usually followed by the class methods that are not INLINE. $EXAMPLES$ + #include "hbclass.ch" CREATE CLASS TWindow VAR hWnd, nOldProc ENDCLASS @@ -479,6 +505,6 @@ $PLATFORMS$ All $SEEALSO$ - Object Oriented Programming, CLASS, METHOD, VAR + CLASS, METHOD, VAR $END$ */ diff --git a/doc/en/compiler.txt b/doc/en/compiler.txt index 047e295843..3f61707c8e 100644 --- a/doc/en/compiler.txt +++ b/doc/en/compiler.txt @@ -8,132 +8,138 @@ $SUBCATEGORY$ Compiler $DESCRIPTION$ - Invoking the Harbour compiler: - ============================== + Invoking the Harbour compiler: + ============================== - harbour [options] - or - harbour [options] - or - harbour [options] [options] + ``` + harbour [options] + ``` + or + ``` + harbour [options] + ``` + or + ``` + harbour [options] [options] + ``` The command-line options have to be separated by at least one space. - The option can start with either '/' character or '-' character. + The option can start with either `-` character or `/` character. - The Harbour command-line options: - ================================= + The Harbour command-line options: + ================================= - /a automatic memvar declaration - ================= + `-a` automatic memvar declaration This causes all variables declared by PARAMETER, PRIVATE or PUBLIC statements to be automatically declared as MEMVAR variables. - /b debug info - ================= + ================= + `-b` debug info The compiler generates all information required for debugging - /build display detailed version info - ================= + ================= + `-build` display detailed version info - /credits display credits - ================= + ================= + `-credits` display credits - /d[=] #define - ================= + ================= + `-d[=]` `#define ` - /es[] set exit severity - ================= + ================= + `-es[]` set exit severity - /es or /es0 - all warnings are ignored and exit code returned by - the compiler is equal to 0 if there are no errors - in compiled source file. + `-es` or `-es0` - all warnings are ignored and exit code returned by + the compiler is equal to 0 if there are no errors + in compiled source file. - /es1 - any warnings generate a non-zero exit code, but + `-es1` - any warnings generate a non-zero exit code, but output is still created. - /es2 - all warnings are treated as errors and no output + `-es2` - all warnings are treated as errors and no output file is created. The exit code is set to a non-zero value. - /fn[:[l|u]|-] set filename casing (l=lower u=upper) - ================= + ================= + `-fn[:[l|u]|-]` set file name casing (`l`=lower `u`=upper) - /fd[:[l|u]|-] set directory casing (l=lower u=upper) - ================= + ================= + `-fd[:[l|u]|-]` set directory casing (`l`=lower `u`=upper) - /fp[:] set path separator - ================= + ================= + `-fp[:]` set path separator - /fs[-] turn filename space trimming on or off (default) - ================= + ================= + `-fs[-]` turn file name space trimming on or off (default) - /g output type generated is - ================= + ================= + `-g` output type generated is - /gc[] output type: C source (.c) (default) - : 0=compact (default) 1=normal 2=verbose - 3=generate real C code + `-gc[]` output type: C source `.c` (default) + : `0`=compact (default) `1`=normal `2`=verbose + `3`=generate real C code - /gh output type: Harbour Portable Object (.hrb) + `-gh` output type: Harbour Portable Object `.hrb` - /gd[.] generate dependencies list into (.d) file + `-gd[.]` generate dependencies list into `.d` file - /ge[] error output : 0=Clipper (default) - 1=IDE friendly + `-ge[]` error output : `0`=Clipper (default) + `1`=IDE friendly - /i #include file search path - ================= + ================= + `-i` #include file search path - /i[-|+] disable/enable support for INCLUDE envvar - ================= + ================= + `-i[-|+]` disable/enable support for INCLUDE envvar - /j[] generate i18n gettext file (.pot) - ================= + ================= + `-j[]` generate i18n gettext file `.pot` - /k compilation mode (type -k? for more data) - ================= + ================= + `-k` compilation mode (type `-k?` for more data) - /kc clear all flags (strict Clipper mode) + `-kc` clear all flags (strict Clipper mode) - /kh Harbour mode (default) + `-kh` Harbour mode (default) - /ko allow operator optimizations + `-ko` allow operator optimizations - /ki enable support for HB_INLINE (default) + `-ki` enable support for HB_INLINE (default) - /kr runtime settings enabled + `-kr` runtime settings enabled - /ks allow indexed assignment on all types + `-ks` allow indexed assignment on all types - /kx extended Xbase++ mode (default) + `-kx` extended Xbase++ mode (default) - /ku strings in user encoding + `-ku` strings in user encoding - /kd accept macros with declared symbols + `-kd` accept macros with declared symbols - /km turn off macrotext substitution + `-km` turn off macro-text substitution - /kj turn off jump optimization in pcode + `-kj` turn off jump optimization in pcode - /k? this info + `-k?` this info - /l suppress line number information - ================= + ================= + `-l` suppress line number information The compiler does not generate the source code line numbers in the output file. The ProcLine() function will return 0 for modules compiled using this option. - /m compile module only - ================= + ================= + `-m` compile module only - /n[] no implicit starting procedure - ================= - : 0=no implicit starting procedure - 1=no starting procedure at all - 2=add starting procedure if necessary + ================= + `-n[]` no implicit starting procedure + + : `0`=no implicit starting procedure + `1`=no starting procedure at all + `2`=add starting procedure if necessary The compiler does not create a procedure with the same name as the compiled file. This means that any declarations placed @@ -143,86 +149,89 @@ placed at the beginning of the file and before the first PROCEDURE/FUNCTION statement are ignored. - /o object file drive and/or path - ================= + ================= + `-o` object file drive and/or path - /p generate pre-processed output (.ppo) file - ================= + ================= + `-p` generate pre-processed output `.ppo` file The compiler only creates the file that contains the result of pre-processing the source file. - /p+ generate pre-processor trace (.ppt) file - ================= + ================= + `-p+` generate pre-processor trace `.ppt` file - /q quiet - ================= + ================= + `-q` quiet The compiler does not print any messages during compiling (except the copyright info). - /q0 quiet and don't display program header + `-q0` quiet and don't display program header - /q2 disable all output messages + `-q2` disable all output messages - /r[] request linker to search (or none) - ================= + `-ql` suppress line number information + + ================= + `-r[]` request linker to search (or none) Currently not supported in Harbour. - /r= sets maximum number of preprocessor iterations - ================= + ================= + `-r=` sets maximum number of preprocessor iterations This set the maximum number of preprocessor iterations during processing the source code. If this switch is not used then the preprocessor stops after 1024 iterations. This value is used to stop processing of infinite loops, for example: - #command ( => (,7 + `#command ( => (,7` - /s[m] syntax check only [minimal for dependencies list] - ================= + ================= + `-s[m]` syntax check only [minimal for dependencies list] The compiler checks the syntax only. No output file is generated. - /t path for temp file creation - ================= + + ================= + `-t` path for temp file creation Currently not used in Harbour (the Harbour compiler does not create any temporary files). - /u[] use command def set in (or none) - ================= + ================= + `-u[]` use command def set in (or none) - /u+ add command def set from - ================= + ================= + `-u+` add command def set from - /undef: #undef - ================= + ================= + `-undef:` `#undef ` - /v variables are assumed M-> - ================= + ================= + `-v` variables are assumed `M->` All undeclared or unaliased variables are assumed MEMVAR variables (private or public variables). If this switch is not used then the scope of such variables is checked at runtime. - /w[] set warning level number (0..3, default 1) - ================= + ================= + `-w[]` set warning level number (0..3, default 1) - /w0 - no warnings + `-w0` - no warnings - /w or /w1 - CA-Cl*pper compatible warnings + `-w` or `-w1` - CA-Cl*pper compatible warnings - /w2 - some useful warnings missed in CA-Cl*pper + `-w2` - some useful warnings missed in CA-Cl*pper - /w3 - warnings generated for Harbour language extensions - and also enables strong type checking but only - warns against declared types, or types which may be - calculated at compile time + `-w3` - warnings generated for Harbour language extensions + and also enables strong type checking but only + warns against declared types, or types which may be + calculated at compile time - /x[] set symbol init function name prefix (for .c only) - ================= + ================= + `-x[]` set symbol init function name prefix (for `.c` only) Sets the prefix added to the generated symbol init function name (in C output currently). This function is generated @@ -230,31 +239,30 @@ prefix can be used to suppress problems with duplicated symbols during linking an application with some third party libraries. - /z suppress shortcutting (.and. & .or.) - ================= + ================= + `-z` suppress shortcutting (`.AND.` & `.OR.`) - Compilation in batch mode. - ========================== + Compilation in batch mode. + ========================== - @ compile list of modules in - ================= + `@file` compile list of modules in Not supported yet. - Known incompatibilities between Harbour and CA-Cl*pper compilers - ============================================================= + Known incompatibilities between Harbour and CA-Cl*pper compilers + ============================================================= - NOTE: + Note: If you want a 100% compatible runtime libraries then you have - to define HB_CLP_STRICT, using 'HB_USER_CFLAGS=-DHB_CLP_STRICT', + to define HB_CLP_STRICT, using `HB_USER_CFLAGS=-DHB_CLP_STRICT`, then rebuild. - Passing an undeclared variable by the reference - =============================================== + Passing an undeclared variable by the reference + =============================================== The CA-Cl*pper compiler uses the special opcode PUSHP to pass a - reference to an undeclared variable ( '@' operator ). The type of + reference to an undeclared variable (`@` operator). The type of passed variable is checked at runtime (field or memvar). However, field variables cannot be passed by reference. This means that CA-Cl*pper checks the memvar variable only and doesn't look for a field. @@ -263,23 +271,23 @@ is the same in CA-Cl*pper and in Harbour - only the generated opcodes are different. - Handling of object messages - =========================== + Handling of object messages + =========================== The HB_CLP_STRICT setting determines the way chained send messages are handled. For example, the following code: - a:b( COUNT() ):c += 1 + `a:b( COUNT() ):c += 1` will be handled as: - a:b( COUNT() ):c := a:b( COUNT() ):c + 1 + `a:b( COUNT() ):c := a:b( COUNT() ):c + 1` in strict CA-Cl*pper compatibility mode and - temp := a:b( COUNT() ), temp:c += 1 + `temp := a:b( COUNT() ), temp:c += 1` in non-strict mode. @@ -287,44 +295,43 @@ the first time before addition and the second one after addition. In Harbour, COUNT() will be called only once, before addition. - The Harbour (non-strict) method is: - 1) faster + The Harbour (non-strict) method is: + + 1) faster + 2) it guarantees that the same instance variable of the same object will be changed - (See also: src/compiler/expropt.c) + (See also: include/hbexpra.c, include/hbexprb.c) - Initialization of static variables - ================================== + Initialization of static variables + ================================== There is a difference in the initialization of static variables that are initialized with a codeblock that refers to a local variable. For example: - PROCEDURE Main() - LOCAL MyLocalVar - STATIC s_MyStaticVar := {|| MyLocalVar } + LOCAL MyLocalVar + STATIC s_MyStaticVar := {|| MyLocalVar } - MyLocalVar := 0 - ? Eval( s_MyStaticVar ) - - RETURN + MyLocalVar := 0 + ? Eval( s_MyStaticVar ) The above code compiles fine in CA-Cl*pper, but it generates a - runtime error Error/BASE 1132 Bound error: array access - Called form (b)STATICS$(0) + runtime error `Error/BASE 1132 Bound error: array access + Called form (b)STATICS$(0)` In Harbour this code generates a compile time error: - Error E0009 Illegal variable (b) initializer: 'MyLocalVar' + `Error E0009 Illegal variable (b) initializer: 'MyLocalVar'` Both CA-Cl*pper and Harbour are handling all local variables used in a codeblock in a special way: they are detached from the local stack of function/procedure where they are declared. This allows access to these variables after the exit from a function/procedure. However, all static variables are initialized in a separate procedure - ('STATICS$' in CA-Cl*pper and '(_INITSTATICS)' in Harbour) before the + (`STATICS$` in CA-Cl*pper and `(_INITSTATICS)` in Harbour) before the main procedure and before all INIT procedures. The local variables don't exist on the eval stack when static variables are initialized, so they cannot be detached. diff --git a/doc/en/datetime.txt b/doc/en/datetime.txt index f5b97ae4f1..3be8332957 100644 --- a/doc/en/datetime.txt +++ b/doc/en/datetime.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2000 Luiz Rafael Culik - * Documentation for: CDoW(), CMonth(), Date(), CToD(), Day(), Days() - * DoW(), DToS(), DToC(), ElapTime(), Month(), Seconds(), Secs(), Time(), Year() - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -47,6 +41,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -71,7 +67,7 @@ $EXAMPLES$ ? CMonth( Date() ) IF CMonth( Date() + 10 ) == "March" - ? "Have you done your system BACKUP?" + ? "Have you done your system backup?" ENDIF $STATUS$ R @@ -87,6 +83,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -122,6 +120,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -141,8 +141,8 @@ $DESCRIPTION$ This function converts a date that has been entered as a character expression to a date expression. The character expression will be in - the form "MM/DD/YY" (based on the default value in SET DATE) or in - the appropriate format specified by the SET DATE TO command. If an + the form `MM/DD/YY` (based on the default value in `SET DATE`) or in + the appropriate format specified by the `SET DATE TO` command. If an improper character string is passed to the function, an empty date value will be returned. $EXAMPLES$ @@ -162,6 +162,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -198,6 +200,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -219,7 +223,7 @@ of days; 86399 seconds represents one day, 0 seconds being midnight. $EXAMPLES$ ? Days( 2434234 ) - ? "Has been passed", Days( 63251 ), "since midnight" + ? Days( 63251 ) $STATUS$ R $COMPLIANCE$ @@ -234,6 +238,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -271,6 +277,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -286,12 +294,12 @@ $ARGUMENTS$ Any date $RETURNS$ - Character represention of date + Character representation of date $DESCRIPTION$ This function converts any date expression (a field or variable) expressed as to a character expression in the default - format "MM/DD/YY". The date format expressed by this function is - controled in part by the date format specified in the SET DATE + format `MM/DD/YY`. The date format expressed by this function is + controlled in part by the date format specified in the `SET DATE` command $EXAMPLES$ ? DToC( Date() ) @@ -309,6 +317,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -327,7 +337,7 @@ String notation of the date $DESCRIPTION$ This function returns the value of as a character - string in the format of YYYYMMDD. If the value of is + string in the format of `YYYYMMDD`. If the value of is an empty date, this function will return eight blank spaces. $EXAMPLES$ ? DToS( Date() ) @@ -345,6 +355,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -354,14 +366,14 @@ $SUBCATEGORY$ Date/Time $ONELINER$ - Calculates elapted time. + Calculates elapsed time. $SYNTAX$ - ElapTime( , ) --> cDiference + ElapTime( , ) --> cDifference $ARGUMENTS$ Start in time as a string format End time as a string format $RETURNS$ - Difference between the times + Difference between the times $DESCRIPTION$ This function returns a string that shows the difference between the starting time represented as and the ending time @@ -389,6 +401,58 @@ */ /* $DOC$ + $AUTHOR$ + 2017 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_Week() + $CATEGORY$ + API + $SUBCATEGORY$ + Date/Time + $ONELINER$ + Returns the week number of year. + $SYNTAX$ + hb_Week( , [@], [@] ) --> nWeekNumber + $ARGUMENTS$ + Any valid date expression. + + Optional parameter to hold the year of the given date. + + Optional parameter to hold the day number of week. + $RETURNS$ + The ordinal week number of the year into which falls + the given . + $DESCRIPTION$ + This function returns the week number of year for the given . + The returned value is an ISO 8601 compliant week number. + Optionally, can also be obtained the year and/or the day number of + the week of the given , if the and/or + parameters have been passed by reference. + If is an empty date expression, the function returns zero(s). + Note: new function available after 2017-02-08 19:36 UTC+0100 commit, + not found in earlier versions. + $EXAMPLES$ + LOCAL nYear, nDayOfWeek + ? hb_Week( 0d20170215, @nYear, @nDayOfWeek ), nYear, nDayOfWeek // --> 7, 2017, 3 + ? hb_Week( 0d00000000, @nYear, @nDayOfWeek ), nYear, nDayOfWeek // --> 0, 0, 0 + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + Year(), Month(), Day() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -408,7 +472,7 @@ 0 to 12 $DESCRIPTION$ This function returns a number that represents the month of a given - date expression . If a NULL date (CToD( "" )) is passed to the + date expression . If a NULL date (`hb_SToD()`) is passed to the function, the value of the function will be 0. $EXAMPLES$ ? Month( Date() ) @@ -426,6 +490,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -464,6 +530,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -500,6 +568,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -518,7 +588,7 @@ Character string representing time $DESCRIPTION$ This function returns the system time represented as a character - expression in the format of HH:MM:SS + expression in the format of `HH:MM:SS` $EXAMPLES$ ? Time() $STATUS$ @@ -535,6 +605,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -544,22 +616,21 @@ $SUBCATEGORY$ Date/Time $ONELINER$ - Converts the year portion of a date into a numeric value + Extracts the year designator of a given date as a numeric value $SYNTAX$ - Year( ) --> nYear + Year( ) --> nYear $ARGUMENTS$ Any valid date expression $RETURNS$ The year portion of the date. $DESCRIPTION$ This function returns the numeric value for the year in . - This value will always be a four-digit number and is not affected - by the setting of the SET CENTURY and SET DATE commands. Addition - ally, an empty date expression passed to this function will yield - a zero value. + The returned value is not affected by the `SET CENTURY` and `SET DATE` + settings and will always be a four-digit year number, unless the + is an empty date expression, in which case it will be zero. $EXAMPLES$ ? Year( Date() ) - ? Year( hb_SToD( "32510125" ) ) + ? Year( 0d32510125 ) $STATUS$ R $COMPLIANCE$ @@ -572,3 +643,49 @@ Day(), Month() $END$ */ + +/* $DOC$ + $AUTHOR$ + + $TEMPLATE$ + Function + $NAME$ + hb_DToT() + $CATEGORY$ + API + $SUBCATEGORY$ + Date/Time + $ONELINER$ + Create a value from a parameter + $SYNTAX$ + hb_DToT( [, ] ) --> + $ARGUMENTS$ + Any valid date expression. + + Optional: representing a time of the day value. + is a string in a valid time format: "hh:mm:ss.nnn". + is a numeric value in seconds in the range from + 0 to 86399.999~ ( 60 secs * 60 mins * 24 hours - 1 millisecond ) + $RETURNS$ + a dateTime value + $DESCRIPTION$ + This function returns a value from a value. + Optionally, a second parameter with the time of the day value + can be provided which can be represented by either of a string + time value or a numeric value in seconds. + $EXAMPLES$ + ? hb_DToT( Date() ) // a dateTime with a empty time part + ? hb_DToT( Date(), "14:30:00.500" ) // a dateTime with time part 14:30pm with 500 milliseconds + ? hb_DToT( Date(), 3600 ) // a dateTime with time part 1:00am (one hour) + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + Date() + $END$ + */ diff --git a/doc/en/dbdelim.txt b/doc/en/dbdelim.txt index f2df4b1c44..2aec842b46 100644 --- a/doc/en/dbdelim.txt +++ b/doc/en/dbdelim.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2001-2002 David G. Holm - * Documentation for: __dbDelim() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2001-2002 David G. Holm $TEMPLATE$ Procedure $NAME$ @@ -29,11 +23,11 @@ If a file extension is not specified, ".txt" is used by default. Either the character to use as the character field - delimiter (only the first character is used). or "BLANK" (not case + delimiter (only the first character is used). or `"BLANK"` (not case sensitive), which eliminates the character field delimiters and sets the field separator to a single space instead of a comma. - An aray of field names to limit the processint to. If + An array of field names to limit the processing to. If not specified, or if empty, then all fields are processed. An optional code block containing a FOR expression that diff --git a/doc/en/dbsdf.txt b/doc/en/dbsdf.txt index 371e2992c3..57864ff16b 100644 --- a/doc/en/dbsdf.txt +++ b/doc/en/dbsdf.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2001-2002 David G. Holm - * Documentation for: __dbSDF() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2001-2002 David G. Holm $TEMPLATE$ Procedure $NAME$ @@ -16,11 +10,11 @@ $SUBCATEGORY$ Database $ONELINER$ - Copies the contents of a database to an SDF text file or - appends the contents of an SDF text file to a database. + Copies the contents of a database to an SDF text file or appends the + contents of an SDF text file to a database. $SYNTAX$ __dbSDF( , , [], - [], [], [], [], ) + [], [], [], [], ) $ARGUMENTS$ If set to .T., copies records to an SDF file. If set to .F., append records from an SDF file. @@ -28,34 +22,35 @@ The name of the text file to copy to or append from. If a file extension is not specified, ".txt" is used by default. - An aray of field names to limit the processint to. If - not specified, or if empty, then all fields are processed. + An array of field names to limit the processing to. If not + specified, or if empty, then all fields are processed. - An optional code block containing a FOR expression that - will reduce the number of records to be processed. + An optional code block containing a FOR expression that will + reduce the number of records to be processed. - An optional code block containing a WHILE expression - that will reduce the number of records to be processed. + An optional code block containing a WHILE expression that will + reduce the number of records to be processed. - If present, but is not present, specifies to - process this number of records, starting with the current record. + If present, but is not present, specifies to process + this number of records, starting with the current record. A value of 0 means to process no records. - If present, specifies the only record to process. A - value of 0 means to process no records. Overrides and . + If present, specifies the only record to process. A value of 0 + means to process no records. Overrides and . - If is .T., then if is set to .T. and there are no - , , or arguments, processes all records from + If is .T., then if is set to .T. and there are + no , , or arguments, processes all records from current to last. $DESCRIPTION$ - __dbSDF() copies all or selected contents of a database table - to an SDF text file or appends all or selected contents of an - SDF text file to a database table. + __dbSDF() copies all or selected contents of a database table to an SDF + text file or appends all or selected contents of an SDF text file to a + database table. $EXAMPLES$ // Copy delinquent accounts into an SDF text file. USE accounts NEW - COPY TO overdue SDF FOR ! Empty( accounts->duedate ) ; - .AND. Date() - accounts->duedate > 30 + COPY TO overdue SDF FOR ; + ! Empty( accounts->duedate ) .AND. ; + Date() - accounts->duedate > 30 // Import new customer records. USE customer NEW APPEND FROM customer SDF diff --git a/doc/en/dbstrux.txt b/doc/en/dbstrux.txt index c7c970855c..b56dced490 100644 --- a/doc/en/dbstrux.txt +++ b/doc/en/dbstrux.txt @@ -1,14 +1,6 @@ -/* - * Copyright 2000 Chen Kedem - * Documentation for: __dbCopyStruct(), COPY STRUCTURE, __dbCopyXStruct(), - * COPY STRUCTURE EXTENDED, __dbCreate(), CREATE, - * CREATE FROM, __FLedit(), __dbStructFilter() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -22,7 +14,7 @@ $SYNTAX$ __dbCopyStruct( , [] ) $ARGUMENTS$ - is the name of the new database file to create. (.dbf) + is the name of the new database file to create. `.dbf` is the default extension if none is given. is an array where each element is a field name. @@ -37,7 +29,7 @@ __dbCopyStruct() can be use to create a sub-set of the currently open database, based on a given field list. - COPY STRUCTURE command is preprocessed into __dbCopyStruct() + `COPY STRUCTURE` command is preprocessed into __dbCopyStruct() function during compile time. $EXAMPLES$ // Create a new file that contain the same structure @@ -63,6 +55,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -76,22 +70,22 @@ $SYNTAX$ COPY STRUCTURE TO [FIELDS ] $ARGUMENTS$ - TO is the name of the new database file to - create. (.dbf) is the default extension if none is given. It can be + `TO xcFileName` is the name of the new database file to + create. `.dbf` is the default extension if none is given. It can be specified as a literal file name or as a character expression enclosed in parentheses. - FIELDS is an optional list of field names to copy + `FIELDS `field,...` is an optional list of field names to copy from the currently open database in the specified order, the default is all fields. Names could be specified as uppercase or lowercase. $DESCRIPTION$ - COPY STRUCTURE create a new empty database file with a structure + `COPY STRUCTURE` create a new empty database file with a structure that is based on the currently open database in this work-area. - COPY STRUCTURE can be use to create a sub-set of the currently + `COPY STRUCTURE` can be use to create a sub-set of the currently open database, based on a given field list. - COPY STRUCTURE command is preprocessed into __dbCopyStruct() + `COPY STRUCTURE` command is preprocessed into __dbCopyStruct() function during compile time. $EXAMPLES$ // Create a new file that contains the same structure @@ -113,6 +107,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -126,27 +122,27 @@ $SYNTAX$ __dbCopyXStruct( ) --> lSuccess $ARGUMENTS$ - is the name of target definition file to create. (.dbf) + is the name of target definition file to create. `.dbf` is the default extension if none is given. $RETURNS$ - __dbCopyXStruct() returns .F. if no database is USED in the current + __dbCopyXStruct() returns .F. if no database is *used* in the current work-area, .T. on success, or a run-time error if the file create operation had failed. $DESCRIPTION$ __dbCopyXStruct() create a new database named with a pre-defined structure (also called "structure extended file"): -
+
Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 -
+ Each record in the new file contains information about one field in - the original file. CREATE FROM could be used to create a database + the original file. `CREATE FROM` could be used to create a database from the structure extended file. For prehistoric compatibility reasons, Character fields which are @@ -156,7 +152,7 @@ FIELD->FIELD_DEC := Int( nLength / 256 ) - FIELD->FIELD_LEN := ( nLength % 256 ) + FIELD->FIELD_LEN := nLength % 256 Later if you want to calculate the length of a field you can use @@ -168,7 +164,7 @@ FIELD->FIELD_LEN ) - COPY STRUCTURE EXTENDED command is preprocessed into + `COPY STRUCTURE EXTENDED` command is preprocessed into __dbCopyXStruct() function during compile time. $EXAMPLES$ // Open a database, then copy its structure to a new file, @@ -191,6 +187,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -205,24 +203,24 @@ COPY STRUCTURE EXTENDED TO $ARGUMENTS$ The name of the target definition file to - create. (.dbf) is the default extension if none is given. It can be + create. `.dbf` is the default extension if none is given. It can be specified as a literal file name or as a character expression enclosed in parentheses. $DESCRIPTION$ - COPY STRUCTURE EXTENDED create a new database named with + `COPY STRUCTURE EXTENDED` create a new database named with a pre-defined structure (also called "structure extended file"): - +
Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 -
+ Each record in the new file contains information about one field in - the original file. CREATE FROM could be used to create a database + the original file. `CREATE FROM` could be used to create a database from the structure extended file. For prehistoric compatibility reasons, Character fields which are @@ -232,7 +230,7 @@ FIELD->FIELD_DEC := Int( nLength / 256 ) - FIELD->FIELD_LEN := ( nLength % 256 ) + FIELD->FIELD_LEN := nLength % 256 Later if you want to calculate the length of a field you can use @@ -244,7 +242,7 @@ FIELD->FIELD_LEN ) - COPY STRUCTURE EXTENDED command is preprocessed into + `COPY STRUCTURE EXTENDED` command is preprocessed into __dbCopyXStruct() function during compile time. $EXAMPLES$ // Open a database, then copy its structure to a new file, @@ -265,6 +263,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -278,7 +278,7 @@ $SYNTAX$ __dbCreate( , [], [], [], [] ) --> lUsed $ARGUMENTS$ - is the target file name to create and then open. (.dbf) + is the target file name to create and then open. `.dbf` is the default extension if none is given. is an optional structure extended file name from which @@ -298,9 +298,9 @@ is an optional alias to USE the target file with. If not specified, alias is based on the root name of . $RETURNS$ - __dbCreate() returns (.T.) if there is database USED in the + __dbCreate() returns (.T.) if there is database *used* in the current work-area (this might be the newly selected work-area), or - (.F.) if there is no database USED. Note that on success a (.T.) + (.F.) if there is no database *used*. Note that on success a (.T.) would be returned, but on failure you probably end up with a run-time error and not a (.F.) value. $DESCRIPTION$ @@ -311,14 +311,14 @@ then opened in the current work-area ( is ignored). The new file has the following structure: - +
Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 -
+ The CREATE command is preprocessed into the __dbCopyStruct() function during compile time and uses this mode. @@ -338,10 +338,10 @@ FIELD->FIELD_DEC := Int( nLength / 256 ) - FIELD->FIELD_LEN := ( nLength % 256 ) + FIELD->FIELD_LEN := nLength % 256 - CREATE FROM command is preprocessed into __dbCopyStruct() function + `CREATE FROM` command is preprocessed into __dbCopyStruct() function during compile time and use this mode. $EXAMPLES$ // CREATE a new structure extended file, append some records and @@ -379,6 +379,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -392,16 +394,16 @@ $SYNTAX$ CREATE [VIA ] [ALIAS ] $ARGUMENTS$ - is the target file name to create and then open. (.dbf) + is the target file name to create and then open. `.dbf` is the default extension if none is given. It can be specified as literal file name or as a character expression enclosed in parentheses. - VIA is RDD name to create target with. If omitted, + `VIA xcRDDName` is RDD name to create target with. If omitted, the default RDD is used. It can be specified as literal name or as a character expression enclosed in parentheses. - ALIAS is an optional alias to USE the target file + `ALIAS xcAlias` is an optional alias to USE the target file with. If not specified, alias is based on the root name of . $DESCRIPTION$ @@ -409,14 +411,14 @@ and then open it in the current work-area. The new file has the following structure: - +
Field name Type Length Decimals FIELD_NAME C 10 0 FIELD_TYPE C 1 0 FIELD_LEN N 3 0 FIELD_DEC N 3 0 -
+ CREATE command is preprocessed into __dbCopyStruct() function during compile time and use this mode. @@ -454,6 +456,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -467,29 +471,29 @@ $SYNTAX$ CREATE FROM [VIA ] [NEW] [ALIAS ] $ARGUMENTS$ - is the target file name to create and then open. (.dbf) + is the target file name to create and then open. `.dbf` is the default extension if none is given. It can be specified as literal file name or as a character expression enclosed in parentheses. - FROM is a structure extended file name from + `FROM xcFileFrom` is a structure extended file name from which the target file is going to be built. It can be specified as literal file name or as a character expression enclosed in parentheses. - VIA is RDD name to create target with. If omitted, + `VIA xcRDDName` is RDD name to create target with. If omitted, the default RDD is used. It can be specified as literal name or as a character expression enclosed in parentheses. - NEW open the target file name in the next + `NEW` open the target file name in the next available unused work-area and making it the current work-area. If omitted open the target file in current work-area. - ALIAS is an optional alias to USE the target file + `ALIAS xcAlias` is an optional alias to USE the target file with. If not specified, alias is based on the root name of . $DESCRIPTION$ - CREATE FROM open a structure extended file where each + `CREATE FROM` open a structure extended file where each record contain at least the following fields (in no particular order): FIELD_NAME, FIELD_TYPE, FIELD_LEN and FIELD_DEC. Any other field is ignored. From this information the file is @@ -503,13 +507,13 @@ FIELD->FIELD_DEC := Int( nLength / 256 ) - FIELD->FIELD_LEN := ( nLength % 256 ) + FIELD->FIELD_LEN := nLength % 256 - CREATE FROM command is preprocessed into __dbCopyStruct() function + `CREATE FROM` command is preprocessed into __dbCopyStruct() function during compile time and uses this mode. $EXAMPLES$ - See example in the CREATE command + // See example in the CREATE command $STATUS$ R $COMPLIANCE$ @@ -522,6 +526,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -539,14 +545,14 @@ structure, which is usually the output from dbStruct(), where each array element has the following structure: - +
Position Description dbstruct.ch 1 cFieldName DBS_NAME 2 cFieldType DBS_TYPE 3 nFieldLength DBS_LEN 4 nDecimals DBS_DEC -
+ is an array where each element is a field name. Names could be specified as uppercase or lowercase. @@ -560,14 +566,15 @@ __FLedit() can be use to create a sub-set of a database structure, based on a given field list. - Note that field names in MUST be specified in uppercase - or else no match would found. + Note that field names in _must_ be specified in uppercase + or else no match would be found. - SET EXACT has no effect on the return value. + `SET EXACT` has no effect on the return value. __FLedit() is a compatibility function and it is synonym for __dbStructFilter() which does exactly the same. $EXAMPLES$ + // FIXME LOCAL aStruct, aList, aRet aStruct := { ; { "CODE", "N", 4, 0 }, ; @@ -576,18 +583,17 @@ { "IQ", "N", 3, 0 } } aList := { "IQ", "NAME" } aRet := __FLedit( aStruct, aList ) - // { { "IQ", "N", 3, 0 }, { "NAME", "C", 10, 0 } } + // { { "IQ", "N", 3, 0 }, { "NAME", "C", 10, 0 } } aRet := __FLedit( aStruct, {} ) - ? aRet == aStruct // .T. + ? aRet == aStruct // .T. aList := { "iq", "NOTEXIST" } aRet := __FLedit( aStruct, aList ) - // { { "IQ", "N", 3, 0 } } + // { { "IQ", "N", 3, 0 } } aList := { "NOTEXIST" } - aRet := __FLedit( aStruct, aList ) // {} - + aRet := __FLedit( aStruct, aList ) // {} // Create a new file that contain part of the original structure LOCAL aStruct, aList, aRet @@ -617,6 +623,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -634,14 +642,14 @@ structure, which is usually the output from dbStruct(), where each array element has the following structure: - +
Position Description dbstruct.ch 1 cFieldName DBS_NAME 2 cFieldType DBS_TYPE 3 nFieldLength DBS_LEN 4 nDecimals DBS_DEC -
+ is an array where each element is a field name. Names could be specified as uppercase or lowercase. @@ -655,11 +663,12 @@ __dbStructFilter() can be use to create a sub-set of a database structure, based on a given field list. - Note that field names in MUST be specified in uppercase + Note that field names in _must_ be specified in uppercase or else no match would be found. - SET EXACT has no effect on the return value. + `SET EXACT` has no effect on the return value. $EXAMPLES$ + // FIXME LOCAL aStruct, aList, aRet aStruct := { ; { "CODE", "N", 4, 0 }, ; @@ -668,18 +677,17 @@ { "IQ", "N", 3, 0 } } aList := { "IQ", "NAME" } aRet := __dbStructFilter( aStruct, aList ) - // { { "IQ", "N", 3, 0 }, { "NAME", "C", 10, 0 } } + // { { "IQ", "N", 3, 0 }, { "NAME", "C", 10, 0 } } aRet := __dbStructFilter( aStruct, {} ) - ? aRet == aStruct // .T. + ? aRet == aStruct // .T. aList := { "iq", "NOTEXIST" } aRet := __dbStructFilter( aStruct, aList ) - // { { "IQ", "N", 3, 0 } } + // { { "IQ", "N", 3, 0 } } aList := { "NOTEXIST" } - aRet := __dbStructFilter( aStruct, aList ) // {} - + aRet := __dbStructFilter( aStruct, aList ) // --> {} // Create a new file that contain part of the original structure LOCAL aStruct, aList, aRet diff --git a/doc/en/dir.txt b/doc/en/dir.txt index ac973fa391..6ec4f772df 100644 --- a/doc/en/dir.txt +++ b/doc/en/dir.txt @@ -1,12 +1,6 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: __Dir(), DIR, ADir() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -50,10 +44,10 @@ // list all PRG files in Harbour Run-Time library // for MS-DOS compatible operating systems - __Dir( "src\rtl\*.prg" ) + __Dir( hb_DirSepToOS( "src/rtl/*.prg" ) ) // list all files in the public section on a Unix like machine - __Dir( "/pub" ) + __Dir( hb_DirSepToOS( "/pub" ) ) $STATUS$ R $COMPLIANCE$ @@ -68,6 +62,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -109,7 +105,7 @@ // list all PRG files in Harbour Run-Time library // for MS-DOS compatible operating systems - DIR "src\rtl\*.prg" + DIR "src/rtl/*.prg" // list all files in the public section on a Unix like machine DIR "/pub" @@ -125,6 +121,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -137,7 +135,7 @@ Fill pre-defined arrays with file/directory information $SYNTAX$ ADir( [], [], [], [], - [], [] ) --> nDirEnries + [], [] ) --> nDirEntries $ARGUMENTS$ File mask to include in the function return. It could contain path and standard wildcard characters as supported by your @@ -179,17 +177,22 @@ ADir() is a compatibility function, it is superseded by Directory() which returns all the information in a multidimensional array. $EXAMPLES$ - LOCAL aName, aSize, aDate, aTime, aAttr, nLen, i - nLen := ADir( "*.jpg" ) // Number of JPG files in this directory + LOCAL aName, aSize, aDate, aTime, aAttr, tmp + LOCAL nLen := ADir( "*.dbf" ) // Number of JPG files in this directory IF nLen > 0 - aName := Array( nLen ) // make room to store the information + aName := Array( nLen ) // make room to store the information aSize := Array( nLen ) aDate := Array( nLen ) aTime := Array( nLen ) aAttr := Array( nLen ) ADir( "*.prg", aName, aSize, aDate, aTime, aAttr ) - FOR i := 1 TO nLen - ? aName[ i ], aSize[ i ], aDate[ i ], aTime[ i ], aAttr[ i ] + FOR tmp := 1 TO nLen + ? ; + aName[ tmp ], ; + aSize[ tmp ], ; + aDate[ tmp ], ; + aTime[ tmp ], ; + aAttr[ tmp ] NEXT ELSE ? "This directory is clean from smut" diff --git a/doc/en/dirdrive.txt b/doc/en/dirdrive.txt new file mode 100644 index 0000000000..3d035d36eb --- /dev/null +++ b/doc/en/dirdrive.txt @@ -0,0 +1,167 @@ +/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik + $TEMPLATE$ + Function + $NAME$ + DirRemove() + $CATEGORY$ + API + $SUBCATEGORY$ + FileSys + $ONELINER$ + Attempt to remove an directory + $SYNTAX$ + DirRemove( ) --> nError + $ARGUMENTS$ + The name of the directory you want to remove. + $RETURNS$ + 0 if directory was successfully removed, otherwise + the number of the last error. + $DESCRIPTION$ + This function attempt to remove the specified directory in + If this function fails, it will return the last OS error code number. + See FError() function for the description of the error. + $EXAMPLES$ + LOCAL cDir + IF DirRemove( cDir := hb_DirSepToOS( "./mydir" ) ) == 0 + ? "Removing directory", cDir, "was successful" + ENDIF + $STATUS$ + R + $COMPLIANCE$ + C53 + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + MakeDir(), DirChange(), IsDisk(), DiskChange(), DiskName(), FError() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik + $TEMPLATE$ + Function + $NAME$ + DirChange() + $CATEGORY$ + API + $SUBCATEGORY$ + FileSys + $ONELINER$ + Changes the directory + $SYNTAX$ + DirChange( ) --> nError + $ARGUMENTS$ + The name of the directory you want do change into. + $RETURNS$ + 0 if directory was successfully changed, otherwise + the number of the last error. + $DESCRIPTION$ + This function attempt to change the current directory to the one + specified in . If this function fails, it will return + the last OS error code number. See FError() function for the + description of the error. + $EXAMPLES$ + IF DirChange( hb_DirSepToOS( "./mydir" ) ) == 0 + ? "Change to directory was successful" + ENDIF + $STATUS$ + R + $COMPLIANCE$ + C53 + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + MakeDir(), DirRemove(), IsDisk(), DiskChange(), DiskName(), FError() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik + $TEMPLATE$ + Function + $NAME$ + MakeDir() + $CATEGORY$ + API + $SUBCATEGORY$ + FileSys + $ONELINER$ + Create a new directory + $SYNTAX$ + MakeDir( ) --> nError + $ARGUMENTS$ + The name of the directory you want to create. + $RETURNS$ + 0 if directory was successfully created, otherwise + the number of the last error. + $DESCRIPTION$ + This function attempt to create a new directory with the name contained + in . If this function fails, it will return the last OS + error code number. See FError() function for the description of the + error + $EXAMPLES$ + LOCAL cDir + IF MakeDir( cDir := hb_DirSepToOS( "./mydir" ) ) == 0 + ? "Directory", cDir, "successfully created" + ENDIF + $STATUS$ + R + $COMPLIANCE$ + C53 + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + DirChange(), DirRemove(), IsDisk(), DiskChange(), DiskName(), FError() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik + $TEMPLATE$ + Function + $NAME$ + IsDisk() + $CATEGORY$ + API + $SUBCATEGORY$ + FileSys + $ONELINER$ + Verify if a drive is ready + $SYNTAX$ + IsDisk( ) --> lSuccess + $ARGUMENTS$ + An valid drive letter + $RETURNS$ + .T. is the drive is ready, otherwise .F. + $DESCRIPTION$ + This function attempts to access a drive. If the access to the drive + was successful, it will return true (.T.), otherwise false (.F.). This + function is useful for backup function, so you can determine if the + drive that will receive the backup data is ready or not. + $EXAMPLES$ + IF IsDisk( "A" ) + ? "Drive is ready" + ENDIF + $STATUS$ + R + $COMPLIANCE$ + C53 + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + DirChange(), MakeDir(), DirRemove(), DiskChange(), DiskName() + $END$ + */ diff --git a/doc/en/diskspac.txt b/doc/en/diskspac.txt index 34a801bf5e..ef5c8643d2 100644 --- a/doc/en/diskspac.txt +++ b/doc/en/diskspac.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2000 Paul Tucker - * Documentation for: DiskSpace() and related functions - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Paul Tucker $TEMPLATE$ Function $NAME$ @@ -18,7 +12,7 @@ $ONELINER$ Get the amount of space available on a disk $SYNTAX$ - DiskSpace( [] ) --> nDiskbytes + DiskSpace( [] ) --> nDiskBytes $ARGUMENTS$ The number of the drive you are requesting info on where 1 = A, 2 = B, etc. For 0 or no parameter, DiskSpace will operate on the current @@ -36,7 +30,7 @@ $EXAMPLES$ ? "You can use:", hb_ntos( DiskSpace() ), "bytes" - // NOTE: See tests/diskspac.prg for another example + // See tests/diskspac.prg for another example $STATUS$ R $COMPLIANCE$ @@ -50,6 +44,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Paul Tucker $TEMPLATE$ Function $NAME$ @@ -61,7 +57,7 @@ $ONELINER$ Get the amount of space available on a disk $SYNTAX$ - hb_DiskSpace( [] [, ] ) --> nDiskbytes + hb_DiskSpace( [] [, ] ) --> nDiskBytes $ARGUMENTS$ The drive letter you are requesting info on. The default is A: @@ -77,17 +73,17 @@ There are 4 types of information available: - HB_FS_AVAIL The amount of space available to the user making the + HB_DISK_AVAIL The amount of space available to the user making the request. This value could be less than HB_FS_FREE if disk quotas are supported by the O/S in use at runtime, and disk quotas are in effect. Otherwise, the value will be equal to that returned for HB_FS_FREE. - HB_FS_FREE The actual amount of free diskspace on the drive. + HB_DISK_FREE The actual amount of free disk space on the drive. - HB_FS_USED The number of bytes in use on the disk. + HB_DISK_USED The number of bytes in use on the disk. - HB_FS_TOTAL The total amount of space allocated for the user if + HB_DISK_TOTAL The total amount of space allocated for the user if disk quotas are in effect, otherwise, the actual size of the drive. @@ -95,10 +91,11 @@ error 2018 will be raised. $EXAMPLES$ #include "fileio.ch" - ? "You can use:", hb_ntos( hb_DiskSpace() ), "bytes", ; - "Out of a total of", hb_ntos( hb_DiskSpace( "C:", HB_FS_TOTAL ) ) - // NOTE: See tests/diskspac.prg for another example + ? "You can use:", hb_ntos( hb_DiskSpace() ), "bytes" + ? "Out of a total of:", hb_ntos( hb_DiskSpace( , HB_DISK_TOTAL ) ) + + // See tests/diskspac.prg for another example $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/errsys.txt b/doc/en/errsys.txt index 7c7e856d13..5b535a02e1 100644 --- a/doc/en/errsys.txt +++ b/doc/en/errsys.txt @@ -1,12 +1,6 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: ErrorSys() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ diff --git a/doc/en/evalhb.txt b/doc/en/evalhb.txt index 0998a2b960..23ebfa88fd 100644 --- a/doc/en/evalhb.txt +++ b/doc/en/evalhb.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2000 Luiz Rafael Culik - * Documentation for: Eval() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -36,15 +30,13 @@ specified in the parameter list and following. Each parameter is separated by a comma within the expression list. $EXAMPLES$ - PROCEDURE Main() - LOCAL bBlock := {|| NIL } - ? Eval( 1 ) - ? Eval( @bBlock ) + LOCAL bBlock := {|| NIL } + ? Eval( 1 ) + ? Eval( @bBlock ) - ? Eval( {| p1 | p1 }, "A", "B" ) - ? Eval( {| p1, p2 | p1 + p2 }, "A", "B" ) - ? Eval( {| p1, p2, p3 | p1 }, "A", "B" ) - RETURN + ? Eval( {| p1 | p1 }, "A", "B" ) + ? Eval( {| p1, p2 | p1 + p2 }, "A", "B" ) + ? Eval( {| p1, p2, p3 | p1 }, "A", "B" ) $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/file.txt b/doc/en/file.txt index cfd4e0f830..07d641c923 100644 --- a/doc/en/file.txt +++ b/doc/en/file.txt @@ -1,20 +1,6 @@ -/* - * Copyright 2000 Chen Kedem - * Documentation for: __TypeFile(), TYPE - * - * Copyright 2000 Luiz Rafael Culik - * Documentation for: FOpen(), FClose(), FWrite(), FSeek(), FRead(), File(), - * FReadStr(), FRename(), FError(), RENAME, ERASE, CurDir(), - * DirMake(), DirChange(), IsDisk(), DirRemove(), DiskChange() - * - * Copyright 2000 David G. Holm - * Documentation for: hb_FEof() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -54,7 +40,7 @@ If there is an error in opening a file, a F_ERROR will be returned by the function. Files handles may be in the range of 0 to 65535. The - status of the SET DEFAULT TO and SET PATH TO commands has no effect + status of the `SET DEFAULT TO` and `SET PATH TO` commands has no effect on this function. Directory names and paths must be specified along with the file that is to be opened. @@ -97,7 +83,7 @@ $RETURNS$ Numeric file handle to be used in other operations. $DESCRIPTION$ - This function creates a new file with a filename of . The + This function creates a new file with a file name of . The default value of is 0 and is used to set the attribute byte for the file being created by this function. The return value will be a file handle that is associated @@ -138,6 +124,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -203,6 +191,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -231,7 +221,7 @@ The returned value is the number of bytes successfully written to the file. If the returned value is 0, an error has occurred (unless this is intended). A successful write occurs when the number returned - by FWrite() is equal to either Len( ) or . + by FWrite() is equal to either `Len( cBuffer )` or . The value of is the string or variable to be written to the open file . @@ -240,7 +230,7 @@ The disk write begins with the current file position in . If this variable is not used, the entire contents of is written to the file. - To truncate a file, a call of FWrite( nHandle, "", 0 ) is needed. + To truncate a file, a call of `FWrite( nHandle, "", 0 )` is needed. $EXAMPLES$ nHandle := FCreate( "test.txt" ) FOR x := 1 TO 10 @@ -261,6 +251,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -272,7 +264,7 @@ $ONELINER$ Reports the error status of low-level file functions $SYNTAX$ - FError() --> + FError() --> nErrorCode $RETURNS$ Value of the OS error last encountered by a low-level file function. @@ -301,7 +293,7 @@ $DESCRIPTION$ After every low-level file function, this function will return a value that provides additional information on the status of - the last low-level file functions's performance. If the FError() + the last low-level file function's performance. If the FError() function returns a 0, no error was detected. Below is a table of possibles values returned by the FError() function. $EXAMPLES$ @@ -320,6 +312,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -331,7 +325,7 @@ $ONELINER$ Closes an open file $SYNTAX$ - FClose( ) --> + FClose( ) --> lSuccess $ARGUMENTS$ File handle $RETURNS$ @@ -377,7 +371,7 @@ $DESCRIPTION$ This function deletes the file specified in from the disk. No extensions are assumed. The drive and path my be included in - ; neither the SET DEFAULT not the SET PATH command controls + ; neither the `SET DEFAULT` not the `SET PATH` command controls the performance of this function. If the drive or path is not used, the function will look for the file only on the currently selected directory on the logged drive. @@ -394,7 +388,7 @@ IF FErase( "test.txt" ) != F_ERROR ? "File successfully erased" ELSE - ? "File can not be deleted" + ? "File cannot be deleted" ENDIF $STATUS$ R @@ -408,6 +402,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -421,33 +417,33 @@ $SYNTAX$ FRename( , ) --> nSuccess $ARGUMENTS$ - Old filename to be changed + Old file name to be changed - New filename + New file name $RETURNS$ If successful, a 0 will be returned otherwise, a -1 will be returned. $DESCRIPTION$ This function renames the specified file to . - A filename and/or directory name may be specified for either para- + A file name and/or directory name may be specified for either para- meter. However, if a path is supplied as part of and this path is different from either the path specified in or (if none is used) the current drive and directory, the function will not execute successfully. - Neither parameter is subject to the control of the SET PATH TO or - SET DEFAULT TO commands. In attempting to locate the file to be + Neither parameter is subject to the control of the `SET PATH TO` or + `SET DEFAULT TO` commands. In attempting to locate the file to be renamed, this function will search the default drive and directory or the drive and path specified in . It will not search - directories named by the SET PATH TO and SET DEFAULT TO commands + directories named by the `SET PATH TO` and `SET DEFAULT TO` commands or by the PATH environment variable. If the file specified in exists or the file is open, the function will be unable to rename the file. If the function is unable to complete its operation, it will return a value of -1. If it is able to rename the file, the return value for the function - will be 0. A call to FError() function will give additional infor- - mation about any error found. + will be 0. A call to FError() function will give additional + information about any error found. $EXAMPLES$ #include "fileio.ch" nResult := FRename( "test.txt", "test1.txt" ) @@ -466,6 +462,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -520,7 +518,7 @@ // cB = a string buffer passed-by-reference to hold the result // nMaxLine = maximum number of bytes to read - FUNCTION FReadLn( nH, cB, nMaxLine ) + STATIC FUNCTION FReadLn( nH, cB, nMaxLine ) LOCAL cLine, nSavePos, nEol, nNumRead cLine := Space( nMaxLine ) cB := "" @@ -546,6 +544,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -555,27 +555,27 @@ $SUBCATEGORY$ FileSys $ONELINER$ - Tests for the existence of File(s) + Tests for the existence of file(s) $SYNTAX$ File( ) --> lExists $ARGUMENTS$ - Filename skeleton or file name to find. + File name skeleton or file name to find. $RETURNS$ a logical true (.T.) if the file exists or logical false (.F.). $DESCRIPTION$ - This function return a logical true (.T.) if the given filename + This function return a logical true (.T.) if the given file name exist. - Filename skeletons symbols may be used in the filename in , + File name skeletons symbols may be used in the file name in , as may the drive and/or path name. If a path is not explicitly - specified, File() will look for the file in the SET DEFAULT path, - then in each SET PATH path, until the file is found or there are + specified, File() will look for the file in the `SET DEFAULT` path, + then in each `SET PATH path`, until the file is found or there are no more paths to search. The PATH environment variable is never searched and the current drive/directory is only searched if - SET DEFAULT is blank. + `SET DEFAULT` is blank. $EXAMPLES$ - ? File( "C:\hb\doc\pp.txt" ) + ? File( hb_DirSepToOS( "/hb/doc/pp.txt" ) ) ? File( "*.txt" ) $STATUS$ S (wild card support is missing) @@ -589,6 +589,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -639,6 +641,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -652,13 +656,13 @@ $SYNTAX$ RENAME TO $ARGUMENTS$ - Old filename + Old file name - New Filename + New File name $DESCRIPTION$ This command changes the name of to . Both and must include a file extension. This command - if not affected by the SET PATH TO or SET DEFAULT TO commands;drive + if not affected by the `SET PATH TO` or `SET DEFAULT TO` commands; drive and directory designates must be specified if either file is in a directory other then the default drive and directory. @@ -678,6 +682,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -693,9 +699,9 @@ $ARGUMENTS$ Name of file to remove $DESCRIPTION$ - This command removes a file from the disk. The use of a drive, directo- - ry, and wild-card skeleton operator is allowed for the root of the - filename. The file extension is required. The SET DEFAULT and SET PATH + This command removes a file from the disk. The use of a drive, directory, + and wild-card skeleton operator is allowed for the root of the + file name. The file extension is required. The `SET DEFAULT` and `SET PATH` commands do not affect this command. The file must be considered closed by the operating system before it @@ -727,9 +733,9 @@ $ARGUMENTS$ Name of file to remove $DESCRIPTION$ - This command removes a file from the disk. The use of a drive, directo- - ry, and wild-card skeleton operator is allowed for the root of the - filename. The file extension is required. The SET DEFAULT and SET PATH + This command removes a file from the disk. The use of a drive, directory, + and wild-card skeleton operator is allowed for the root of the + file name. The file extension is required. The `SET DEFAULT` and `SET PATH` commands do not affect this command. The file must be considered closed by the operating system before it @@ -746,134 +752,8 @@ */ /* $DOC$ - $TEMPLATE$ - Function - $NAME$ - __TypeFile() - $CATEGORY$ - API - $SUBCATEGORY$ - Terminal - $ONELINER$ - Show the content of a file on the console and/or printer - $SYNTAX$ - __TypeFile( , [] ) --> NIL - $ARGUMENTS$ - is a name of the file to display. If the file have an - extension, it must be specified (there is no default value). - - is an optional logical value that specifies whether the - output should go only to the screen (.F.) or to both the screen and - printer (.T.), the default is (.F.). - $RETURNS$ - __TypeFile() always return NIL. - $DESCRIPTION$ - __TypeFile() function type the content of a text file on the screen - with an option to send this information also to the printer. The - file is displayed as is without any headings or formatting. - - If contain no path, __TypeFile() try to find the file first - in the SET DEFAULT directory and then in search all of the SET PATH - directories. If can not be found a run-time error occur. - - Use SET CONSOLE OFF to suppress screen output. - You can pause the output using Ctrl-S, press any key to resume. - - __TypeFile() function is used in the preprocessing of the TYPE - command. - $EXAMPLES$ - The following examples assume a file name mytext.dat exist in all - specified paths, a run-time error would displayed if it does not - - // display mytext.dat file on screen - __TypeFile( "mytext.dat" ) - - // display mytext.dat file on screen and printer - __TypeFile( "mytext.dat", .T. ) - - // display mytext.dat file on printer only - SET CONSOLE OFF - __TypeFile( "mytext.dat", .T. ) - SET CONSOLE ON - $STATUS$ - R - $COMPLIANCE$ - C - $FILES$ - Library is core - $SEEALSO$ - COPY FILE, SET DEFAULT, SET PATH, SET PRINTER, TYPE - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Command - $NAME$ - TYPE - $CATEGORY$ - Command - $SUBCATEGORY$ - FileSys - $ONELINER$ - Show the content of a file on the console, printer or file - $SYNTAX$ - TYPE [TO PRINTER] [TO FILE ] - $ARGUMENTS$ - is a name of the file to display. If the file have an - extension, it must be specified (there is no default value). - It can be specified as literal file name or as a character - expression enclosed in parentheses. - - TO PRINTER is an optional keyword that specifies that the output - should go to both the screen and printer. - - TO FILE copy the source also to a file. If no - extension is given (.txt) is added to the output file name. - can be specified as literal file name or as a character - expression enclosed in parentheses. - $DESCRIPTION$ - TYPE command type the content of a text file on the screen - with an option to send this information also to the printer or to - an alternate file. The file is displayed as is without any headings - or formatting. - - If contain no path, TYPE try to find the file first in the - SET DEFAULT directory and then in search all of the SET PATH - directories. If can not be found a run-time error occur. - - If contain no path it is created in the SET DEFAULT - directory. - - Use SET CONSOLE OFF to suppress screen output. - You can pause the output using Ctrl-S, press any key to resume. - $EXAMPLES$ - The following examples assume a file name mytext.dat exist in all - specified paths, a run-time error would displayed if it does not - - // display mytext.dat file on screen - TYPE mytext.dat - - // display mytext.dat file on screen and printer - TYPE mytext.dat TO PRINTER - - // display mytext.dat file on printer only - SET CONSOLE OFF - TYPE mytext.dat TO PRINTER - SET CONSOLE ON - - // display mytext.dat file on screen and into a file myreport.txt - TYPE mytext.dat TO FILE myreport - $STATUS$ - R - $COMPLIANCE$ - C - $SEEALSO$ - COPY FILE, SET DEFAULT, SET PATH, SET PRINTER, __TypeFile() - $END$ - */ - -/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -928,20 +808,20 @@ $ONELINER$ Copies a file. $SYNTAX$ - COPY FILE TO + COPY FILE TO $ARGUMENTS$ - Filename of source file - Filename of target file + File name of source file + File name of target file $DESCRIPTION$ This command makes an exact copy of and names it . Both files must have the file extension included; the drive and the directory names must also be specified if they are different from the default drive and/or director. also can refer to a OS - device (e.g. LPT1). This command does not observe the SET PATH TO or - SET DEFAULT TO settings. + device (e.g. `LPT1`). This command does not observe the `SET PATH TO` or + `SET DEFAULT TO` settings. $EXAMPLES$ - COPY FILE /path/to/adir.prg TO /tmp/adir.prg - COPY FILE adir.prg TO LPT1 + COPY FILE test.dbf TO adir.prg + COPY FILE test.txt TO LPT1 $STATUS$ R $COMPLIANCE$ @@ -952,6 +832,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 David G. Holm $TEMPLATE$ Function $NAME$ @@ -975,7 +857,7 @@ function returns .T. and sets the value returned by FError() to -1 (F_ERROR) or a C-compiler dependent errno value (EBADF or EINVAL). $EXAMPLES$ - nH := FOpen( "test.txt" ) + LOCAL nH := FOpen( "test.txt" ) ? FReadStr( nH, 80 ) IF hb_FEof( nH ) ? "End-of-file reached" @@ -992,163 +874,3 @@ FError() $END$ */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - DirRemove() - $CATEGORY$ - API - $SUBCATEGORY$ - FileSys - $ONELINER$ - Attempt to remove an directory - $SYNTAX$ - DirRemove( ) --> nError - $ARGUMENTS$ - The name of the directory you want to remove. - $RETURNS$ - 0 if directory was successfully removed, otherwise - the number of the last error. - $DESCRIPTION$ - This function attempt to remove the specified directory in - If this function fails, it will return the last OS error code number. - See FError() function for the description of the error. - $EXAMPLES$ - cDir := ".\backup" - IF DirRemove( cDir ) == 0 - ? "Remove of directory", cDir, "was successful" - ENDIF - $STATUS$ - R - $COMPLIANCE$ - This function is CA-Cl*pper 5.3 compliant - $PLATFORMS$ - All - $FILES$ - Library is core - $SEEALSO$ - MakeDir(), DirChange(), IsDisk(), DiskChange(), DiskName(), FError() - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - DirChange() - $CATEGORY$ - API - $SUBCATEGORY$ - FileSys - $ONELINER$ - Changes the directory - $SYNTAX$ - DirChange( ) --> nError - $ARGUMENTS$ - The name of the directory you want do change into. - $RETURNS$ - 0 if directory was successfully changed, otherwise - the number of the last error. - $DESCRIPTION$ - This function attempt to change the current directory to the one - specified in . If this function fails, it will return - the last OS error code number. See FError() function for the - description of the error. - $EXAMPLES$ - IF DirChange( "\temp" ) == 0 - ? "Change to diretory was successful" - ENDIF - $STATUS$ - R - $COMPLIANCE$ - This function is CA-Cl*pper 5.3 compliant - $PLATFORMS$ - All - $FILES$ - Library is core - $SEEALSO$ - MakeDir(), DirRemove(), IsDisk(), DiskChange(), DiskName(), FError() - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - MakeDir() - $CATEGORY$ - API - $SUBCATEGORY$ - FileSys - $ONELINER$ - Create a new directory - $SYNTAX$ - MakeDir( ) --> nError - $ARGUMENTS$ - The name of the directory you want to create. - $RETURNS$ - 0 if directory was successfully created, otherwise - the number of the last error. - $DESCRIPTION$ - This function attempt to create a new directory with the name contained - in . If this function fails, it will return the last OS - error code number. See FError() function for the description of the - error - $EXAMPLES$ - cDir := "temp" - IF MakeDir( cDir ) == 0 - ? "Directory", cDir, "successfully created" - ENDIF - $STATUS$ - R - $COMPLIANCE$ - This function is CA-Cl*pper 5.3 compliant - $PLATFORMS$ - All - $FILES$ - Library is core - $SEEALSO$ - DirChange(), DirRemove(), IsDisk(), DiskChange(), DiskName(), FError() - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - IsDisk() - $CATEGORY$ - API - $SUBCATEGORY$ - FileSys - $ONELINER$ - Verify if a drive is ready - $SYNTAX$ - IsDisk( ) --> lSuccess - $ARGUMENTS$ - An valid Drive letter - $RETURNS$ - .T. is the drive is ready, otherwise .F. - $DESCRIPTION$ - This function attempts to access a drive. If the access to the drive - was successful, it will return true (.T.), otherwise false(.F.). This - function is usefull for backup function, so you can determine if the - drive that will receive the backup data is ready or not. - $EXAMPLES$ - IF IsDisk( "A" ) - ? "Drive is ready" - ENDIF - $STATUS$ - R - $COMPLIANCE$ - This function is CA-Cl*pper 5.3 compliant - $PLATFORMS$ - All - $FILES$ - Library is core - $SEEALSO$ - DirChange(), MakeDir(), DirRemove(), DiskChange(), DiskName() - $END$ - */ diff --git a/doc/en/garbage.txt b/doc/en/garbage.txt index c0c57e9783..6d8affe3ab 100644 --- a/doc/en/garbage.txt +++ b/doc/en/garbage.txt @@ -13,14 +13,14 @@ - next scan all variables if these memory blocks are still referenced. Notice that only arrays, objects and codeblocks are collected because - these are the only datatypes that can cause self-references ( a[ 1 ] := a ) - or circular references ( a[ 1 ] := b; b[ 1 ] := c; c[ 1 ] := a ) that + these are the only datatypes that can cause self-references `a[ 1 ] := a` + or circular references `a[ 1 ] := b; b[ 1 ] := c; c[ 1 ] := a` that cannot be properly deallocated by simple reference counting. Since all variables in Harbour are stored inside some available tables (the eval stack, memvars table and array of static variables) then checking if the reference is still alive is quite easy and doesn't require any - special treatment during memory allocation. Additionaly the garbage + special treatment during memory allocation. Additionally the garbage collector is scanning some internal data used by Harbour objects implementation that also stores some values that can contain memory references. These data are used to initialize class instance variables @@ -33,10 +33,12 @@ premature deallocation of such memory blocks the static data have to store a pointer to the value created with hb_itemNew() function. Example: + ```c static HB_ITEM s_item; /* this item can be released by the GC */ static PHB_ITEM pItem; /* this item will be maintained correctly */ pItem = hb_itemNew( hb_param( 1, IT_BLOCK ) ); + ``` However, scanning of all variables can be a time consuming operation. It requires that all allocated arrays have to be traversed through all their @@ -46,19 +48,19 @@ The idle state is a state when there is no real application code executed. For example, the user code is stopped for 0.1 of a second - during Inkey( 0.1 ) - Harbour is checking the keyboard only + during `Inkey( 0.1 )` - Harbour is checking the keyboard only during this time. It leaves however quite enough time for many other background tasks. One such background task can be looking for unreferenced memory blocks. - Allocating memory + Allocating memory ----------------- The garbage collector collects memory blocks allocated with hb_gcAlloc() function calls. Memory allocated by hb_gcAlloc() should be released with hb_gcFree() function. - The garbage collecting + The garbage collecting ---------------------- During scanning of unreferenced memory the GC is using a mark & sweep @@ -81,11 +83,11 @@ with the same flag before the sweep step will start. See hb_gcCollectAll() and hb_gcItemRef() - Calling the garbage collector from Harbour code + Calling the garbage collector from Harbour code ----------------------------------------------- The garbage collector can be called directly from the Harbour code. - This is usefull in situations where there is no idle states available + This is useful in situations where there is no idle states available or the application is working in the loop with no user interaction and there is many memory allocations. See hb_gcAll() for explanation of how to call this function from your @@ -132,7 +134,7 @@ by the GC if it is not locked or if it is not referenced by some Harbour level variable. $STATUS$ - C + R $COMPLIANCE$ H $PLATFORMS$ @@ -164,7 +166,7 @@ hb_gcFree() is used to deallocate the memory that was allocated with the hb_gcAlloc() function. $STATUS$ - C + R $COMPLIANCE$ H $PLATFORMS$ @@ -197,7 +199,7 @@ memory blocks. After scanning all unused memory blocks and blocks that are not locked are released. $STATUS$ - C + R $COMPLIANCE$ H $PLATFORMS$ @@ -239,7 +241,7 @@ passed item can be released prematurely during the closest garbage collection). $STATUS$ - C + R $COMPLIANCE$ H $PLATFORMS$ @@ -268,7 +270,7 @@ This function releases all memory blocks that are considered as the garbage. $STATUS$ - Harbour + R $COMPLIANCE$ H $PLATFORMS$ diff --git a/doc/en/gx.txt b/doc/en/gx.txt index 1d7d8c8339..f9feda0ecb 100644 --- a/doc/en/gx.txt +++ b/doc/en/gx.txt @@ -1,11 +1,6 @@ -/* - * Copyright 2000 Alejandro de Garate - * Documentation for: SetMode() - * - * See COPYING.txt for licensing terms. - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Alejandro de Garate $TEMPLATE$ Function $NAME$ @@ -31,7 +26,7 @@ columns specified. Note that there are only a real few combination or rows/cols pairs that produce the video mode change. - The followings are availables for GTDOS: + The followings are available for GTDOS: 12 rows x 40 columns 12 rows x 80 columns @@ -49,7 +44,7 @@ 50 rows x 80 columns - Some modes only are availables for color and/or VGA monitors. + Some modes only are available for color and/or VGA monitors. Any change produced on the screen size is updated in the values returned by MaxRow() and MaxCol(). $EXAMPLES$ @@ -69,7 +64,7 @@ $STATUS$ R $COMPLIANCE$ - Some of these modes are not availables in CA-Cl*pper + Some of these modes are not available in CA-Cl*pper $PLATFORMS$ All $SEEALSO$ diff --git a/doc/en/harbext.txt b/doc/en/harbext.txt index 403c2547b0..ca21c896de 100644 --- a/doc/en/harbext.txt +++ b/doc/en/harbext.txt @@ -6,7 +6,7 @@ $CATEGORY$ Document $DESCRIPTION$ - Language extensions: + Language extensions: -------------------- * Class generation and management. @@ -19,16 +19,16 @@ Entire applications can be designed and coded in Object Oriented style. - * @() + * `@()` Returns the pointer (address) to a function. The returned value is not useful to application-level programming, but - is used at a low level to implement object oriented coding. + is used at a low-level to implement object oriented coding. (Internally, a class method is a static function and there is no symbol for it, so it is accessed via its address). - * Class HBGetList + * Class HBGetList() Object oriented support for GetLists management. @@ -46,28 +46,28 @@ * SToD() --> dDate - New function that converts a yyyymmdd string to a Date value. + New function that converts a `yyyymmdd` string to a Date value. - * Optional Compile Time STRONG TYPE declaration (and compile time TYPE - MISMATCH warnings) + * Optional Compile Time *strong type* declaration (and compile time + *type mismatch* warnings) - Example: LOCAL/STATIC Var AS ... + Example: LOCAL/STATIC Var `AS` ... * The Harbour debugger provides new interesting classes: - - Class TDbWindow could be the foundation for a generic multi-platform + - Class HBDbWindow() could be the foundation for a generic multi-platform - - Class TForm + - Class HBDbInput() - - Class TDbMenu implement both pulldown and popup menus. + - Class HBDbMenu() implement both pull-down and popup menus. - RTL enhanced functionality: + RTL enhanced functionality: --------------------------- - - hb_vfDirSpace( , ) + - `hb_vfDirSpace( , )` The second parameter is a Harbour (optional) parameter and indicates the - type of diskinfo being requested. See en/diskspac.txt for info. + type of disk info being requested. See doc/en/diskspac.txt for info. $END$ */ diff --git a/doc/en/hashfunc.txt b/doc/en/hashfunc.txt new file mode 100644 index 0000000000..36eb55a4d7 --- /dev/null +++ b/doc/en/hashfunc.txt @@ -0,0 +1,1011 @@ +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_Hash() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Returns a hash table + $SYNTAX$ + hb_Hash( [ , ], [ , ], ... ) -> hTable + $ARGUMENTS$ + entry key; + can be of type: number, date, datetime, string, pointer + + entry value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table + + Equivalent to: + ``` + hTable := { => } + hTable := { => , => , => } + ``` + $RETURNS$ + A hash table built from the initial key/value pairs + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HHasKey() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Determines whether a hash table has an entry with a give key + $SYNTAX$ + hb_HHasKey( , ) -> lExists + $ARGUMENTS$ + a hash table + + a key value to be queried for; + can be of type: number, date, datetime, string, pointer + $RETURNS$ + A logical value indicating whether the key exists within the hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HPos() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Locates the index of a key within a hash table + $SYNTAX$ + hb_HPos( , ) -> nPosition + $ARGUMENTS$ + a hash table + + key for which its position is to be determined; + can be of type: number, date, datetime, string, pointer + $RETURNS$ + A integer number being the index position of the key within the hash table. + + TODO: what is the return value if the key does not exist? zero (0)? RTE? + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HGet() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Returns a hash value + $SYNTAX$ + hb_HGet( , ) -> + $ARGUMENTS$ + a hash table + + key to be retrieve from the hash table; + can be of type: number, date, datetime, string, pointer + $RETURNS$ + Either the value within the hash table for the given key. + + An array access error occurs of the key is not found + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HGetDef() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Returns a hash value, or a default value if the key is not present + $SYNTAX$ + hb_HGetDef( , , [] ) -> + $ARGUMENTS$ + a hash table + + key to be retrieve from the hash table; + can be of type: number, date, datetime, string, pointer + + a default value to be returned if the + hash table does not contain the key + $RETURNS$ + Either the value within the hash table for the given key, + or the default value. + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HSet() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Sets a hash value + $SYNTAX$ + hb_HSet( , , ) -> + $ARGUMENTS$ + a hash table + + the key of the entry to be set; + can be of type: number, date, datetime, string, pointer + + the entry value + $RETURNS$ + The hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HDel() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Removes a key/value pair from a hash table + $SYNTAX$ + hb_HDel( , ) -> + $ARGUMENTS$ + a hash table + + key to be removed from the hash table; + can be of type: number, date, datetime, string, pointer + $RETURNS$ + The hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HKeyAt() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Gets a hash table key at a given position + $SYNTAX$ + hb_HKeyAt( , ) -> + $ARGUMENTS$ + a hash table + + the position of an entry within the hash table that will + be returned + $RETURNS$ + The key at the given position of the hash table; + the type will be one: number, date, datetime, string, pointer + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HValueAt() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Gets/sets a hash value at a given position + $SYNTAX$ + hb_HValueAt( , , [] ) -> + $ARGUMENTS$ + a hash table + + the position of an entry within the hash table that will + be returned + + a new value to be assigned to the hash table at the given + position + $RETURNS$ + The existing value, or the new value if it is given + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HPairAt() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Returns a two-dimensional array of a hash table entry key/value pair + $SYNTAX$ + hb_HPairAt( , ) -> + $ARGUMENTS$ + a hash table + + the position of an entry within the hash table that will + be returned + $RETURNS$ + A two-dimensional array of the key/value pair entry of the hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HDelAt() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Removes an entry from a hash table based on its index position + $SYNTAX$ + hb_HDelAt( , ) -> + $ARGUMENTS$ + a hash table + + the position of an entry within the hash table that will + be deleted + $RETURNS$ + The hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HKeys() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Returns an array of the keys of a hash table + $SYNTAX$ + hb_HKeys( ) -> + $ARGUMENTS$ + a hash table + $RETURNS$ + An array of all the hash table keys + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HValues() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Returns an array of the values of a hash table + $SYNTAX$ + hb_HValues( ) -> + $ARGUMENTS$ + a hash table + $RETURNS$ + An array of all the hash values + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HFill() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Fills a hash table with a value + $SYNTAX$ + hb_HFill( , ) -> + $ARGUMENTS$ + a hash table + + fill value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table + $RETURNS$ + The hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HClone() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Creates a copy of a hash table + $SYNTAX$ + hb_HClone( ) -> + $ARGUMENTS$ + a hash table + $RETURNS$ + A cloned copy of the hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HCopy() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Adds entries from the source hash table to the destination hash table + $SYNTAX$ + hb_HCopy( , , [], [] ) -> + $ARGUMENTS$ + a destination hash table + + a source hash table + + starting index, defaults to 1 if omitted + + counter, defaults to (length) - is omitted + $RETURNS$ + The destination hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HMerge() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Merges a source hash table into a destination hash table + $SYNTAX$ + hb_HMerge( , , | ) -> + $ARGUMENTS$ + a destination hash table + + a source hash table + + a code block that will be evaluated for each entry within the + source hash table; the code block will be passed the entry key, value and + position; if the code block returns a true value, the entry will be added to + the destination hash table + + the position of an entry within the source hash table that will + be appended to the destination hash table + + TODO: the source code passes either a number or HB_HASH_UNION; research this + $RETURNS$ + The destination hash table with the contents of the source hash table merged + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HEval() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Evaluate a code block across the contents of a hash table + $SYNTAX$ + hb_HEval( , , [], [] ) -> + $ARGUMENTS$ + a hash table + + code block to be evaluated + + starting index, defaults to 1 if omitted + + counter, defaults to (length) - is omitted + $RETURNS$ + The hash table + $DESCRIPTION$ + The code block is evaluated for every hash table entry starting at + for items. + + The code block is passed the entry key, value, and numeric position + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HScan() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Scans a hash table + $SYNTAX$ + hb_HScan( , , [], [, [] ) -> nPosition + $ARGUMENTS$ + a hash table + + to be located within the hash table + + starting index, defaults to 1 if omitted + + counter, defaults to (length) - is omitted + + logical value indicating whether the comparison + is to be be exact or not + $RETURNS$ + The position of the located value within the hash table, or zero (0) if not found. + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HSort() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Reorganizes the internal list of the hash table to be sorted + $SYNTAX$ + hb_HSort( ) -> + $ARGUMENTS$ + a hash table + $RETURNS$ + The hash table sorted + + TODO: is the original table altered? + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HCaseMatch() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Sets the 'case match' flag for the hash table + $SYNTAX$ + hb_HCaseMatch( , [] ) -> + $ARGUMENTS$ + a hash table + + a logical value indicating to turn on or off + the 'case match' flag of the hash table + $RETURNS$ + The previous value of the 'case match' flag + $DESCRIPTION$ + This function returns the old flag value + $EXAMPLES$ + LOCAL hsTable, lFlag + hsTable := { "one" => 1, "two" => 2 } + // turn 'case match' on for a new hash table, storing old flag + lFlag := hb_HCaseMatch( hsTable, .T. ) + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HBinary() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Sets the 'binary' flag for the hash table + $SYNTAX$ + hb_HBinary( , [] ) -> + $ARGUMENTS$ + a hash table + + a logical value indicating to turn on or off + the 'binary' flag of the hash table + $RETURNS$ + The previous value of the 'binary' flag + $DESCRIPTION$ + This function is equivalent to hb_HBinary() but it returns + the old flag value rather than the hash table + $EXAMPLES$ + LOCAL hsTable, lFlag + hsTable := { "one" => 1, "two" => 2 } + // turn 'binary' on for a new hash table, storing old flag + lFlag := hb_HBinary( hsTable, .T. ) + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HAutoAdd() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Sets the 'auto add' flag for the hash table + $SYNTAX$ + hb_HAutoAdd( , [] ) -> + $ARGUMENTS$ + a hash table + + a logical value indicating to turn on or off + the 'auto add' flag of the hash table + $RETURNS$ + The previous value of the 'auto add' flag + $DESCRIPTION$ + This function is equivalent to hb_HAutoAdd() but it returns + the old flag value rather than the hash table + $EXAMPLES$ + LOCAL hsTable, lFlag + hsTable := { "one" => 1, "two" => 2 } + // turn 'auto add' on for a new hash table, storing old flag + lFlag := hb_HAutoAdd( hsTable, .T. ) + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Procedure + $NAME$ + hb_HAllocate() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Preallocates a hash table + $SYNTAX$ + hb_HAllocate( , ) + $ARGUMENTS$ + a hash table + + number of items to preallocate in the hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2009 April White + $TEMPLATE$ + Function + $NAME$ + hb_HDefault() + $CATEGORY$ + API + $SUBCATEGORY$ + Hash table + $ONELINER$ + Returns/sets a default value for a hash table. + $SYNTAX$ + hb_HDefault( , ) -> + $ARGUMENTS$ + a hash table + + + $RETURNS$ + The previous default value assigned to the hash table + $DESCRIPTION$ + + $EXAMPLES$ + + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + + $FILES$ + + $SEEALSO$ + + $END$ + */ diff --git a/doc/en/hbflock.txt b/doc/en/hbflock.txt index 26408f63ae..ab80b6feb5 100644 --- a/doc/en/hbflock.txt +++ b/doc/en/hbflock.txt @@ -11,9 +11,9 @@ Locks part or all of any file $SYNTAX$ hb_FLock( , , [, + --> lSuccess $ARGUMENTS$ - Dos file handle + OS file handle set> Offset of the first byte of the region to be locked. @@ -24,7 +24,7 @@ .T. if the lock was obtained, else .F. $DESCRIPTION$ This function attempts to lock a region of the file whose file handle - is . This is a low level file function. To lock Harbour + is . This is a low-level file function. To lock Harbour data files use either the FLock() or RLock() function. The value of is obtained from either a call to the FOpen() @@ -36,14 +36,14 @@ is the length of the region to be locked in bytes. - e> is the type of lock requested. There are two types of locks: - sive write locks ( = 0x0000 ) - the default, and shared - locks( = 0x0100 ). Additionally you can specify a - ing version of this function (that is it won't return until - r an error has occurred or the lock has been obtained) by - g Ox0200 to the above values. + is the type of lock requested. There are two types of locks: + exclusive write locks ( = 0x0000 ) - the default, and shared + read locks ( = 0x0100 ). Additionally you can specify a + blocking version of this function (that is it won't return until + either an error has occurred or the lock has been obtained) by + adding 0x0200 to the above values. $EXAMPLES$ - refer to tests/tflock.prg + // refer to tests/tflock.prg $STATUS$ R $COMPLIANCE$ @@ -69,9 +69,9 @@ $ONELINER$ Unlocks part or all of any file $SYNTAX$ - hb_FUnlock( , , ) --> + hb_FUnlock( , , ) --> lSuccess $ARGUMENTS$ - Dos file handle + OS file handle set> Offset of the first byte of the region to be locked. @@ -80,7 +80,7 @@ .T. if the lock was removed, else .F. $DESCRIPTION$ This function attempts to unlock a region of the file whose file - handle is . This is a low level file function. To + handle is . This is a low-level file function. To unlock Harbour data files use the dbUnlock() function. The value of is obtained from either a call to the FOpen() @@ -92,7 +92,7 @@ is the length of the region to be unlocked in bytes. $EXAMPLES$ - refer to tests/tflock.prg + // refer to tests/tflock.prg $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/hbinet.txt b/doc/en/hbinet.txt index a19a32f4ff..64a4292c80 100644 --- a/doc/en/hbinet.txt +++ b/doc/en/hbinet.txt @@ -1,12 +1,6 @@ -/* - * Copyright (date unknown) Giancarlo Niccolai - * Documentation for: Harbour INET API - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -18,7 +12,7 @@ $ONELINER$ Activate Harbour INET support $SYNTAX$ - hb_inetInit() -> lResult + hb_inetInit() --> lResult $ARGUMENTS$ (This function has no arguments) $RETURNS$ @@ -30,7 +24,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -43,6 +37,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Procedure $NAME$ @@ -63,7 +59,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -76,6 +72,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -87,7 +85,7 @@ $ONELINER$ Create an INET socket $SYNTAX$ - hb_inetCreate( [ ] ) -> SOCKET + hb_inetCreate( [ ] ) --> $ARGUMENTS$ Socket timeout (optional) TODO: what is the scale (seconds, milliseconds?) $RETURNS$ @@ -100,7 +98,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -113,6 +111,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -124,14 +124,14 @@ $ONELINER$ Close an INET socket $SYNTAX$ - hb_inetClose( ) -> nResult + hb_inetClose( ) --> nResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ Returns 0 on success or -1 on error; on error, the error code is set; (actually, on success the socket error code is set to 1 -- socket closed ) $DESCRIPTION$ - Closes the socket, notifiying both ends of the communication pipe that the + Closes the socket, notifying both ends of the communication pipe that the connection is over. If you have threads waiting for data to be read from @@ -145,7 +145,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -158,6 +158,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -169,7 +171,7 @@ $ONELINER$ ? $SYNTAX$ - hb_inetFD( [, ] ) -> nResult + hb_inetFD( [, ] ) --> nResult $ARGUMENTS$ a socket previously created / opened @@ -181,7 +183,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -194,6 +196,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -205,7 +209,7 @@ $ONELINER$ Get the status of a socket $SYNTAX$ - hb_inetstatus( ) -> nResult + hb_inetstatus( ) --> nResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -215,7 +219,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -228,6 +232,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -239,7 +245,7 @@ $ONELINER$ Get the last INET error code $SYNTAX$ - hb_inetErrorCode( ) -> nResult + hb_inetErrorCode( ) --> nResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -253,7 +259,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -266,6 +272,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -277,11 +285,11 @@ $ONELINER$ Get the last INET error code description $SYNTAX$ - hb_inetErrorDesc( ) -> cResult + hb_inetErrorDesc( ) --> cResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ - System-dependant error string + System-dependent error string $DESCRIPTION$ Returns a string describing the last error that occurred in the socket; the string is system dependent, and should be used only for debugging @@ -289,7 +297,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -302,6 +310,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Procedure $NAME$ @@ -321,7 +331,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -334,6 +344,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -345,7 +357,7 @@ $ONELINER$ Get the number of bytes last read or sent $SYNTAX$ - hb_inetCount( ) -> nResult + hb_inetCount( ) --> nResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -356,7 +368,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -369,6 +381,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -380,7 +394,7 @@ $ONELINER$ Get a remote server address $SYNTAX$ - hb_inetAddress( ) -> cResult + hb_inetAddress( ) --> cResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -394,7 +408,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -407,6 +421,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -418,7 +434,7 @@ $ONELINER$ Get the port a socket is bound to. $SYNTAX$ - hb_inetPort( ) -> cResult + hb_inetPort( ) --> cResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -429,7 +445,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -442,6 +458,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -453,7 +471,7 @@ $ONELINER$ Get or change the timeout value of a socket $SYNTAX$ - hb_inetTimeout( [, ] ) -> nPreviousTimeout + hb_inetTimeout( [, ] ) --> nPreviousTimeout $ARGUMENTS$ a socket previously created / opened @@ -465,7 +483,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -478,6 +496,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Procedure $NAME$ @@ -498,7 +518,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -511,6 +531,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -522,7 +544,7 @@ $ONELINER$ Get or change the time limit value of a socket $SYNTAX$ - hb_inetTimeLimit( [, ) -> NIL + hb_inetTimeLimit( [, ) --> NIL $ARGUMENTS$ a socket previously created / opened @@ -534,7 +556,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -547,6 +569,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Procedure $NAME$ @@ -566,7 +590,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -579,6 +603,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -590,22 +616,22 @@ $ONELINER$ Get or change the periodic callback value of a socket $SYNTAX$ - hb_inetPeriodCallback( [, ] ) -> xPreviousCallback + hb_inetPeriodCallback( [, ] ) --> xPreviousCallback $ARGUMENTS$ a socket previously created / opened - xCallback a new periodic callback + a new periodic callback $RETURNS$ The previous periodic callback value $DESCRIPTION$ Sets or returns the socket periodic callback value - xCallback can be one of: a codeblock, an array of (...), or a (symbol) + can be one of: a codeblock, an array of (...), or a (symbol) TODO: describe these better $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -618,6 +644,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Procedure $NAME$ @@ -637,7 +665,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -650,6 +678,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -661,7 +691,7 @@ $ONELINER$ Get the socket send buffer size $SYNTAX$ - hb_inetGetSndBufSize( ) -> nResult + hb_inetGetSndBufSize( ) --> nResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -671,7 +701,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -684,6 +714,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -695,7 +727,7 @@ $ONELINER$ Get the socket receive buffer size $SYNTAX$ - hb_inetGetRcvBufSize( ) -> nResult + hb_inetGetRcvBufSize( ) --> nResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -705,7 +737,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -718,6 +750,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -729,19 +763,19 @@ $ONELINER$ Set the send buffer size of a socket $SYNTAX$ - hb_inetSetSndBufSize( , ) -> nSize + hb_inetSetSndBufSize( , ) --> nSize $ARGUMENTS$ a socket previously created / opened - nSize + $RETURNS$ - Returns the passed nSize or -1 on error + Returns the passed or -1 on error $DESCRIPTION$ Sets the send buffer size of a socket $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -754,6 +788,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -765,19 +801,19 @@ $ONELINER$ Set the receive buffer size of a socket $SYNTAX$ - hb_inetSetRcvBufSize( , nSize ) -> nSize + hb_inetSetRcvBufSize( , ) --> nSize $ARGUMENTS$ a socket previously created / opened - nSize + $RETURNS$ - Returns the passed nSize or -1 on error + Returns the passed or -1 on error $DESCRIPTION$ Sets the receive buffer size of a socket $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -790,6 +826,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -801,20 +839,20 @@ $ONELINER$ Read from a socket $SYNTAX$ - hb_inetRecv( , @, [ ] ) -> nResult + hb_inetRecv( , @, [ ] ) --> nResult $ARGUMENTS$ a socket previously created / opened is the target buffer and must be passed by reference is the upper limit of characters to be read from the socket. - If not passed this defaults to the length of cResult + If not passed this defaults to the length of $RETURNS$ The number of the characters read from the socket. $DESCRIPTION$ Reads from the socket into a buffer. - The parameter cString must be preallocated so that it has enough + The parameter must be preallocated so that it has enough space to receive the data. The routine will block the thread until some bytes are read from the socket, the socket is closed (either from the receiver or the sender side) or a network error occurs, whichever comes @@ -823,13 +861,13 @@ Notice that there is no guarantee that all the available bytes will be read before the function returns, in fact, hb_inetRecv() returns as soon it - is able to fill cString with one or more bytes. To block the current - process until the whole cString is filled (or nAmount bytes are read), + is able to fill with one or more bytes. To block the current + process until the whole is filled (or bytes are read), use the hb_inetRecvAll(). $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -842,6 +880,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -853,25 +893,25 @@ $ONELINER$ Read from a socket without blocking $SYNTAX$ - hb_inetRecvAll( , @, [ ] ) -> nResult + hb_inetRecvAll( , @, [ ] ) --> nResult $ARGUMENTS$ a socket previously created / opened is the target buffer and must be passed by reference is the upper limit of characters to be read from the socket. - If not passed this defaults to the length of cResult + If not passed this defaults to the length of $RETURNS$ The number of the characters read from the socket. Might be - less than nAmount on premature socket closing or on network error. + less than on premature socket closing or on network error. $DESCRIPTION$ This function works exactly as hb_inetRecv() except that it - blocks until nAmount bytes are read, if nAmount is given, or - cString is filled for its whole length. + blocks until bytes are read, if is given, or + is filled for its whole length. $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -884,6 +924,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -895,7 +937,7 @@ $ONELINER$ Read a line from a socket $SYNTAX$ - hb_inetRecvLine( [, @, [, [, ]]] ) -> cResult + hb_inetRecvLine( [, @, [, [, ]]] ) --> cResult $ARGUMENTS$ a socket previously created / opened @@ -917,25 +959,25 @@ The returned string does not contain the trailing CRLF sequence, so an empty line is effectively returned as an empty string. - If the nBytesRead parameter is given, it will contain the number of bytes + If the parameter is given, it will contain the number of bytes read from the socket, including the CRLF sequence, so that in normal - conditions, nResult will report a count equal to the length of the - returned string plus 2. nBytesRead will be 0 if stream is closed before + conditions, will report a count equal to the length of the + returned string plus 2. will be 0 if stream is closed before a CRLF sequence is read, and will be -1 on error. - An optional nMaxLength parameter can be given to allow a maximum character + An optional parameter can be given to allow a maximum character count before the data is returned anyway. If this number is reached before - a CRLF sequence is encountered, nBytesRead will contain the value one. + a CRLF sequence is encountered, will contain the value one. - Finally, a nBufSize parameter can be given. If not, memory allocation + Finally, a parameter can be given. If not, memory allocation will be increased by discrete amounts of 80 bytes. The programmer - can provide here a different allocation strategy (e.g. setting nBufSize - equal to nMaxLength, memory for reading the line will be allocated only + can provide here a different allocation strategy (e.g. setting + equal to , memory for reading the line will be allocated only once, at the beginning of the function). $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -948,6 +990,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -959,7 +1003,7 @@ $ONELINER$ Read a block from a socket $SYNTAX$ - hb_inetRecvEndblock( [, [, @ [, [, ]]]] ) -> cResult + hb_inetRecvEndblock( [, [, @ [, [, ]]]] ) --> cResult $ARGUMENTS$ a socket previously created / opened @@ -974,13 +1018,12 @@ Block read $DESCRIPTION$ This function operates exactly the same way as hb_inetRecvLine(), but - the "record termination" is customizable through the cBlock parameter. + the "record termination" is customizable through the parameter. If not given, this parameter defaults to the CRLF sequence. - Provided by: Marcelo Lombardo $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -993,6 +1036,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1004,7 +1049,7 @@ $ONELINER$ Get whether there is data ready in a socket $SYNTAX$ - hb_inetDataReady( , [ ] ) -> nResult + hb_inetDataReady( , [ ] ) --> nResult $ARGUMENTS$ a socket previously created / opened @@ -1016,11 +1061,11 @@ Verifies if some data is available to be read in the socket without blocking execution of the caller. - If nMillisecs is not given, the function returns + If is not given, the function returns immediately 1 if there is some data to be read, 0 if there isn't any data and -1 in case of error. - If nMillisecs is given, the functon will wait up to that + If is given, the function will wait up to that amount of milliseconds for data to be available; if some data arrives in the meanwhile, the wait is immediately interrupted. @@ -1032,7 +1077,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1045,6 +1090,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1056,7 +1103,7 @@ $ONELINER$ Sent data through a socket $SYNTAX$ - hb_inetSend( , [, ] ) -> nResult + hb_inetSend( , [, ] ) --> nResult $ARGUMENTS$ a socket previously created / opened @@ -1068,10 +1115,10 @@ $DESCRIPTION$ Send data being stored in a string over the socket. - The nLength parameter can be given to allow writing only a part of + The parameter can be given to allow writing only a part of the string. - There is no guarantee that all of cBuffer will be + There is no guarantee that all of will be sent, as this is a decision that is up to the OS; this function does not take care to ensure that the data is really sent; check the returned number and send the part that has not been sent. @@ -1083,7 +1130,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1096,6 +1143,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1107,7 +1156,7 @@ $ONELINER$ Send data through a socket with blocking $SYNTAX$ - hb_inetSendAll( , [, ] ) -> nResult + hb_inetSendAll( , [, ] ) --> nResult $ARGUMENTS$ a socket previously created / opened @@ -1122,7 +1171,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1135,6 +1184,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1146,18 +1197,18 @@ $ONELINER$ Get an array of IP addresses of a host $SYNTAX$ - hb_inetGetHosts( ) -> aHosts + hb_inetGetHosts( ) --> aHosts $ARGUMENTS$ $RETURNS$ An array of IP addresses $DESCRIPTION$ Returns an array containing all the IP addresses associated with a given - host name. The IP addressess returned by this funtion are strings in - quad dot notations, eg "127.0.0.1", and can be directly used into + host name. The IP addresses returned by this function are strings in + quad dot notations, e.g. "127.0.0.1", and can be directly used into hb_inetConnectIP(). - cName can be any string: valid DNS names (eg. + can be any string: valid DNS names (e.g. "example.org"), locally available names (e.g. "localhost" or windows Network Neighborhood names), or even IP addresses in quad dot notation. @@ -1171,7 +1222,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1184,6 +1235,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1195,7 +1248,7 @@ $ONELINER$ Get an array of aliases of a server $SYNTAX$ - hb_inetGetAlias( ) -> aHosts + hb_inetGetAlias( ) --> aHosts $ARGUMENTS$ $RETURNS$ @@ -1210,7 +1263,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1223,6 +1276,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1234,7 +1289,7 @@ $ONELINER$ Create a socket bound to a port $SYNTAX$ - hb_inetServer( [, [, ]] ) -> SOCKET + hb_inetServer( [, [, ]] ) --> $ARGUMENTS$ @@ -1248,7 +1303,7 @@ If the computer on which hb_inetServer() is called has more than one logical interface (e.g. one network card, one loopback and one PPP address), - cBindAddr can be specified to select only one of these interfaces to accept + can be specified to select only one of these interfaces to accept connections for this process. This is useful when a server is present on two networks, and the service is to be available only in one of them. Also, the same port on other addresses is left free to be used, so you can have @@ -1257,10 +1312,10 @@ network could be radically different from an FTP server available for the internet. - nListenLimit is the number of incoming connections accepted by kernel before the + is the number of incoming connections accepted by kernel before the kernel has the chance to report them to the application program. If - the sockets receive nListenLimit connections before accepting them - all, the nListenLimit + 1 connection will be notified to be "busy" by + the sockets receive connections before accepting them + all, the `nListenLimit + 1` connection will be notified to be "busy" by the kernel. The default value of 10 is enough for even a heavy duty server. @@ -1268,7 +1323,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1281,6 +1336,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1292,7 +1349,7 @@ $ONELINER$ Wait until a socket is ready $SYNTAX$ - hb_inetAccept( ) -> SOCKET + hb_inetAccept( ) --> $ARGUMENTS$ An INET socket $RETURNS$ @@ -1301,13 +1358,13 @@ Waits until a connection is available on a socket created with hb_inetServer(), returns a socket that can be used to communicate with the incoming client. - On error, NIL is returned and error code sets in the passed SOCKET. + On error, NIL is returned and error code sets in the passed . This error can be accessed using hb_inetErrorCode() function. $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1320,6 +1377,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1331,9 +1390,9 @@ $ONELINER$ Connect a socket to a remote server by IP address or name $SYNTAX$ - hb_inetConnect( , ) -> SOCKET + hb_inetConnect( , ) --> - hb_inetConnect( , , ) -> NIL + hb_inetConnect( , , ) --> NIL $ARGUMENTS$ @@ -1345,7 +1404,7 @@ (Second form has no return value) $DESCRIPTION$ - Connects to a remote server described by cAddress, that can be in + Connects to a remote server described by , that can be in quad dot notation (e.g. "127.0.0.1") or in DNS name (e.g. "example.org"), using the desired port. @@ -1358,9 +1417,9 @@ hb_inetGetHosts() is not called in the same moment as an hb_inetConnect()). The second version of this function accepts a pre-built socket - as a parameter. This allows to kill asyncronously a thread waiting + as a parameter. This allows to kill asynchronously a thread waiting for hb_inetConnect() to connect, and then cleaning up the leftover - socket data. Also, it is possible to give timeout to the given SOCKET, + socket data. Also, it is possible to give timeout to the given , but this timeout will be used only in the connection phase, after that the network address resolution is completed. Use hb_inetGetHosts() and hb_inetConnectIP() for a finer timeout control. @@ -1370,7 +1429,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1383,6 +1442,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1394,9 +1455,9 @@ $ONELINER$ Connect to a remote server by IP address $SYNTAX$ - hb_inetConnectIP( , ) -> SOCKET + hb_inetConnectIP( , ) --> - hb_inetConnectIP( , , ) -> NIL + hb_inetConnectIP( , , ) --> NIL $ARGUMENTS$ @@ -1408,22 +1469,22 @@ (Second form has no return value) $DESCRIPTION$ - Connects to a remote server described by cAddress, that can be specified + Connects to a remote server described by , that can be specified only in quad dot IPv4 notation (e.g. "127.0.0.1"), using the desired port. - This version of hb_inetConnect() does not use gethostbyname, and thus is thread + This version of hb_inetConnect() does not use gethostbyname(), and thus is thread safe and can be used in combination with hb_inetGetHosts() to have a finer timeout control while connecting to a server, and a finer error control. The second version of this function accepts a pre-built socket - as a parameter. This allows to kill asyncronously a thread waiting + as a parameter. This allows to kill asynchronously a thread waiting for hb_inetConnectIP() to connect, and then cleaning up the leftover - socket data. Also, it is possible to give timeout at the given SOCKET. + socket data. Also, it is possible to give timeout at the given . On error, the error of the returned socket is set. $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1436,6 +1497,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1447,19 +1510,19 @@ $ONELINER$ Create a datagram socket $SYNTAX$ - hb_inetDGram( [] ) -> SOCKET + hb_inetDGram( [] ) --> $ARGUMENTS$ - lBroadcast + $RETURNS$ An INET socket $DESCRIPTION$ Creates a datagram-oriented socket that will be able to send data and eventually receive data. Since the socket is not bound, the program can't - retrieve the address at which this socket appaers to be, but a second + retrieve the address at which this socket appears to be, but a second socket receiving a message sent from this one would be able to reply correctly with a datagram that can be read from a non-bound socket. - If lBroadcast is set to .T., the routine creates a broadcast capable socket: + If is set to .T., the routine creates a broadcast capable socket: it will be able to receive and send broadcast messages. On most systems this requires special user privileges. @@ -1468,7 +1531,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1481,6 +1544,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1492,7 +1557,7 @@ $ONELINER$ Create a bound datagram socket $SYNTAX$ - hb_inetDGramBind( , [ [, ] ] ) -> SOCKET + hb_inetDGramBind( , [ [, ] ] ) --> $ARGUMENTS$ @@ -1503,9 +1568,9 @@ An INET socket $DESCRIPTION$ Creates a datagram-oriented socket and binds it to a particular port, and - eventually to a certain interface if cAddress is given and not NIL. + eventually to a certain interface if is given and not NIL. - If lBroadcast is set to .T., the routine creates a broadcast capable socket: + If is set to .T., the routine creates a broadcast capable socket: it will be able to receive and send broadcast messages. On most systems this requires special user privileges. @@ -1516,7 +1581,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1529,6 +1594,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1540,7 +1607,7 @@ $ONELINER$ Send data to a datagram socket $SYNTAX$ - hb_inetDGramSend( , , , [, ] ) -> nBytesSent + hb_inetDGramSend( , , , [, ] ) --> nBytesSent $ARGUMENTS$ a socket previously created / opened @@ -1554,12 +1621,12 @@ $RETURNS$ Returns number of bytes sent, or -1 on error $DESCRIPTION$ - Sends a datagram (a fixed length data) to a determined ip address (cAddress, + Sends a datagram (a fixed length data) to a determined IP address (, to be specified in quad-dot notation) and port. - If nSize is not specified, - all the data in cBuffer will be sent; if nSize is specified, only - the first nSize bytes of cBuffer will be sent. + If is not specified, + all the data in will be sent; if is specified, only + the first bytes of will be sent. There isn't any guarantee that all the data required to be written is really sent to the socket: the calling program should check for the @@ -1570,14 +1637,14 @@ less than the system datagram size will be sent and received as a single item. - If the socket is created in broadcast mode, the cAddress element + If the socket is created in broadcast mode, the element can be a broadcast address. Returns -1 on error, or the number of bytes actually sent on success. $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1590,6 +1657,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1601,7 +1670,7 @@ $ONELINER$ Get data from a datagram socket $SYNTAX$ - hb_inetDGramRecv( , @ [, ] ) -> nBytesRead + hb_inetDGramRecv( , @ [, ] ) --> nBytesRead $ARGUMENTS$ a socket previously created / opened @@ -1611,17 +1680,17 @@ $RETURNS$ Returns number of bytes read, or -1 on error $DESCRIPTION$ - Reads at maximum nSize bytes incoming from a UDP socket, if nSize is - given, or reads at maximum cBuffer length if nSize is not given. + Reads at maximum bytes incoming from a UDP socket, if is + given, or reads at maximum length if is not given. There isn't any guarantee that all the data required to be read is really sent from the kernel to the application: the kernel should just return the last complete datagram that has been received, up - to nSize bytes. + to bytes. $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1634,6 +1703,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1645,7 +1716,7 @@ $ONELINER$ Get a CRLF sequence for internet protocols $SYNTAX$ - hb_inetCRLF() -> cResult + hb_inetCRLF() --> cResult $ARGUMENTS$ (This function has no arguments) $RETURNS$ @@ -1655,7 +1726,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ @@ -1668,6 +1739,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright Giancarlo Niccolai $TEMPLATE$ Function $NAME$ @@ -1679,7 +1752,7 @@ $ONELINER$ Get whether a variable is a socket $SYNTAX$ - hb_inetIsSocket( ) -> lResult + hb_inetIsSocket( ) --> lResult $ARGUMENTS$ a socket previously created / opened $RETURNS$ @@ -1689,7 +1762,7 @@ $EXAMPLES$ $STATUS$ - + R $COMPLIANCE$ H $PLATFORMS$ diff --git a/doc/en/hbtoken.txt b/doc/en/hbtoken.txt new file mode 100644 index 0000000000..0d8c2a4ef2 --- /dev/null +++ b/doc/en/hbtoken.txt @@ -0,0 +1,68 @@ +/* $DOC$ + $AUTHOR$ + 2016 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_ATokens() + $CATEGORY$ + API + $SUBCATEGORY$ + Strings + $ONELINER$ + Parses a complex string (e.g. a sentence or multi-line text) into individual + tokens (words or other string chunks depending on delimiter used). + $SYNTAX$ + hb_ATokens( , [|], [], ; + [] ) --> aTokens + $ARGUMENTS$ + Complex string to be parsed. + + | flag defined instead of , + then end of line marker(s) will be used as delimiter. + + Boolean flag indicating if quoted substrings + will be tokenized or not. + + Boolean flag indicating that only double-quoted + substrings will be tokenized. + $RETURNS$ + A character array, filled with the individual tokens found. + $DESCRIPTION$ + This function analyses the complex string and splits it + into separate sub-strings (tokens) that are delimited by + or by space character, if no delimiter is passed, or by EOL marker + if instead of is specified. + + The located tokens, are stored in an array which is returned by the function. + + If is .T. (default: .F.), the quoted sub-strings (if any) + within are not tokenized. If is .T. + only the double quote `"` is recognized as a quote sign. + This argument is meaningful only when is .T. + + $NOTES$ + 1) the tokenization process is case sensitive, in the (rare) case + where is an alphabetic character. + + 2) The delimiters are removed (trimmed) from tokens. + $EXAMPLES$ + LOCAL cString := "Harbour is proven to be stable, robust and efficient." + LOCAL aTokens := hb_ATokens( cString ) + AEval( aTokens, {| token, n | QOut( hb_ntos(n), token ) } ) + ? + aTokens := hb_ATokens( cString, "," ) + AEval( aTokens, {| token, n | QOut( hb_ntos(n), token ) } ) + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + SubStr() + $END$ + */ diff --git a/doc/en/hvm.txt b/doc/en/hvm.txt index 8ec6a33d92..f70f03f1ad 100644 --- a/doc/en/hvm.txt +++ b/doc/en/hvm.txt @@ -1,136 +1,3 @@ -/* - * Copyright 1999 Jose Lanin - * Documentation for: ProcLine(), ProcFile(), ProcName() - * - * Copyright 1999 Eddie Ruina - * Documentation for: __dbgVMVarLGet() - * - * Copyright 1999 Chen Kedem - * Documentation for: CLIPINIT(), __SetHelpK() - * - * Copyright 1999 Ryszard Glab - * Documentation for: Do() - * - * See COPYING.txt for licensing terms. - * - */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - ProcName() - $CATEGORY$ - API - $SUBCATEGORY$ - Application - $ONELINER$ - Gets the name of the current function on the stack - $SYNTAX$ - ProcName( ) --> - $ARGUMENTS$ - is the function level required. - $RETURNS$ - The name of the function that it is being executed. - $DESCRIPTION$ - This function looks at the top of the stack and gets the current - executed function if no arguments are passed. Otherwise it returns - the name of the function or procedure at . - $EXAMPLES$ - // This test will show the functions and procedures in stack. - // before executing it. - PROCEDURE Main() - LOCAL n := 1 - DO WHILE ! Empty( ProcName( n ) ) - ? ProcName( n++ ) - ENDDO - RETURN - $STATUS$ - R - $COMPLIANCE$ - C - $FILES$ - Library is core - $SEEALSO$ - ProcLine(), ProcFile() - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - ProcLine() - $CATEGORY$ - API - $SUBCATEGORY$ - Application - $ONELINER$ - Gets the line number of the current function on the stack. - $SYNTAX$ - ProcLine( ) --> - $ARGUMENTS$ - is the function level required. - $RETURNS$ - The line number of the function that it is being executed. - $DESCRIPTION$ - This function looks at the top of the stack and gets the current - line number of the executed function if no arguments are passed. - Otherwise it returns the line number of the function or procedure - at . - $EXAMPLES$ - PROCEDURE Main() - ? ProcLine( 0 ) - ? ProcName( 2 ) - RETURN - $STATUS$ - R - $COMPLIANCE$ - C - $FILES$ - Library is core - $SEEALSO$ - ProcName(), ProcFile() - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Function - $NAME$ - ProcFile() - $CATEGORY$ - API - $SUBCATEGORY$ - Application - $ONELINER$ - This function allways returns an empty string. - $SYNTAX$ - ProcFile( ) --> - $ARGUMENTS$ - is any valid type. - $RETURNS$ - Return an empty string - $DESCRIPTION$ - This function is added to the RTL for full compatibility. It - always returns an empty string. - $EXAMPLES$ - PROCEDURE Main() - ? ProcFile() - ? ProcFile( NIL ) - ? ProcFile( 2 ) - RETURN - $STATUS$ - R - $COMPLIANCE$ - C - $FILES$ - Library is core - $SEEALSO$ - ProcName(), ProcLine() - $END$ - */ - /* $DOC$ $TEMPLATE$ Function @@ -143,7 +10,7 @@ $ONELINER$ Retrieves the value of an argument. $SYNTAX$ - hb_PValue( ) --> + hb_PValue( ) --> xExp $ARGUMENTS$ A number that indicates the argument to check. $RETURNS$ @@ -151,7 +18,8 @@ $DESCRIPTION$ This function is useful to check the value stored in an argument. $EXAMPLES$ - PROCEDURE Test( nValue, cString ) + Test( 123, "abc" ) + STATIC PROCEDURE Test( nValue, cString ) IF PCount() == 2 ? hb_PValue( 1 ), nValue ? hb_PValue( 2 ), cString @@ -180,7 +48,7 @@ $ONELINER$ Retrieves the number of arguments passed to a function. $SYNTAX$ - PCount() --> + PCount() --> nArgs $ARGUMENTS$ None $RETURNS$ @@ -190,7 +58,9 @@ This function is useful to check if a function or procedure has received the required number of arguments. $EXAMPLES$ - PROCEDURE Test( xExp ) + Test() + Test( "abc" ) + STATIC PROCEDURE Test( xExp ) IF PCount() == 0 ? "This function needs a parameter" ELSE @@ -227,7 +97,9 @@ This function terminates the current application and returns to the system. $EXAMPLES$ - PROCEDURE EndApp( lYesNo ) + EndApp( .F. ) + EndApp( .T. ) + STATIC PROCEDURE EndApp( lYesNo ) IF lYesNo __Quit() ENDIF @@ -244,6 +116,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -279,6 +153,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -288,13 +164,13 @@ $SUBCATEGORY$ Internal $ONELINER$ - Set F1 as the default help key + Set as the default help key $SYNTAX$ __SetHelpK() $ARGUMENTS$ None. $DESCRIPTION$ - Set F1 to execute a function called HELP if such a function is + Set to execute a function called HELP if such a function is linked into the program. $STATUS$ R @@ -317,7 +193,7 @@ $SUBCATEGORY$ Error $ONELINER$ - Exits from a BEGIN SEQUENCE block + Exits from a `BEGIN SEQUENCE` block $SYNTAX$ Break( ) $ARGUMENTS$ @@ -325,7 +201,7 @@ If do not want to pass any argument, just use NIL. $DESCRIPTION$ This function passes control to the RECOVER statement in a - BEGIN SEQUENCE block. + `BEGIN SEQUENCE` block. $EXAMPLES$ Break( NIL ) $STATUS$ @@ -340,6 +216,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -351,7 +229,7 @@ $ONELINER$ Calls a procedure or a function $SYNTAX$ - Do( [, ] ) --> + Do( [, ] ) --> xRetVal $ARGUMENTS$ = Either a string with a function/procedure name to be called or a codeblock to evaluate. @@ -362,24 +240,27 @@ A value that was returned from called function. $DESCRIPTION$ This function can be called either by the Harbour compiler or by user. - The compiler always passes the item of IT_SYMBOL type that stores the - name of procedure specified in DO WITH ... statement. + The compiler always passes the item of HB_IT_SYMBOL type that stores the + name of procedure specified in `DO WITH ...` statement. If called procedure/function doesn't exist then a runtime error is generated. This function can be used as replacement of macro operator. - It is also used internally to implement DO WITH + It is also used internally to implement `DO WITH ` In this case is of type HB_SYMB. $EXAMPLES$ - cbCode := {| x | MyFunc( x ) } - Do( cbCode, 1 ) + LOCAL cFunction := "MyFunc" - cFunction := "MyFunc" - xRetVal := Do( cFunction, 2 ) + ? Do( cFunction, 1 ) // Old style + DO &cFunction WITH 2 // Old style with macro - // Old style (slower): - DO &cFunction WITH 3 + ? Do( {| n | MyFunc( n ) }, 3 ) + ? Do( @MyFunc(), 4 ) + + FUNCTION MyFunc( n ) /* must be a public function for old style calls */ + ? n + RETURN n + 1 $COMPLIANCE$ C $FILES$ diff --git a/doc/en/idle.txt b/doc/en/idle.txt index 7637cb467b..e8eb321afb 100644 --- a/doc/en/idle.txt +++ b/doc/en/idle.txt @@ -6,7 +6,7 @@ $CATEGORY$ Document $ONELINER$ - Read me file for Idle States + Readme file for Idle States $DESCRIPTION$ The idle state is the state of the Harbour virtual machine when it waits for the user input from the keyboard or the mouse. The idle @@ -80,7 +80,7 @@ $ONELINER$ Removes the background task from the list of tasks. $SYNTAX$ - hb_idleDel( ) --> + hb_idleDel( ) --> bAction $ARGUMENTS$ is the identifier of the task returned by the hb_idleAdd() function. @@ -89,7 +89,7 @@ passed to hb_idleAdd() function $DESCRIPTION$ hb_idleDel() removes the action associated with passed identifier - from the list of background tasks. The identifer should be the + from the list of background tasks. The identifier should be the value returned by the previous call of hb_idleAdd() function. If specified task is defined then the codeblock is returned @@ -137,8 +137,8 @@ nTask1 := hb_idleAdd( {|| SayTime() } ) nTask2 := hb_idleAdd( {|| SaveScreen() } ) DO WHILE ! bFinished - bFinished := DoSomethingVeryImportant() - hb_idleState() + bFinished := DoSomethingVeryImportant() + hb_idleState() ENDDO cbAction := hb_idleDel( nTask1 ) hb_idleDel( nTask2 ) @@ -156,7 +156,7 @@ /* $DOC$ $TEMPLATE$ - Procedure + C Function $NAME$ hb_idleState() $CATEGORY$ diff --git a/doc/en/inputall.txt b/doc/en/inputall.txt index f10c947b3a..9cb5cd62d8 100644 --- a/doc/en/inputall.txt +++ b/doc/en/inputall.txt @@ -1,11 +1,3 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: ReadKey() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ $TEMPLATE$ Function @@ -30,32 +22,32 @@ treated as if it were not present. is an optional mask of input events that are to be enabled. - If omitted, defaults to hb_set.HB_SET_EVENTMASK. Valid input masks are + If omitted, defaults to `hb_set.HB_SET_EVENTMASK`. Valid input masks are in inkey.ch and are explained below. It is recommended that the mask names be used rather than their numeric values, in case the numeric values change in future releases of Harbour. To allow more than one type of input event, simply add the various mask names together. - - inkey.ch Meaning +
+ inkey.ch Meaning - INKEY_MOVE Mouse motion events are allowed - INKEY_LDOWN The mouse left click down event is allowed - INKEY_LUP The mouse left click up event is allowed - INKEY_RDOWN The mouse right click down event is allowed - INKEY_RUP The mouse right click up event is allowed - INKEY_KEYBOARD All keyboard events are allowed - INKEY_ALL All mouse and keyboard events are allowed - HB_INKEY_EXTENDED Extended keyboard codes are used. -
+ INKEY_MOVE Mouse motion events are allowed + INKEY_LDOWN The mouse left click down event is allowed + INKEY_LUP The mouse left click up event is allowed + INKEY_RDOWN The mouse right click down event is allowed + INKEY_RUP The mouse right click up event is allowed + INKEY_KEYBOARD All keyboard events are allowed + INKEY_ALL All mouse and keyboard events are allowed + HB_INKEY_EXTENDED Extended keyboard codes are used. + If the parameter is not numeric, it will be treated as if it were set - to hb_set.HB_SET_EVENTMASK. + to `hb_set.HB_SET_EVENTMASK`. $RETURNS$ 0 in case of timeout with no input event, otherwise returns a value in the range -47 to 386 for keyboard events or the range 1001 to 1007 for mouse events. Mouse events and non-printable keyboard events are - represented by the K_ values listed in inkey.ch. Keyboard + represented by the `K_` values listed in inkey.ch. Keyboard event return codes in the range 32 through 127 are equivalent to the printable ASCII character set. Keyboard event return codes in the range 128 through 255 are assumed to be printable, but results may @@ -65,14 +57,14 @@ Extended key codes consist of the PC keyboard scan code and one or more offset values. If no keyboard modifier was used, then - HB_INKEY_NONE is added. The Alt key adds HB_INKEY_ALT, the Ctrl - key adds HB_INKEY_CTRL, the Shift key adds HB_INKEY_SHIFT, and - enhanced keys (KeyPad+/ and CursorPad keys) add HB_INKEY_ENHANCED. - For example, F1 is scan code 59, so if you just press F1, you get - key code 315, but Alt+F1 gives 443, Ctrl+F1 gives 571, and Shift+ - F1 gives 699. And NumPad+/ gives 1077, 1205, 1333, and 1461. At + HB_INKEY_NONE is added. The key adds HB_INKEY_ALT, the + key adds HB_INKEY_CTRL, the key adds HB_INKEY_SHIFT, and + enhanced keys ( and keys) add HB_INKEY_ENHANCED. + For example, is scan code 59, so if you just press , you get + key code 315, but gives 443, gives 571, and + gives 699. And gives 1077, 1205, 1333, and 1461. At this time, the only value that can combine with other values is - HB_INKEY_ENHANCED (i.e., there are no Alt+Ctl combinations, etc.) + HB_INKEY_ENHANCED (i.e., there are no combinations, etc.) Note: The extended key code set is larger than the normal key code set. As a result, if you switch between the normal and extended @@ -82,28 +74,29 @@ input buffer in normal mode and you won't be able to go back and fetch them later in extended mode. $DESCRIPTION$ - Inkey() can be used to detect input events, such as keypress, mouse + Inkey() can be used to detect input events, such as key-press, mouse movement, or mouse key clicks (up and/or down). $EXAMPLES$ - // Wait for the user to press the Esc key - ? "Please press the ESC key." + #include "inkey.ch" + // Wait for the user to press the key + ? "Please press the key." DO WHILE Inkey( 0.1 ) != K_ESC ENDDO - // - KEYBOARD "AB"; ? Inkey(), Inkey() // -> 65 66 + + KEYBOARD "AB"; ? Inkey(), Inkey() // --> 65 66 $STATUS$ S $COMPLIANCE$ Inkey() is compliant with the CA-Cl*pper 5.3 Inkey() function with one exception: The Harbour Inkey() function will raise an argument error if the first parameter is less than or equal to 0 and the second - parameter (or the default mask) is not valid, because otherwise INKEY + parameter (or the default mask) is not valid, because otherwise Inkey() would never return, because it was, in effect, asked to wait forever - for no events (Note: In CA-Cl*pper, this also blocks SET KEY events). + for no events (Note: In CA-Cl*pper, this also blocks `SET KEY` events). $FILES$ Library is core + Header is inkey.ch $SEEALSO$ - inkey.ch $END$ */ @@ -125,24 +118,24 @@ is the optional string to stuff into the Harbour keyboard buffer after clearing it first. - Note: The character ";" is converted - to Chr( 13 ) (this is an undocumented CA-Cl*pper feature). + Note: The character `;` is converted + to `Chr( 13 )` (this is an undocumented CA-Cl*pper feature). $DESCRIPTION$ - Clears the Harbour keyboard typeahead buffer and then inserts an + Clears the Harbour keyboard type-ahead buffer and then inserts an optional string into it. $EXAMPLES$ // Stuff an Enter key into the keyboard buffer KEYBOARD Chr( 13 ) // Clear the keyboard buffer CLEAR TYPEAHEAD - // - KEYBOARD Chr( 13 ); ? Inkey() // -> 13 - KEYBOARD ";"; ? Inkey() // -> 13 - KEYBOARD "Hello"; CLEAR TYPEAHEAD; ? Inkey() // -> 0 + + KEYBOARD Chr( 13 ); ? Inkey() // --> 13 + KEYBOARD ";"; ? Inkey() // --> 13 + KEYBOARD "Hello"; CLEAR TYPEAHEAD; ? Inkey() // --> 0 $STATUS$ R $COMPLIANCE$ - __Keyboard() is compliant with CA-Cl*pper 5.3 + C $FILES$ Library is core $SEEALSO$ @@ -175,9 +168,10 @@ than one code, call the function repeatedly. The zero code cannot be inserted. $EXAMPLES$ - // Stuff an Alt+PgDn key into the keyboard buffer - hb_keyPut( K_ALT_PGDN ); ? Inkey() // -> 417 - hb_keyPut( K_F11 ); ? Inkey() // -> -40 + #include "inkey.ch" + // Stuff an key into the keyboard buffer + hb_keyPut( K_ALT_PGDN ); ? Inkey() // --> 417 + hb_keyPut( K_F11 ); ? Inkey() // --> -40 $STATUS$ R $COMPLIANCE$ @@ -203,7 +197,7 @@ $SYNTAX$ NextKey( [] ) --> nKey $ARGUMENTS$ - nInputMask is an optional integer value composed of one or more + is an optional integer value composed of one or more INKEY_ or HB_INKEY_ constants. The sole purpose of this argument is to allow switching between using HB_INKEY_EXTENDED key codes and using the normal CA-Cl*pper-compatible key codes @@ -213,22 +207,22 @@ Returns the value of the next key in the Harbour keyboard buffer without extracting it. $EXAMPLES$ + #include "inkey.ch" // Use NextKey() with Inkey() to change display characters, or by - // itself to exit the loop, so that the caller can detect the Esc. + // itself to exit the loop, so that the caller can detect the . LOCAL nKey, cChar := "+" DO WHILE .T. ?? cChar nKey := NextKey() - IF nKey == K_ESC + DO CASE + CASE nKey == K_ESC EXIT - ELSE - IF nKey != 0 - cChar := hb_keyChar( nKey ) - ENDIF - ENDIF + CASE nKey != 0 + cChar := hb_keyChar( nKey ) + ENDCASE ENDDO - // - KEYBOARD "AB"; ? NextKey(), NextKey() // -> 65 65 + + KEYBOARD "AB"; ? NextKey(), NextKey() // --> 65 65 $STATUS$ R $COMPLIANCE$ @@ -255,25 +249,30 @@ $SYNTAX$ LastKey( [] ) --> nKey $ARGUMENTS$ - nInputMask is an optional integer value composed of one or more + is an optional integer value composed of one or more INKEY_ or HB_INKEY_ constants. The sole purpose of this argument is to allow switching between using HB_INKEY_EXTENDED key codes and using the normal CA-Cl*pper-compatible key codes $RETURNS$ The last key extracted from the keyboard buffer. $DESCRIPTION$ - Returns the value of the last key exttracted from the Harbour + Returns the value of the last key extracted from the Harbour keyboard buffer $EXAMPLES$ - // Continue looping unless the ESC key was pressed in MainFunc() + #include "inkey.ch" + // Continue looping unless the key was pressed in MainFunc() DO WHILE .T. MainFunc() IF LastKey() == K_ESC EXIT ENDIF ENDDO - // - KEYBOARD "AB"; ? Inkey(), LastKey() // -> 65 65 + + KEYBOARD "AB"; ? Inkey(), LastKey() // --> 65 65 + + STATIC PROCEDURE MainFunc() + Inkey( 0 ) + RETURN $STATUS$ R $COMPLIANCE$ @@ -312,25 +311,27 @@ None of the extended keys may be stuffed into the keyboard buffer. - Issuing a KEYBOARD " " will clear the keyboard buffer. + Issuing a `KEYBOARD " "` will clear the keyboard buffer. $EXAMPLES$ // Stuff an Enter key into the keyboard buffer KEYBOARD Chr( 13 ) // Clear the keyboard buffer CLEAR TYPEAHEAD - // - KEYBOARD Chr( 13 ); ? Inkey() // -> 13 - KEYBOARD "Hello"; CLEAR TYPEAHEAD; ? Inkey() // -> 0 + + KEYBOARD Chr( 13 ); ? Inkey() // --> 13 + KEYBOARD "Hello"; CLEAR TYPEAHEAD; ? Inkey() // --> 0 $STATUS$ R $COMPLIANCE$ - KEYBOARD is compliant with CA-Cl*pper 5.3 + C $SEEALSO$ CLEAR TYPEAHEAD, __Keyboard() $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -354,20 +355,20 @@ to the return code. - Exit Return code Return code - Key (not updated) (updated) + Exit Return code Return code + Key (not updated) (updated) - Up 4 260 - Down 5 261 - Page-Up 6 262 - Page-Down 7 263 - Ctrl Page-Up 34 290 - Ctrl Page-Down 35 291 - Esc 12 268 - Ctrl End 14 270 - Enter 15 271 - Key >= 32 15 271 - otherwise 0 0 + Up 4 260 + Down 5 261 + Page-Up 6 262 + Page-Down 7 263 + Ctrl Page-Up 34 290 + Ctrl Page-Down 35 291 + Esc 12 268 + Ctrl End 14 270 + Enter 15 271 + Key >= 32 15 271 + otherwise 0 0 ReadKey() is a compatibility function so try not to use it. @@ -377,7 +378,7 @@ $STATUS$ R $COMPLIANCE$ - ReadKey() is compliant with CA-Cl*pper 5.3 + C $FILES$ Library is core $SEEALSO$ diff --git a/doc/en/langall.txt b/doc/en/langall.txt index 4a8bcd540b..7c5b562770 100644 --- a/doc/en/langall.txt +++ b/doc/en/langall.txt @@ -1,16 +1,6 @@ -/* - * Copyright 2000 Luiz Rafael Culik - * Documentation for: hb_langName(), hb_langSelect() - * - * Copyright 2004 Chen Kedem - * Documentation for: hb_langErrMsg(), hb_langMessage(), hb_cdpSelect(), - * hb_Translate() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2004 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -24,7 +14,7 @@ $SYNTAX$ hb_langErrMsg( ) --> cErrorMessage $ARGUMENTS$ - is one of the generic error codes (EG_...) defined + is one of the generic error codes (`EG_...`) defined in error.ch $RETURNS$ hb_langErrMsg() return the error message string represented by @@ -35,13 +25,9 @@ $EXAMPLES$ #include "error.ch" REQUEST HB_LANG_ES - PROCEDURE Main() - // English: Argument error - ? "English:", hb_langErrMsg( EG_ARG ) - hb_langSelect( "es" ) - // Spanish: Error de argumento - ? "Spanish:", hb_langErrMsg( EG_ARG ) - RETURN + ? "English:", hb_langErrMsg( EG_ARG ) // --> English: Argument error + hb_langSelect( "es" ) + ? "Spanish:", hb_langErrMsg( EG_ARG ) // --> Spanish: Error de argumento $STATUS$ R $COMPLIANCE$ @@ -56,6 +42,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2004 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -83,14 +71,10 @@ $EXAMPLES$ #include "hblang.ch" REQUEST HB_LANG_ES - PROCEDURE Main() - // English: Monday - ? "English:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 ) - hb_langSelect( "es" ) - // Spanish: Lunes - ? "Spanish:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 ) - ? "English:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1, "en" ) - RETURN + ? "English:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 ) // --> English: Monday + hb_langSelect( "es" ) + ? "Spanish:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 ) // --> Spanish: Lunes + ? "English:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1, "en" ) $STATUS$ R $COMPLIANCE$ @@ -105,6 +89,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -129,22 +115,20 @@ REQUEST HB_LANG_PT REQUEST HB_LANG_RO REQUEST HB_LANG_ES - REQUEST HB_LANG_HU - PROCEDURE Main() - ? hb_langName( "hu" ) - ? hb_langName( "" ) - hb_langSelect( "pt" ) // Default language is now Portuguese - ? CDoW( Date() ) // Segunda-feira - ? "Current language is", hb_langName() // Portuguese - ? "Old language id selected is", hb_langSelect() // PT - hb_langSelect( "ro" ) // Default language is now Romanian - ? CMonth( Date() ) // Mai - ? "Old language id selected is", hb_langSelect() // RO - hb_langSelect( "es" ) // Default language is now Spanish - ? "Current language is", hb_langName() // Spanish - ? CMonth( Date() ) // Mayo - ? CDoW( Date() ) // Lunes - RETURN + REQUEST HB_LANG_PL + ? hb_langName( "pl" ) + ? hb_langName( "" ) + hb_langSelect( "pt" ) // Default language is now Portuguese + ? CDoW( Date() ) // --> Segunda-feira + ? "Current language is", hb_langName() // --> Portuguese + ? "Old language id selected is", hb_langSelect() // --> pt + hb_langSelect( "ro" ) // Default language is now Romanian + ? CMonth( Date() ) // --> Mai + ? "Old language id selected is", hb_langSelect() // --> ro + hb_langSelect( "es" ) // Default language is now Spanish + ? "Current language is", hb_langName() // --> Spanish + ? CMonth( Date() ) // --> Mayo + ? CDoW( Date() ) // --> Lunes $STATUS$ R $COMPLIANCE$ @@ -158,6 +142,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -178,69 +164,67 @@ module strings are automatically converted by Harbour. - Language + Language - Basque eu - Belorussian be - Bulgarian bg - Catalan ca - Chinese Traditional zh - Chinese Simplified zh_sim - Croatian hr - Czech cs - Dutch nl - Esperanto eo - French fr - Galician gl - German de - Greek el - Hebrew he - Hungarian hu - Icelandic is - Indonesian id - Italian it - Korean ko - Lithuanian lt - Polish pl - Portuguese pt - Romanian ro - Russian ru - Serbian (cyrillic) sr_cyr - Serbian (latin) sr_lat - Slovak sk - Slovenian sl - Spanish es - Swedish sv - Turkish tr - Ukrainian uk + Basque eu + Belorussian be + Bulgarian bg + Catalan ca + Chinese Traditional zh + Chinese Simplified zh_sim + Croatian hr + Czech cs + Dutch nl + Esperanto eo + French fr + Galician gl + German de + Greek el + Hebrew he + Hungarian hu + Icelandic is + Indonesian id + Italian it + Korean ko + Lithuanian lt + Polish pl + Portuguese pt + Romanian ro + Russian ru + Serbian (cyrillic) sr_cyr + Serbian (latin) sr_lat + Slovak sk + Slovenian sl + Spanish es + Swedish sv + Turkish tr + Ukrainian uk
$RETURNS$ - The old language indentifier + The old language identifier $DESCRIPTION$ This function set a default language module for date/month names, - internal warnigs, NatMsg messages and internal errors. When a + internal warnings, NatMsg messages and internal errors. When a Lang ID is selected all messages will be output with the current language selected until another one is selected or the program ends. The default language is English (cLang == "EN"). NOTE: You must REQUEST every language module you intend to use. - For example: to use the Russian RU866 language you must add the - following to your program: REQUEST HB_LANG_RU866 + For example: to use the Portuguese language you must add the + following to your program: `REQUEST HB_LANG_PT` $EXAMPLES$ REQUEST HB_LANG_PT REQUEST HB_LANG_RO REQUEST HB_LANG_ES - PROCEDURE Main() - hb_langSelect( "pt" ) // Default language is now Portuguese - ? CDoW( Date() ) // Segunda-feira - ? "Old language id selected is", hb_langSelect() // PT - hb_langSelect( "ro" ) // Default language is now Romanian - ? CMonth( Date() ) // Mai - ? "Old language id selected is", hb_langSelect() // RO - hb_langSelect( "es" ) // Default language is now Spanish - ? CMonth( Date() ) // Mayo - ? CDoW( Date() ) // Lunes - RETURN + hb_langSelect( "pt" ) // Default language is now Portuguese + ? CDoW( Date() ) // --> Segunda-feira + ? "Old language id selected is", hb_langSelect() // --> pt + hb_langSelect( "ro" ) // Default language is now Romanian + ? CMonth( Date() ) // --> Mai + ? "Old language id selected is", hb_langSelect() // --> ro + hb_langSelect( "es" ) // Default language is now Spanish + ? CMonth( Date() ) // --> Mayo + ? CDoW( Date() ) // --> Lunes $STATUS$ R $COMPLIANCE$ @@ -254,6 +238,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2004 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -272,85 +258,83 @@ Codepage library, sorted by language. - Language Codepage + Language Codepage - Bulgarian 866 BG866 - Bulgarian ISO-8859-5 BGISO - Bulgarian MIK BGMIK - Bulgarian Windows-1251 BGWIN - Croatian 437 HR437 - Croatian 852 HR852 - Croatian Windows-1250 HR1250 - Czech 852 CS852 - Czech ISO-8859-2 CSISO - Czech KAM CSKAM - Czech Windoes-1250 CSWIN - English 437 EN - French 850 FR - German 850 DE - German ISO-8859-1 DEWIN - Greek 737 EL - Greek Windows-1253 ELWIN - Hungarian (ntxhu852) 852 HU852C - Hungarian (sixhu852) 852 HU852 - Hungarian (sixhu852) CWI-2 HUCWI - Hungarian ISO-8859-2 HUISO - Hungarian Windows-1250 HUWIN - Italian 437 IT437 - Italian 850 IT850 - Italian ISO-8859-1b ITISB - Italian ISO-8859-1 ITISO - Lithuanian Windows-1257 LT - Polish 852 PL852 - Polish ISO-8859-2 PLISO - Polish Mazowia PLMAZ - Polish Windows-1250 PLWIN - Portuguese 850 PT850 - Portuguese ISO-8859-1 PTISO - Russian 866 RU866 - Russian KOI-8 RUKOI8 - Russian Windows-1251 RU1251 - Serbian Windows-1251 SRWIN - Slovak 852 SK852 - Slovak ISO-8859-2 SKISO - Slovak Kamenicky SKKAM - Slovak Windows-1250 SKWIN - Slovenian 437 SL437 - Slovenian 852 SL852 - Slovenian ISO-8859-2 SLISO - Slovenian Windows-1250 SLWIN - Spanish 850 ES - Spanish ISO-8859-1 ESWIN - Spanish Modern ISO-8859-1 ESMWIN - Swedish 850 SV850 - Swedish (Clipper) 437 SVCLIP - Swedish ISO-8859-1 SVWIN - Turkish 857 TR857 - Turkish Windows-1254 TRWIN - Ukrainian 866 UA866 - Ukrainian KOI-8U UAKOI8 - Ukrainian Windows-1251 UA1251 + Bulgarian 866 BG866 + Bulgarian ISO-8859-5 BGISO + Bulgarian MIK BGMIK + Bulgarian Windows-1251 BGWIN + Croatian 437 HR437 + Croatian 852 HR852 + Croatian Windows-1250 HRWIN + Czech 852 CS852 + Czech ISO-8859-2 CSISO + Czech KAM CSKAM + Czech Windoes-1250 CSWIN + English 437 EN + French 850 FR850 + German 850 DE850 + German ISO-8859-1 DEWIN + Greek 737 EL737 + Greek Windows-1253 ELWIN + Hungarian (ntxhu852) 852 HU852C + Hungarian (sixhu852) 852 HU852 + Hungarian (sixhu852) CWI-2 HUCWI + Hungarian ISO-8859-2 HUISO + Hungarian Windows-1250 HUWIN + Italian 437 IT437 + Italian 850 IT850 + Italian ISO-8859-1b ITISB + Italian ISO-8859-1 ITISO + Lithuanian Windows-1257 LTWIN + Polish 852 PL852 + Polish ISO-8859-2 PLISO + Polish Mazowia PLMAZ + Polish Windows-1250 PLWIN + Portuguese 850 PT850 + Portuguese ISO-8859-1 PTISO + Russian 866 RU866 + Russian KOI-8 RUKOI8 + Russian Windows-1251 RU1251 + Serbian Windows-1251 SRWIN + Slovak 852 SK852 + Slovak ISO-8859-2 SKISO + Slovak Kamenicky SKKAM + Slovak Windows-1250 SKWIN + Slovenian 437 SL437 + Slovenian 852 SL852 + Slovenian ISO-8859-2 SLISO + Slovenian Windows-1250 SLWIN + Spanish 850 ES850 + Spanish ISO-8859-1 ESWIN + Spanish Modern ISO-8859-1 ESMWIN + Swedish 850 SV850 + Swedish (Clipper) 437 SV437C + Swedish ISO-8859-1 SVWIN + Turkish 857 TR857 + Turkish Windows-1254 TRWIN + Ukrainian 866 UA866 + Ukrainian KOI-8U UAKOI8 + Ukrainian Windows-1251 UA1251
$RETURNS$ - The old language indentifier + The old language identifier $DESCRIPTION$ hb_cdpSelect() set the active code page use by Harbour for sorting and comparing strings. The default code page use ASCII order (cLang == "EN"). NOTE: You must REQUEST every code page module you intend to use. - For example: to use the Russian RU866 code page you must add the - following to your program: REQUEST HB_CODEPAGE_RU866 + For example: to use the French 850 code page you must add the + following to your program: `REQUEST HB_CODEPAGE_FR850` $EXAMPLES$ - REQUEST HB_CODEPAGE_HU852 - PROCEDURE Main() - hb_cdpSelect( "EN" ) - ? hb_cdpSelect() - ? hb_UTF8ToStr( "É < G is" ), hb_BChar( 144 ) < "G" // É > G is .F. - hb_cdpSelect( "HU852" ) - ? hb_cdpSelect() - ? hb_UTF8ToStr( "É < G is" ), hb_BChar( 144 ) < "G" // É > G is .T. - RETURN + REQUEST HB_CODEPAGE_FR850 + hb_cdpSelect( "EN" ) + ? hb_cdpSelect() + ? hb_UTF8ToStr( "É < G is" ), hb_BChar( 144 ) < "G" // --> É < G is .F. + hb_cdpSelect( "FR850" ) + ? hb_cdpSelect() + ? hb_UTF8ToStr( "É < G is" ), hb_BChar( 144 ) < "G" // --> É < G is .T. $STATUS$ R $COMPLIANCE$ @@ -364,6 +348,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2004 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -391,24 +377,21 @@ hb_Translate() try to convert a source string from one code page into the other. If a code page ID is not recognized, or not linked in, the default code page is used. hb_Translate() is used usually - to convert between the Dos and the Windows code pages of the same - language. + to convert between the MS-DOS and the Windows code pages of the + same language. NOTE: If the source code page and target code page does not have - the same number of characters, a translation can not be done and + the same number of characters, a translation cannot be done and the destination string is a copy of the source string. NOTE: You must REQUEST every code page module you intend to use. - For example: to use the Russian RU866 code page you must add the - following to your program: REQUEST HB_CODEPAGE_RU866 + For example: to use the CP-850 code page you must add the + following to your program: `#include "hbextcdp.ch"` $EXAMPLES$ - REQUEST HB_CODEPAGE_DE - REQUEST HB_CODEPAGE_DEWIN - PROCEDURE Main() - LOCAL cTxt := "A" + hb_BChar( 142 ) + "BC" - ? "German CP-850 text:", cTxt - ? "German Windows-1252 text:", hb_Translate( cTxt, "DE850", "DEWIN" ) - RETURN + #include "hbextcdp.ch" + LOCAL cTxt := "A" + hb_BChar( 142 ) + "BC" + ? "CP-850 text:", hb_StrToHex( cTxt ) + ? "UTF-8 text:", hb_Translate( cTxt, "cp850", "UTF8" ) $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/left.txt b/doc/en/left.txt new file mode 100644 index 0000000000..fb1f9e0fa6 --- /dev/null +++ b/doc/en/left.txt @@ -0,0 +1,88 @@ +/* $DOC$ + $AUTHOR$ + 2016 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_LeftEq() + $CATEGORY$ + API + $SUBCATEGORY$ + Strings + $ONELINER$ + Checks if a sub-string matches to leftmost part of a string. + $SYNTAX$ + hb_LeftEq( , ) --> lMatch + $ARGUMENTS$ + Main string of comparison. + + Sub-string compared to leftmost part of + $RETURNS$ + Boolean flag indicating if the matching was successful + $DESCRIPTION$ + This function checks if all characters (one by one and with the given order) + of match to leftmost (same length) part of + or in other words, checks if starts with , + in which case returns .T., otherwise .F. + + Basically it's equivalent to the expression: + `Left( , Len( ) ) == ` + but faster and shorter. + + NOTE: Case sensitive! + $EXAMPLES$ + ? hb_LeftEq( "Harbour", "Ha" ) // --> .T. + ? hb_LeftEq( "Harbour", "ha" ) // --> .F. + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + hb_LeftEqI(), Left(), At() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + 2016 Pete D. + $TEMPLATE$ + Function + $NAME$ + hb_LeftEqI() + $CATEGORY$ + API + $SUBCATEGORY$ + Strings + $ONELINER$ + Checks if a sub-string matches to leftmost part of a string. + $SYNTAX$ + hb_LeftEqI( , ) --> lMatch + $ARGUMENTS$ + Main string of comparison. + + Sub-string compared to leftmost part of . + $RETURNS$ + Boolean flag indicating if the matching was successful. + $DESCRIPTION$ + This function is identical to hb_LeftEq() (see above for details) + but it is case *insensitive*! + $EXAMPLES$ + ? hb_LeftEqI( "Harbour", "HA" ) // --> .T. + ? hb_LeftEqI( "Harbour", "ha" ) // --> .T. + ? hb_LeftEq( "Harbour", "HA" ) // --> .F. + $STATUS$ + R + $COMPLIANCE$ + H + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + hb_LeftEqI(), Left(), At() + $END$ + */ diff --git a/doc/en/macro.txt b/doc/en/macro.txt index 6cecfbad9b..b15b02b937 100644 --- a/doc/en/macro.txt +++ b/doc/en/macro.txt @@ -8,14 +8,18 @@ $SUBCATEGORY$ Compiler $DESCRIPTION$ - Invoking the macro compiler: - ============================== - - &variable - or - &( expression ) - or - &variable.text + Invoking the macro compiler: + ``` + &variable + ``` + or + ``` + &( expression ) + ``` + or + ``` + &variable.text + ``` $END$ */ @@ -31,9 +35,9 @@ $ONELINER$ Enable/disable the macro compiler runtime features. $SYNTAX$ - hb_SetMacro( , [] ) --> + hb_SetMacro( , [] ) --> lOldSetting $ARGUMENTS$ - One of the HB_SM_* constants defined in set.ch. + One of the `HB_SM_*` constants defined in set.ch. .T. to enable or .F. to disable a feature $RETURNS$ @@ -44,25 +48,27 @@ to an original set available in CA-Cl*pper. Enabling/disabling some of them allows to keep strict CA-Cl*pper compatibility. - Available features are: - HB_SM_HARBOUR - enables Harbour extensions: - operators: ++, --, +=, -=, *=, /=, ^= - objects: assigments to an instance variable + Available features are: - HB_SM_XBASE - enables other Xbase++ dialects extensions: - expanding of expresions lists + `HB_SM_HARBOUR` - enables Harbour extensions: + operators: `++`, `--`, `+=`, `-=`, `*=`, `/=`, `^=` + objects: assignments to an instance variable - HB_SM_SHORTCUTS - enables optimized evaluation of - logical operators (.and., .or.) + `HB_SM_XBASE` - enables other Xbase++ dialects extensions: + expanding of expressions lists - HB_SM_PREPROC - enables preprocessing of commands - This is meaningfull if Harbour is compiled with + `HB_SM_SHORTCUTS` - enables optimized evaluation of + logical operators (`.AND.`, `.OR.`) + + `HB_SM_PREPROC` - enables preprocessing of commands + This is meaningful if Harbour is compiled with HB_MACRO_STATEMENTS flag $EXAMPLES$ + #include "hbmacro.ch" INIT PROCEDURE IWANTCLIPPER() - hb_SetMacro( HB_SM_HARBOUR, .F. ) - hb_SetMacro( HB_SM_XBASE, .F. ) + ? hb_SetMacro( HB_SM_HARBOUR, .F. ) + ? hb_SetMacro( HB_SM_XBASE, .F. ) RETURN $STATUS$ R diff --git a/doc/en/math.txt b/doc/en/math.txt index 64e7923a26..da8d526090 100644 --- a/doc/en/math.txt +++ b/doc/en/math.txt @@ -1,17 +1,6 @@ -/* - * Copyright 2000 Luiz Rafael Culik - * Documentation for: Abs(), Exp(), Log(), Int(), Max() - * Min(), Sqrt(), Round() - * Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany - * Author: Martin Vogel - * Documentation for API - * $SUBCATEGORY$ - * Math functions - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -23,7 +12,7 @@ $ONELINER$ Return the absolute value of a number. $SYNTAX$ - Abs( ) --> + Abs( ) --> nAbsNumber $ARGUMENTS$ Any number. $RETURNS$ @@ -32,16 +21,14 @@ This function yields the absolute value of the numeric value or expression . $EXAMPLES$ - PROCEDURE Main() - LOCAL nNumber := 50 - LOCAL nNumber1 := 27 - CLS + LOCAL nNumber := 50 + LOCAL nNumber1 := 27 - ? nNumber - nNumber1 - ? nNumber1 - nNumber - ? Abs( nNumber - nNumber1 ) - ? Abs( nNumber1 - nNumber ) - ? Abs( -1 * 345 ) + ? nNumber - nNumber1 + ? nNumber1 - nNumber + ? Abs( nNumber - nNumber1 ) + ? Abs( nNumber1 - nNumber ) + ? Abs( -1 * 345 ) $STATUS$ R $COMPLIANCE$ @@ -56,6 +43,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -67,14 +56,14 @@ $ONELINER$ Calculates the value of e raised to the passed power. $SYNTAX$ - Exp( ) --> + Exp( ) --> nValue $ARGUMENTS$ Any real number. $RETURNS$ The anti-logarithm of $DESCRIPTION$ This function returns the value of e raised to the power of - . It is the inverse of Log(). + . It is the inverse of Log(). $EXAMPLES$ ? Exp( 45 ) $STATUS$ @@ -91,6 +80,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -102,7 +93,7 @@ $ONELINER$ Return the integer port of a numeric value. $SYNTAX$ - Int( ) --> + Int( ) --> nIntNumber $ARGUMENTS$ Any numeric value. $RETURNS$ @@ -130,6 +121,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -141,7 +134,7 @@ $ONELINER$ Returns the natural logarithm of a number. $SYNTAX$ - Log( ) --> + Log( ) --> nLog $ARGUMENTS$ Any numeric expression. $RETURNS$ @@ -167,6 +160,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -178,7 +173,7 @@ $ONELINER$ Returns the maximum of two numbers or dates. $SYNTAX$ - Max( , ) --> + Max( , ) --> xMax $ARGUMENTS$ Any date or numeric value. @@ -186,7 +181,7 @@ $RETURNS$ The larger numeric (or later date) value. $DESCRIPTION$ - This function returns the larger of the two passed espressions. If + This function returns the larger of the two passed expressions. If and are numeric data types, the value returned by this function will be a numeric data type as well and will be the larger of the two numbers passed to it. If and @@ -194,7 +189,7 @@ well. It will be the later of the two dates passed to it. $EXAMPLES$ ? Max( 214514214, 6251242142 ) - ? Max( hb_SToD( "20001111" ), hb_SToD( "20140621" ) ) + ? Max( 0d20001111, 0d20140621 ) $STATUS$ R $COMPLIANCE$ @@ -209,6 +204,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -218,9 +215,9 @@ $SUBCATEGORY$ Math $ONELINER$ - Determines the minumum of two numbers or dates. + Determines the minimum of two numbers or dates. $SYNTAX$ - Min( , ) --> + Min( , ) --> xMin $ARGUMENTS$ Any date or numeric value. @@ -228,12 +225,12 @@ $RETURNS$ The smaller numeric (or earlier date) value. $DESCRIPTION$ - This function returns the smaller of the two passed espressions. + This function returns the smaller of the two passed expressions. and must be the same data type. If numeric, the smaller number is returned. If dates, the earlier date is returned. $EXAMPLES$ ? Min( 214514214, 6251242142 ) - ? Min( hb_SToD( "20001111" ), hb_SToD( "20140621" ) ) + ? Min( 0d20001111, 0d20140621 ) $STATUS$ R $COMPLIANCE$ @@ -267,7 +264,7 @@ $RETURNS$ The remainder after the division operation. $DESCRIPTION$ - This functuion returns the remainder of one number divided by + This function returns the remainder of one number divided by another. $EXAMPLES$ ? Mod( 12, 8.521 ) @@ -287,6 +284,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -298,14 +297,14 @@ $ONELINER$ Calculates the square root of a number. $SYNTAX$ - Sqrt( ) --> + Sqrt( ) --> nSqrt $ARGUMENTS$ Any numeric value. $RETURNS$ The square root of . $DESCRIPTION$ This function returns the square root of . The precision - of this evaluation is based solely on the setting of _SET_DECIMALS. + of this evaluation is based solely on the setting of `_SET_DECIMALS`. Any negative number passed as will always return a 0. $EXAMPLES$ Set( _SET_DECIMALS, 5 ) @@ -325,6 +324,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -336,7 +337,7 @@ $ONELINER$ Rounds off a numeric expression. $SYNTAX$ - Round( , ) --> + Round( , ) --> nResult $ARGUMENTS$ Any numeric value. @@ -366,8 +367,10 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ - Function + C Function $NAME$ hb_mathGetLastError() $CATEGORY$ @@ -386,22 +389,23 @@ phb_exc pointer to HB_MATH_EXCEPTION structure, if not NULL, the structure will be filled with information about the last math error: - - typedef struct _HB_MATH_EXCEPTION { - int type; // Math error type, is one of the constants - // HB_MATH_ERR_xxx defined in hbmath.ch - char *funcname; // Pointer to name of the math C RTL routine - // that caused the error. - char *error; // Pointer to error description. - double arg1; // First and - double arg2; // Second double argument to the math routine. - double retval; // Corrected return value for the math routine. - int retvalwidth; // Width and - int retvaldec; // Decimals of the corrected return value, - // both default to -1 - int handled; // 1, if the math error is already corrected, - // 0 otherwise. - } HB_MATH_EXCEPTION; + ```c + typedef struct _HB_MATH_EXCEPTION { + int type; // Math error type, is one of the constants + // HB_MATH_ERR_xxx defined in hbmath.ch + char *funcname; // Pointer to name of the math C RTL routine + // that caused the error. + char *error; // Pointer to error description. + double arg1; // First and + double arg2; // Second double argument to the math routine. + double retval; // Corrected return value for the math routine. + int retvalwidth; // Width and + int retvaldec; // Decimals of the corrected return value, + // both default to -1 + int handled; // 1, if the math error is already corrected, + // 0 otherwise. + } HB_MATH_EXCEPTION; + ``` $RETURNS$ $DESCRIPTION$ @@ -423,8 +427,10 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ - Procedure + C Function $NAME$ hb_mathResetError() $CATEGORY$ @@ -459,8 +465,10 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ - Function + C Function $NAME$ hb_mathIsMathErr() $CATEGORY$ @@ -497,8 +505,10 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ - Function + C Function $NAME$ hb_mathSetHandler() $CATEGORY$ @@ -538,8 +548,10 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ - Function + C Function $NAME$ hb_mathGetHandler() $CATEGORY$ @@ -577,8 +589,10 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ - Function + C Function $NAME$ hb_mathSetErrMode() $CATEGORY$ @@ -595,11 +609,13 @@ $ARGUMENTS$ imode math error handling mode, one of the following constants, defined in hbmath.ch: - HB_MATH_ERRMODE_DEFAULT - HB_MATH_ERRMODE_CDEFAULT - HB_MATH_ERRMODE_USER - HB_MATH_ERRMODE_USERDEFAULT - HB_MATH_ERRMODE_USERCDEFAULT + + HB_MATH_ERRMODE_DEFAULT + HB_MATH_ERRMODE_CDEFAULT + HB_MATH_ERRMODE_USER + HB_MATH_ERRMODE_USERDEFAULT + HB_MATH_ERRMODE_USERCDEFAULT + $RETURNS$ ioldmode old math error handling mode $DESCRIPTION$ @@ -621,8 +637,10 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ - Function + C Function $NAME$ hb_mathGetErrMode() $CATEGORY$ @@ -659,6 +677,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ Function $NAME$ @@ -670,15 +690,17 @@ $ONELINER$ Set/Get math error handling mode $SYNTAX$ - hb_matherMode( [] ) --> + hb_matherMode( [] ) --> nOldMode $ARGUMENTS$ [] new math error handling mode, one of the following constants, defined in hbmath.ch: - HB_MATH_ERRMODE_DEFAULT - HB_MATH_ERRMODE_CDEFAULT - HB_MATH_ERRMODE_USER - HB_MATH_ERRMODE_USERDEFAULT - HB_MATH_ERRMODE_USERCDEFAULT + + HB_MATH_ERRMODE_DEFAULT + HB_MATH_ERRMODE_CDEFAULT + HB_MATH_ERRMODE_USER + HB_MATH_ERRMODE_USERDEFAULT + HB_MATH_ERRMODE_USERCDEFAULT + $RETURNS$ old math error handling mode $DESCRIPTION$ @@ -700,6 +722,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ Function $NAME$ @@ -711,7 +735,7 @@ $ONELINER$ Set/Get math error handling codeblock $SYNTAX$ - hb_matherBlock( [] ) --> + hb_matherBlock( [] ) --> bOldBlock $ARGUMENTS$ $RETURNS$ diff --git a/doc/en/memo.txt b/doc/en/memo.txt index 8840fe7095..152c1205de 100644 --- a/doc/en/memo.txt +++ b/doc/en/memo.txt @@ -1,19 +1,6 @@ -/* - * Copyright 1999 Jose Lalin - * MemoTran() documentation - * HardCR() documentation - * - * Copyright 2003 Alejandro de Garate - * MemoRead() documentation - * MemoWrit() documentation - * - * Documentation for hb_MemoRead(), hb_MemoWrit() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -25,7 +12,7 @@ $ONELINER$ Converts hard and soft carriage returns within strings. $SYNTAX$ - MemoTran( , , ) --> + MemoTran( , , ) --> cConvertedString $ARGUMENTS$ is a string of chars to convert. @@ -40,7 +27,8 @@ Returns a string/memo with carriage return chars converted to specified chars. $EXAMPLES$ - ? MemoTran( DATA->CNOTES ) + // FIXME + ? MemoTran( data->CNOTES ) $STATUS$ R $COMPLIANCE$ @@ -53,6 +41,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -64,7 +54,7 @@ $ONELINER$ Replace all soft carriage returns with hard carriages returns. $SYNTAX$ - HardCR( ) --> + HardCR( ) --> cConvertedString $ARGUMENTS$ is a string of chars to convert. $RETURNS$ @@ -73,7 +63,8 @@ Returns a string/memo with soft carriage return chars converted to hard carriage return chars. $EXAMPLES$ - ? HardCR( Data->CNOTES ) + // FIXME + ? HardCR( data->CNOTES ) $STATUS$ R $COMPLIANCE$ @@ -86,6 +77,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2003 Alejandro de Garate $TEMPLATE$ Function $NAME$ @@ -99,17 +92,17 @@ $SYNTAX$ MemoRead( ) --> cString $ARGUMENTS$ - is the filename to read from disk. + is the file name to read from disk. It must include the file extension. If file to be read lives in another directory, you must include the path. $RETURNS$ Returns the contents of a text file as a character string. - If cannot be found or read MEMOREAD returns an empty + If cannot be found or read MemoRead() returns an empty string (""). $DESCRIPTION$ MemoRead() is a function that reads the content of a text file (till - now) from disk (floppy, HD, CD-ROM, etc.) into a memory string. + now) from disk (floppy, HDD, CD-ROM, etc.) into a memory string. In that way you can manipulate as any character string or assigned to a memo field to be saved in a database. @@ -128,15 +121,15 @@ mode and shared. If the file is used in mode exclusive by another process, the function will returns a null string (""). $EXAMPLES$ - // This example uses MemoRead() to assign the contents of a text - // file to a character variable for later search + // This example uses MemoRead() to assign the contents of a text + // file to a character variable for later search - cFile := "account.prg" - cString := MemoRead( cFile ) - cCopyright := "Melina" + LOCAL cFile := "account.prg" + LOCAL cString := MemoRead( cFile ) + LOCAL cCopyright := "Melina" - IF ! cCopyright $ cString // check for copyright - MemoWrit( cFile, cCopyright + cString ) // if not, add it! + IF ! cCopyright $ cString // check for copyright + ? MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF $STATUS$ R @@ -152,6 +145,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2003 Alejandro de Garate $TEMPLATE$ Function $NAME$ @@ -165,17 +160,17 @@ $SYNTAX$ hb_MemoRead( ) --> cString $ARGUMENTS$ - is the filename to read from disk. + is the file name to read from disk. It must include the file extension. If file to be read lives in another directory, you must include the path. $RETURNS$ Returns the contents of a text file as a character string. - If cannot be found or read HB_MEMOREAD returns an empty + If cannot be found or read hb_MemoRead() returns an empty string (""). $DESCRIPTION$ hb_MemoRead() is a function that reads the content of a text file - (till now) from disk (floppy, HD, CD-ROM, etc.) into a memory string. + (till now) from disk (floppy, HDD, CD-ROM, etc.) into a memory string. In that way you can manipulate as any character string or assigned to a memo field to be saved in a database. @@ -196,17 +191,17 @@ hb_MemoRead() vs MemoRead(): hb_MemoRead() is identical to MemoRead() except it won't truncate the - last byte (on non-UNIX compatible systems) if it's a EOF char. + last byte (on non-Unix compatible systems) if it's a EOF char. $EXAMPLES$ - // This example uses hb_MemoRead() to assign the contents of a text - // file to a character variable for later search + // This example uses hb_MemoRead() to assign the contents of a text + // file to a character variable for later search - cFile := "account.prg" - cString := hb_MemoRead( cFile ) - cCopyright := "Melina" + LOCAL cFile := "account.prg" + LOCAL cString := hb_MemoRead( cFile ) + LOCAL cCopyright := "Melina" - IF ! cCopyright $ cString // check for copyright - hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it! + IF ! cCopyright $ cString // check for copyright + ? hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF $STATUS$ R @@ -222,6 +217,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2003 Alejandro de Garate $TEMPLATE$ Function $NAME$ @@ -235,7 +232,7 @@ $SYNTAX$ MemoWrit( , ) --> lSuccess $ARGUMENTS$ - is the filename to be written to disk. + is the file name to be written to disk. It must include the file extension. If file to be read lives in another directory, you must include the path. @@ -246,7 +243,7 @@ otherwise, it returns false (.F.). $DESCRIPTION$ This a function that writes a memo field or character string to a - text file on disk (floppy, HD, CD-ROM, etc.) + text file on disk (floppy, HDD, CD-ROM, etc.) If you not specified a path, MemoWrit() writes to the current directory. If exists, it is overwritten. @@ -259,11 +256,12 @@ // This example uses MemoWrit() to write the contents of a character // variable to a text file. - cFile := "account.prg" - cString := MemoRead( cFile ) + LOCAL cFile := "account.prg" + LOCAL cString := MemoRead( cFile ) + LOCAL cCopyright := "Melina" - IF ! cCopyright $ cString // check for copyright - MemoWrit( cFile, cCopyright + cString ) // if not, add it! + IF ! cCopyright $ cString // check for copyright + ? MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF $STATUS$ R @@ -279,6 +277,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2003 Alejandro de Garate $TEMPLATE$ Function $NAME$ @@ -292,7 +292,7 @@ $SYNTAX$ hb_MemoWrit( , ) --> lSuccess $ARGUMENTS$ - is the filename to be written to disk. + is the file name to be written to disk. It must include the file extension. If file to be read lives in another directory, you must include the path. @@ -303,7 +303,7 @@ otherwise, it returns false (.F.). $DESCRIPTION$ This a function that writes a memo field or character string to a - text file on disk (floppy, HD, CD-ROM, etc.) + text file on disk (floppy, HDD, CD-ROM, etc.) If you not specified a path, hb_MemoWrit() writes to the current directory. If exists, it is overwritten. @@ -319,12 +319,12 @@ // This example uses hb_MemoWrit() to write the contents of a character // variable to a text file. - cFile := "account.prg" - cString := hb_MemoRead( cFile ) - cCopyright := "Melina" + LOCAL cFile := "account.prg" + LOCAL cString := hb_MemoRead( cFile ) + LOCAL cCopyright := "Melina" - IF ! cCopyright $ cString // check for copyright - hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it! + IF ! cCopyright $ cString // check for copyright + ? hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it! ENDIF $STATUS$ R diff --git a/doc/en/memvar.txt b/doc/en/memvar.txt index f36e563d9e..cd4df1babf 100644 --- a/doc/en/memvar.txt +++ b/doc/en/memvar.txt @@ -1,10 +1,10 @@ /* $DOC$ $TEMPLATE$ - Command + Statement $NAME$ FIELD $CATEGORY$ - Command + Statement $SUBCATEGORY$ RDD $ONELINER$ @@ -23,21 +23,16 @@ This command allow Harbour to resolve any reference to a field specified in the field list by viewing it as a field when it is not referenced by an alias. If a field is not listed in this list and it - is not explicity tagged with an alias indentifier, it may be viewed + is not explicitly tagged with an alias identifier, it may be viewed as a memory variable, which may cause run-time errors. This command has no effect on memory variables or on field reference buried within a macro expression. $EXAMPLES$ - PROCEDURE Main() - - FIELD Id - FIELD Name - USE test.dbf NEW - Name := "Sales" - Id := 5 - dbCloseArea() - - RETURN + FIELD first + FIELD age + USE test NEW + first := "FirstName" + age := 25 $STATUS$ R $COMPLIANCE$ @@ -53,11 +48,11 @@ /* $DOC$ $TEMPLATE$ - Command + Statement $NAME$ LOCAL $CATEGORY$ - Command + Statement $SUBCATEGORY$ Variable management $ONELINER$ @@ -67,17 +62,17 @@ $ARGUMENTS$ Name of a memory variable or array. - Value to be assinged to a variable or array + Value to be assigned to a variable or array $DESCRIPTION$ This command created a LOCAL memory variable or array. The name of either is specified in . If more then one variable is being initialized with the LOCAL command, separate each entry with a comma. - If a variable or an array is to be assingned a start-up value, that - expression may be specified in and folling. Is Strong type - compile mode is used, the Compiler will check if the value recived - matchs the type specified in . + If a variable or an array is to be assigned a start-up value, that + expression may be specified in and following. Is Strong type + compile mode is used, the Compiler will check if the value received + matches the type specified in . - LOCAL varibles are symbols generated at run time and are resolved + LOCAL variables are symbols generated at run time and are resolved at compile time. The visibility and life span of a LOCAL variable or array is limited to the function or procedure in which it is defined. @@ -92,17 +87,13 @@ LOCAL variables and arrays are not affected by the RELEASE command. $EXAMPLES$ - PROCEDURE Main() + LOCAL n, lVar := .T. - LOCAL n, lVar - - n := iif( lVar, "A", 3 ) - n := 2 - n := "a" - n := Seconds() + 2 - n := Int( Seconds() + 2 ) - - RETURN + n := iif( lVar, "A", 3 ) + n := 2 + n := "a" + n := Seconds() + 2 + n := Int( Seconds() + 2 ) $STATUS$ R $COMPLIANCE$ @@ -118,11 +109,11 @@ /* $DOC$ $TEMPLATE$ - Command + Statement $NAME$ MEMVAR $CATEGORY$ - Command + Statement $SUBCATEGORY$ Variable management $ONELINER$ @@ -134,30 +125,27 @@ $DESCRIPTION$ This command tells the compiler to resolve any reference to a memory variable designated within this list s if it possessed an explicit - memory variable alias with either the M-> or MEMVAR-> prefix.Only + memory variable alias with either the `M->` or `MEMVAR->` prefix. Only those memory variables that do not contain any such explicit are - affected by this command. Those memory variabls within macro + affected by this command. Those memory variables within macro expansions are not affected by this command. - The MEMVAR declaration must apear before any executable commands;it - is similat to the LOCAL, STATIC, FIELD, PARAMETERS, FUNCTION, and + The MEMVAR declaration must appear before any executable commands; it + is similar to the LOCAL, STATIC, FIELD, PARAMETERS, FUNCTION, and PROCEDURE commands statements. $EXAMPLES$ MEMVAR y AS NUMERIC - PROCEDURE Main() - LOCAL n, lVar + LOCAL n, lVar := .T. - n := iif( lVar, "A", 3 ) - n := 2 - n := "a" - n := Seconds() + 2 - n := Int( Seconds() + 2 ) - y := n + n := iif( lVar, "A", 3 ) + n := 2 + n := "a" + n := Seconds() + 2 + n := Int( Seconds() + 2 ) + y := n - ? y - - RETURN + ? y $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/menu.txt b/doc/en/menu.txt index 1cabe553f5..954ba31646 100644 --- a/doc/en/menu.txt +++ b/doc/en/menu.txt @@ -1,11 +1,3 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: __AtPrompt(), @...PROMPT, __MenuTo(), MENU TO - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ $TEMPLATE$ Function @@ -36,26 +28,25 @@ character, it is macro evaluated, and the result is expected to be a logical. A value of .T. means that the item may be selected, .F. that it may not. - (See next argument: lSelectableItems) + (See next argument: `lSelectableItems`) - a logical value which is used to apply to all - items in acMenuItems. If .T., all items may be + items in `acMenuItems`. If .T., all items may be selected; if .F., none may be selected. - (See previous argument: alSelectableItems) + (See previous argument: `alSelectableItems`) Default .T. - the name of a function to be called which may affect special processing of keystrokes. It is specified without parentheses or parameters. When it is called, it will be supplied with the - parameters: nMode, nCurElement, and nRowPos. + parameters: `nMode`, `nCurElement`, and `nRowPos`. Default NIL. - a codeblock to be called which may affect special processing of keystrokes. It should be specified in the form - {| nMode, nCurElemenet, nRowPos | ; - MyFunc( nMode, nCurElemenet, nRowPos ) }. + `{| nMode, nCurElemenet, nRowPos | MyFunc( nMode, nCurElemenet, nRowPos ) }`. Default NIL. - the number of the element to be highlighted as @@ -69,11 +60,11 @@ selection was aborted. $DESCRIPTION$ Allows selection of an element from an array. - Please see standard CA-Cl*pper documentation for ACHOICE for + Please see standard CA-Cl*pper documentation for AChoice() for additional detail. $EXAMPLES$ - aItems := { "One", "Two", "Three" } - nChoice := AChoice( 10, 10, 20, 20, aItems ) + LOCAL aItems := { "One", "Two", "Three" } + LOCAL nChoice := AChoice( 10, 10, 20, 20, aItems ) IF nChoice == 0 ? "You did not choose an item" ELSE @@ -91,6 +82,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -121,15 +114,16 @@ $DESCRIPTION$ With __AtPrompt() you define and display a menu item, each call to __AtPrompt() add another item to the menu, to start the menu itself - you should call the __MenuTo() function (MENU TO command). You can + you should call the __MenuTo() function (`MENU TO` command). You can define any row and column combination and they will be displayed at the order of definition. After each call to __AtPrompt(), the cursor is placed one column to the right of the last text displayed, and Row() and Col() are updated. - @...PROMPT command is preprocessed into __AtPrompt() function during + `@...PROMPT` command is preprocessed into __AtPrompt() function during compile time. $EXAMPLES$ + LOCAL nChoice // display a two line menu with status line at the bottom // let the user select favorite day SET MESSAGE TO 24 CENTER @@ -137,7 +131,7 @@ @ 11, 2 PROMPT "Monday" MESSAGE "Now we're on the 2nd item" MENU TO nChoice DO CASE - CASE nChoice == 0 // user press Esc key + CASE nChoice == 0 // user press key QUIT CASE nChoice == 1 // user select 1st menu item ? "Guess you don't like Mondays" @@ -156,6 +150,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -182,17 +178,18 @@ is evaluated to a character string. If is not specified or of the wrong type, an empty string ("") would be used. $DESCRIPTION$ - With @...Prompt you define and display a menu item, each call to - @...Prompt add another item to the menu, to start the menu itself - you should call the __MenuTo() function (MENU TO command). You can + With `@...PROMPT` you define and display a menu item, each call to + `@...PROMPT` add another item to the menu, to start the menu itself + you should call the __MenuTo() function (`MENU TO` command). You can define any row and column combination and they will be displayed at - the order of definition. After each call to @...Prompt, the cursor + the order of definition. After each call to `@...PROMPT`, the cursor is placed one column to the right of the last text displayed, and Row() and Col() are updated. - @...PROMPT command is preprocessed into __AtPrompt() function during + `@...PROMPT` command is preprocessed into __AtPrompt() function during compile time. $EXAMPLES$ + LOCAL nChoice // display a two line menu with status line at the bottom // let the user select favorite day SET MESSAGE TO 24 CENTER @@ -200,7 +197,7 @@ @ 11, 2 PROMPT "Monday" MESSAGE "Now we're on the 2nd item" MENU TO nChoice DO CASE - CASE nChoice == 0 // user press Esc key + CASE nChoice == 0 // user press key QUIT CASE nChoice == 1 // user select 1st menu item ? "Guess you don't like Mondays" @@ -217,6 +214,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -226,7 +225,7 @@ $SUBCATEGORY$ User interface $ONELINER$ - Invoked a menu defined by set of @...PROMPT + Invoked a menu defined by set of `@...PROMPT` $SYNTAX$ __MenuTo( , ) --> nChoice $ARGUMENTS$ @@ -238,7 +237,7 @@ hold the result. $RETURNS$ __MenuTo() return the number of select menu item, or 0 if there was - no item to select from or if the user pressed the Esc key. + no item to select from or if the user pressed the key. $DESCRIPTION$ __MenuTo() invoked the menu define by previous __AtPrompt() call and display a highlight bar that the user can move to select an @@ -252,9 +251,9 @@ Pressing the arrow keys move the highlighted bar. When a menu item is highlighted the message associated with it is displayed on the - line specified with SET MESSAGE. If SET WRAP is ON and the user - press UP arrow while on the first selection the last menu item is - highlighted, if the user press Down arrow while on the last item, + line specified with `SET MESSAGE`. If `SET WRAP` is ON and the user + press arrow while on the first selection the last menu item is + highlighted, if the user press arrow while on the last item, the first item is highlighted. Following are active keys that handled by __MenuTo(): @@ -268,19 +267,20 @@ Right Move to next item Home Move to the first item End Move to the last item - Page-Up Select menu item, return position - Page-Down Select menu item, return position + PgUp Select menu item, return position + PgDn Select menu item, return position Enter Select menu item, return position Esc Abort selection, return 0 First letter Select next menu with the same first letter, - | return this item position. + return this item position. upon exit the cursor is placed at MaxRow() - 1, 0 __MenuTo() can be nested without loosing the previous prompts. - MENU TO command is preprocessed into __MenuTo() function during + `MENU TO` command is preprocessed into __MenuTo() function during compile time. $EXAMPLES$ + LOCAL nChoice // display menu item on each screen corner and let user select one CLS SET MESSAGE TO MaxRow() / 2 CENTER @@ -292,7 +292,7 @@ MENU TO nChoice SetPos( MaxRow() / 2, MaxCol() / 2 - 10 ) IF nChoice == 0 - ?? "Esc was pressed" + ?? " was pressed" ELSE ?? "Selected option is", nChoice ENDIF @@ -308,6 +308,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -317,7 +319,7 @@ $SUBCATEGORY$ User interface $ONELINER$ - Invoked a menu defined by set of @...PROMPT + Invoked a menu defined by set of `@...PROMPT` $SYNTAX$ MENU TO $ARGUMENTS$ @@ -326,7 +328,7 @@ a PRIVATE variable with the name would be created to hold the result. $DESCRIPTION$ - MENU TO invoked the menu define by previous __AtPrompt() call + `MENU TO` invoked the menu define by previous __AtPrompt() call and display a highlight bar that the user can move to select an option from the menu. If does not exist or not visible, a PRIVATE variable named is created and hold the current @@ -338,12 +340,12 @@ Pressing the arrow keys move the highlighted bar. When a menu item is highlighted the message associated with it is displayed on the - line specified with SET MESSAGE. If SET WRAP is ON and the user - press UP arrow while on the first selection the last menu item is - highlighted, if the user press Down arrow while on the last item, + line specified with `SET MESSAGE`. If `SET WRAP` is ON and the user + press arrow while on the first selection the last menu item is + highlighted, if the user press arrow while on the last item, the first item is highlighted. - Following are active keys that handled by MENU TO: + Following are active keys that handled by `MENU TO`: key Meaning @@ -354,19 +356,20 @@ Right Move to next item Home Move to the first item End Move to the last item - Page-Up Select menu item, return position - Page-Down Select menu item, return position + PgUp Select menu item, return position + PgDn Select menu item, return position Enter Select menu item, return position Esc Abort selection, return 0 First letter Select next menu with the same first letter, - | return this item position. + return this item position.
upon exit the cursor is placed at MaxRow() - 1, 0 - MENU TO can be nested without loosing the previous prompts. + `MENU TO` can be nested without loosing the previous prompts. - MENU TO command is preprocessed into __MenuTo() function during + `MENU TO` command is preprocessed into __MenuTo() function during compile time. $EXAMPLES$ + LOCAL nChoice // display menu item on each screen corner and let user select one CLS SET MESSAGE TO MaxRow() / 2 CENTER @@ -378,7 +381,7 @@ MENU TO nChoice SetPos( MaxRow() / 2, MaxCol() / 2 - 10 ) IF nChoice == 0 - ?? "Esc was pressed" + ?? " was pressed" ELSE ?? "Selected option is", nChoice ENDIF diff --git a/doc/en/misc.txt b/doc/en/misc.txt index e0b03ce18d..8f280d7bab 100644 --- a/doc/en/misc.txt +++ b/doc/en/misc.txt @@ -1,11 +1,3 @@ -/* - * Copyright 2000 Chen Kedem - * Documentation for: Tone() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ $TEMPLATE$ Function @@ -18,7 +10,7 @@ $ONELINER$ Return the current operating system. $SYNTAX$ - OS() --> + OS() --> cOperatingSystem $RETURNS$ The current operating system. $DESCRIPTION$ @@ -46,7 +38,7 @@ $ONELINER$ Returns the version of Harbour compiler $SYNTAX$ - Version() --> + Version() --> cReturn $ARGUMENTS$ None $RETURNS$ @@ -80,15 +72,15 @@ $ONELINER$ Obtains a system environmental setting. $SYNTAX$ - GetEnv( ) --> + GetEnv( ) --> cReturn $ARGUMENTS$ - Enviromental variable to obtain. + Environmental variable to obtain. $RETURNS$ Value of the Environment Variable. $DESCRIPTION$ This function yields a string that is the value of the environment variable , which is stored at the - system level. + system-level. If no environment variable is found, an empty string is returned. @@ -121,28 +113,25 @@ $ONELINER$ Obtains a system environmental setting. $SYNTAX$ - GetE( ) --> + GetE( ) --> cReturn $ARGUMENTS$ - Enviromental variable to obtain. + Environmental variable to obtain. $RETURNS$ Value of the Environment Variable. $DESCRIPTION$ This function yields a string that is the value of the environment variable , which is stored at the - system level. + system-level. If no environment variable is found, an empty string is returned. $EXAMPLES$ ? GetE( "PATH" ) ? GetE( "CONFIG" ) - ? GetE( "HARBOURCMD", "-n -l -es2" ) $STATUS$ R $COMPLIANCE$ - This is CA-Cl*pper compliant. - - The parameter is a Harbour extension. + C $PLATFORMS$ All $FILES$ @@ -164,9 +153,9 @@ $ONELINER$ Obtains a system environmental setting. $SYNTAX$ - hb_GetEnv( , [] ) --> + hb_GetEnv( , [] ) --> cReturn $ARGUMENTS$ - Enviromental variable to obtain. + Environmental variable to obtain. Optional value to return if is not found. $RETURNS$ @@ -174,7 +163,7 @@ $DESCRIPTION$ This function yields a string that is the value of the environment variable , which is stored at the - system level. + system-level. If no environment variable can be found, the value of the function will be @@ -232,11 +221,13 @@ $FILES$ Library is core $SEEALSO$ - RUN + RUN, hb_run() $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -262,24 +253,24 @@ user, his or her dog, and the surrounding neighborhood. The frequency is limited to the range 0 to 32767 Hz. $EXAMPLES$ - IF lOk // Good Sound - Tone( 500, 1 ) - Tone( 4000, 1 ) - Tone( 2500, 1 ) - ELSE // Bad Sound - Tone( 300, 1 ) - Tone( 499, 5 ) - Tone( 700, 5 ) - ENDIF - // - Tone( 800, 1 ) // same as ? Chr( 7 ) - Tone( 32000, 200 ) // any dogs around yet? - Tone( 130.80, 1 ) // musical note - C - Tone( 400, 0 ) // short beep - Tone( 700 ) // short beep - Tone( 10, 18.2 ) // 1 second delay - Tone( -1 ) // 1/18.2 second delay - Tone() // 1/18.2 second delay + // Good sound + Tone( 500, 1 ) + Tone( 4000, 1 ) + Tone( 2500, 1 ) + + // Bad sound + Tone( 300, 1 ) + Tone( 499, 5 ) + Tone( 700, 5 ) + + Tone( 800, 1 ) // same as hb_BChar( 7 ) + Tone( 32000, 200 ) // any dogs around yet? + Tone( 130.80, 1 ) // musical note - C + Tone( 400, 0 ) // short beep + Tone( 700 ) // short beep + Tone( 10, 18.2 ) // 1 second delay + Tone( -1 ) // 1/18.2 second delay + Tone() // 1/18.2 second delay $STATUS$ S $COMPLIANCE$ diff --git a/doc/en/natmsg.txt b/doc/en/natmsg.txt index 6a90c2df88..1db5a5f423 100644 --- a/doc/en/natmsg.txt +++ b/doc/en/natmsg.txt @@ -1,14 +1,6 @@ -/* - * Copyright 1999 Jose Lalin - * IsAffirm() documentation - * IsNegative() documentation - * NationMsg() documentation - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -20,15 +12,15 @@ $ONELINER$ Checks if passed char is an affirmation char $SYNTAX$ - IsAffirm( ) --> + IsAffirm( ) --> lTrueOrFalse $ARGUMENTS$ - is a char or string of chars + is a char or string of chars $RETURNS$ True if passed char is an affirmation char, otherwise - false + false $DESCRIPTION$ This function is used to check if a user's input is true or not - according to the msgxxx module used. + according to the msgxxx module used. $EXAMPLES$ // Wait until user enters Y DO WHILE ! IsAffirm( cYesNo ) @@ -46,6 +38,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -57,15 +51,15 @@ $ONELINER$ Checks if passed char is a negation char. $SYNTAX$ - IsNegative( ) --> + IsNegative( ) --> lTrueOrFalse $ARGUMENTS$ - is a char or string of chars + is a char or string of chars $RETURNS$ True if passed char is a negation char, otherwise - false. + false. $DESCRIPTION$ This function is used to check if a user's input is true or not - according to the msgxxx module used. + according to the msgxxx module used. $EXAMPLES$ // Wait until user enters N DO WHILE ! IsNegative( cYesNo ) @@ -83,6 +77,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -94,15 +90,15 @@ $ONELINER$ Returns international strings messages. $SYNTAX$ - NationMsg( ) --> + NationMsg( ) --> cMessage $ARGUMENTS$ - is the message number you want to get. + is the message number you want to get. $RETURNS$ if is a valid message selector, returns the message. If is NIL, it returns "Invalid Argument", and if is any - other type it returns an empty string. + other type it returns an empty string. $DESCRIPTION$ - NationMsg() returns international message descriptions. + NationMsg() returns international message descriptions. $EXAMPLES$ // Displays "Sure Y/N: " and waits until user enters Y // Y/N is the string for NationMsg( 12 ) with default natmsg module. @@ -110,7 +106,7 @@ ACCEPT "Sure " + NationMsg( 12 ) + ": " TO cYesNo ENDDO $STATUS$ - C + R $COMPLIANCE$ C $FILES$ diff --git a/doc/en/objfunc.txt b/doc/en/objfunc.txt index c5ab878eb6..9a64c03ca5 100644 --- a/doc/en/objfunc.txt +++ b/doc/en/objfunc.txt @@ -1,17 +1,6 @@ -/* - * Copyright 1999-2000 Chen Kedem - * Documentation for: __objHasData(), __objHasMethod(), __objGetMsgList(), - * __objGetMethodList(), __objGetValueList(), - * __objSetValueList(), __objAddMethod(), - * __objAddInline(), __objAddData(), __objModMethod(), - * __objModInline(), __objDelMethod(), __objDelInline(), - * __objDelData(), __objDerivedFrom() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -32,13 +21,13 @@ __objHasData() return .T. if the given exist as VAR (instance variable) in object .T. + ? __objHasData( oB, "lBugFree" ) // --> .F. + ? __objHasData( oB, "Left" ) // --> .F. since this is a METHOD $STATUS$ R $COMPLIANCE$ @@ -51,6 +40,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -71,13 +62,13 @@ __objHasMethod() return .T. if the given exist as METHOD (class function) in object .F. since this is a VAR + ? __objHasMethod( oB, "FixBugs" ) // --> .F. + ? __objHasMethod( oB, "Left" ) // --> .T. $STATUS$ R $COMPLIANCE$ @@ -90,6 +81,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -119,19 +112,19 @@ would return an empty array {} if the given object does not contain the requested information. $DESCRIPTION$ - __objGetMsgList() is a low level class support function that let you + __objGetMsgList() is a low-level class support function that let you find all instance variable or method names for a given object. If specified, the following table shows the values for that allow you to distinguish between VAR and CLASS VAR: - table> - hboo.ch Meaning + + hboo.ch Meaning - HB_MSGLISTALL All types - HB_MSGLISTCLASS CLASS VAR only - HB_MSGLISTPURE VAR only - /table> + HB_MSGLISTALL All types + HB_MSGLISTCLASS CLASS VAR only + HB_MSGLISTPURE VAR only +
VAR are instance variable usable within each object from a class, where each object has its own VARs. @@ -140,19 +133,17 @@ value within Object1 will be reflected when accessing the CLASS VAR from Object2. $EXAMPLES$ + #include "hboo.ch" // show information about TBrowse class - oB := TBrowseNew( 0, 0, 24, 79 ) - aData := __objGetMsgList( oB, .T. ) - aClassData := __objGetMsgList( oB, .T., HB_MSGLISTCLASS ) - aMethod := __objGetMsgList( oB, .F. ) - FOR EACH x IN aData - ? "VAR name:", x + LOCAL oB := TBrowseNew( 0, 0, 24, 79 ), tmp + FOR EACH tmp IN __objGetMsgList( oB, .T. ) + ? "VAR name:", tmp NEXT - FOR EACH x IN aClassData - ? "CLASS VAR name:", x + FOR EACH tmp IN __objGetMsgList( oB, .T., HB_MSGLISTCLASS ) + ? "CLASS VAR name:", tmp NEXT - FOR EACH x IN aMethod - ? "METHOD name:", x + FOR EACH tmp IN __objGetMsgList( oB, .F. ) + ? "METHOD name:", tmp NEXT $STATUS$ R @@ -167,6 +158,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -186,14 +179,14 @@ METHOD names for a given object. __objGetMethodList() would return an empty array {} if the given object does not contain any METHOD. $DESCRIPTION$ - __objGetMethodList() is a low level class support function that let + __objGetMethodList() is a low-level class support function that let you find all class functions names for a given object. - It is equivalent to __objGetMsgList( oObject, .F. ). + It is equivalent to `__objGetMsgList( oObject, .F. )`. $EXAMPLES$ // show information about TBrowse class - oB := TBrowseNew( 0, 0, 24, 79 ) - FOR EACH s IN __objGetMethodList( oB ) - ? "METHOD name:", s + LOCAL oB := TBrowseNew( 0, 0, 24, 79 ), tmp + FOR EACH tmp IN __objGetMethodList( oB ) + ? "METHOD name:", tmp NEXT $STATUS$ R @@ -207,6 +200,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -230,17 +225,19 @@ an empty array {} if the given object does not contain the requested information. $DESCRIPTION$ - __objGetValueList() is a low level class support function that + __objGetValueList() is a low-level class support function that return an array with VAR names and value, each array element is a - pair of: aData[ i, HB_OO_DATA_SYMBOL ] contain the symbol name - aData[ i, HB_OO_DATA_VALUE ] contain the value of DATA + pair of: `aData[ i ][ HB_OO_DATA_SYMBOL ]` contain the symbol name + `aData[ i ][ HB_OO_DATA_VALUE ]` contain the value of VAR $EXAMPLES$ + // FIXME // show information about TBrowse class - oB := TBrowseNew( 0, 0, 24, 79 ) - FOR EACH i IN __objGetValueList( oB ) + #include "hboo.ch" + LOCAL oB := TBrowseNew( 0, 0, 24, 79 ), tmp + FOR EACH tmp IN __objGetValueList( oB ) ? ; - "VAR name:", i[ HB_OO_DATA_SYMBOL ], ; - " value=", i[ HB_OO_DATA_VALUE ] + "VAR name:", tmp[ HB_OO_DATA_SYMBOL ], ; + " value=", tmp[ HB_OO_DATA_VALUE ] NEXT $STATUS$ R @@ -255,6 +252,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -275,28 +274,29 @@ $RETURNS$ __objSetValueList() return a reference to . $DESCRIPTION$ - __objSetValueList() is a low level class support function that let + __objSetValueList() is a low-level class support function that let you set a group of instance variables with values. each array element in is a pair of: - aData[ i, HB_OO_DATA_SYMBOL ] which contain the variable name to set - aData[ i, HB_OO_DATA_VALUE ] contain the new variable value. + aData[ i ][ HB_OO_DATA_SYMBOL ] which contain the variable name to set + aData[ i ][ HB_OO_DATA_VALUE ] contain the new variable value. $EXAMPLES$ // set some TBrowse instance variable - oB := TBrowse():New() - aData := Array( 4, 2 ) - aData[ 1, HB_OO_DATA_SYMBOL ] = "nTop" - aData[ 1, HB_OO_DATA_VALUE ] = 1 - aData[ 2, HB_OO_DATA_SYMBOL ] = "nLeft" - aData[ 2, HB_OO_DATA_VALUE ] = 10 - aData[ 3, HB_OO_DATA_SYMBOL ] = "nBottom" - aData[ 3, HB_OO_DATA_VALUE ] = 20 - aData[ 4, HB_OO_DATA_SYMBOL ] = "nRight" - aData[ 4, HB_OO_DATA_VALUE ] = 70 + #include "hboo.ch" + LOCAL oB := TBrowse():New() + LOCAL aData := Array( 4, 2 ) + aData[ 1 ][ HB_OO_DATA_SYMBOL ] := "nTop" + aData[ 1 ][ HB_OO_DATA_VALUE ] := 1 + aData[ 2 ][ HB_OO_DATA_SYMBOL ] := "nLeft" + aData[ 2 ][ HB_OO_DATA_VALUE ] := 10 + aData[ 3 ][ HB_OO_DATA_SYMBOL ] := "nBottom" + aData[ 3 ][ HB_OO_DATA_VALUE ] := 20 + aData[ 4 ][ HB_OO_DATA_SYMBOL ] := "nRight" + aData[ 4 ][ HB_OO_DATA_VALUE ] := 70 __objSetValueList( oB, aData ) - ? oB:nTop // 1 - ? oB:nLeft // 10 - ? oB:nBottom // 20 - ? oB:nRight // 70 + ? oB:nTop // --> 1 + ? oB:nLeft // --> 10 + ? oB:nBottom // --> 20 + ? oB:nRight // --> 70 $STATUS$ R $COMPLIANCE$ @@ -310,6 +310,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -331,7 +333,7 @@ $RETURNS$ __objAddMethod() return a reference to . $DESCRIPTION$ - __objAddMethod() is a low level class support function that add a + __objAddMethod() is a low-level class support function that add a new METHOD to an object. is unchanged if a symbol with the name already exist in . @@ -339,11 +341,11 @@ created using the @ operator, see example below. $EXAMPLES$ // create a new THappy class and add a Smile method - oHappy := HBClass():New( "THappy" ) + LOCAL oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) - ? oHappy:Smile( 1 ) // :) - ? oHappy:Smile( 2 ) // ;) - ? oHappy:Smile( 3 ) // *SMILE* + ? oHappy:Smile( 1 ) // --> :) + ? oHappy:Smile( 2 ) // --> ;) + ? oHappy:Smile( 3 ) // --> *SMILE* STATIC FUNCTION MySmile( nType ) IF HB_ISNUMERIC( nType ) @@ -366,6 +368,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -387,17 +391,18 @@ $RETURNS$ __objAddInline() return a reference to . $DESCRIPTION$ - __objAddInline() is a low level class support function that add a + __objAddInline() is a low-level class support function that add a new INLINE method to an object. is unchanged if a symbol with the name already exist in . $EXAMPLES$ // create a new THappy class and add a Smile INLINE method - oHappy := HBClass():New( "THappy" ) - bInline := {| nType | { ":)", ";)", "*SMILE*" }[ nType ] } + LOCAL oHappy := HBClass():New( "THappy" ) + LOCAL bInline := {| Self, nType | HB_SYMBOL_UNUSED( Self ), ; + { ":)", ";)", "*SMILE*" }[ nType ] } __objAddInline( oHappy, "Smile", bInline ) - ? oHappy:Smile( 1 ) // :) - ? oHappy:Smile( 2 ) // ;) - ? oHappy:Smile( 3 ) // *SMILE* + ? oHappy:Smile( 1 ) // --> :) + ? oHappy:Smile( 2 ) // --> ;) + ? oHappy:Smile( 3 ) // --> *SMILE* $STATUS$ R $COMPLIANCE$ @@ -410,6 +415,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -429,12 +436,12 @@ $RETURNS$ __objAddData() return a reference to . $DESCRIPTION$ - __objAddData() is a low level class support function that add a new + __objAddData() is a low-level class support function that add a new VAR to an object. is unchanged if a symbol with the name already exist in . $EXAMPLES$ // create a new THappy class and add a lHappy VAR - oHappy := HBClass():New( "THappy" ) + LOCAL oHappy := HBClass():New( "THappy" ) __objAddData( oHappy, "lHappy" ) oHappy:lHappy := .T. IF oHappy:lHappy @@ -454,6 +461,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -476,7 +485,7 @@ $RETURNS$ __objModMethod() return a reference to . $DESCRIPTION$ - __objModMethod() is a low level class support function that modify + __objModMethod() is a low-level class support function that modify a METHOD in an object and replace it with a new function. is unchanged if a symbol with the name does not exist in . __objModMethod() is used in inheritance mechanism. @@ -485,34 +494,32 @@ created using the @ operator, see example below. $EXAMPLES$ // create a new THappy class and add a Smile method - oHappy := HBClass():New( "THappy" ) + LOCAL oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) - ? oHappy:Smile( 1 ) // :) - ? oHappy:Smile( 2 ) // ;) + ? oHappy:Smile( 1 ) // --> :) + ? oHappy:Smile( 2 ) // --> ;) // replace Smile method with a new function __objAddMethod( oHappy, "Smile", @YourSmile() ) - ? oHappy:Smile( 1 ) // *SMILE* - ? oHappy:Smile( 2 ) // *WINK* + ? oHappy:Smile( 1 ) // --> *SMILE* + ? oHappy:Smile( 2 ) // --> *WINK* STATIC FUNCTION MySmile( nType ) - LOCAL cSmile DO CASE CASE nType == 1 - cSmile := ":)" + RETURN ":)" CASE nType == 2 - cSmile := ";)" + RETURN ";)" ENDCASE - RETURN cSmile + RETURN NIL STATIC FUNCTION YourSmile( nType ) - LOCAL cSmile DO CASE CASE nType == 1 - cSmile := "*SMILE*" + RETURN "*SMILE*" CASE nType == 2 - cSmile := "*WINK*" + RETURN "*WINK*" ENDCASE - RETURN cSmile + RETURN NIL $STATUS$ R $COMPLIANCE$ @@ -525,6 +532,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -546,23 +555,25 @@ $RETURNS$ __objModInline() return a reference to . $DESCRIPTION$ - __objModInline() is a low level class support function that modify + __objModInline() is a low-level class support function that modify an INLINE method in an object and replace it with a new code block. is unchanged if a symbol with the name does not exist in . __objModInline() is used in inheritance mechanism. $EXAMPLES$ // create a new THappy class and add a Smile INLINE method - oHappy := HBClass():New( "THappy" ) - bMyInline := {| nType | { ":)", ";)" }[ nType ] } - bYourInline := {| nType | { "*SMILE*", "*WINK*" }[ nType ] } + LOCAL oHappy := HBClass():New( "THappy" ) + LOCAL bMyInline := {| Self, nType | HB_SYMBOL_UNUSED( Self ), ; + { ":)", ";)" }[ nType ] } + LOCAL bYourInline := {| Self, nType | HB_SYMBOL_UNUSED( Self ), ; + { "*SMILE*", "*WINK*" }[ nType ] } __objAddInline( oHappy, "Smile", bMyInline ) - ? oHappy:Smile( 1 ) // :) - ? oHappy:Smile( 2 ) // ;) + ? oHappy:Smile( 1 ) // --> :) + ? oHappy:Smile( 2 ) // --> ;) // replace Smile inline method with a new code block __objModInline( oHappy, "Smile", bYourInline ) - ? oHappy:Smile( 1 ) // *SMILE* - ? oHappy:Smile( 2 ) // *WINK* + ? oHappy:Smile( 1 ) // --> *SMILE* + ? oHappy:Smile( 2 ) // --> *WINK* $STATUS$ R $COMPLIANCE$ @@ -575,6 +586,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -595,7 +608,7 @@ $RETURNS$ __objDelMethod() return a reference to . $DESCRIPTION$ - __objDelMethod() is a low level class support function that deletes + __objDelMethod() is a low-level class support function that deletes (removes) a METHOD or an INLINE method from an object. is unchanged if a symbol with the name does not exist in . @@ -603,22 +616,21 @@ __objDelInline() is exactly the same as __objDelMethod(). $EXAMPLES$ // create a new THappy class and add a Smile method - oHappy := HBClass():New( "THappy" ) + LOCAL oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) - ? __objHasMethod( oHappy, "Smile" ) // .T. + ? __objHasMethod( oHappy, "Smile" ) // --> .T. // remove Smile method __objDelMethod( oHappy, "Smile" ) - ? __objHasMethod( oHappy, "Smile" ) // .F. + ? __objHasMethod( oHappy, "Smile" ) // --> .F. STATIC FUNCTION MySmile( nType ) - LOCAL cSmile DO CASE CASE nType == 1 - cSmile := ":)" + RETURN ":)" CASE nType == 2 - cSmile := ";)" + RETURN ";)" ENDCASE - RETURN cSmile + RETURN NIL $STATUS$ R $COMPLIANCE$ @@ -631,6 +643,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -649,30 +663,29 @@ is the symbol name of METHOD or INLINE method to be deleted (removed) from the object. $RETURNS$ - __objDelInMethod() return a reference to . + __objDelInline() return a reference to . $DESCRIPTION$ - __objDelInMethod() is a low level class support function that delete + __objDelInline() is a low-level class support function that delete (remove) a METHOD or an INLINE method from an object. is unchanged if a symbol with the name does not exist in . $EXAMPLES$ // create a new THappy class and add a Smile method - oHappy := HBClass():New( "THappy" ) + LOCAL oHappy := HBClass():New( "THappy" ) __objAddMethod( oHappy, "Smile", @MySmile() ) - ? __objHasMethod( oHappy, "Smile" ) // .T. + ? __objHasMethod( oHappy, "Smile" ) // --> .T. // remove Smile method - __objDelInMethod( oHappy, "Smile" ) - ? __objHasMethod( oHappy, "Smile" ) // .F. + __objDelInline( oHappy, "Smile" ) + ? __objHasMethod( oHappy, "Smile" ) // --> .F. STATIC FUNCTION MySmile( nType ) - LOCAL cSmile DO CASE CASE nType == 1 - cSmile := ":)" + RETURN ":)" CASE nType == 2 - cSmile := ";)" + RETURN ";)" ENDCASE - RETURN cSmile + RETURN NIL $STATUS$ R $COMPLIANCE$ @@ -685,6 +698,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -705,17 +720,17 @@ $RETURNS$ __objDelData() return a reference to . $DESCRIPTION$ - __objDelData() is a low level class support function that delete + __objDelData() is a low-level class support function that delete (remove) a VAR from an object. is unchanged if a symbol with the name does not exist in . $EXAMPLES$ // create a new THappy class and add a lHappy VAR - oHappy := HBClass():New( "THappy" ) + LOCAL oHappy := HBClass():New( "THappy" ) __objAddData( oHappy, "lHappy" ) - ? __objHasData( oHappy, "lHappy" ) // .T. + ? __objHasData( oHappy, "lHappy" ) // --> .T. // remove lHappy VAR __objDelData( oHappy, "lHappy" ) - ? __objHasData( oHappy, "lHappy" ) // .F. + ? __objHasData( oHappy, "lHappy" ) // --> .F. $STATUS$ R $COMPLIANCE$ @@ -728,6 +743,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -749,7 +766,7 @@ __objDerivedFrom() return a logical TRUE (.T.) if is derived from . $DESCRIPTION$ - __objDerivedFrom() is a low level class support function that check + __objDerivedFrom() is a low-level class support function that check is one class is a super class of the other, or in other words, does class a child or descendant of . $EXAMPLES$ @@ -757,13 +774,12 @@ #include "hbclass.ch" PROCEDURE Main() - LOCAL oSuper, oObject, oDress - oSuper := TMood():New() - oObject := THappy():New() - oDress := TShirt():New() - ? __objDerivedFrom( oObject, oSuper ) // .T. - ? __objDerivedFrom( oSuper, oObject ) // .F. - ? __objDerivedFrom( oObject, oDress ) // .F. + LOCAL oSuper := TMood():New() + LOCAL oObject := THappy():New() + LOCAL oDress := TShirt():New() + ? __objDerivedFrom( oObject, oSuper ) // --> .T. + ? __objDerivedFrom( oSuper, oObject ) // --> .F. + ? __objDerivedFrom( oObject, oDress ) // --> .F. RETURN CREATE CLASS TMood diff --git a/doc/en/proc.txt b/doc/en/proc.txt new file mode 100644 index 0000000000..e85d6584cb --- /dev/null +++ b/doc/en/proc.txt @@ -0,0 +1,115 @@ +/* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin + $TEMPLATE$ + Function + $NAME$ + ProcName() + $CATEGORY$ + API + $SUBCATEGORY$ + Application + $ONELINER$ + Gets the name of the current function on the stack + $SYNTAX$ + ProcName( ) --> cProcName + $ARGUMENTS$ + is the function level required. + $RETURNS$ + The name of the function that it is being executed. + $DESCRIPTION$ + This function looks at the top of the stack and gets the current + executed function if no arguments are passed. Otherwise it returns + the name of the function or procedure at . + $EXAMPLES$ + // This test will show the functions and procedures in stack. + // before executing it. + LOCAL n := 1 + DO WHILE ! Empty( ProcName( n ) ) + ? ProcName( n++ ) + ENDDO + $STATUS$ + R + $COMPLIANCE$ + C + $FILES$ + Library is core + $SEEALSO$ + ProcLine(), ProcFile() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lanin + $TEMPLATE$ + Function + $NAME$ + ProcLine() + $CATEGORY$ + API + $SUBCATEGORY$ + Application + $ONELINER$ + Gets the line number of the current function on the stack. + $SYNTAX$ + ProcLine( ) --> nLine + $ARGUMENTS$ + is the function level required. + $RETURNS$ + The line number of the function that it is being executed. + $DESCRIPTION$ + This function looks at the top of the stack and gets the current + line number of the executed function if no arguments are passed. + Otherwise it returns the line number of the function or procedure + at . + $EXAMPLES$ + ? ProcLine( 0 ) + ? ProcName( 2 ) + $STATUS$ + R + $COMPLIANCE$ + C + $FILES$ + Library is core + $SEEALSO$ + ProcName(), ProcFile() + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lanin + $TEMPLATE$ + Function + $NAME$ + ProcFile() + $CATEGORY$ + API + $SUBCATEGORY$ + Application + $ONELINER$ + This function always returns an empty string. + $SYNTAX$ + ProcFile( ) --> cEmptyString + $ARGUMENTS$ + is any valid type. + $RETURNS$ + Return an empty string + $DESCRIPTION$ + This function is added to the RTL for full compatibility. It + always returns an empty string. + $EXAMPLES$ + ? ProcFile() + ? ProcFile( NIL ) + ? ProcFile( 2 ) + $STATUS$ + R + $COMPLIANCE$ + C + $FILES$ + Library is core + $SEEALSO$ + ProcName(), ProcLine() + $END$ + */ diff --git a/doc/en/rdddb.txt b/doc/en/rdddb.txt index 95b3c2925d..bf2adbe8b1 100644 --- a/doc/en/rdddb.txt +++ b/doc/en/rdddb.txt @@ -1,14 +1,6 @@ -/* - * Copyright 1999 Luiz Rafael Culik - * db*() documentation - * ord*() documentation - * rdd*() documentation - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -41,19 +33,16 @@ $DESCRIPTION$ Performs a code block operation on the current Database $EXAMPLES$ - PROCEDURE Main() - LOCAL nCount + LOCAL nCount - USE test + USE test - dbGoto( 4 ) - ? RecNo() - COUNT TO nCount - ? RecNo(), nCount - COUNT TO nCount NEXT 10 - ? RecNo(), nCount - - RETURN + dbGoto( 4 ) + ? RecNo() + COUNT TO nCount NEXT 10 + ? RecNo(), nCount + COUNT TO nCount + ? RecNo(), nCount $STATUS$ S $COMPLIANCE$ @@ -77,22 +66,18 @@ $ONELINER$ Alias name of a work area $SYNTAX$ - Dbf() --> + Dbf() --> cWorkArea $RETURNS$ Name of alias $DESCRIPTION$ - This function returns the same alias name ofthe currently selected + This function returns the same alias name of the currently selected work area. $EXAMPLES$ - PROCEDURE Main() - - USE test - SELECT 0 - ? iif( Dbf() == "", "No Name", Dbf() ) - ? test->( Dbf() ) - ? Alias( 1 ) - - RETURN + USE test + SELECT 0 + ? iif( Dbf() == "", "No Name", Dbf() ) + ? test->( Dbf() ) + ? Alias( 1 ) $STATUS$ R $COMPLIANCE$ @@ -105,6 +90,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -131,25 +118,23 @@ the record is flushed from the buffer and the contents are written to the disk. - Under a networking enviroment, dbAppend() performs an additional - operation: It attrmps to lock the newly added record. If + Under a networking environment, dbAppend() performs an additional + operation: It attempts to lock the newly added record. If the database file is currently locked or if a locking assignment - if made to LastRec() + 1, NetErr() will return a logical true (.T.) + is made to `LastRec() + 1`, NetErr() will return a logical true (.T.) immediately after the dbAppend() function. This function does not unlock the locked records. If is passed a logical true (.T.) value, it will - release the record locks, which allows the application to main- - tain multiple record locks during an appending operation. The + release the record locks, which allows the application to maintain + multiple record locks during an appending operation. The default for this parameter is a logical false (.F.). $EXAMPLES$ - PROCEDURE Main() - LOCAL cName := "Harbour", nId := 10 - USE test - test->( dbAppend() ) - test->Name := cName - test->Id := nId - RETURN + LOCAL cName := "Harbour", nAge := 15 + USE test + test->( dbAppend() ) + test->first := cName + test->age := nAge $STATUS$ R $COMPLIANCE$ @@ -162,6 +147,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -171,21 +158,20 @@ $SUBCATEGORY$ Database $ONELINER$ - Clears the current filter condiction in a work area + Clears the current filter condition in a work area $SYNTAX$ dbClearFilter() --> NIL $RETURNS$ dbClearFilter() always returns NIL $DESCRIPTION$ - This function clears any active filter condiction + This function clears any active filter conduction for the current or selected work area. $EXAMPLES$ - PROCEDURE Main() - USE test - SET FILTER TO hb_LeftEq( test->Name, "An" ) - dbEdit() - Test->( dbClearFilter() ) - RETURN + USE test + SET FILTER TO hb_LeftEq( test->first, "An" ) + dbGoTop() + dbEval( {|| QOut( test->first ) } ) + dbClearFilter() $STATUS$ R $COMPLIANCE$ @@ -198,6 +184,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -217,13 +205,11 @@ indexes. In addition, it closes all format files and moves the work area pointer to the first position $EXAMPLES$ - PROCEDURE Main() - USE test NEW - dbEdit() - USE test1 NEW - dbEdit() - dbCloseAll() - RETURN + USE test NEW + dbEdit() + USE test1 NEW + dbEdit() + dbCloseAll() $STATUS$ R $COMPLIANCE$ @@ -236,6 +222,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -252,11 +240,9 @@ This function will close any database open in the selected or aliased work area. $EXAMPLES$ - PROCEDURE Main() - USE test - dbEdit() - Test->( dbCloseArea() ) - RETURN + USE test + dbEdit() + test->( dbCloseArea() ) $STATUS$ R $COMPLIANCE$ @@ -269,6 +255,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -278,32 +266,31 @@ $SUBCATEGORY$ Database $ONELINER$ - Updates all index and database buffers for a given workarea + Updates all index and database buffers for a given work area $SYNTAX$ dbCommit() $DESCRIPTION$ This function updates all of the information for a give, selected, - or active workarea. This operation includes all database and index + or active work area. This operation includes all database and index buffers for that work area only. This function does not update all open work areas. $EXAMPLES$ - PROCEDURE Main() - LOCAL cName := Space( 40 ) - LOCAL nId := 0 + LOCAL GetList := {} + LOCAL cName := Space( 40 ) + LOCAL nAge := 0 - USE test EXCLUSIVE NEW + USE test EXCLUSIVE NEW - @ 10, 10 GET cName - @ 11, 10 GET nId - READ + @ 10, 10 GET cName + @ 11, 10 GET nAge + READ - IF Updated() - dbAppend() - test->Name := cName - test->Id := nId - dbCommit() - ENDIF - RETURN + IF Updated() + dbAppend() + test->first := cName + test->age := nAge + dbCommit() + ENDIF $STATUS$ R $COMPLIANCE$ @@ -316,6 +303,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -333,28 +322,28 @@ Before the disk write is performed, all buffers are flushed. open work areas. $EXAMPLES$ - PROCEDURE Main() - LOCAL cName := Space( 40 ) - LOCAL nId := 0 + // FIXME + LOCAL GetList := {} + LOCAL cName := Space( 40 ) + LOCAL nId := 0 - USE test EXCLUSIVE NEW - USE testid NEW INDEX testid + USE test EXCLUSIVE NEW + USE testid NEW INDEX testid - @ 10, 10 GET cName - @ 11, 10 GET nId - READ + @ 10, 10 GET cName + @ 11, 10 GET nId + READ - IF Updated() - dbAppend() - test->Name := cName - test->Id := nId - IF ! testid->( dbSeek( nId ) ) - testid->( dbAppend() ) - testid->Id := nId - ENDIF + IF Updated() + dbAppend() + test->first := cName + test->Id := nId + IF ! testid->( dbSeek( nId ) ) + testid->( dbAppend() ) + testid->Id := nId ENDIF - dbCommitAll() - RETURN + ENDIF + dbCommitAll() $STATUS$ R $COMPLIANCE$ @@ -367,6 +356,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -378,17 +369,17 @@ $ONELINER$ Creates an empty database from a array. $SYNTAX$ - dbCreate( , , [], [], - [] ) + dbCreate( , , [], [], [], + [], [], [] ) $ARGUMENTS$ - Name of database to be create + Name of database file to be create Name of a multidimensional array that contains the database structure - Name of the RDD + Name of the RDD - 3-way toggle to Open the file in New or Current workarea: + 3-way toggle to Open the file in New or Current work area: NIL The file is not opened. @@ -407,7 +398,7 @@ - All subscripts values in the second dimension must be set to proper values - The fourth subscript value in the second dimension - which contains - the decimal value-must he specified. even 1kw nonnumeric fields. + the decimal value-must he specified. even 1kw non-numeric fields. - The second subscript value in the second dimension-which contains the field data type-must contain a proper value: C, D, L, M or N @@ -415,40 +406,37 @@ for 'N'): however, the first letter of this array element must be a proper value. - The dbCreate( ) function does not use the decimal field to + The dbCreate() function does not use the decimal field to calculate the length of a character held longer than 256. Values up to the maximum length of a character field (which is 65519 bytes) are stored directly in the database in the length attribute if that database was created via this function. However, a file containing fields longer than 256 bytes is not compatible with any interpreter. - The parameter specifies the name of the Replaceable + The parameter specifies the name of the Replaceable Database Driver to use to create the database. If it is not specified, then the Replaceable Database Driver in the current work area is used. - The parameter specifies if the already created database is + The parameter specifies if the already created database is to be opened, and where. If NIL, the file is not opened. If True, it is opened in a New area, and if False it is opened in the current area (closing any file already occupying that area). The parameter specifies the alias name for the new opened database. $EXAMPLES$ - PROCEDURE Main() - LOCAL aStruct := { ; - { "CHARACTER", "C", 25, 0 }, ; - { "NUMERIC", "N", 8, 0 }, ; - { "DOUBLE", "N", 8, 2 }, ; - { "DATE", "D", 8, 0 }, ; - { "LOGICAL", "L", 1, 0 }, ; - { "MEMO1", "M", 10, 0 }, ; - { "MEMO2", "M", 10, 0 } } + LOCAL aStruct := { ; + { "CHARACTER", "C", 25, 0 }, ; + { "NUMERIC", "N", 8, 0 }, ; + { "DOUBLE", "N", 8, 2 }, ; + { "DATE", "D", 8, 0 }, ; + { "LOGICAL", "L", 1, 0 }, ; + { "MEMO1", "M", 10, 0 }, ; + { "MEMO2", "M", 10, 0 } } - REQUEST DBFCDX + REQUEST DBFCDX - dbCreate( "testdbf", aStruct, "DBFCDX", .T., "MYALIAS" ) - - RETURN + ? dbCreate( "testdbf", aStruct, "DBFCDX", .T., "MYALIAS" ) $STATUS$ R $COMPLIANCE$ @@ -462,6 +450,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -483,9 +473,10 @@ In a networking situation, this function requires that the record be locked prior to issuing the dbDelete() function. $EXAMPLES$ - nId := 10 - USE testid INDEX testid NEW - IF dbSeek( nId ) .AND. RLock() + LOCAL nAge := 50 + USE test NEW + INDEX ON field->age TO test + IF dbSeek( nAge ) .AND. RLock() dbDelete() ENDIF $STATUS$ @@ -500,6 +491,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -515,14 +508,14 @@ $RETURNS$ dbFilter() returns the filter expression. $DESCRIPTION$ - This function return the expression of the SET FILTER TO command + This function return the expression of the `SET FILTER TO` command for the current or designated work area. If no filter condition - is present, a NULL string will be returned. + is present, a null string will be returned. $EXAMPLES$ USE test INDEX test NEW - SET FILTER TO Name == "Harbour" + SET FILTER TO field->first = "Harbour" USE testid INDEX testid NEW - SET FILTER TO Id == 1 + SET FILTER TO field->age == 25 SELECT test ? dbFilter() @@ -539,6 +532,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -575,6 +570,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -593,18 +590,18 @@ This function places the record pointer, if working with a .dbf file, in selected or aliased work area at the record number specified by . The position is not affected by an active index or - by any enviromental SET condiction. + by any environmental SET condition. The parameter may be something other than a record number. In some data formats, for example, the value of is a unique primary key while in other formats, could be an array offset if the data set was an array. - Issuing a dbGoto( RecNo() ) call in a network enviroment will refresh - the database and index buffers. This is the same as a dbSkip(0) call. + Issuing a `dbGoto( RecNo() )` call in a network environment will refresh + the database and index buffers. This is the same as a `dbSkip( 0 )` call. $EXAMPLES$ - The following example uses dbGoto() to iteratively process - every fourth record: + // The following example uses dbGoto() to iteratively process + // every fourth record: dbUseArea( .T., "DBFNTX", "sales", "sales", .T. ) @@ -625,6 +622,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -661,6 +660,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -670,7 +671,7 @@ $SUBCATEGORY$ Database $ONELINER$ - Recalls a record previousy marked for deletion. + Recalls a record previously marked for deletion. $SYNTAX$ dbRecall() $DESCRIPTION$ @@ -700,6 +701,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -724,14 +727,13 @@ passed it will be assumed to lock the current active record/data item. $EXAMPLES$ - PROCEDURE Main() - LOCAL x - USE test NEW - FOR x := 1 TO LastRec() - IF ! dbRLock() - dbUnlock() - ENDIF - NEXT + LOCAL nRecNo + USE test NEW + FOR nRecNo := 1 TO LastRec() + IF ! dbRLock() + dbUnlock() + ENDIF + NEXT $STATUS$ R $COMPLIANCE$ @@ -744,6 +746,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -764,18 +768,15 @@ (meaning no elements in it), then there are no locked records in that work area. $EXAMPLES$ - PROCEDURE Main() - LOCAL aList, x - USE test NEW - dbGoto( 10 ) - RLock() - dbGoto( 100 ) - RLock() - aList := dbRLockList() - FOR EACH x IN aList - ? x - NEXT - RETURN + LOCAL nRecNo + USE test NEW + dbGoto( 10 ) + ? RLock() + dbGoto( 100 ) + ? RLock() + FOR EACH nRecNo IN dbRLockList() + ? nRecNo + NEXT $STATUS$ R $COMPLIANCE$ @@ -788,6 +789,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -808,14 +811,12 @@ specified, them the current active record/data item will be unlocked $EXAMPLES$ - PROCEDURE Main() - USE test NEW - dbGoto( 10 ) - IF RLock() - ? test->ID - dbRUnlock() - ENDIF - RETURN + USE test NEW + dbGoto( 10 ) + IF RLock() + ? test->age + dbRUnlock() + ENDIF $STATUS$ R $COMPLIANCE$ @@ -828,6 +829,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -852,10 +855,10 @@ $DESCRIPTION$ This function searches for the first record in a database file whose index key matches . If the item is found, the function will - return a logical true (.T.), the value of Found() wilI be a logical - true (.T.), and the value of Eof() wilI be a logical false (.F.). If + return a logical true (.T.), the value of Found() will be a logical + true (.T.), and the value of Eof() will be a logical false (.F.). If no item is found. then the function will return a logical false, the - value of Found( ) will be a logical false (.F.), and the value of + value of Found() will be a logical false (.F.), and the value of Eof() will be a logical true (.T.). This function always "rewinds" the database pointer and starts the @@ -872,21 +875,38 @@ is a logical false (.F.) $EXAMPLES$ PROCEDURE Main() - USE test NEW INDEX test + + LOCAL nAge + + USE test NEW + INDEX ON field->age TO test dbGoto( 10 ) - nId := test->nId - IF dbSeek( nId ) .AND. RLock() - ? test->Name - dbRUnlock() + nAge := test->age + dbGoTop() + IF dbSeek( nAge ) + ? test->first ENDIF + RETURN - ACCEPT "Employee name: " TO cName - IF Employee->( dbSeek( cName ) ) - Employee->( ViewRecord() ) - ELSE - ? "Not found" - ENDIF + STATIC PROCEDURE EmployeeLookup() + + LOCAL cName + + ACCEPT "Employee name: " TO cName + IF Employee->( dbSeek( cName ) ) + Employee->( ViewRecord() ) + ELSE + ? "Not found" + ENDIF + + RETURN + + STATIC PROCEDURE ViewRecord() + + ? field->name + + RETURN $STATUS$ S $COMPLIANCE$ @@ -899,6 +919,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -910,7 +932,7 @@ $ONELINER$ Change to another work area $SYNTAX$ - dbSelectArea( ) - + dbSelectArea( ) --> NIL $ARGUMENTS$ Alias or work area $DESCRIPTION$ @@ -919,23 +941,23 @@ select the numeric work area; if is character, then it will select the work area with the alias name. - dbSelectArea( 0 ) will select the next avaliable and unused work area. - Up to 255 work areas are supported. Each work area has its own alias + `dbSelectArea( 0 )` will select the next available and unused work area. + Up to 65534 work areas are supported. Each work area has its own alias and record pointer, as well as its own Found(), dbFilter(), dbRSelect() and dbRelation() function values. $EXAMPLES$ - PROCEDURE Main() - LOCAL nId - USE test NEW INDEX test - USE test1 NEW INDEX test1 - dbSelectArea( 1 ) - nId := test->Id - dbSelectArea( 2 ) - IF dbSeek( nId ) - ? test1->cName - ENDIF - dbCloseAll() - RETURN + LOCAL nAge + USE test NEW + COPY TO test1 + USE test1 NEW + INDEX ON field->age TO test1 + dbSelectArea( "test" ) + dbGoto( 100 ) + ? nAge := field->age + dbSelectArea( "test1" ) + IF dbSeek( nAge ) + ? field->first + ENDIF $STATUS$ R $COMPLIANCE$ @@ -948,6 +970,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -969,9 +993,9 @@ selected work area. The default will be "DBFNTX". If specified, contains the name of the database driver that should be used to activate and manage the work area. If the specified driver is - not avaliable, this function will have no effect. + not available, this function will have no effect. $EXAMPLES$ - dbSetDriver( "ADS" ) + ? dbSetDriver( "DBFNSX" ) $STATUS$ R $COMPLIANCE$ @@ -984,6 +1008,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -1001,18 +1027,16 @@ $DESCRIPTION$ This function moves the record pointer in the selected or aliased work area. The default value for will be 1. - A dbSkip( 0 ) will flush and refresh the internal database bufer and + A `dbSkip( 0 )` will flush and refresh the internal database buffer and make any changes made to the record visible without moving the record pointer in either direction. $EXAMPLES$ - PROCEDURE Main() - USE test NEW - dbGoTop() - DO WHILE ! Eof() - ? test->Id, test->Name - dbSkip() - ENDDO - RETURN + USE test NEW + dbGoTop() + DO WHILE ! Eof() + ? test->age, test->first + dbSkip() + ENDDO $STATUS$ R $COMPLIANCE$ @@ -1025,6 +1049,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -1049,10 +1075,10 @@ function will return an empty string showing no filter in that work area which in fact, would be not correct. $EXAMPLES$ - PROCEDURE Main() - USE test NEW - dbSetFilter( {|| test->Id < 100 }, "test->Id <100" ) - dbGoTop() + USE test NEW + dbSetFilter( {|| test->age > 30 }, "test->age > 30" ) + dbGoTop() + ? RecNo() $STATUS$ R $COMPLIANCE$ @@ -1065,6 +1091,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1084,18 +1112,15 @@ pointers to other arrays, each of which contains the characteristic of a field in the active work area. The length of this array is based in the number of fields in that particular work area. In other words, - Len( dbStruct() ) is equal to the value obtained from FCount(). + `Len( dbStruct() )` is equal to the value obtained from FCount(). Each subscript position $EXAMPLES$ #include "dbstruct.ch" - PROCEDURE Main() - LOCAL aStru, x - USE test NEW - aStru := dbStruct() - FOR EACH x IN aStru - ? x[ DBS_NAME ] - NEXT - RETURN + LOCAL field + USE test NEW + FOR EACH field IN dbStruct() + ? field[ DBS_NAME ] + NEXT $STATUS$ R $COMPLIANCE$ @@ -1109,6 +1134,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -1126,10 +1153,11 @@ selected or aliased work area. It will not unlock an associated lock in a related databases. $EXAMPLES$ - nId := 10 - USE testid INDEX testid NEW - IF testid->( dbSeek( nId ) ) - IF testid->( RLock() ) + LOCAL nAge := 30 + USE test NEW + INDEX ON field->age TO test + IF test->( dbSeek( nAge ) ) + IF test->( RLock() ) dbDelete() ELSE dbUnlock() @@ -1147,6 +1175,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -1162,10 +1192,11 @@ $DESCRIPTION$ This function will remove all file and record locks in all work area. $EXAMPLES$ - nId := 10 - USE test INDEX testid NEW - IF testid->( dbSeek( nId ) ) - IF testid->( RLock() ) + LOCAL nAge := 50 + USE test NEW + INDEX ON field->age TO test + IF test->( dbSeek( nAge ) ) + IF test->( RLock() ) dbDelete() ELSE dbUnlock() @@ -1185,6 +1216,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -1224,17 +1257,17 @@ used. If is set to a logical true (.T.) value, the database that - is specified in will be opened by the user EXCLUSIVELY. Thus + is specified in will be opened by the user *exclusively*. Thus locking it from all other nodes or users on the network. If is set to a logical false (.F.) value, then the database will be in SHARED mode. If is not passed, then the function will turn to the internal setting of SET EXCLUSIVE to determine a setting. - If is specified, the file will be set to READ ONLY mode. + If is specified, the file will be set to *read only* mode. If it is not specified, the file will he opened in normal read-write mode. $EXAMPLES$ - dbUseArea( .T.,, "test" ) + ? dbUseArea( .T.,, "test" ) $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/rddmisc.txt b/doc/en/rddmisc.txt index 1cf3fd4674..e7f7437bfb 100644 --- a/doc/en/rddmisc.txt +++ b/doc/en/rddmisc.txt @@ -1,14 +1,6 @@ -/* - * Copyright 1999 Luiz Rafael Culik - * db*() documentation - * ord*() documentation - * rdd*() documentation - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -20,7 +12,7 @@ $ONELINER$ Fills referenced arrays with database field information $SYNTAX$ - AFields( , [], [], [] ) --> + AFields( , [], [], [] ) --> nFields $ARGUMENTS$ Array of field names @@ -30,7 +22,7 @@ Array of field names $RETURNS$ - Number od fields in a database or work area + Number of fields in a database or work area $DESCRIPTION$ This function will fill a series of arrays with field names, field types, field lengths, and number of field @@ -52,27 +44,34 @@ $EXAMPLES$ PROCEDURE Main() + LOCAL nCount + USE test nCount := FCount() ? "Number of fields:", nCount - PrintFields( nCount ) // Information for all fields - PrintFields( 4 ) // Information for first 4 fields + PrintFields( nCount ) // Information for all fields + PrintFields( 4 ) // Information for first 4 fields + RETURN - PROCEDURE PrintFields( nCount ) - LOCAL aNames, aTypes, aLens, aDecs, nFields, i + STATIC PROCEDURE PrintFields( nCount ) - aNames := Array( nCount ) - aTypes := Array( nCount ) - aLens := Array( nCount ) - aDecs := Array( nCount ) - nFields := AFields( aNames, aTypes, aLens, aDecs ) + LOCAL aNames := Array( nCount ) + LOCAL aTypes := Array( nCount ) + LOCAL aLens := Array( nCount ) + LOCAL aDecs := Array( nCount ) + + LOCAL nFields := AFields( aNames, aTypes, aLens, aDecs ), i ? "Number of items:", nFields - FOR i := 1 TO nFields - ? i, PadR( aNames[ i ], 12 ), aTypes[ i ], aLens[ i ], aDecs[ i ] + FOR tmp := 1 TO nFields + ? tmp, ; + PadR( aNames[ tmp ], 12 ), ; + aTypes[ tmp ], ; + aLens[ tmp ], ; + aDecs[ tmp ] NEXT RETURN @@ -99,25 +98,21 @@ $ONELINER$ Returns the alias name of a work area $SYNTAX$ - Alias( [] ) --> + Alias( [] ) --> cWorkArea $ARGUMENTS$ Number of a work area $RETURNS$ Name of alias $DESCRIPTION$ - This function returns the alias of the work area indicated by + This function returns the alias of the work area indicated by . If is not provided, the alias of the current work area is returned. $EXAMPLES$ - PROCEDURE Main() - - USE test - SELECT 0 - ? iif( Alias() == "", "No Name", Alias() ) - ? test->( Alias() ) - ? Alias( 1 ) - - RETURN + USE test + SELECT 0 + ? iif( Alias() == "", "No Name", Alias() ) + ? test->( Alias() ) + ? Alias( 1 ) $STATUS$ R $COMPLIANCE$ @@ -141,7 +136,7 @@ $ONELINER$ Test for the beginning-of-file condition $SYNTAX$ - Bof() --> + Bof() --> lBegin $RETURNS$ Bof() Logical true (.T.) or false (.F.) $DESCRIPTION$ @@ -151,16 +146,13 @@ By default, Bof() will apply to the currently selected database unless the function is preceded by an alias $EXAMPLES$ - PROCEDURE Main() - USE test NEW - ? "Is Bof()", Bof() - dbGoTop() - DO WHILE ! Bof() - dbSkip( -1 ) - ENDDO - ? "Is Bof()", Bof() - dbCloseArea() - RETURN + USE test NEW + ? "Is Bof()", Bof() + dbGoTop() + DO WHILE ! Bof() + dbSkip( -1 ) + ENDDO + ? "Is Bof()", Bof() $STATUS$ R $COMPLIANCE$ @@ -195,9 +187,10 @@ In a network environment, any file that is about to be ZAPped must be used exclusively. $EXAMPLES$ - USE test NEW INDEX test + USE test + ? LastRec() // --> 500 ZAP - dbCloseArea() + ? LastRec() // --> 0 $STATUS$ R $COMPLIANCE$ @@ -229,14 +222,11 @@ selected or designated work area has been marked for deletion. If not, the function will return a logical false (.F.). $EXAMPLES$ - PROCEDURE Main() - USE test NEW - dbGoto() - dbDelete() - ? "Is Record Deleted", Test->( Deleted() ) - dbRecall() - dbCloseArea() - RETURN + USE test NEW + dbGoto( 10 ) + dbDelete() + ? "Is Record Deleted", test->( Deleted() ) + dbRecall() $STATUS$ R $COMPLIANCE$ @@ -260,7 +250,7 @@ $ONELINER$ Test for end-of-file condition. $SYNTAX$ - Eof() --> + Eof() --> lEnd $ARGUMENTS$ (This command has no arguments) $RETURNS$ @@ -270,17 +260,14 @@ If it has, the function will return a logical true (.T.); otherwise a logical false (.F.) will be returned $EXAMPLES$ - PROCEDURE Main() - USE test NEW - dbGoTop() - ? "Is Eof()", Eof() - dbGoBottom() - DO WHILE ! Eof() - dbSkip() - ENDDO - ? "Is Eof()", Eof() - dbCloseArea() - RETURN + USE test NEW + dbGoTop() + ? "Is Eof()", Eof() + dbGoBottom() + DO WHILE ! Eof() + dbSkip() + ENDDO + ? "Is Eof()", Eof() $STATUS$ R $COMPLIANCE$ @@ -312,11 +299,8 @@ work area. If no database is open in this work area, the function will return 0. $EXAMPLES$ - PROCEDURE Main() - USE test NEW - ? "This database has", test->( FCount() ), "fields" - dbCloseArea() - RETURN + USE test NEW + ? "This database has", hb_ntos( test->( FCount() ) ), "field(s)" $STATUS$ R $COMPLIANCE$ @@ -351,11 +335,8 @@ correspond to n available field position in this work area, the function will return a NIL data type. $EXAMPLES$ - PROCEDURE Main() - USE test NEW - ? test->( FieldGet( 1 ) ) - dbCloseArea() - RETURN + USE test NEW + ? test->( FieldGet( 1 ) ) $STATUS$ R $COMPLIANCE$ @@ -390,14 +371,11 @@ existing field in the designated or selected work area, this function will return a NULL byte. $EXAMPLES$ - PROCEDURE Main() - LOCAL x - USE test NEW - FOR x := 1 TO test->( FCount() ) - ? "Field Name:", FieldName( x ) - NEXT - dbCloseArea() - RETURN + LOCAL nField + USE test NEW + FOR nField := 1 TO test->( FCount() ) + ? "Field Name:", FieldName( nField ) + NEXT $STATUS$ R $COMPLIANCE$ @@ -428,15 +406,12 @@ is ordinal position of the field. $DESCRIPTION$ This function return the ordinal position of the specified field - in the current or aliased work areaIf there isn't field under the name + in the current or aliased work area. If there isn't field under the name of or of no database is open in the selected work area, the function will return a 0. $EXAMPLES$ - PROCEDURE Main() - USE test NEW - ? test->( FieldPos( "ID" ) ) - dbCloseArea() - RETURN + USE test NEW + ? test->( FieldPos( "LAST" ) ) $STATUS$ R $COMPLIANCE$ @@ -475,8 +450,7 @@ the function will return a NIL data type $EXAMPLES$ USE test NEW - FieldPut( 1, "Mr. Jones" ) - dbCloseArea() + ? FieldPut( 1, "Mr. Jones" ) $STATUS$ R $COMPLIANCE$ @@ -510,11 +484,12 @@ database. This function will also unlock all records locks placed by the same network station. $EXAMPLES$ + LOCAL nSum USE test NEW IF FLock() - SUM test->Ammount + SUM test->age TO nSum + ? nSum ENDIF - dbCloseArea() $STATUS$ R $COMPLIANCE$ @@ -549,13 +524,13 @@ flag, so that a Found() condition may be tested in unselected work areas by using an alias. $EXAMPLES$ - nId := 100 - USE test NEW INDEX test - SEEK nId + LOCAL nAge := 40 + USE test NEW + INDEX ON field->age TO test + SEEK nAge IF Found() - ? test->Name + ? test->first ENDIF - dbCloseArea() $STATUS$ R $COMPLIANCE$ @@ -584,7 +559,7 @@ The numeric size of a database file header in bytes $DESCRIPTION$ This function returns the number of bytes in the header of the - selected database ot the database in the designated work area. + selected database of the database in the designated work area. If used in conjunction with the LastRec(), RecSize() and DiskSpace() functions, this functions is capable of implementing a backup and @@ -662,11 +637,8 @@ or designated database was last written to disk. This function will only work for those database files in USE. $EXAMPLES$ - PROCEDURE Main() - USE test NEW - ? LUpdate() - dbCloseArea() - RETURN + USE test NEW + ? LUpdate() $STATUS$ R $COMPLIANCE$ @@ -700,8 +672,8 @@ function. $DESCRIPTION$ This function return a logical true (.T.) is a USE, dbAppend(), or - a USE...EXCLUSIVE command is issue and fails in a network environment. - In the case of USE and USE...EXCLUSIVE commands, a NetErr() value + a `USE...EXCLUSIVE` command is issue and fails in a network environment. + In the case of USE and `USE...EXCLUSIVE` commands, a NetErr() value of .T. would be returned if another node of the network has the exclusive use of a file. And the case of the dbAppend() command, NetErr() will return a logical true (.T.) if the file or record @@ -712,15 +684,13 @@ $EXAMPLES$ USE test NEW IF ! NetErr() - INDEX ON field->First TO test + INDEX ON field->first TO test SET INDEX TO test - test->First := "Harbour" - SEEK "Harbour" - IF Found() - ? test->First + test->first := "Harbour" + IF dbSeek( "Harbour" ) + ? test->first ENDIF ENDIF - dbCloseArea() $STATUS$ R $COMPLIANCE$ @@ -757,10 +727,7 @@ return a 0 value as well. $EXAMPLES$ USE test NEW - USE harbour NEW ? RecCount() - ? Test->( RecCount() ) - dbCloseAll() $STATUS$ R $COMPLIANCE$ @@ -798,9 +765,9 @@ $EXAMPLES$ USE test NEW dbGoTop() - RecNo() // Returns 1 + ? RecNo() // --> 1 dbGoto( 50 ) - RecNo() // Returns 50 + ? RecNo() // --> 50 $STATUS$ R $COMPLIANCE$ @@ -837,9 +804,9 @@ $EXAMPLES$ USE test NEW dbGoTop() - RecSize() // Returns 1 + ? RecSize() // --> 1 dbGoto( 50 ) - RecSize() + ? RecSize() $STATUS$ R $COMPLIANCE$ @@ -879,7 +846,7 @@ On a Network environment the follow command need that the record is locked: - @...GET + `@...GET` DELETE (single record) @@ -887,14 +854,12 @@ REPLACE (single record) $EXAMPLES$ - nId := 10 - USE testid INDEX testid NEW - IF testid->( dbSeek( nId ) ) - IF testid->( RLock() ) - dbDelete() - ENDIF + LOCAL nAge := 50 + USE test NEW + INDEX ON field->age TO test + IF dbSeek( nAge ) .AND. RLock() + dbDelete() ENDIF - dbCloseArea() $STATUS$ R $COMPLIANCE$ @@ -928,6 +893,7 @@ name . If no parameter is specified, the current work area will be the return value of the function. $EXAMPLES$ + LOCAL cOldArea USE test NEW USE names NEW cOldArea := Select( "names" ) @@ -970,12 +936,12 @@ $EXAMPLES$ USE test NEW USE names NEW - ? Used() // .T. - ? TESTS->( Used() ) //.T. + ? Used() // --> .T. + ? test->( Used() ) // --> .T. dbCloseArea() - ? Used() // .F. + ? Used() // --> .F. SELECT test - ? Used() // .T. + ? Used() // --> .T. $STATUS$ R $COMPLIANCE$ @@ -1011,11 +977,12 @@ has completed its operation. On completion, the record pointer is placed on the first record in the database. $EXAMPLES$ - USE test NEW INDEX test + USE test dbGoto( 10 ) DELETE NEXT 10 + ? LastRec() PACK - dbCloseArea() + ? LastRec() $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/rddord.txt b/doc/en/rddord.txt index b881be0053..791a955c75 100644 --- a/doc/en/rddord.txt +++ b/doc/en/rddord.txt @@ -1,14 +1,6 @@ -/* - * Copyright 1999 Luiz Rafael Culik - * db*() documentation - * ord*() documentation - * rdd*() documentation - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -32,12 +24,10 @@ This function replaces the IndexOrd() function. $EXAMPLES$ - USE test NEW VIA "DBFNTX" - ? ordBagExt() // Returns .ntx - dbCloseArea() - USE test NEW VIA "DBFCDX" - ? ordBagExt() // Returns .cdx - dbCloseArea() + USE test VIA "DBFNTX" + ? ordBagExt() // --> ".ntx" + USE test VIA "DBFCDX" + ? ordBagExt() // --> ".cdx" $STATUS$ S $COMPLIANCE$ @@ -52,6 +42,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -75,17 +67,17 @@ work area. If is specidied, it will represent the position in the order list of the target order. If is specified, it will represent the name of the target order. In essence, it will - tell the name of the database (if That Rdd is in use) for a given + tell the name of the database (if That RDD is in use) for a given index name or index order number. If is not specified or is 0, the Current active order will be used. $EXAMPLES$ USE test VIA "DBFCDX" NEW SET INDEX TO test - ordBagName( "TeName" ) // Returns: Customer - ordBagName( "TeLast" ) // Returns: Customer - ordBagName( "teZip" ) // Returns: Customer + ? ordBagName( "TeName" ) // --> "Customer" + ? ordBagName( "TeLast" ) // --> "Customer" + ? ordBagName( "teZip" ) // --> "Customer" ordSetFocus( "TeName" ) - ? OrderBagName() // Returns: Custumer + ? ordBagName() // --> "Custumer" $STATUS$ S $COMPLIANCE$ @@ -100,6 +92,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -131,10 +125,10 @@ order. is a code block that defines a FOR condition that - each record within the scope must meet in order to be processed. If - a record does not meet the specified condition, it is ignored and the - next record is processed.Duplicate keys values are not added to the - index file when a FOR condition is Used. + each record within the scope must meet in order to be processed. If + a record does not meet the specified condition, it is ignored and the + next record is processed. Duplicate keys values are not added to the + index file when a FOR condition is Used. $DESCRIPTION$ $EXAMPLES$ @@ -151,6 +145,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -190,7 +186,7 @@ macro expanding the value of . If is not specified, then the current internal setting of - SET UNIQUE ON or OFF will be observed. + `SET UNIQUE ON` or OFF will be observed. The active RDD driver determines the capacity in the order for a specific order bag. @@ -203,11 +199,11 @@ added. It is does exist, then the replaces the former name in the order list in the current or specified work area. $EXAMPLES$ - USE test VIA "DBFNDX" NEW - ordCreate( "FNAME",, "test->fName" ) + USE test VIA "DBFNTX" + ? ordCreate( "FNAME",, "field->first" ) - USE test VIA "DBFCDX" NEW - ordCreate( , "lName", "test->lName" ) + USE test VIA "DBFCDX" + ? ordCreate( , "LNAME", "field->last" ) $STATUS$ S $COMPLIANCE$ @@ -222,6 +218,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -253,7 +251,7 @@ and RDDADS drivers). $EXAMPLES$ USE test VIA "DBFCDX" NEW - ordDestroy( "lName", "test" ) + ? ordDestroy( "lName", "test" ) $STATUS$ S $COMPLIANCE$ @@ -268,6 +266,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -291,13 +291,13 @@ $DESCRIPTION$ This function returns a character string that is the expression for the FOR condition for the specified order. The order may be specified - if is the name of the order.However, may be an + if is the name of the order. However, may be an numeric which represent the position in the order list of the desired Order. $EXAMPLES$ USE test NEW VIA "DBFCDX" - INDEX ON field->ID TO test FOR field->ID > 100 - ordFor( "test" ) // Returns: field->ID > 100 + INDEX ON field->first TO test FOR field->age > 50 + ? ordFor( "test" ) // --> "field->age > 50" $STATUS$ S $COMPLIANCE$ @@ -314,6 +314,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -337,12 +339,12 @@ $EXAMPLES$ USE test NEW VIA "DBFCDX" - INDEX ON field->fName TO test FOR field->fName > "CK" - INDEX ON field->Id TO testid + INDEX ON field->first TO test FOR field->first > "CK" + INDEX ON field->age TO testage - ordKey( "test" ) // Returns: field->fName + ? ordKey( "test" ) // --> "field->first" ordSetFocus( 2 ) - ordKey() // Returns: field->Id + ? ordKey() // --> "field->age" $STATUS$ S $COMPLIANCE$ @@ -370,7 +372,7 @@ $ONELINER$ Returns the file extension of the index module used in an application $SYNTAX$ - IndexExt() --> + IndexExt() --> cExtension $ARGUMENTS$ None. $RETURNS$ @@ -378,7 +380,7 @@ $DESCRIPTION$ This function returns a string that tells what indexes are to be used or will be created in the compiled application. The default value is - ".ntx". This is controled by the particular database driver that is + `.ntx`. This is controlled by the particular database driver that is linked with the application. $EXAMPLES$ IF IndexExt() == ".ntx" @@ -409,7 +411,7 @@ $ONELINER$ Yields the key expression of a specified index file. $SYNTAX$ - IndexKey( ) --> + IndexKey( ) --> cIndexKey $ARGUMENTS$ Index order number $RETURNS$ @@ -419,12 +421,13 @@ index file The index key is displayed for an index file that is designated by - , its position in the USE...INDEX or SET INDEX TO command in + , its position in the `USE...INDEX` or `SET INDEX TO` command in the currently selected or designated work area. If there is no corresnponding index key at the specified order position, a NULL byte will be returned. $EXAMPLES$ - USE test NEW INDEX test1 + USE test NEW + INDEX ON field->first TO test ? IndexKey( 1 ) $STATUS$ R @@ -451,7 +454,7 @@ $ONELINER$ Returns the numeric position of the controlling index. $SYNTAX$ - IndexOrd() --> + IndexOrd() --> nPosition $ARGUMENTS$ None. $RETURNS$ @@ -462,9 +465,10 @@ A returned value of 0 indicated that no active index is controlling the database, which therefore is in the natural order. $EXAMPLES$ - USE test NEW INDEX test1 + USE test NEW + INDEX ON field->first TO test IF IndexOrd() > 0 - ? "Current order is", IndexOrd() + ? "Current order is", hb_ntos( IndexOrd() ) ENDIF $STATUS$ R diff --git a/doc/en/readvar.txt b/doc/en/readvar.txt index d5e8eead58..b39ba04aea 100644 --- a/doc/en/readvar.txt +++ b/doc/en/readvar.txt @@ -1,12 +1,6 @@ -/* - * Copyright 1999 Chen Kedem - * Documentation for: ReadVar() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -25,26 +19,27 @@ ReadVar() return the old variable name. If no variable previously was set, ReadVar() return "". $DESCRIPTION$ - ReadVar() is set inside a READ or MENU TO command to hold the - uppercase name of the GET / MENU TO variable, and re-set back to old + ReadVar() is set inside a READ or `MENU TO` command to hold the + uppercase name of the GET / `MENU TO` variable, and re-set back to old value when those commands finished. You should not normally set a variable name but rather use it to retrieve the name of a GET - variable when executing a VALID or WHEN clause, or during SET KEY - execution and you are inside a READ or MENU TO. + variable when executing a VALID or WHEN clause, or during `SET KEY` + execution and you are inside a READ or `MENU TO`. $EXAMPLES$ #include "inkey.ch" - // display a menu, press F1 to view the MENU TO variable name + LOCAL What_Is_Bug + // display a menu, press to view the MENU TO variable name CLS @ 1, 10 PROMPT "blood sucking insect that infect beds " @ 2, 10 PROMPT "germ; virus infection " @ 3, 10 PROMPT "defect; snag; (source of) malfunctioning" @ 4, 10 PROMPT "small hidden microphone " - @ 6, 10 SAY "(Press F1 for a hint)" + @ 6, 10 SAY "(Press for a hint)" SetKey( K_F1, {|| ShowVar() } ) MENU TO What_Is_Bug STATIC PROCEDURE ShowVar() - Alert( ReadVar() ) // WHAT_IS_BUG in red Alert() box + Alert( ReadVar() ) // --> "WHAT_IS_BUG" RETURN $STATUS$ R diff --git a/doc/en/sayget.txt b/doc/en/sayget.txt index e34366d92d..a13991d0f2 100644 --- a/doc/en/sayget.txt +++ b/doc/en/sayget.txt @@ -39,13 +39,13 @@ Color string to be used for the GET expression. $DESCRIPTION$ This command adds a GET object to the reserved array variable - named GETLIST[] and displays it to the screen. The field or variable + named `GetList` and displays it to the screen. The field or variable to be added to the GET object is specified in and is displayed at row, column coordinate , . If the SAY clause is used will be displayed starting at , , with the field variable displayed at Row(), - Col()+ 1. If , the picture template for the SAY expression + `Col() + 1`. If , the picture template for the SAY expression , is used, all formatting rules contained will apply See the TRANSFORM I function for further information. @@ -68,7 +68,7 @@ until the condition in evaluates to true (.T.). The name of a user-defined function returning a logical true (.T.) or false (.F.) or it code block may be specified in . This clause is - not activated until a READ command or ReadModal( ) function call is + not activated until a READ command or ReadModal() function call is issued. If the RANGE clause is specified instead of the VALID clause, the @@ -76,11 +76,13 @@ and . Id is a date data type, and must also be date data types; if is a numeric data type and must also be numeric data types. If a value fails the - RANGE test ,a message of OUT OF RANGE will appear in the SCOREBOARD + RANGE test, the message "OUT OF RANGE" will appear in the SCOREBOARD area (row = 0, col = 60). The RANGE message may be turned off it the - SET SCOREBOARD command or Set() function appropriately toggled. + `SET SCOREBOARD` command or Set() function appropriately toggled. - NOTE GET functions/formatting rules: + $NOTES$ + + GET functions/formatting rules: @A Allows only alphabetic characters. @@ -121,20 +123,18 @@ Format PICTURE functions may he grouped together as well as used - in Conjunction with a PICTURE templates;however, a blank space must + in conjunction with a PICTURE templates; however, a blank space must be included in the PICTURE string if there are both functions and templates. $EXAMPLES$ - PROCEDURE Main() - LOCAL cVar := Space( 50 ) - LOCAL nId := 0 - CLS - @ 3, 1 SAY "Name" GET cVar PICTURE "@!S 30" - @ 4, 1 SAY "Id" GET nId PICTURE "999.999" - READ - ? "The name you entered is", cVar - ? "The id you entered is", nId - RETURN + LOCAL cVar := Space( 50 ), nId := 0 + LOCAL GetList := {} + CLS + @ 3, 1 SAY "Name" GET cVar PICTURE "@!S 30" + @ 4, 1 SAY "Id" GET nId PICTURE "999.999" + READ + ? "The name you entered is", cVar + ? "The id you entered is", nId $STATUS$ R $COMPLIANCE$ @@ -177,14 +177,12 @@ the screen. For a complete list of PICTURES templates and functions, see the - @...GET command. + `@...GET` command. $EXAMPLES$ - PROCEDURE Main() - CLS - @ 2, 1 SAY "Harbour" - @ 3, 1 SAY "is" COLOR "b/r+" - @ 4, 1 SAY "Power" PICTURE "@!" - RETURN + CLS + @ 2, 1 SAY "Harbour" + @ 3, 1 SAY "is" COLOR "b/r+" + @ 4, 1 SAY "Power" PICTURE "@!" $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/set.txt b/doc/en/set.txt index 892fa9390c..c39de2ba43 100644 --- a/doc/en/set.txt +++ b/doc/en/set.txt @@ -1,29 +1,6 @@ -/* - * Copyright 1999 David G. Holm - * Documentation for: Set(), __SetCentury() - * - * Copyright 1999 April White - * Documentation for: SetKey(), hb_SetKeyGet(), hb_SetKeySave(), - * hb_SetKeyCheck(), SET KEY - * - * Copyright 1999 Chen Kedem - * Documentation for: __SetFunction(), SET FUNCTION - * - * Copyright 1999 Jose Lalin - * Documentation for: SetTypeahead() - * Documentation for: __XHelp() - * - * Copyright 2000 Luiz Rafael Culik - * Documentation for: SET WRAP, SET DEFAULT, SET MESSAGE - * Documentation for: SET PATH, SET INTENSITY, SET ALTERNATE - * Documentation for: SET CENTURY, SET DATE, SET CONSOLE - * Documentation for: SET EPOCH, SET PRINTER, SET FIXED - * Documentation for: SET BELL - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 David G. Holm $TEMPLATE$ Function $NAME$ @@ -38,8 +15,8 @@ __SetCentury([ | ] ) --> lPreviousValue $ARGUMENTS$ optional or (not case sensitive) - .T. or "ON" to enable the century setting (4-digit years) - .F. or "OFF" to disable the century setting (2-digit years) + .T. or `"ON"` to enable the century setting (4-digit years) + .F. or `"OFF"` to disable the century setting (2-digit years) $RETURNS$ Either the current or previous century setting as a logical value $FILES$ @@ -50,6 +27,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 David G. Holm $TEMPLATE$ Function $NAME$ @@ -71,15 +50,15 @@ - _SET_ALTERNATE | + `_SET_ALTERNATE` | If enabled, QOut() and QQOut() write to the screen and to a file, provided that a file has been opened or created - with _SET_ALTFILE. If disabled, which is the default, + with `_SET_ALTFILE`. If disabled, which is the default, QOut() and QQOut() only write to the screen (and/or to the PRINTFILE). Defaults to disabled. - _SET_ALTFILE + `_SET_ALTFILE` When set, creates or opens file to write QOut() and QQOut() output to. If is TRUE and the file @@ -87,132 +66,132 @@ of file. Otherwise, the file is created. If a file is already opened, it is closed before the new file is opened or created (even if it is the same file). The - default file extension is ".txt". There is no default + default file extension is `.txt`. There is no default file name. Call with an empty string to close the file. - _SET_AUTOPEN | + `_SET_AUTOPEN` | TODO: Document - _SET_AUTORDER | + `_SET_AUTORDER` | TODO: Document - _SET_AUTOSHARE | + `_SET_AUTOSHARE` | TODO: Document - _SET_BELL | + `_SET_BELL` | When enabled, the bell sounds when the last position of a GET is reached and/or when a GET validation fails. Disabled by default. - _SET_CANCEL | + `_SET_CANCEL` | - When enabled, which is the default, pressing Alt+C or - Ctrl+Break terminates the program. When disabled, both - keystrokes can be read by Inkey(). Note: SET KEY has - precedence over SET CANCEL. + When enabled, which is the default, pressing or + terminates the program. When disabled, both + keystrokes can be read by Inkey(). Note: `SET KEY` has + precedence over `SET CANCEL`. - _SET_COLOR + `_SET_COLOR` Sets the current color scheme, using color pairs in the - sequence ", , , , - ". Each color pair uses the format - "/". The color codes are space - or "N" for black, "B" for blue, "G" for green, "BG" for - Cyan, "R" for red, "RB" for magenta, "GR" for brown, "W" - for white, "N+" for gray, "B+" for bright blue, "G+" for - bright green, "BG+" for bright cyan, "R+" for bright red, - "RB+" for bright magenta, "GR+" for yellow, and "W+" for - bright white. Special codes are "I" for inverse video, - "U" for underline on a monochrome monitor (blue on a - color monitor), and "X" for blank. The default color is - "W/N,N/W,N,N,N/W". + sequence `", , , , + "`. Each color pair uses the format + `"/"`. The color codes are space + or `"N"` for black, `"B"` for blue, `"G"` for green, `"BG"` for + Cyan, `"R"` for red, `"RB"` for magenta, `"GR"` for brown, `"W"` + for white, `"N+"` for gray, `"B+"` for bright blue, `"G+"` for + bright green, `"BG+"` for bright cyan, `"R+"` for bright red, + `"RB+"` for bright magenta, `"GR+"` for yellow, and `"W+"` for + bright white. Special codes are `"I"` for inverse video, + `"U"` for underline on a monochrome monitor (blue on a + color monitor), and `"X"` for blank. The default color is + `"W/N,N/W,N,N,N/W"`. - _SET_CONFIRM | + `_SET_CONFIRM` | If enabled, an exit key must be pressed to leave a GET. If disabled, which is the default, typing past the end will leave a GET. - _SET_CONSOLE | + `_SET_CONSOLE` | If enabled, which is the default, all screen output goes to the screen. When disabled, screen output is suppressed (Note: This setting does not affect OutStd() or OutErr()). - _SET_CURSOR + `_SET_CURSOR` If enabled, which is the default, the cursor is displayed on screen. If disabled, the screen cursor is hidden. - _SET_DATEFORMAT + `_SET_DATEFORMAT` Sets the default date format for display, date input, and - date conversion. Defaults to American ("mm/dd/yy"). Other - formats include ANSI ("yy.mm.dd"), British ("dd/mm/yy"), - French ("dd/mm/yy"), German ("dd.mm.yy"), Italian - ("dd-mm-yy"), Japan ("yy/mm/dd"), and USA ("mm-dd-yy"). - SET CENTURY modifies the date format. SET CENTURY ON - replaces the "y"s with "YYYY". SET CENTURY OFF replaces - the "y"s with "YY". + date conversion. Defaults to American `mm/dd/yy`. Other + formats include ANSI `yy.mm.dd`, British `dd/mm/yy`, + French `dd/mm/yy`, German `dd.mm.yy`, Italian + `dd-mm-yy`, Japan `yy/mm/dd`, and USA `mm-dd-yy`. + `SET CENTURY` modifies the date format. `SET CENTURY ON` + replaces the `y`s with `YYYY`. `SET CENTURY OFF` replaces + the `y`s with `YY`. - _SET_DEBUG + `_SET_DEBUG` - When set to .T., pressing Alt+D activates the debugger. - When set to .F., which is the default, Alt+D can be read - by Inkey(). (Also affected by AltD(1) and AltD(0)) + When set to .T., pressing activates the debugger. + When set to .F., which is the default, can be read + by Inkey(). (Also affected by `AltD( 1 )` and `AltD( 0 )`) - _SET_DECIMALS + `_SET_DECIMALS` Sets the number of decimal digits to use when displaying - printing numeric values when SET FIXED is ON. Defaults to - 2. If SET FIXED is OFF, then SET DECIMALS is only used to + printing numeric values when `SET FIXED` is ON. Defaults to + 2. If `SET FIXED` is OFF, then `SET DECIMALS` is only used to determine the number of decimal digits to use after using Exp(), Log(), Sqrt(), or division. Other math operations may adjust the number of decimal digits that the result will display. Note: This never affects the precision of a number. Only the display format is affected. - _SET_DEFAULT + `_SET_DEFAULT` Sets the default directory in which to open, create and check for files. Defaults to current directory (blank). - _SET_DELETED | + `_SET_DELETED` | If enabled, deleted records will be processed. If disabled, which is the default, deleted records will be ignored. - _SET_DELIMCHARS + `_SET_DELIMCHARS` - Sets the GET delimiter characters. Defaults to "::". + Sets the GET delimiter characters. Defaults to `"::"`. - _SET_DELIMITERS | + `_SET_DELIMITERS` | If enabled, GETs are delimited on screen. If disabled, which is the default, no GET delimiters are used. - _SET_DEVICE + `_SET_DEVICE` Selects the output device for DevOut(). When set to - "PRINTER", all output is sent to the printer device or - file set by _SET_PRINTFILE. When set to anything else, - all output is sent to the screen. Defaults to "SCREEN". + `"PRINTER"`, all output is sent to the printer device or + file set by `_SET_PRINTFILE`. When set to anything else, + all output is sent to the screen. Defaults to `"SCREEN"`. - _SET_EOF | + `_SET_EOF` | - Defaults to FALSE on UN*X, but defaults to TRUE on - everything else. If set to FALSE, then Chr( 26 ) does not - get written when using COPY TO DELIMITED, COPY TO SDF, + Defaults to FALSE on *nix, but defaults to TRUE on + everything else. If set to FALSE, then `Chr( 26 )` does not + get written when using `COPY TO DELIMITED`, `COPY TO SDF`, or when closing any of the various text files that are created using various SET values. [This is a Harbour extension] - _SET_EPOCH + `_SET_EPOCH` Determines how to handle the conversion of 2-digit years to 4 digit years. When a 2-digit year is greater than or @@ -226,14 +205,14 @@ and 2-digit years in the range 00 to 49 get converted to 20xx. - _SET_ESCAPE | + `_SET_ESCAPE` | - When enabled, which is the default, pressing Esc will - exit a READ. When disabled, pressing Esc during a READ - is ignored, unless the Esc key has been assigned to a - function using SET KEY. + When enabled, which is the default, pressing will + exit a READ. When disabled, pressing during a READ + is ignored, unless the key has been assigned to a + function using `SET KEY`. - _SET_EVENTMASK + `_SET_EVENTMASK` Determines which events Inkey() will respond to. INKEY_MOVE allows mouse movement events. INKEY_LDOWN @@ -243,23 +222,23 @@ allows the right mouse button up clock. INKEY_KEYBOARD allows keyboard keystrokes. INKEY_ALL allows all of the preceding events. Events may be combined (e.g., using - INKEY_LDOWN + INKEY_RUP will allow left mouse button + `INKEY_LDOWN + INKEY_RUP` will allow left mouse button down clicks and right mouse button up clicks). The default is INKEY_KEYBOARD. - _SET_EXACT | + `_SET_EXACT` | - When enabled, all string comparisons other than "==" + When enabled, all string comparisons other than `==` exclude trailing spaces when checking for equality. When disabled, which is the default, all string - comparisons other than "==" treat two strings as + comparisons other than `==` treat two strings as equal if the right hand string is "" or if the right hand string is shorter than or the same length as the left hand string and all of the characters in the right hand string match the corresponding characters in the left hand string. - _SET_EXCLUSIVE | + `_SET_EXCLUSIVE` | When enabled, which is the default, all database files are opened in exclusive mode. When disabled, all @@ -267,19 +246,19 @@ EXCLUSIVE and SHARED clauses of the USE command can be used to override this setting. - _SET_EXIT | + `_SET_EXIT` | - Toggles the use of Uparrow and Dnarrow as READ exit keys. + Toggles the use of and as READ exit keys. Specifying true (.T.) enables them as exit keys, and false (.F.) disables them. Used internally by the ReadExit() function. - _SET_EXTRA | + `_SET_EXTRA` | QUESTION: What is this for? - It does not affect _SET_EXTRAFILE in CA-Cl*pper! + It does not affect `_SET_EXTRAFILE` in CA-Cl*pper! - _SET_EXTRAFILE + `_SET_EXTRAFILE` When set, creates or opens file to write QOut() and QQOut() output to. If is TRUE and the file @@ -287,56 +266,56 @@ of file. Otherwise, the file is created. If a file is already opened, it is closed before the new file is opened or created (even if it is the same file). The - default file extension is ".prn". There is no default + default file extension is `.prn`. There is no default file name. Call with an empty string to close the file. - _SET_FIXED | + `_SET_FIXED` | When enabled, all numeric values will be displayed and printed with the number of decimal digits set - by SET DECIMALS, unless a PICTURE clause is used. + by `SET DECIMALS`, unless a PICTURE clause is used. When disabled, which is the default, the number of decimal digits that are displayed depends upon - a variety of factors. See _SET_DECIMALS for more. + a variety of factors. See `_SET_DECIMALS` for more. - _SET_INSERT | + `_SET_INSERT` | - When enabled, characters typed in a GET or MEMOEDIT + When enabled, characters typed in a GET or MemoEdit() are inserted. When disabled, which is the default, - characters typed in a GET or MEMOEDIT overwrite. + characters typed in a GET or MemoEdit() overwrite. Note: This setting can also be toggled between on and - off by pressing the Insert key during a GET or MEMOEDIT. + off by pressing the Insert key during a GET or MemoEdit(). - _SET_INTENSITY | + `_SET_INTENSITY` | When enabled, which is the default, GETs and PROMPTs are displayed using the enhanced color setting. When disabled, GETs and PROMPTs are displayed using the standard color setting. - _SET_LANGUAGE + `_SET_LANGUAGE` Specifies the language to be used for Harbour messages. [This is a Harbour extension] - _SET_MARGIN + `_SET_MARGIN` Sets the left margin for all printed output. The default value is 0. Note: PCol() reflects the printer's column - position including the margin (e.g., SET MARGIN TO 5 - followed by DevPos(5, 10) makes PCol() return 15). + position including the margin (e.g., `SET MARGIN TO 5` + followed by `DevPos( 5, 10 )` makes PCol() return 15). - _SET_MBLOCKSIZE + `_SET_MBLOCKSIZE` TODO: Document - _SET_MCENTER | + `_SET_MCENTER` | If enabled, display PROMPTs centered on the MESSAGE row. If disabled, which is the default, display PROMPTS at column position 0 on the MESSAGE row. - _SET_MESSAGE + `_SET_MESSAGE` If set to 0, which is the default, PROMPTs are always suppressed. Otherwise, PROMPTs are displayed on the @@ -344,30 +323,30 @@ on the top-most screen row, because row 0 is reserved for the SCOREBOARD, if enabled. - _SET_MFILEEXT + `_SET_MFILEEXT` TODO: Document - _SET_OPTIMIZE | + `_SET_OPTIMIZE` | TODO: Document - _SET_PATH + `_SET_PATH` Specifies a path of directories to search through to locate a file that can't be located in the DEFAULT - directory. Defaults to no path (""). Directories must - be separated by a semicolon (e.g., "C:\hb\bin;C:\hb\tests"). + directory. Defaults to no path `""`. Directories must + be separated by a semicolon (e.g., `/hb/bin;/hb/tests`). - _SET_PRINTER | + `_SET_PRINTER` | If enabled, QOut() and QQOut() write to the screen and to a file, provided that a file has been opened or created - with _SET_ALTFILE. If disabled, which is the default, + with `_SET_ALTFILE`. If disabled, which is the default, QOut() and QQOut() only write to the screen (and/or to the ALTFILE). - _SET_PRINTFILE + `_SET_PRINTFILE` When set, creates or opens file to write QOut(), QQOut() and DevOut() output to. If is TRUE and the @@ -375,47 +354,47 @@ at end of file. Otherwise, the file is created. If a file is already opened, it is closed before the new file is opened or created (even if it is the same file). The - default file extension is ".prn". The default file name - is "PRN", which maps to the default printer device. Call + default file extension is `.prn`. The default file name + is `PRN`, which maps to the default printer device. Call with an empty string to close the file. - _SET_SCOREBOARD | + `_SET_SCOREBOARD` | - When enabled, which is the default, READ and MEMOEDIT + When enabled, which is the default, READ and MemoEdit() display status messages on screen row 0. When disabled, - READ and MEMOEDIT status messages are suppressed. + READ and MemoEdit() status messages are suppressed. - _SET_SCROLLBREAK | + `_SET_SCROLLBREAK` | QUESTION: What is this flag for? - _SET_SOFTSEEK | + `_SET_SOFTSEEK` | When enabled, a SEEK that fails will position the record pointer to the first key that is higher than the sought - after key or to LastRec() + 1 if there is no higher key. + after key or to `LastRec() + 1` if there is no higher key. When disabled, which is the default, a SEEK that fails - will position the record pointer to LastRec()+1. + will position the record pointer to `LastRec() + 1`. - _SET_STRICTREAD | + `_SET_STRICTREAD` | TODO: Document - _SET_TYPEAHEAD + `_SET_TYPEAHEAD` Sets the size of the keyboard typeahead buffer. Defaults to 50. The minimum is 16 and the maximum is 4096. - _SET_UNIQUE | + `_SET_UNIQUE` | When enabled, indexes are not allowed to have duplicate keys. When disabled, indexes are allowed duplicate keys. - _SET_VIDEOMODE + `_SET_VIDEOMODE` TODO: Document - _SET_WRAP | + `_SET_WRAP` | When enabled, lightbar menus can be navigated from the last position to the first and from the first position @@ -431,6 +410,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -459,29 +440,31 @@ SetKey() previously set to the same function number and vice versa. - nFunctionKey Key to be set + nFunctionKey Key to be set - 1 .. 12 F1 .. F12 - 13 .. 20 Shift-F3 .. Shift-F10 - 21 .. 30 Ctrl-F1 .. Ctrl-F10 - 31 .. 40 Alt-F1 .. Alt-F10 + 1 .. 12 .. + 13 .. 20 .. + 21 .. 30 .. + 31 .. 40 ..
- SET FUNCTION command is preprocessed into __SetFunction() function + `SET FUNCTION` command is preprocessed into __SetFunction() function during compile time. $EXAMPLES$ - // Set F1 with a string + #include "inkey.ch" + LOCAL cTest, GetList := {} + // Associate with a string + __SetFunction( 1, "I Am Lazy" + Chr( K_ENTER ) ) CLS - __SetFunction( 1, "I Am Lazy" + Chr( 13 ) ) cTest := Space( 20 ) - @ 10, 0 SAY "type something or F1 for lazy mode " GET cTest + @ 10, 0 SAY "type something or for lazy mode" GET cTest READ ? cTest $STATUS$ R $COMPLIANCE$ - Harbour use 11 and 12 to represent F11 and F12, while CA-Cl*pper use - 11 and 12 to represent Shift-F1 and Shift-F2. + Harbour use 11 and 12 to represent and , while CA-Cl*pper use + 11 and 12 to represent and . $PLATFORMS$ All $FILES$ @@ -492,6 +475,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -518,29 +503,31 @@ SetKey() previously set to the same function number and vice versa. - nFunctionKey Key to be set + nFunctionKey Key to be set - 1 .. 12 F1 .. F12 - 13 .. 20 Shift-F3 .. Shift-F10 - 21 .. 30 Ctrl-F1 .. Ctrl-F10 - 31 .. 40 Alt-F1 .. Alt-F10 + 1 .. 12 .. + 13 .. 20 .. + 21 .. 30 .. + 31 .. 40 ..
- SET FUNCTION command is preprocessed into __SetFunction() function + `SET FUNCTION` command is preprocessed into __SetFunction() function during compile time. $EXAMPLES$ - // Set F1 with a string + #include "inkey.ch" + LOCAL cTest, GetList := {} + // Associate with a string + SET FUNCTION 1 TO "I Am Lazy" + Chr( K_ENTER ) CLS - SET FUNCTION 1 TO "I Am Lazy" + Chr( 13 ) cTest := Space( 20 ) - @ 10, 0 SAY "type something or F1 for lazy mode " GET cTest + @ 10, 0 SAY "type something or for lazy mode" GET cTest READ ? cTest $STATUS$ R $COMPLIANCE$ - Harbour use 11 and 12 to represent F11 and F12, while CA-Cl*pper use - 11 and 12 to represent Shift-F1 and Shift-F2. + Harbour use 11 and 12 to represent and , while CA-Cl*pper use + 11 and 12 to represent and . $PLATFORMS$ All $SEEALSO$ @@ -549,6 +536,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 April White $TEMPLATE$ Function $NAME$ @@ -577,32 +566,38 @@ A group of keys may be assigned the same code block/condition block by using an array of key values in place on the first parameter. $EXAMPLES$ + #include "getexit.ch" + #include "inkey.ch" LOCAL bOldF10 := SetKey( K_F10, {|| Yahoo() } ) - ... // some other processing + LOCAL bBlock + // some other processing ... SetKey( K_F10, bOldF10 ) - ... // some other processing + // some other processing ... bBlock := SetKey( K_SPACE ) - IF bBlock != NIL ... + IF bBlock != NIL // ... - // make F10 exit current get, but only if in a get - ignores other - // wait-states such as menus, achoices, etc... - SetKey( K_F10, {|| GetActive():State := GE_WRITE },; - {|| GetActive() != NIL } ) + // make exit current get, but only if in a get - ignores other + // wait states such as menus, achoices, etc... + SetKey( K_F10, {|| GetActive():State := GE_WRITE }, ; + {|| GetActive() != NIL } ) + ENDIF $STATUS$ R $COMPLIANCE$ SetKey() is mostly CA-Cl*pper compliant. The only difference is the addition of the condition code-block parameter, allowing set-keys to be conditionally turned off or on. This condition-block cannot be - returned once set - see SetKeyGet() + returned once set - see hb_SetKeyGet() $FILES$ Library is core $SEEALSO$ - hb_SetKeySave() + hb_SetKeySave(), hb_SetKeyGet() $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 April White $TEMPLATE$ Function $NAME$ @@ -626,9 +621,10 @@ a key, and optionally assigns the condition-block to the return-parameter $EXAMPLES$ + #include "inkey.ch" LOCAL bOldF10, bOldF10Cond bOldF10 := hb_SetKeyGet( K_F10, @bOldF10Cond ) - ... // some other processing + // some other processing ... SetKey( K_F10, bOldF10, bOldF10Cond ) $STATUS$ R @@ -642,6 +638,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 April White $TEMPLATE$ Function $NAME$ @@ -664,11 +662,11 @@ returns the current state of an environment setting, and optionally assigning a new value. In this case, the "environment setting" is the internal set-key list, and the optional new value is either a value - returned from a previous call to SetKeySave() - to restore that list, + returned from a previous call to hb_SetKeySave() - to restore that list, or the value of NIL to clear the current list. $EXAMPLES$ LOCAL aKeys := hb_SetKeySave( NIL ) // removes all current set=keys - ... // some other processing + // some other processing ... hb_SetKeySave( aKeys ) $STATUS$ R @@ -682,6 +680,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 April White $TEMPLATE$ Function $NAME$ @@ -712,15 +712,17 @@ functionality for such functions as AChoice(), dbEdit(), MemoEdit(), ACCEPT, INPUT, READ, and WAIT $EXAMPLES$ + // FIXME + #include "inkey.ch" // within ReadModal() IF hb_SetKeyCheck( K_ALT_X, GetActive() ) - ... // some other processing + // some other processing ... ENDIF // within TBrowse handler CASE hb_SetKeyCheck( nInkey, oTBrowse ) RETURN CASE nInKey == K_ESC - ... // some other processing + // some other processing ... $STATUS$ R $COMPLIANCE$ @@ -733,6 +735,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 April White $TEMPLATE$ Command $NAME$ @@ -752,7 +756,7 @@ is an optional condition code-block $DESCRIPTION$ - The Set Key Command function is translated to the SetKey() function + The `SET KEY` Command function is translated to the SetKey() function witch returns the current code-block assigned to a key when called with only the key value. If the action block (and optionally the condition block) are passed, the current block is @@ -760,30 +764,36 @@ A group of keys may be assigned the same code block/condition block by using an array of key values in place on the first parameter. $EXAMPLES$ + #include "getexit.ch" + #include "inkey.ch" LOCAL bOldF10 := SetKey( K_F10, {|| Yahoo() } ) - ... // some other processing + LOCAL bBlock + // some other processing ... SET KEY K_F10 TO bOldF10 - ... // some other processing + // some other processing ... bBlock := SetKey( K_SPACE ) - IF bBlock != NIL ... + IF bBlock != NIL // ... - // make F10 exit current get, but only if in a get - ignores other + // make exit current get, but only if in a get - ignores other // wait-states such as menus, achoices, etc... SetKey( K_F10, {|| GetActive():State := GE_WRITE }, ; {|| GetActive() != NIL } ) + ENDIF $STATUS$ R $COMPLIANCE$ - SET KEY is mostly CA-Cl*pper compliant. The only difference is the + `SET KEY` is mostly CA-Cl*pper compliant. The only difference is the addition of the condition code-block parameter, allowing set-keys to be conditionally turned off or on. This condition-block cannot be - returned once set - see SetKeyGet() + returned once set - see hb_SetKeyGet() $SEEALSO$ - hb_SetKeySave() + hb_SetKeySave(), hb_SetKeyGet() $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -795,14 +805,14 @@ $ONELINER$ Sets the typeahead buffer to given size. $SYNTAX$ - SetTypeahead( ) --> + SetTypeahead( ) --> nPreviousSize $ARGUMENTS$ is a valid typeahead size. $RETURNS$ - The previous state of _SET_TYPEAHEAD + The previous state of `_SET_TYPEAHEAD` $DESCRIPTION$ This function sets the typeahead buffer to a valid given size as is - Set( _SET_TYPEAHEAD ) where used. + `Set( _SET_TYPEAHEAD )` where used. $EXAMPLES$ // Sets typeahead to 12 SetTypeahead( 12 ) @@ -818,6 +828,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -829,7 +841,7 @@ $ONELINER$ Determines whether a HELP() user defined function exists. $SYNTAX$ - __XHelp() --> + __XHelp() --> xValue $ARGUMENTS$ None $RETURNS$ @@ -838,7 +850,7 @@ This is an internal undocumented CA-Cl*pper function, which will try to call the user defined function HELP() if it is defined in the current application. This is the default SetKey() handler - for the F1 key. + for the key. $STATUS$ R $COMPLIANCE$ @@ -849,6 +861,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -869,7 +883,8 @@ parameters with this command will default the operation to the current logged drive and directory. $EXAMPLES$ - SET DEFAULT TO C:\hb\tests + SET DEFAULT TO /hb/tests + Set( _SET_DEFAULT, hb_DirSepToOS( "/hb/tests" ) ) $STATUS$ R $COMPLIANCE$ @@ -880,6 +895,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -895,12 +912,12 @@ $ARGUMENTS$ Logical expression for toggle $DESCRIPTION$ - This command toggles the highlighted bars in a @...PROMPT command + This command toggles the highlighted bars in a `@...PROMPT` command to wrap around in a bottom-to-top and top-to-bottom manner. If the value of the logical expression is a logical false (.F.), the wrapping mode is set OFF; otherwise, it is set ON. $EXAMPLES$ - See tests/menuto.prg + // See tests/menuto.prg $STATUS$ R $COMPLIANCE$ @@ -911,6 +928,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -920,20 +939,20 @@ $SUBCATEGORY$ Environment $ONELINER$ - Establishes a message row for @...PROMPT command + Establishes a message row for `@...PROMPT` command $SYNTAX$ SET MESSAGE TO [ [CENTER]] $ARGUMENTS$ Row number to display the message $DESCRIPTION$ - This command is designed to work in conjunction with the MENU TO and - @...PROMPT commands. With this command, a row number between 0 and + This command is designed to work in conjunction with the `MENU TO` and + `@...PROMPT` commands. With this command, a row number between 0 and MaxRow() may be specified in . This establishes the row on - witch any message associated with an @...PROMPT command will appear. + witch any message associated with an `@...PROMPT` command will appear. If the value of is 0, all messages will be suppressed. All messaged will be left-justifies unless the CENTER clause is - used. In this case, the individual messages in each @...PROMPT command + used. In this case, the individual messages in each `@...PROMPT` command will be centered at the designated row (unless is 0). All messages are independent; therefore, the screen area is cleared out by the centered message will vary based on the length of each @@ -954,6 +973,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -973,10 +994,11 @@ commands and functions not found in the current drive and directory. This pertains primarily, but not exclusively, to databases, indexes, and memo files, as well as to memory, labels and reports files. The - search hierarchy is: 1 Current drive and directory, 2 The SET DEFAULT - path; 3 The SET PATH path. + search hierarchy is: 1 Current drive and directory, 2 The `SET DEFAULT` + path; 3 The `SET PATH` path. $EXAMPLES$ - SET PATH TO C:\hb\tests + SET PATH TO /hb/tests + Set( _SET_PATH, hb_DirSepToOS( "/hb/tests" ) ) $STATUS$ R $COMPLIANCE$ @@ -987,6 +1009,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -996,13 +1020,13 @@ $SUBCATEGORY$ Environment $ONELINER$ - Toggles the enhanced display of PROMPT's and GETs. + Toggles the enhanced display of PROMPTs and GETs. $SYNTAX$ SET INTENSITY ON | off | ( ) $ARGUMENTS$ Logical expression for toggle command $DESCRIPTION$ - This command set the field input color and @...PROMPT menu color + This command set the field input color and `@...PROMPT` menu color to either highlighted (inverse video) or normal color. The default condition is ON (highlighted). $EXAMPLES$ @@ -1017,6 +1041,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1041,14 +1067,14 @@ file extension, .txt will be assumed. The file name may optionally have a drive letter and/or directory path. If none is specified, the current drive and directory will be used. - If the ALTERNATE file is created but no ALTERNATE ON command is + If the ALTERNATE file is created but no `ALTERNATE ON` command is issued, nothing will be echoed to the file. If ADDITIVE clause is used, then the information will be appended to the existing alternate file. Otherwise, a new file will be created with the specified name (or an existing one will be overwritten) and the information will be appended to the file. The default is to create a new file. - A SET ALTERNATE TO command will close the alternate file + A `SET ALTERNATE TO` command will close the alternate file $EXAMPLES$ SET ALTERNATE TO test.txt SET ALTERNATE ON @@ -1067,6 +1093,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1083,8 +1111,8 @@ Logical expression for toggle $DESCRIPTION$ This command allows the input and display of dates with the century - prefix. It will be in the standart MM/DD/YYYY format unless specified - by the SET DATE command or Set() function. If is a logical + prefix. It will be in the standard `MM/DD/YYYY` format unless specified + by the `SET DATE` command or Set() function. If is a logical true (.T.), the command will be set on; otherwise, the command will be set off $EXAMPLES$ @@ -1101,6 +1129,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1151,6 +1181,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1181,6 +1213,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1201,7 +1235,7 @@ a logical true (.T.), FIXED will be turned ON; otherwise it will be turned OFF. - When SET DECIMALS OFF is used, the following rules apply to the number + When `SET DECIMALS OFF` is used, the following rules apply to the number of decimal placed displayed. @@ -1229,6 +1263,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1249,7 +1285,7 @@ A device name or an alternate name $DESCRIPTION$ This command can direct all output that is not controlled by the - @...SAY command and the DevPos() and DevOut() functions to the + `@...SAY` command and the DevPos() and DevOut() functions to the printer. If specified, the condition toggles the printer ON if a logical true (.T.) and OFF if a logical false (.F.). If no argument is specified in the command, the alternate file (if one @@ -1275,7 +1311,7 @@ SET PRINTER ON SET PRINTER TO LPT1 ? 25141251 / 362 - SET PRINTER .F. + SET PRINTER ( .F. ) $STATUS$ R $COMPLIANCE$ @@ -1286,6 +1322,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1302,7 +1340,7 @@ Logical expression for toggle command $DESCRIPTION$ This command turns the screen display either off or on for all - screens display other then direct output via the @...SAY commands + screens display other then direct output via the `@...SAY` commands or the <-> DevOut() function. If is a logical true (.T.), the console will be turned @@ -1340,7 +1378,7 @@ This command establishes the number of decimal places that Harbour will display in mathematical calculations, functions, memory variables, and fields. Issuing no parameter with this command will the default - number of decimals to 0. For decimals to be seen, the SET FIXED ON + number of decimals to 0. For decimals to be seen, the `SET FIXED ON` command must be activated. $EXAMPLES$ SET FIXED ON @@ -1366,21 +1404,21 @@ $SUBCATEGORY$ Environment $ONELINER$ - Directs all @...SAY output to a device. + Directs all `@...SAY` output to a device. $SYNTAX$ SET DEVICE TO [printer | SCREEN ] $ARGUMENTS$ None. $DESCRIPTION$ - This command determines whether the output from the @...SAY command + This command determines whether the output from the `@...SAY` command and the DevPos() and DevOut() function will be displayed on the printer. - When the device is set to the PRINTER, the SET MARGIN value adjusts + When the device is set to the PRINTER, the `SET MARGIN` value adjusts the position of the column values accordingly. Also, an automatic - page eject will be issued when the current printhead position is + page eject will be issued when the current printer head position is less than the last printed row. Finally, if used in conjunction with - the @...GET commands, the values for the GETs will all be ignored. + the `@...GET` commands, the values for the GETs will all be ignored. $EXAMPLES$ SET DEVICE TO SCREEN ? 25141251 / 362 @@ -1399,6 +1437,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -1421,6 +1461,7 @@ If is a logical true (.T.), the bell will be turned ON; otherwise, the bell will be turned off. $EXAMPLES$ + LOCAL cDummy, GetList := {} SET BELL ON cDummy := Space( 20 ) @ 3, 2 GET cDummy @@ -1437,7 +1478,7 @@ /* $DOC$ $TEMPLATE$ - Function + C Function $NAME$ hb_setListenerAdd() $CATEGORY$ @@ -1490,7 +1531,7 @@ /* $DOC$ $TEMPLATE$ - Function + C Function $NAME$ hb_setListenerNotify() $CATEGORY$ @@ -1539,7 +1580,7 @@ /* $DOC$ $TEMPLATE$ - Function + C Function $NAME$ hb_setListenerRemove() $CATEGORY$ @@ -1563,7 +1604,7 @@ This function removes a SET listener callback function. $EXAMPLES$ int handle = hb_setListenerAdd( callback_function ); - ... + /* ... */ hb_setListenerRemove( handle ); $STATUS$ R diff --git a/doc/en/string.txt b/doc/en/string.txt index 3b11b30266..ca14a29bf5 100644 --- a/doc/en/string.txt +++ b/doc/en/string.txt @@ -1,19 +1,6 @@ -/* - * Copyright 1999 Jose Lalin - * Documentation for: Descend() - * - * Copyright 2000 Luiz Rafael Culik - * Documentation for: IsAlpha(), IsDigit(), IsUpper(), IsLower(), LTrim(), - * At(), hb_At(), RAt(), hb_RAt(), Left(), Right(), - * SubStr(), Upper(), Lower(), Asc(), Chr(), PadC(), - * PadL(), PadR(), AllTrim(), Trim(), RTrim(), Space(), - * Replicate(), Val(), Transform(), StrTran() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -29,7 +16,7 @@ $ARGUMENTS$ Any character string $RETURNS$ - lAlpha Logical true (.T.) or false (.F.). + Logical true (.T.) or false (.F.). $DESCRIPTION$ This function return a logical true (.T.) if the first character in is an alphabetic character. If not, the function will @@ -51,6 +38,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -66,15 +55,15 @@ $ARGUMENTS$ Any character string $RETURNS$ - lDigit Logical true (.T.) or false (.F.). + Logical true (.T.) or false (.F.). $DESCRIPTION$ This function takes the character string and checks to see if the leftmost character is a digit, from 1 to 9. If so, the function will return a logical true (.T.); otherwise, it will return a logical false (.F.). $EXAMPLES$ - ? IsDigit( "12345" ) // .T. - ? IsDigit( "abcde" ) // .F. + ? IsDigit( "12345" ) // --> .T. + ? IsDigit( "abcde" ) // --> .F. $STATUS$ R $COMPLIANCE$ @@ -89,6 +78,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -104,15 +95,15 @@ $ARGUMENTS$ Any character string $RETURNS$ - lUpper Logical true (.T.) or false (.F.). + Logical true (.T.) or false (.F.). $DESCRIPTION$ This function checks to see if the leftmost character if is a uppercased letter. If so, the function will return a logical true (.T.); otherwise, it will return a logical false (.F.). $EXAMPLES$ - ? IsUpper( "Abcde" ) // .T. - ? IsUpper( "abcde" ) // .F. + ? IsUpper( "Abcde" ) // --> .T. + ? IsUpper( "abcde" ) // --> .F. $STATUS$ R $COMPLIANCE$ @@ -127,6 +118,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -142,15 +135,15 @@ $ARGUMENTS$ Any character string $RETURNS$ - lLower Logical true (.T.) or false (.F.). + Logical true (.T.) or false (.F.). $DESCRIPTION$ This function takes the character string and checks to see if the leftmost character is a lowercased letter. If so, the function will return a logical true (.T.); otherwise, it will return a logical false (.F.). $EXAMPLES$ - ? IsLower( "ABCde" ) // .F. - ? IsLower( "aBCde" ) // .T. + ? IsLower( "ABCde" ) // --> .F. + ? IsLower( "aBCde" ) // --> .T. $STATUS$ R $COMPLIANCE$ @@ -165,6 +158,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -185,7 +180,7 @@ $DESCRIPTION$ This function trims the leading space blank $EXAMPLES$ - ? LTrim( "Hello " ) + ? "|" + LTrim( "Hello " ) + "|" $STATUS$ R $COMPLIANCE$ @@ -200,6 +195,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -224,7 +221,7 @@ the first string . If the substring is not contained within the second expression, the function will return 0. $EXAMPLES$ - ? At( "cde", "abcdefgfedcba" ) // 3 + ? At( "cde", "abcdefgfedcba" ) // --> 3 $STATUS$ R $COMPLIANCE$ @@ -239,6 +236,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -256,9 +255,9 @@ Main string - First position to search in cString, by default 1 + First position to search in , by default 1 - End position to search, by default cString length + End position to search, by default length $RETURNS$ hb_At() return the starting position of the first occurrence of the substring in the main string @@ -268,8 +267,8 @@ the second expression, the function will return 0. The third and fourth parameters lets you indicate a starting and end offset to search in. $EXAMPLES$ - ? hb_At( "cde", "abcdefgfedcba" ) // 3 - ? hb_At( "cde", "abcdefgfedcba", 4 ) // 0 + ? hb_At( "cde", "abcdefgfedcba" ) // --> 3 + ? hb_At( "cde", "abcdefgfedcba", 4 ) // --> 0 $STATUS$ R $COMPLIANCE$ @@ -287,6 +286,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -311,8 +312,8 @@ If the function is unable to find any occurrence of in , the return value is 0. $EXAMPLES$ - ? hb_ntos( RAt( "cde", "abcdefgfcdeedcba" ) ) // 9 - ? hb_ntos( RAt( "cdr", "abcdefgfedcba" ) ) // 0 + ? RAt( "cde", "abcdefgfcdeedcba" ) // --> 9 + ? RAt( "cdr", "abcdefgfedcba" ) // --> 0 $STATUS$ R $COMPLIANCE$ @@ -327,6 +328,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -338,15 +341,15 @@ $ONELINER$ Searches for last occurrence a substring of a string. $SYNTAX$ - hb_RAt( , , [], [] ) --> nPos + hb_RAt( , , [], [] ) --> nPos $ARGUMENTS$ Substring to search for Main string - First position to search in cString, by default 1. + First position to search in , by default 1. - End position to search, by default cString length + End position to search, by default length $RETURNS$ hb_RAt() return the location of beginning position of last occurrence a substring of a string. @@ -372,7 +375,7 @@ NEXT NEXT - ? hb_RAt( cSearch, "abcdefgfedcba" ) // -> 3 + ? hb_RAt( cSearch, "abcdefgfedcba" ) // --> 3 $STATUS$ R $COMPLIANCE$ @@ -387,6 +390,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -408,10 +413,11 @@ $DESCRIPTION$ This functions returns the leftmost characters of . It is equivalent to the following expression: - + ``` SubStr( , 1, ) + ``` $EXAMPLES$ - ? Left( "Hello Harbour", 5 ) // Hello + ? Left( "Hello Harbour", 5 ) // --> "Hello" $STATUS$ R $COMPLIANCE$ @@ -426,6 +432,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -447,12 +455,14 @@ $DESCRIPTION$ This functions returns the rightmost characters of . It is equivalent to the following expressions: - + ``` SubStr( , - ) - + ``` + ``` SubStr( , Len( ) - + 1, ) + ``` $EXAMPLES$ - ? Right( "Hello Harbour", 5 ) // rbour + ? Right( "Hello Harbour", 5 ) // --> "rbour" $STATUS$ R $COMPLIANCE$ @@ -467,6 +477,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -499,9 +511,9 @@ characters from to the end of the string is less than the rest are ignored. $EXAMPLES$ - ? SubStr( "Hello Harbour", 7, 4 ) // Harb - ? SubStr( "Hello Harbour", -3, 3 ) // our - ? SubStr( "Hello Harbour", 7 ) // Harbour + ? SubStr( "Hello Harbour", 7, 4 ) // --> "Harb" + ? SubStr( "Hello Harbour", -3, 3 ) // --> "our" + ? SubStr( "Hello Harbour", 7 ) // --> "Harbour" $STATUS$ R $COMPLIANCE$ @@ -537,21 +549,21 @@ is the number of decimal places to return. $RETURNS$ - Str() returns formatted as a character string. If the + Str() returns formatted as a character string. If the optional length and decimal arguments are not specified, Str() returns the character string according to the following rules: Results of Str() with No Optional Arguments - Expression Return Value Length + Expression Return Value Length - Field Variable Field length plus decimals - Expressions/constants Minimum of 10 digits plus decimals - Val() Minimum of 3 digits - Month()/Day() 3 digits - Year() 5 digits - RecNo() 7 digits + Field Variable Field length plus decimals + Expressions/constants Minimum of 10 digits plus decimals + Val() Minimum of 3 digits + Month()/Day() 3 digits + Year() 5 digits + RecNo() 7 digits
$DESCRIPTION$ Str() is a numeric conversion function that converts numeric values @@ -576,8 +588,8 @@ * If is specified but is omitted (no decimal places), the return value is rounded to an integer. $EXAMPLES$ - ? Str( 10, 6, 2 ) // " 10.00" - ? Str( -10, 8, 2 ) // " -10.00" + ? Str( 10, 6, 2 ) // --> " 10.00" + ? Str( -10, 8, 2 ) // --> " -10.00" $STATUS$ R $COMPLIANCE$ @@ -611,21 +623,21 @@ is the number of decimal places to return. $RETURNS$ - StrZero() returns formatted as a character string. If the + StrZero() returns formatted as a character string. If the optional length and decimal arguments are not specified, StrZero() returns the character string according to the following rules: Results of StrZero() with No Optional Arguments - Expression Return Value Length + Expression Return Value Length - Field Variable Field length plus decimals - Expressions/constants Minimum of 10 digits plus decimals - Val() Minimum of 3 digits - Month()/Day() 3 digits - Year() 5 digits - RecNo() 7 digits + Field Variable Field length plus decimals + Expressions/constants Minimum of 10 digits plus decimals + Val() Minimum of 3 digits + Month()/Day() 3 digits + Year() 5 digits + RecNo() 7 digits
$DESCRIPTION$ StrZero() is a numeric conversion function that converts numeric @@ -654,8 +666,8 @@ The StrZero() function was part of the CA-Cl*pper samples. $EXAMPLES$ - ? StrZero( 10, 6, 2 ) // "010.00" - ? StrZero( -10, 8, 2 ) // "-0010.00" + ? StrZero( 10, 6, 2 ) // --> "010.00" + ? StrZero( -10, 8, 2 ) // --> "-0010.00" $STATUS$ R $COMPLIANCE$ @@ -692,7 +704,7 @@ ? hb_ValToStr( 4 ) == " 4" ? hb_ValToStr( 4.0 / 2 ) == " 2.00" ? hb_ValToStr( "String" ) == "String" - ? hb_ValToStr( hb_SToD( "20010101" ) ) == "2001-01-01" + ? hb_ValToStr( 0d20010101 ) == "2001-01-01" ? hb_ValToStr( NIL ) == "NIL" ? hb_ValToStr( .F. ) == ".F." ? hb_ValToStr( .T. ) == ".T." @@ -719,7 +731,7 @@ $ONELINER$ Returns size of a string or size of an array. $SYNTAX$ - Len( | ) --> + Len( | ) --> nLength $ARGUMENTS$ is a character string or the array to check. $RETURNS$ @@ -730,17 +742,14 @@ size of a hash table. If it is used with a multidimensional array it returns the size of the first dimension. $EXAMPLES$ - PROCEDURE Main() - LOCAL cName + LOCAL cName - ? Len( "Harbour" ) // --> 7 - ? Len( { "One", "Two" } ) // --> 2 + ? Len( "Harbour" ) // --> 7 + ? Len( { "One", "Two" } ) // --> 2 - cName := "" - ACCEPT "Enter your name: " TO cName - ? Len( cName ) - - RETURN + cName := "" + ACCEPT "Enter your name: " TO cName + ? Len( cName ) $STATUS$ R $COMPLIANCE$ @@ -774,18 +783,16 @@ This function checks if an expression has empty value and returns a logical indicating whether it the expression is empty or not. $EXAMPLES$ - PROCEDURE Main() - ? Empty( "I'm not empty" ) // .F. - ? Empty( NIL ) // .T. - ? Empty( 0 ) // .T. - ? Empty( .F. ) // .T. - ? Empty( "" ) // .T. - ? Empty( " " ) // .T. - ? Empty( 1 ) // .F. - ? Empty( .T. ) // .F. - ? Empty( "smile" ) // .F. - ? Empty( Date() ) // .F. - RETURN + ? Empty( "I'm not empty" ) // --> .F. + ? Empty( NIL ) // --> .T. + ? Empty( 0 ) // --> .T. + ? Empty( .F. ) // --> .T. + ? Empty( "" ) // --> .T. + ? Empty( " " ) // --> .T. + ? Empty( 1 ) // --> .F. + ? Empty( .T. ) // --> .F. + ? Empty( "smile" ) // --> .F. + ? Empty( Date() ) // --> .F. $STATUS$ R $COMPLIANCE$ @@ -798,6 +805,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -818,6 +827,7 @@ This function converts an expression in his inverted form. It is useful to build descending indexes. $EXAMPLES$ + // FIXME // Seek for Smith in a descending index dbSeek( Descend( "SMITH" ) ) $STATUS$ @@ -853,8 +863,8 @@ to its lowercased representation. Any non alphabetic character withing will remain unchanged. $EXAMPLES$ - ? Lower( "HARBOUR" ) // harbour - ? Lower( "Hello All" ) // hello all + ? Lower( "HARBOUR" ) // --> "harbour" + ? Lower( "Hello All" ) // --> "hello all" $STATUS$ R $COMPLIANCE$ @@ -869,6 +879,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -889,8 +901,8 @@ This function converts all alpha characters in to upper case values and returns that formatted character expression. $EXAMPLES$ - ? Upper( "harbour" ) // HARBOUR - ? Upper( "Harbour" ) // HARBOUR + ? Upper( "harbour" ) // --> "HARBOUR" + ? Upper( "Harbour" ) // --> "HARBOUR" $STATUS$ R $COMPLIANCE$ @@ -905,6 +917,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -946,6 +960,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -982,6 +998,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1030,6 +1048,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1078,6 +1098,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1126,6 +1148,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1164,6 +1188,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1188,10 +1214,10 @@ Together with LTrim(), this function equated to the AllTrim() function. $EXAMPLES$ - ? RTrim( "Hello" ) // "Hello" - ? RTrim( "" ) // "" - ? RTrim( "UA " ) // "UA" - ? RTrim( " UA" ) // " UA" + ? RTrim( "Hello" ) // --> "Hello" + ? RTrim( "" ) // --> "" + ? RTrim( "UA " ) // --> "UA" + ? RTrim( " UA" ) // --> " UA" $STATUS$ R $COMPLIANCE$ @@ -1206,6 +1232,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1230,10 +1258,10 @@ Together with LTrim(), this function equated to the AllTrim() function. $EXAMPLES$ - ? Trim( "Hello" ) // "Hello" - ? Trim( "" ) // "" - ? Trim( "UA " ) // "UA" - ? Trim( " UA" ) // " UA" + ? Trim( "Hello" ) // --> "Hello" + ? Trim( "" ) // --> "" + ? Trim( "UA " ) // --> "UA" + ? Trim( " UA" ) // --> " UA" $STATUS$ R $COMPLIANCE$ @@ -1248,6 +1276,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1272,9 +1302,9 @@ . The length of the character string returned by this function is limited to the memory available. - A value of 0 for will return a NULL string. + A value of 0 for will return a null string. $EXAMPLES$ - ? Replicate( "a", 10 ) // aaaaaaaaaa + ? Replicate( "a", 10 ) // --> "aaaaaaaaaa" ? Replicate( "b", 100000 ) $STATUS$ R @@ -1290,6 +1320,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1308,7 +1340,7 @@ A string containing blank spaces $DESCRIPTION$ This function returns a string consisting of blank spaces. - If the value of is 0, a NULL string ( "" ) will be returned. + If the value of is 0, a null string ("") will be returned. This function is useful to declare the length of a character memory variable. @@ -1319,11 +1351,11 @@ LOCAL cBigString LOCAL cFirst - LOCAL cString := Space( 20 ) // Create an character memory variable - // with length 20 - ? Len( cString ) // 20 - cBigString := Space( 100000 ) // create a memory variable with 100000 - // blank spaces + LOCAL cString := Space( 20 ) // Create an character memory variable + // with length 20 + ? Len( cString ) // --> 20 + cBigString := Space( 100000 ) // Create a memory variable with 100000 + // blank spaces ? Len( cBigString ) USE test NEW cFirst := MakeEmpty( 1 ) @@ -1331,12 +1363,12 @@ RETURN - FUNCTION MakeEmpty( xField ) + STATIC FUNCTION MakeEmpty( xField ) LOCAL nRecord LOCAL xRetValue - IF ! HB_ISNULL( Alias() ) + IF ! Alias() == "" nRecord := RecNo() dbGoto( 0 ) IF HB_ISSTRING( xField ) @@ -1368,6 +1400,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -1390,7 +1424,7 @@ This functions is the oppose of the Str() function. $EXAMPLES$ - ? Val( "31421" ) // 31421 + ? Val( "31421" ) // --> 31421 $STATUS$ R $COMPLIANCE$ @@ -1405,151 +1439,109 @@ */ /* $DOC$ + $AUTHOR$ + 2017 Pete D. $TEMPLATE$ Function $NAME$ - StrTran() + hb_ntoc() $CATEGORY$ API $SUBCATEGORY$ Strings $ONELINER$ - Translate substring value with a main string + Converts a numeric value to string $SYNTAX$ - StrTran( , , [], [], - [] ) --> cReturn + hb_ntoc( , [] ) --> cValue $ARGUMENTS$ - The main string to search + is the numeric value to convert. - The string to locate in the main string - - The string to replace the - - The first occurrence to be replaced - - Number of occurrence to replace + decimal digits to retain (if any). $RETURNS$ - Formated string + A string representation of $DESCRIPTION$ - This function searches for any occurrence of in - and replaces it with . If is not specified, a - NULL byte will replace . + This function converts the given numeric value + to a string value, while (trying to) keep all or at least `nDecs` + significant digits in double numbers, unless `` is lesser + than actual decimal digits of , in which case the result + will be rounded. - If is used, its value defines the first occurrence to be - replaced. The default value is 1. Additionally, if used, the value of - tell the function how many occurrences of - in are to the replaced. The default of is - all occurrences. + SET DECIMAL setting has no effect on the returned value (ignored), + which means that, unlike f.e. Str(), all non-significant digits + (e.g.: trailing decimal zeros) will be removed. Likewise, all + leading empty spaces will be trimmed. + + Returns stringified value of ``, preserving all (or at least + ``) significant digits, if any. + Interestingly, if `` is NIL or not numeric, this function + will return a null string and, unlike Str(), will NOT cause an RTE. + NOTE: new function, available after 2016-06-20 21:59 UTC+0200 commit, + (it is not available in earlier versions). $EXAMPLES$ - ? StrTran( "Harbour Power", " ", " " ) // Harbour Power - // Harbour Power The future of xBase - ? StrTran( "Harbour Power The Future of xBase", " ", " " , , 2 ) + LOCAL n := ( 5 / 2 ) + 0.009 + + ? hb_ntoc( n ) // --> 2.509 + ? Str( n ) // --> 2.51 + ? hb_ntoc( n, 2 ) // --> 2.51 + ? Str( n, 5, 2 ) // --> 2.51 + ? hb_ntos( n ) // --> 2.51 + ? "--- decimals set to 7 ----" + SET DECIMALS TO 7 + ? Str( n ) // --> 2.51 + ? hb_ntoc( n ) // --> 2.509 + ? Str( n, 10, 7 ) // --> 2.5090000 + ? hb_ntoc( n, 7 ) // --> 2.509 + ? "--- pass non numeric / NIL value ----" + ? Str( "42" ) // --> RTE $STATUS$ R $COMPLIANCE$ - C - $PLATFORMS$ - All + H $FILES$ - Libraty is rtl + Library is core $SEEALSO$ - SubStr(), At() + Str(), hb_ntos() $END$ */ /* $DOC$ + $AUTHOR$ + 2017 Pete D. $TEMPLATE$ Function $NAME$ - Transform() + hb_ntos() $CATEGORY$ API $SUBCATEGORY$ Strings $ONELINER$ - Formats a value based on a specific picture template. + Converts a numeric value to string. $SYNTAX$ - Transform( , ) --> cFormatted + hb_ntos( ) --> cValue $ARGUMENTS$ - Any expression to be formated. - - Character string with picture template + is the numeric value to convert. $RETURNS$ - Formatted expression in character format + A string representation of $DESCRIPTION$ - This function returns in the format of the picture - expression passed to the function as . + This function converts any numeric value to a string, + trimming all the leading empty spaces. If `` is NIL + or not numeric, this function will return a null string. - Their are two components that can make up : a function - string and a template string. Function strings are those functions - that globally tell what the format of should be. These - functions are represented by a single character precede by the - @ symbol. - - There are a couple of rules to follow when using function strings - and template strings: - - - First, a single space must fall between the function template - and the template string if they are used in conjunction with - one another. - - - Second, if both components make up the value of , the - function string must precede the template string. Otherwise, the - function string may appear with out the template string and - vice versa. - - The table below shows the possible function strings available with - the Transform() function. - - - @B Left justify the string within the format. - @C Issue a CR after format is numbers are positive. - @D Put dates in SET DATE format. - @E Put dates in BRITISH format. - @L Make a zero padded string out of the number. - @R Insert non template characters. - @X Issue a DB after format is numbers are negative. - @Z Display any zero as blank spaces. - @( Quotes around negative numbers - @! Convert alpha characters to uppercased format. - - - The second part of consists of the format string. Each - character in the string may be formatted based on using the follow - characters as template markers for the string. - - - A,N,X,9,# Any data type - L Shows logical as "T" or "F" - Y Shows logical as "Y" or "N" - ! Convert to uppercase - $ Dollar sing in place of leading spaces in numeric expression - * Asterisks in place of leading spaces in numeric expression - , Commas position - . Decimal point position - + Essentially, `hb_ntos()` function is equivalent to + `LTrim( Str( ) )` but quite simpler and faster. $EXAMPLES$ - LOCAL cString := "This is harbour" - LOCAL nNumber := 9923.34 - LOCAL nNumber1 := -95842.00 - LOCAL lValue := .T. - LOCAL dDate := Date() - ? "working with String" - ? "Current String is", cString - ? "All uppercased", Transform( cString, "@!" ) - ? "Date is", dDate - ? "Date is", Transform( dDate, "@D" ) - ? Transform( nNumber, "@L 99999999" ) // "009923.34" - ? Transform( 0 , "@L 9999" ) // "0000" + LOCAL n := ( 5 / 2 ) + 0.009 + + ? Str( n ) // --> 2.51 + ? hb_ntos( n ) // --> 2.51 $STATUS$ R $COMPLIANCE$ - The @L function template is a FoxPro/Xbase++ Extension - $PLATFORMS$ - All + H $FILES$ Library is core $SEEALSO$ - @...SAY, DevOutPict() + Str(), hb_ntoc(), LTrim() $END$ */ diff --git a/doc/en/strtran.txt b/doc/en/strtran.txt new file mode 100644 index 0000000000..bc5ae67d12 --- /dev/null +++ b/doc/en/strtran.txt @@ -0,0 +1,54 @@ +/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik + $TEMPLATE$ + Function + $NAME$ + StrTran() + $CATEGORY$ + API + $SUBCATEGORY$ + Strings + $ONELINER$ + Translate substring value with a main string + $SYNTAX$ + StrTran( , , [], [], + [] ) --> cReturn + $ARGUMENTS$ + The main string to search + + The string to locate in the main string + + The string to replace the + + The first occurrence to be replaced + + Number of occurrence to replace + $RETURNS$ + Formatted string + $DESCRIPTION$ + This function searches for any occurrence of in + and replaces it with . If is not specified, a + NULL byte will replace . + + If is used, its value defines the first occurrence to be + replaced. The default value is 1. Additionally, if used, the value of + tell the function how many occurrences of + in are to the replaced. The default of is + all occurrences. + $EXAMPLES$ + ? StrTran( "Harbour Power", " ", " " ) // --> "Harbour Power" + ? StrTran( "Harbour Power The Future of xBase", " ", " " , , 2 ) + // --> "Harbour Power The future of xBase" + $STATUS$ + R + $COMPLIANCE$ + C + $PLATFORMS$ + All + $FILES$ + Libraty is rtl + $SEEALSO$ + SubStr(), At() + $END$ + */ diff --git a/doc/en/subcodes.txt b/doc/en/subcodes.txt index cb01b7ea48..f1cb5f71e9 100644 --- a/doc/en/subcodes.txt +++ b/doc/en/subcodes.txt @@ -1,12 +1,12 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1003 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ - Attempt to access nonexisting or hidden variable + Attempt to access non-existing or hidden variable $DESCRIPTION$ The specified variable was not found. @@ -23,29 +23,11 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1068 $CATEGORY$ - Run time errors - $ONELINER$ - Invalid type of argument - $DESCRIPTION$ - The used data is not of logical type. - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1068 - $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Bound error in array access $DESCRIPTION$ @@ -59,11 +41,11 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1069 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Bound error in array access $DESCRIPTION$ @@ -77,17 +59,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ - BASE/1078 + BASE/1070 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of compared arguments do not match. $EXAMPLES$ - == + ? "a" == 0 $COMPLIANCE$ C $SEEALSO$ @@ -97,17 +79,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1072 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of compared arguments do not match. $EXAMPLES$ - <> + ? "a" != 0 $COMPLIANCE$ C $SEEALSO$ @@ -117,17 +99,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1073 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of compared argument do not match. $EXAMPLES$ - < + ? "a" < 0 $COMPLIANCE$ C $SEEALSO$ @@ -137,17 +119,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1074 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of compared arguments do not match. $EXAMPLES$ - <= + ? "a" <= 0 $COMPLIANCE$ C $SEEALSO$ @@ -157,17 +139,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1075 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of compared arguments do not match. $EXAMPLES$ - > + ? "a" > 0 $COMPLIANCE$ C $SEEALSO$ @@ -177,17 +159,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1076 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of compared arguments do not match. $EXAMPLES$ - >= + ? "a" >= 0 $COMPLIANCE$ C $SEEALSO$ @@ -197,18 +179,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1077 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ Operation is not allowed for passed argument. The argument is not a logical value. $EXAMPLES$ - ! + ? ! "a" $COMPLIANCE$ C $SEEALSO$ @@ -218,16 +200,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1078 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of one or both arguments is not a logical. $EXAMPLES$ + // FIXME .AND. $COMPLIANCE$ C @@ -238,16 +221,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1079 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The type of one or both arguments is not a logical. $EXAMPLES$ + // FIXME .OR. $COMPLIANCE$ C @@ -258,31 +242,11 @@ /* $DOC$ $TEMPLATE$ - Run time error - $NAME$ - BASE/1076 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid type of arguments - $DESCRIPTION$ - The value of argument cannot be incremented. - $EXAMPLES$ - ++ - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1081 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ @@ -298,17 +262,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1082 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ The minus operation is not allowed for used arguments. $EXAMPLES$ - - + ? "a" - 1 $COMPLIANCE$ C $SEEALSO$ @@ -318,197 +282,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ - BASE/1100 + BASE/1086 $CATEGORY$ - Run time errors - $ONELINER$ - Incorrect type of argument - $DESCRIPTION$ - The specified argument is not a string. - $EXAMPLES$ - RTrim(), Trim() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1101 - $CATEGORY$ - Run time errors - $ONELINER$ - Incorrect type of argument - $DESCRIPTION$ - The specified argument is not a string. - $EXAMPLES$ - LTrim() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1102 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The first argument passed to a function is not a string. - $EXAMPLES$ - Upper() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1103 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The first argument passed to a function is not a string. - $EXAMPLES$ - Lower() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1104 - $CATEGORY$ - Run time errors - $ONELINER$ - Incorrect type of argument - $DESCRIPTION$ - The specified argument is not a numeric value. - $EXAMPLES$ - Chr() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1105 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The arguments passed to a function are of incorrect type. - $EXAMPLES$ - Space() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1106 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The arguments passed to a function are of incorrect type. - $EXAMPLES$ - Replicate() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1107 - $CATEGORY$ - Run time errors - $ONELINER$ - Incorrect type of argument - $DESCRIPTION$ - The specified argument is not a string. - $EXAMPLES$ - Asc() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1108 - $CATEGORY$ - Run time errors - $ONELINER$ - Incorrect type of argument - $DESCRIPTION$ - The specified argument is not a string. - $EXAMPLES$ - At() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1076 - $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of arguments $DESCRIPTION$ - The arguments of '$' operator are not a strings. + The value of argument cannot be incremented. $EXAMPLES$ - + LOCAL cVar := "a" + cVar++ $COMPLIANCE$ C $SEEALSO$ @@ -518,316 +303,11 @@ /* $DOC$ $TEMPLATE$ - Run time error - $NAME$ - BASE/1110 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The first argument passed to a function is not a string. - $EXAMPLES$ - SubStr() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1110 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The passed argument is neither a string nor an array. - $EXAMPLES$ - Len() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1112 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The argument (or arguments) passed to a function are of incorrect - type - $EXAMPLES$ - Year() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1113 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The argument (or arguments) passed to a function are of incorrect - type - $EXAMPLES$ - Month() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1114 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The argument (or arguments) passed to a function are of incorrect - type - $EXAMPLES$ - Day() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1115 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The argument (or arguments) passed to a function are of incorrect - type - $EXAMPLES$ - DoW() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1116 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The argument (or arguments) passed to a function are of incorrect - type - $EXAMPLES$ - CMonth() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1117 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The argument (or arguments) passed to a function is of incorrect - type - $EXAMPLES$ - CDoW() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1120 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The argument (or arguments) passed to a function is of incorrect - type - $EXAMPLES$ - DToS() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1122 - $CATEGORY$ - Run time errors - $ONELINER$ - Incorrect type of argument - $DESCRIPTION$ - The argument (or arguments) passed to a function is of incorrect - type - $EXAMPLES$ - Transform() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1124 - $CATEGORY$ - Run time errors - $ONELINER$ - Incorrect type of argument - $DESCRIPTION$ - The first argument is not a string. - $EXAMPLES$ - Left() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1126 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The first arguments passed to a function is not a string. - $EXAMPLES$ - StrTran() - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1132 - $CATEGORY$ - Run time errors - $ONELINER$ - Bound error in array access - $DESCRIPTION$ - The specified index into an array was greater then the number of - elements in the array. - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1133 - $CATEGORY$ - Run time errors - $ONELINER$ - Bound error in array assignment - $DESCRIPTION$ - The specified index into an array was greater then the number of - elements in the array. - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error - $NAME$ - BASE/1068 - $CATEGORY$ - Run time errors - $ONELINER$ - Bound error in array element assignment - $DESCRIPTION$ - The specified index into an array was greater then the number of - elements in the array. - $COMPLIANCE$ - C - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1085 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ @@ -844,18 +324,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1089 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - Abs() + Abs( "a" ) $COMPLIANCE$ C $SEEALSO$ @@ -865,18 +345,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1090 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - INT() + Int( "a" ) $COMPLIANCE$ C $SEEALSO$ @@ -886,18 +366,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1092 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - Min() + Min( "a", "b" ) $COMPLIANCE$ C $SEEALSO$ @@ -907,18 +387,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1093 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - Max() + Max( "a", "b" ) $COMPLIANCE$ C $SEEALSO$ @@ -928,18 +408,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1094 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - Round() + Round( "a", 0 ) $COMPLIANCE$ C $SEEALSO$ @@ -949,18 +429,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1095 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - Log() + Log( "a" ) $COMPLIANCE$ C $SEEALSO$ @@ -970,18 +450,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1096 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - Exp() + Exp( "a" ) $COMPLIANCE$ C $SEEALSO$ @@ -991,18 +471,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1097 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not an numeric value $EXAMPLES$ - Sqrt() + Sqrt( "a" ) $COMPLIANCE$ C $SEEALSO$ @@ -1012,18 +492,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1098 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not a string value $EXAMPLES$ - Val() + Val( 1 ) $COMPLIANCE$ C $SEEALSO$ @@ -1033,18 +513,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/1099 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The argument (or arguments) passed to a function is not a numeric value $EXAMPLES$ - Str() + Str( "a" ) $COMPLIANCE$ C $SEEALSO$ @@ -1054,17 +534,504 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error + $NAME$ + BASE/1100 + $CATEGORY$ + Runtime errors + $ONELINER$ + Incorrect type of argument + $DESCRIPTION$ + The specified argument is not a string. + $EXAMPLES$ + RTrim( 1 ) + Trim( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1101 + $CATEGORY$ + Runtime errors + $ONELINER$ + Incorrect type of argument + $DESCRIPTION$ + The specified argument is not a string. + $EXAMPLES$ + LTrim( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1102 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The first argument passed to a function is not a string. + $EXAMPLES$ + Upper( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1103 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The first argument passed to a function is not a string. + $EXAMPLES$ + Lower( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1104 + $CATEGORY$ + Runtime errors + $ONELINER$ + Incorrect type of argument + $DESCRIPTION$ + The specified argument is not a numeric value. + $EXAMPLES$ + Chr( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1105 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The arguments passed to a function are of incorrect type. + $EXAMPLES$ + Space( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1106 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The arguments passed to a function are of incorrect type. + $EXAMPLES$ + Replicate( 1, "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1107 + $CATEGORY$ + Runtime errors + $ONELINER$ + Incorrect type of argument + $DESCRIPTION$ + The specified argument is not a string. + $EXAMPLES$ + Asc( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1108 + $CATEGORY$ + Runtime errors + $ONELINER$ + Incorrect type of argument + $DESCRIPTION$ + The specified argument is not a string. + $EXAMPLES$ + At( 1, "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1109 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid type of arguments + $DESCRIPTION$ + The arguments of '$' operator are not a strings. + $EXAMPLES$ + ? 1 $ "a" + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1110 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The first argument passed to a function is not a string. + $EXAMPLES$ + SubStr( 1, 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1111 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The passed argument is neither a string nor an array. + $EXAMPLES$ + Len( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1112 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The argument (or arguments) passed to a function are of incorrect + type + $EXAMPLES$ + Year( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1113 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The argument (or arguments) passed to a function are of incorrect + type + $EXAMPLES$ + Month( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1114 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The argument (or arguments) passed to a function are of incorrect + type + $EXAMPLES$ + Day( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1115 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The argument (or arguments) passed to a function are of incorrect + type + $EXAMPLES$ + DoW( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1116 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The argument (or arguments) passed to a function are of incorrect + type + $EXAMPLES$ + CMonth( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1117 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The argument (or arguments) passed to a function is of incorrect + type + $EXAMPLES$ + CDoW( "a" ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1120 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The argument (or arguments) passed to a function is of incorrect + type + $EXAMPLES$ + DToS( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1122 + $CATEGORY$ + Runtime errors + $ONELINER$ + Incorrect type of argument + $DESCRIPTION$ + The argument (or arguments) passed to a function is of incorrect + type + $EXAMPLES$ + Transform( "a", 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1124 + $CATEGORY$ + Runtime errors + $ONELINER$ + Incorrect type of argument + $DESCRIPTION$ + The first argument is not a string. + $EXAMPLES$ + Left( 1, 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1126 + $CATEGORY$ + Runtime errors + $ONELINER$ + Invalid argument passed to function + $DESCRIPTION$ + The first arguments passed to a function is not a string. + $EXAMPLES$ + StrTran( 1 ) + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1132 + $CATEGORY$ + Runtime errors + $ONELINER$ + Bound error in array access + $DESCRIPTION$ + The specified index into an array was greater then the number of + elements in the array. + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error + $NAME$ + BASE/1133 + $CATEGORY$ + Runtime errors + $ONELINER$ + Bound error in array element assignment + $DESCRIPTION$ + The specified index into an array was greater then the number of + elements in the array. + $COMPLIANCE$ + C + $SEEALSO$ + + $END$ + */ + +/* $DOC$ + $TEMPLATE$ + Runtime error $NAME$ BASE/2010 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Incorrect arguments type $DESCRIPTION$ - Passed Run time errors was not strings with filenames to copy/ + Passed Runtime errors was not strings with file names to copy. $EXAMPLES$ - __CopyFile() + __CopyFile( 1, 2 ) $COMPLIANCE$ H $SEEALSO$ @@ -1074,18 +1041,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/2012 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ File error $DESCRIPTION$ An error has occurred during the attempt to open, create or write during copy operation $EXAMPLES$ - __CopyFile() + __CopyFile( "", "test.txt" ) $COMPLIANCE$ C $SEEALSO$ @@ -1095,18 +1062,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/2017 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to a function $DESCRIPTION$ The first argument is not an array or/and the second argument is not a code block $EXAMPLES$ - AEval() + AEval( 1 ) $COMPLIANCE$ C $SEEALSO$ @@ -1116,20 +1083,20 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/2020 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to function $DESCRIPTION$ The passed value is negative. Only values > 0 are allowed. $EXAMPLES$ - SET DECIMALS - SET EPOCH - SET MARGIN - SET MESSAGE + // SET DECIMALS + // SET EPOCH + // SET MARGIN + // SET MESSAGE $COMPLIANCE$ C $SEEALSO$ @@ -1139,18 +1106,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3001 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Incorrect argument type $DESCRIPTION$ The passed argument is not an object. Only data of type OBJECT can be cloned by this function $EXAMPLES$ - OCLONE() + __objClone( 1 ) $COMPLIANCE$ H $SEEALSO$ @@ -1160,18 +1127,19 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3002 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Super class does not return an object $DESCRIPTION$ Passed argument is not a name of defined class or specified class doesn't have a super class $EXAMPLES$ - __INSTSUPER() + // FIXME + __clsInstSuper() $COMPLIANCE$ H $SEEALSO$ @@ -1181,17 +1149,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3003 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Cannot find super class $DESCRIPTION$ Passed argument is not a name of defined class $EXAMPLES$ - __INSTSUPER() + __clsInstSuper() $COMPLIANCE$ H $SEEALSO$ @@ -1201,18 +1169,19 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3004 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Cannot modify a DATA item in a class $DESCRIPTION$ The attempt to modify a data member of a class was made. Only INLINE and METHOD can be modified $EXAMPLES$ - __CLASSMOD() + // FIXME + __clsModMsg() $COMPLIANCE$ H $SEEALSO$ @@ -1222,18 +1191,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3005 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Incorrect arguments type $DESCRIPTION$ Either the first argument was not an object or the second argument wasn't a string. $EXAMPLES$ - ISMESSAGE(), OSEND() + __clsAssocType( 1, 1 ) $COMPLIANCE$ H $SEEALSO$ @@ -1243,17 +1212,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3007 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of argument $DESCRIPTION$ The passed arguments are causing conflict in handling of the request. There is no point in waiting forever for no input events! $EXAMPLES$ + // FIXME Inkey() $COMPLIANCE$ H @@ -1264,18 +1234,19 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3008 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid type of argument $DESCRIPTION$ The passed argument(s) is not a string. It should be a string with a variable name or an one-dimensional array of strings. $EXAMPLES$ - __mvPrivate(), __mvPublic() + __mvPrivate( 1 ) + __mvPublic( 1 ) $COMPLIANCE$ H $SEEALSO$ @@ -1285,18 +1256,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3009 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Incorrect argument passed to __mvGet() function $DESCRIPTION$ __mvGet() function expects only one argument: a string with a name of variable. The value of this variable will be returned. $EXAMPLES$ - __mvGet() + __mvGet( 1 ) $COMPLIANCE$ H $SEEALSO$ @@ -1306,18 +1277,18 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3010 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Incorrect argument passed to __mvPut() function $DESCRIPTION$ __mvPut() function expects at least one argument: a string with a name of variable. The value of this variable will be set. $EXAMPLES$ - __mvPut() + __mvPut( 1 ) $COMPLIANCE$ H $SEEALSO$ @@ -1327,40 +1298,18 @@ /* $DOC$ $TEMPLATE$ - Run time error - $NAME$ - BASE/3011 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to a function - $DESCRIPTION$ - The attempt to retrieve the function argument that was not passed. - The number of requested argument is greater then the number of - passed arguments. - $EXAMPLES$ - hb_PValue() - $COMPLIANCE$ - H - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3012 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to a function $DESCRIPTION$ The first argument is not a string with function/procedure name that should be called. $EXAMPLES$ - Do() + Do( 1 ) $COMPLIANCE$ H $SEEALSO$ @@ -1370,17 +1319,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3101 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Invalid argument passed to an object/class function $DESCRIPTION$ One passed argument is not of the required type. $EXAMPLES$ - __obj*() + // __obj*() $COMPLIANCE$ H $SEEALSO$ @@ -1390,11 +1339,11 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3102 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ A symbol should be modified or deleted from a class, but the symbol doesn't exist. @@ -1402,7 +1351,7 @@ A symbol should be modified or deleted from a class, but the symbol doesn't exist. $EXAMPLES$ - __obj*() + // __obj*() $COMPLIANCE$ H $SEEALSO$ @@ -1412,17 +1361,17 @@ /* $DOC$ $TEMPLATE$ - Run time error + Runtime error $NAME$ BASE/3103 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ A symbol should be added to a class, but the symbol already exists. $DESCRIPTION$ A symbol should be added to a class, but the symbol already exists. $EXAMPLES$ - __obj*() + // __obj*() $COMPLIANCE$ H $SEEALSO$ @@ -1432,37 +1381,18 @@ /* $DOC$ $TEMPLATE$ - Run time error - $NAME$ - TOOLS/4001 - $CATEGORY$ - Run time errors - $ONELINER$ - Invalid argument passed to function - $DESCRIPTION$ - The second arguments passed to a function is not a string. - $EXAMPLES$ - IsLeapYear() - $COMPLIANCE$ - H - $SEEALSO$ - - $END$ - */ - -/* $DOC$ - $TEMPLATE$ - Run time error + Runtime error $NAME$ TERM/2013 $CATEGORY$ - Run time errors + Runtime errors $ONELINER$ Create error $DESCRIPTION$ The specified file cannot be created due some OS error. $EXAMPLES$ - Set(), SET ALTERNATE TO + // Set() + // SET ALTERNATE TO $COMPLIANCE$ C $SEEALSO$ diff --git a/doc/en/tbrowse.txt b/doc/en/tbrowse.txt index 316d2e596a..f8f1a066b1 100644 --- a/doc/en/tbrowse.txt +++ b/doc/en/tbrowse.txt @@ -7,8 +7,8 @@ TBrowse class $ONELINER$ Create a Browse Object - $CONSTRUCTOR$ - TBrowseNew( , , , ) --> + $SYNTAX$ + TBrowseNew( , , , ) --> oBrowse $ARGUMENTS$ Top Row @@ -22,156 +22,156 @@ $DESCRIPTION$ This function set up a browsing window at top-left coordinates of , to bottom-right coordinates of , . - To browse Database files use TBrowseDB() function insted. + To browse Database files use TBrowseDB() function instead. $DATANOLINK$ - :aColumns Array to hold all browse columns + `:aColumns` Array to hold all browse columns - :autoLite Logical value to control highlighting + `:autoLite` Logical value to control highlighting - :cargo User-definable variable + `:cargo` User-definable variable - :colorSpec Color table for the TBrowse display + `:colorSpec` Color table for the TBrowse display - :colPos Current cursor column position + `:colPos` Current cursor column position - :colSep Column separator character + `:colSep` Column separator character - :footSep Footing separator character + `:footSep` Footing separator character - :freeze Number of columns to freeze + `:freeze` Number of columns to freeze - :goBottomBlock Code block executed by TBrowse:goBottom() + `:goBottomBlock` Code block executed by `TBrowse:goBottom()` - :goTopBlock Code block executed by TBrowse:goTop() + `:goTopBlock` Code block executed by `TBrowse:goTop()` - :headSep Heading separator character + `:headSep` Heading separator character - :hitBottom Indicates the end of available data + `:hitBottom` Indicates the end of available data - :hitTop Indicates the beginning of available data + `:hitTop` Indicates the beginning of available data - :leftVisible Indicates position of leftmost unfrozen column + `:leftVisible` Indicates position of leftmost unfrozen column in display - :nBottom Bottom row number for the TBrowse display + `:nBottom` Bottom row number for the TBrowse display - :nLeft Leftmost column for the TBrowse display + `:nLeft` Leftmost column for the TBrowse display - :nRight Rightmost column for the TBrowse display + `:nRight` Rightmost column for the TBrowse display - :nTop Top row number for the TBrowse display + `:nTop` Top row number for the TBrowse display - :rightVisible Indicates position of rightmost unfrozen column + `:rightVisible` Indicates position of rightmost unfrozen column in display - :rowCount Number of visible data rows in the TBrowse + `:rowCount` Number of visible data rows in the TBrowse display - :rowPos Current cursor row position + `:rowPos` Current cursor row position - :skipBlock Code block used to reposition data source + `:skipBlock` Code block used to reposition data source - :stable Indicates if the TBrowse object is stable + `:stable` Indicates if the TBrowse object is stable - :aRedraw Array of logical items indicating, is appropriate + `:aRedraw` Array of logical items indicating, is appropriate row need to be redraw - :RelativePos Indicates record position relatively position of + `:RelativePos` Indicates record position relatively position of first record on the screen - :lHeaders Internal variable which indicates whether there + `:lHeaders` Internal variable which indicates whether there are column footers to paint - :lFooters Internal variable which indicates whether there + `:lFooters` Internal variable which indicates whether there are column footers to paint - :aRect The rectangle specified with ColorRect() + `:aRect` The rectangle specified with `:ColorRect()` - :aRectColor The color positions to use in the rectangle - specified with ColorRect() + `:aRectColor` The color positions to use in the rectangle + specified with `:ColorRect()` - :aKeys Holds the Default movement keys + `:aKeys` Holds the Default movement keys $METHODSLINK$ - AddColumn() Adds an new TBColumn object to the current Browse + `:AddColumn()` Adds an new TBColumn object to the current Browse - Applykey() Perform the Browse Key movement + `:Applykey()` Perform the Browse Key movement - SetKey() Add an New key to the Keyboard dictionary + `:SetKey()` Add an New key to the Keyboard dictionary $METHODSNOLINK$ - New(nTop, nLeft, nBottom, nRight) Create an new Browse class and set the + `:New( nTop, nLeft, nBottom, nRight )` Create an new Browse class and set the default values - Down() Moves the cursor down one row + `:Down()` Moves the cursor down one row - End() Moves the cursor to the rightmost visible data column + `:End()` Moves the cursor to the rightmost visible data column - GoBottom() Repositions the data source to the bottom of file + `:GoBottom()` Repositions the data source to the bottom of file - GoTop() Repositions the data source to the top of file + `:GoTop()` Repositions the data source to the top of file - Home() Moves the cursor to the leftmost visible data column + `:Home()` Moves the cursor to the leftmost visible data column - Left() Moves the cursor left one column + `:Left()` Moves the cursor left one column - PageDown() Repositions the data source downward + `:PageDown()` Repositions the data source downward - PageUp() Repositions the data source upward + `:PageUp()` Repositions the data source upward - PanEnd() Moves the cursor to the rightmost data column + `:PanEnd()` Moves the cursor to the rightmost data column - PanHome() Moves the cursor to the leftmost visible data column + `:PanHome()` Moves the cursor to the leftmost visible data column - PanLeft() Pans left without changing the cursor position + `:PanLeft()` Pans left without changing the cursor position - PanRight() Pans right without changing the cursor position + `:PanRight()` Pans right without changing the cursor position - Right() Moves the cursor right one column + `:Right()` Moves the cursor right one column - Up() Moves the cursor up one row + `:Up()` Moves the cursor up one row - ColCount() Return the Current number of Columns + `:ColCount()` Return the Current number of Columns - ColorRect() Alters the color of a rectangular group of cells + `:ColorRect()` Alters the color of a rectangular group of cells - ColWidth( nColumn ) Returns the display width of a particular column + `:ColWidth( nColumn )` Returns the display width of a particular column - Configure( nMode ) Reconfigures the internal settings of the TBrowse - object nMode is an undocumented parameter in CA-Cl*pper + `:Configure( nMode )` Reconfigures the internal settings of the TBrowse() + object is an undocumented parameter in CA-Cl*pper - LeftDetermine() Determine leftmost unfrozen column in display + `:LeftDetermine()` Determine leftmost unfrozen column in display - DeHilite() Dehighlights the current cell + `:DeHilite()` Dehighlights the current cell - DelColumn( nPos ) Delete a column object from a browse + `:DelColumn( nPos )` Delete a column object from a browse - ForceStable() Performs a full stabilization + `:ForceStable()` Performs a full stabilization - GetColumn( nColumn ) Gets a specific TBColumn object + `:GetColumn( nColumn )` Gets a specific TBColumn() object - Hilite() Highlights the current cell + `:Hilite()` Highlights the current cell - InsColumn( nPos, oCol ) Insert a column object in a browse + `:InsColumn( nPos, oCol )` Insert a column object in a browse - Invalidate() Forces entire redraw during next stabilization + `:Invalidate()` Forces entire redraw during next stabilization - RefreshAll() Causes all data to be recalculated during the next + `:RefreshAll()` Causes all data to be recalculated during the next stabilize - RefreshCurrent() Causes the current row to be refilled and repainted + `:RefreshCurrent()` Causes the current row to be refilled and repainted on next stabilize - SetColumn( nColumn, oCol ) Replaces one TBColumn object with another + `:SetColumn( nColumn, oCol )` Replaces one TBColumn() object with another - Stabilize() Performs incremental stabilization + `:Stabilize()` Performs incremental stabilization - DispCell( nColumn, cColor ) Displays a single cell + `:DispCell( nColumn, cColor )` Displays a single cell $EXAMPLES$ - See tests/tbrowse.prg + // See tests/tbrowse.prg $STATUS$ S $COMPLIANCE$ - This functions is Compatible with CA-Cl*pper 5.2. The applykey() and - SetKey() methods are only visible if HB_COMPAT_C53 is defined. + This functions is Compatible with CA-Cl*pper 5.2. The `:applykey()` and + `:SetKey()` methods are only visible if HB_COMPAT_C53 is defined. $PLATFORMS$ All $FILES$ @@ -184,78 +184,83 @@ /* $DOC$ $TEMPLATE$ Class - $METHOD$ - SetKey() + $NAME$ + TBrowse():SetKey() $CATEGORY$ TBrowse Method $ONELINER$ - Get an optionaly Set an new Code block associated to a inkey value + Get an optionally Set an new Code block associated to a inkey value $SYNTAX$ - SetKey( [, ] ) --> bOldBlock + :SetKey( [, ] ) --> bOldBlock $ARGUMENTS$ An valid inkey Code An optional action to associate to the inkey value. $RETURNS$ - If an Keypress has it code block changes, it will return - the previus one; otherwise, it will return the current one + If a key-press has it code block changes, it will return + the previous one; otherwise, it will return the current one $DESCRIPTION$ - This method Get an optionaly set an code block that is associated to + This method Get an optionally set an code block that is associated to an inkey value. - The table below show the default keypress/Code Block definitions + The table below show the default key-press/Code Block definitions - Inkey Value Code Block + Inkey Value Code Block - K_DOWN {| oB, nKey | oB:Down(), 0 } - K_END {| oB, nKey | oB:End(), 0 } - K_CTRL_PGDN {| oB, nKey | oB:GoBottom(), 0 } - K_CTRL_PGUP {| oB, nKey | oB:GoTop(), 0 } - K_HOME {| oB, nKey | oB:Home(), 0 } - K_LEFT {| oB, nKey | oB:Left(), 0 } - K_PGDN {| oB, nKey | oB:PageDown(), 0 } - K_PGUP {| oB, nKey | oB:PageUp(), 0 } - K_CTRL_END {| oB, nKey | oB:PanEnd(), 0 } - K_CTRL_HOME {| oB, nKey | oB:PanHome(), 0 } - K_CTRL_LEFT {| oB, nKey | oB:PanLeft(), 0 } - K_CTRL_RIGHT {| oB, nKey | oB:PanRight(), 0 } - K_RIGHT {| oB, nKey | oB:Right(), 0 } - K_UP {| oB, nKey | oB:Up(), 0 } - K_ESC {| oB, nKey | -1 } + K_DOWN {| oB, nKey | oB:Down(), 0 } + K_END {| oB, nKey | oB:End(), 0 } + K_CTRL_PGDN {| oB, nKey | oB:GoBottom(), 0 } + K_CTRL_PGUP {| oB, nKey | oB:GoTop(), 0 } + K_HOME {| oB, nKey | oB:Home(), 0 } + K_LEFT {| oB, nKey | oB:Left(), 0 } + K_PGDN {| oB, nKey | oB:PageDown(), 0 } + K_PGUP {| oB, nKey | oB:PageUp(), 0 } + K_CTRL_END {| oB, nKey | oB:PanEnd(), 0 } + K_CTRL_HOME {| oB, nKey | oB:PanHome(), 0 } + K_CTRL_LEFT {| oB, nKey | oB:PanLeft(), 0 } + K_CTRL_RIGHT {| oB, nKey | oB:PanRight(), 0 } + K_RIGHT {| oB, nKey | oB:Right(), 0 } + K_UP {| oB, nKey | oB:Up(), 0 } + K_ESC {| oB, nKey | -1 }
The keys handlers can be queried, added and replace an removed from the internal keyboard dictionary. See the example. - + ``` oTb:SetKey( K_TAB, {| oTb, nKey | -1 } ) - - An default key handler can be declared by specifyin a value of 0 + ``` + An default key handler can be declared by specifying a value of 0 for . It associate code block will be evaluated each time TBrowse:Applykey() is called with an key value that is not contained in the dictionary. For example - - oTb:SetKey( 0, {| oTb, nKey | DefKeyHandler( otb, nkey } ) - This call the a function named DefKeyHandler() when nKey is not + ``` + oTb:SetKey( 0, {| oTb, nKey | DefKeyHandler( oTb, nkey } ) + ``` + This call the a function named DefKeyHandler() when is not contained in the dictionary. - To remove an keypress/code block definition, specify NIL for + To remove an key-press/code block definition, specify NIL for + ``` oTb:SetKey( K_ESC, NIL ) + ``` $EXAMPLES$ - oTb:SeyKey( K_F10, {| otb, nkey | ShowListByname( otb ) } + #include "inkey.ch" + LOCAL oTb := TBrowseNew( 0, 0, 10, 20 ) + oTb:SetKey( K_F10, {| oTb, nkey | ShowListByname( oTb ) } ) $END$ */ /* $DOC$ $TEMPLATE$ Class - $METHOD$ - Applykey() + $NAME$ + TBrowse():ApplyKey() $CATEGORY$ TBrowse Method $ONELINER$ Evaluates an code block associated with an specific key $SYNTAX$ - ApplyKey( ) --> nResult + :ApplyKey( ) --> nResult $ARGUMENTS$ An valid Inkey code $RETURNS$ @@ -263,15 +268,16 @@ See Table Below - Value Meaning - -1 User request for the browse lost input focus - 0 Code block associated with was evaluated - 1 Unable to locate in the dictionary, Key was not processed + Value Meaning + -1 User request for the browse lost input focus + 0 Code block associated with was evaluated + 1 Unable to locate in the dictionary, Key was not processed
$DESCRIPTION$ This method evaluate an code block associated with that is contained in the TBrowse:SetKey() dictionary. $EXAMPLES$ + LOCAL oTb := TBrowseNew( 0, 0, 10, 20 ) DO WHILE .T. oTb:forceStable() IF oTb:applykey( Inkey( 0 ) ) == -1 @@ -284,14 +290,14 @@ /* $DOC$ $TEMPLATE$ Class - $METHOD$ - AddColumn() + $NAME$ + TBrowse():AddColumn() $CATEGORY$ TBrowse Method $ONELINER$ Add an New Column to an TBrowse Object $SYNTAX$ - AddColumn( ) --> Self + :AddColumn( ) --> Self $ARGUMENTS$ Is an TbColumn object $RETURNS$ diff --git a/doc/en/tclass.txt b/doc/en/tclass.txt index ac0bf3bb1b..b17913b92c 100644 --- a/doc/en/tclass.txt +++ b/doc/en/tclass.txt @@ -1,12 +1,6 @@ -/* - * Copyright 2000 Brian Hays - * Documentation - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 2000 Brian Hays $TEMPLATE$ Function $NAME$ @@ -25,27 +19,23 @@ HBClass() is usually accessed by defining a class with the commands defined in hbclass.ch: - CREATE CLASS HBGetList // Calls HBClass() to create the HBGetList class - ... - ENDCLASS + CREATE CLASS HBGetList // Calls HBClass() to create the HBGetList class + ... + ENDCLASS $ARGUMENTS$ $RETURNS$ - An instance of the HBClass Class. This special object's :New() + An instance of the HBClass() Class. This special object's `:New()` method can then create the classes you define. $DESCRIPTION$ - HBClass is a class that ... + HBClass() is a class that ... The class methods are as follows: - New() Create a new instance of the class + `:New()` Create a new instance of the class $EXAMPLES$ - PROCEDURE TestObject() - LOCAL oObject + LOCAL oObject := HBClass():New( "TMyClass" ) - oObject := HBClass():New( "TMyClass" ) - oObject:End() - - RETURN + oObject:End() $STATUS$ R $COMPLIANCE$ @@ -63,6 +53,6 @@ $FILES$ Library is core $SEEALSO$ - __objHasData(), Object Oriented Programming, CLASS + __objHasData(), CLASS $END$ */ diff --git a/doc/en/terminal.txt b/doc/en/terminal.txt index ce77a09f79..6b1c094e5a 100644 --- a/doc/en/terminal.txt +++ b/doc/en/terminal.txt @@ -1,26 +1,6 @@ -/* - * Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) - * Documentation for: hb_ColorIndex() - * - * Copyright 1999 Jose Lalin - * Documentation for: __Wait(), __Input() - * - * Copyright 1999-2000 Chen Kedem - * Documentation for: Alert(), __NoNoAlert(), OutStd(), OutErr(), - * __XSaveScreen(), SAVE SCREEN, __XRestScreen(), - * RESTORE SCREEN, __TextSave(), __TextRestore() - * - * Copyright 1999 David G. Holm - * Documentation for: DevOutPict() - * - * Copyright 2000 Luiz Rafael Culik - * Documentation for: EJECT, MaxRow(), MaxCol(), Row(), Col(), PRow(), PCol() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -36,13 +16,13 @@ $ARGUMENTS$ none. $DESCRIPTION$ - __XSaveScreen() save the image of the whole screen into an internal + __XSaveScreen() saves the image of the whole screen into an internal buffer, it also save current cursor position. The information could later be restored by __XRestScreen(). Each call to __XSaveScreen() overwrite the internal buffer. - SAVE SCREEN command is preprocessed into __XSaveScreen() function - during compile time. Note that SAVE SCREEN TO is preprocessed into + `SAVE SCREEN` command is preprocessed into __XSaveScreen() function + during compile time. Note that `SAVE SCREEN TO` is preprocessed into SaveScreen() function. __XSaveScreen() is a compatibility function, it is superseded by @@ -52,7 +32,6 @@ // save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* - WAIT RESTORE SCREEN $STATUS$ R @@ -68,6 +47,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -83,19 +64,18 @@ $ARGUMENTS$ none. $DESCRIPTION$ - SAVE SCREEN save the image of the whole screen into an internal + `SAVE SCREEN` saves the image of the whole screen into an internal buffer, it also save current cursor position. The information could - later be restored by REST SCREEN. Each call to SAVE SCREEN + later be restored by `RESTORE SCREEN`. Each call to `SAVE SCREEN` overwrite the internal buffer. - SAVE SCREEN command is preprocessed into __XSaveScreen() function - during compile time. Note that SAVE SCREEN TO is preprocessed into + `SAVE SCREEN` command is preprocessed into __XSaveScreen() function + during compile time. Note that `SAVE SCREEN TO` is preprocessed into SaveScreen() function. $EXAMPLES$ // save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* - WAIT RESTORE SCREEN $STATUS$ R @@ -109,6 +89,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -124,13 +106,13 @@ $ARGUMENTS$ none. $DESCRIPTION$ - __XRestScreen() restore saved image of the whole screen from an + __XRestScreen() restores saved image of the whole screen from an internal buffer that was saved by __XSaveScreen(), it also restore cursor position. After a call to __XRestScreen() the internal buffer is cleared. - RESTORE SCREEN command is preprocessed into __XRestScreen() function - during compile time. Note that RESTORE SCREEN FROM is preprocessed + `RESTORE SCREEN` command is preprocessed into __XRestScreen() function + during compile time. Note that `RESTORE SCREEN FROM` is preprocessed into RestScreen() function. __XRestScreen() is a compatibility function, it is superseded by @@ -139,7 +121,6 @@ // save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* - WAIT RESTORE SCREEN $STATUS$ R @@ -155,6 +136,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Command $NAME$ @@ -170,19 +153,18 @@ $ARGUMENTS$ none. $DESCRIPTION$ - Rest Screen restore saved image of the whole screen from an - internal buffer that was saved by Save Screen, it also restore - cursor position. After a call to Rest Screen the internal buffer - is cleared. + `RESTORE SCREEN` restores saved image of the whole screen from an + internal buffer that was saved by `SAVE SCREEN`, it also restore + cursor position. After a call to 'RESTORE SCREEN` the internal + buffer is cleared. - RESTORE SCREEN command is preprocessed into __XRestScreen() function - during compile time. Note that RESTORE SCREEN FROM is preprocessed + `RESTORE SCREEN` command is preprocessed into __XRestScreen() function + during compile time. Note that `RESTORE SCREEN FROM` is preprocessed into RestScreen() function. $EXAMPLES$ // save the screen, display list of files than restore the screen SAVE SCREEN DIR *.* - WAIT RESTORE SCREEN $STATUS$ R @@ -196,6 +178,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -214,20 +198,20 @@ If is an array of Character strings, each element would be displayed in a new line. If is a Character string, you could split the message to several lines by placing - a semicolon (;) in the desired places. + a semicolon `;` in the desired places. Array with available response. Each element should be - Character string. If omitted, default is { "Ok" }. + Character string. If omitted, default is `{ "Ok" }`. Color string to paint the dialog box with. - If omitted, default color is "W+/R". + If omitted, default color is `"W+/R"`. Number of seconds to wait to user response before abort. Default value is 0, that wait forever. $RETURNS$ Alert() return Numeric value representing option number chosen. - If ESC was pressed, return value is zero. + If was pressed, return value is zero. The return value is NIL if Alert() is called with no parameters, or if type is @@ -236,10 +220,10 @@ $DESCRIPTION$ Alert() display simple dialog box on screen and let the user select one option. The user can move the highlight bar using arrow keys or - TAB key. To select an option the user can press ENTER, SPACE or the + key. To select an option the user can press , or the first letter of the option. - If the program is executed with the //NOALERT command-line switch, + If the program is executed with the `//NOALERT` command-line switch, nothing is displayed and it simply returns NIL. This switch could be overridden with __NoNoAlert(). @@ -250,12 +234,12 @@ LOCAL cMessage, aOptions, nChoice // harmless message - cMessage := "Major Database Corruption Detected!;" + ; - "(deadline in few hours);;" + ; + cMessage := "Major Database Corruption Detected!;" + ; + "(deadline in few hours);;" + ; "where DO you want to go today?" // define response option - aOptions := { "Ok", "www.jobs.com", "Oops" } + aOptions := { "Ok", "www.example.org", "Oops" } // show message and let end user select panic level nChoice := Alert( cMessage, aOptions ) @@ -263,7 +247,7 @@ CASE nChoice == 0 // do nothing, blame it on some one else CASE nChoice == 1 - ? "Please call home and tell them you're gonn'a be late" + ? "Please call home and tell them you're going to be late" CASE nChoice == 2 // make sure your resume is up to date CASE nChoice == 3 @@ -290,10 +274,10 @@ src/rtl/alert.prg the Left-Mouse button could be used to select an option. - The interpretation of the //NOALERT command-line switch is done only + The interpretation of the `//NOALERT` command-line switch is done only if HB_CLP_UNDOC was define during compilation of src/rtl/alert.prg - is a Harbour extension, or at least un-documented + is a Harbour extension, or at least undocumented in Clipper 5.2 NG. is a Harbour extension. @@ -305,6 +289,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -314,13 +300,13 @@ $SUBCATEGORY$ User interface $ONELINER$ - Override //NOALERT command-line switch + Override `//NOALERT` command-line switch $SYNTAX$ __NoNoAlert() $ARGUMENTS$ This function takes no arguments. $DESCRIPTION$ - The //NOALERT command-line switch cause Clipper to ignore calls to + The `//NOALERT` command-line switch cause Cl*pper to ignore calls to the Alert() function, this function override this behavior and always display Alert() dialog box. $EXAMPLES$ @@ -359,9 +345,9 @@ (or thinks it is running on, if an OS emulator is being used). Under HB_OS_UNIX operating system the return value is the - Line-Feed character (0x0a, Chr( 10 ) ); with other operating systems + Line-Feed character (0x0a, `Chr( 10 )` ); with other operating systems (like DOS) the return value is the Carriage-Return plus Line-Feed - characters (0x0d 0x0a, Chr( 13 ) + Chr( 10 )). + characters (0x0d 0x0a, `Chr( 13 ) + Chr( 10 )`). $EXAMPLES$ // Get the newline character(s) for the current OS. OutStd( "Hello World!" + hb_eol() ) @@ -381,6 +367,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) $TEMPLATE$ Function $NAME$ @@ -390,9 +378,9 @@ $SUBCATEGORY$ Terminal $ONELINER$ - Extract one color from a full colorspec string. + Extract one color from a full color-spec string. $SYNTAX$ - hb_ColorIndex( , ) --> + hb_ColorIndex( , ) --> cColor $ARGUMENTS$ is a color list @@ -409,7 +397,8 @@ a given item from this list. You may use the manifest constants defined in color.ch to identify and extract common colors. $EXAMPLES$ - ? hb_ColorIndex( "W/N, N/W", CLR_ENHANCED ) // "N/W" + #include "color.ch" + ? hb_ColorIndex( "W/N, N/W", CLR_ENHANCED ) // --> "N/W" $STATUS$ R $COMPLIANCE$ @@ -422,6 +411,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 David G. Holm $TEMPLATE$ Procedure $NAME$ @@ -446,7 +437,7 @@ using the default transformation for the type of expression. $EXAMPLES$ // Output a negative dollar amount using debit notation. - DevOutPict( -1.25, "@D$ 99,999.99 ) // -> $( 1.25) + DevOutPict( -1.25, "@D$ 99,999.99 ) // --> $( 1.25) $STATUS$ R $COMPLIANCE$ @@ -460,6 +451,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -471,7 +464,7 @@ $ONELINER$ Stops application $SYNTAX$ - __Input( ) --> + __Input( ) --> cString $ARGUMENTS$ is any valid expression. $RETURNS$ @@ -491,6 +484,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -506,9 +501,9 @@ $ARGUMENTS$ is either "PRINTER" (note the uppercase) in which console output is SET to PRINTER, or a name of a text file with a default - ".txt" extension, that is used to redirect console output. + `.txt` extension, that is used to redirect console output. $DESCRIPTION$ - __TextSave() is used in the preprocessing of the TEXT TO command to + __TextSave() is used in the preprocessing of the `TEXT TO` command to redirect the console output while saving old settings that can be restored later by __TextRestore(). $STATUS$ @@ -525,6 +520,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -557,6 +554,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Jose Lalin $TEMPLATE$ Function $NAME$ @@ -568,7 +567,7 @@ $ONELINER$ Stops the application until a key is pressed. $SYNTAX$ - __Wait( ) --> + __Wait( ) --> cKey $ARGUMENTS$ is a string. $RETURNS$ @@ -577,10 +576,11 @@ This function stops the application until a key is pressed. The key must be in the range 32..255. Control keys are not processed. $EXAMPLES$ + LOCAL cKey // Wait for a key stroke __Wait( "Press a key to continue" ) - // - DO WHILE !( cKey == "Q" ) + + DO WHILE ! cKey == "Q" cKey := __Wait( "Press 'Q' to continue" ) ENDDO $STATUS$ @@ -595,6 +595,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -613,7 +615,7 @@ $DESCRIPTION$ OutStd() write one or more values into the standard output device. Character and Memo values are printed as is, Dates are printed - according to the SET DATE FORMAT, Numeric values are converted to + according to the `SET DATE FORMAT`, Numeric values are converted to strings, Logical values are printed as .T. or .F., NIL are printed as NIL, values of any other kind are printed as empty string. There is one space separating each two values. Note that Numeric value can @@ -621,14 +623,14 @@ source (see Str() for detail). OutStd() is similar to QQOut() with the different that QQOut() send - its output to the Harbour console stream, which can or can not be + its output to the Harbour console stream, which can or cannot be redirected according with the screen driver, and OutStd() send its output to the standard output device (STDOUT) and can be redirected. $EXAMPLES$ - OutStd( "Hello" ) // Result: Hello + OutStd( "Hello" ) // --> Hello OutStd( 1, .T., NIL, "A" ) - OutStd( "B" ) // Result: 1 .T. NIL AB + OutStd( "B" ) // --> 1 .T. NIL AB $STATUS$ R $COMPLIANCE$ @@ -638,11 +640,13 @@ $FILES$ Library is core $SEEALSO$ - ?, ??, DevOut(), DevOutPict(), DispOut(), DispOutAt(), OutErr(), QOut(), QQOut(), Str() + ?|??, DevOut(), DevOutPict(), DispOut(), DispOutAt(), OutErr(), QOut(), QQOut(), Str() $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2000 Chen Kedem $TEMPLATE$ Procedure $NAME$ @@ -661,17 +665,17 @@ $DESCRIPTION$ OutErr() write one or more values into the standard error device. Character and Memo values are printed as is, Dates are printed - according to the SET DATE FORMAT, Numeric values are converted to + according to the `SET DATE FORMAT`, Numeric values are converted to strings, Logical values are printed as .T. or .F., NIL are printed as NIL, values of any other kind are printed as empty string. There is one space separating each two values. Note that Numeric value can take varying length when converted into string depending on its source (see Str() for detail). - There is an undocumented CA-Cl*pper command-line switch //STDERR + There is an undocumented CA-Cl*pper command-line switch `//STDERR` which can set the file handle to write output from OutErr(). If not - specified the default STDERR is used, //STDERR or //STDERR:0 set - OutErr() to output to the same file handle as OutStd(), //STDERR:n + specified the default STDERR is used, `//STDERR` or `//STDERR:0` set + OutErr() to output to the same file handle as OutStd(), `//STDERR:n` set output to file handle n. Like other undocumented features this switch is available only if src/rtl/console.c was compiled with the HB_CLP_UNDOC flag. @@ -687,11 +691,13 @@ $FILES$ Library is core $SEEALSO$ - ?, ??, DevOut(), DevOutPict(), DispOut(), DispOutAt(), OutStd(), QOut(), QQOut(), Str() + ?|??, DevOut(), DevOutPict(), DispOut(), DispOutAt(), OutStd(), QOut(), QQOut(), Str() $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Procedure $NAME$ @@ -713,16 +719,17 @@ Once completed, the values of PRow() and PCol(), the row and column indicators to the printer, will be set to 0. Their values, however, may - be manipulated before or after ussuing an EJECT by using the DevPos() + be manipulated before or after issuing an EJECT by using the DevPos() function. On compile time this command is translated into __Eject() function. $EXAMPLES$ - USE clients NEW + LOCAL Curpos + USE test NEW SET DEVICE TO PRINTER - CurPos := 0 + Curpos := 0 DO WHILE ! Eof() - ? clients->NAME, clients->ADDRESS + ? test->first, test->last Curpos++ IF Curpos > 59 Curpos := 0 @@ -730,7 +737,6 @@ ENDIF ENDDO SET DEVICE TO SCREEN - dbCloseArea() $STATUS$ R $COMPLIANCE$ @@ -743,6 +749,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -778,6 +786,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -813,6 +823,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -822,13 +834,13 @@ $SUBCATEGORY$ Terminal $ONELINER$ - Returns the maximun number of columns in the current video mode + Returns the maximum number of columns in the current video mode $SYNTAX$ MaxCol() --> nPosition $ARGUMENTS$ None. $RETURNS$ - The maximun number of columns possible in current video + The maximum number of columns possible in current video mode $DESCRIPTION$ This function returns the current cursor column position. The value @@ -849,6 +861,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ @@ -864,7 +878,7 @@ $ARGUMENTS$ None. $RETURNS$ - The maximun number of rows possible in current video + The maximum number of rows possible in current video mode $DESCRIPTION$ This function returns the current cursor row location. The value diff --git a/doc/en/tlabel.txt b/doc/en/tlabel.txt index abf15a166a..3e5b091760 100644 --- a/doc/en/tlabel.txt +++ b/doc/en/tlabel.txt @@ -1,12 +1,6 @@ -/* - * Copyright 1999 Luiz Rafael Culik - * Documentation - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -30,21 +24,21 @@ This command allows labels to be printed based on the format outlined in LBL file specified as . By default, output will go to the screen however this output may be rerouted with - either the TO PRINTER or the TO FILE clause. + either the `TO PRINTER` or the `TO FILE` clause. - If the TO FILE clause is specified, the name of the ASCII text file + If the `TO FILE` clause is specified, the name of the ASCII text file containing the generated labels will be . If no file extension is specified a .txt extension is added. is the scope condition for this command. Valid scopes - include NEXT (number of records to be displayed, where - is the number of records), RECORD (a specific record to be + include `NEXT ` (number of records to be displayed, where + is the number of records), `RECORD ` (a specific record to be printed), REST (all records starting from the current record position, and ALL (all records). The default is ALL. Both logical expression may work ill conjunction with one another where is the logical expression for the FOR condition (for - records to be displayed whitin a given value range) and for + records to be displayed within a given value range) and for the WHILE condition (for records to be displayed until they fail to meet the condition). @@ -53,15 +47,12 @@ If the NOCONSOLE clause is specified, the console will be turned off while this command is being executed. - This command follows the search criteria outlined in the SET PATH TO + This command follows the search criteria outlined in the `SET PATH TO` command. The path may be specified, along, with (the drive letter, in $EXAMPLES$ - PROCEDURE Main() - USE test NEW - LABEL FORM test.lbl - dbCloseArea() - RETURN + USE test NEW + LABEL FORM test.lbl $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/transfrm.txt b/doc/en/transfrm.txt new file mode 100644 index 0000000000..86ca4e22b9 --- /dev/null +++ b/doc/en/transfrm.txt @@ -0,0 +1,98 @@ +/* $DOC$ + $AUTHOR$ + Copyright 2000 Luiz Rafael Culik + $TEMPLATE$ + Function + $NAME$ + Transform() + $CATEGORY$ + API + $SUBCATEGORY$ + Strings + $ONELINER$ + Formats a value based on a specific picture template. + $SYNTAX$ + Transform( , ) --> cFormatted + $ARGUMENTS$ + Any expression to be formatted. + + Character string with picture template + $RETURNS$ + Formatted expression in character format + $DESCRIPTION$ + This function returns in the format of the picture + expression passed to the function as . + + Their are two components that can make up : a function + string and a template string. Function strings are those functions + that globally tell what the format of should be. These + functions are represented by a single character precede by the + @ symbol. + + There are a couple of rules to follow when using function strings + and template strings: + + - First, a single space must fall between the function template + and the template string if they are used in conjunction with + one another. + + - Second, if both components make up the value of , the + function string must precede the template string. Otherwise, the + function string may appear with out the template string and + vice versa. + + The table below shows the possible function strings available with + the Transform() function. + + + @B Left justify the string within the format. + @C Issue a CR after format is numbers are positive. + @D Put dates in SET DATE format. + @E Put dates in BRITISH format. + @L Make a zero padded string out of the number. + @R Insert non template characters. + @X Issue a DB after format is numbers are negative. + @Z Display any zero as blank spaces. + @( Quotes around negative numbers + @! Convert alpha characters to uppercased format. + + + The second part of consists of the format string. Each + character in the string may be formatted based on using the follow + characters as template markers for the string. + + + A,N,X,9,# Any data type + L Shows logical as "T" or "F" + Y Shows logical as "Y" or "N" + ! Convert to uppercase + $ Dollar sing in place of leading spaces in numeric expression + * Asterisks in place of leading spaces in numeric expression + , Commas position + . Decimal point position + + $EXAMPLES$ + LOCAL cString := "This is harbour" + LOCAL nNumber := 9923.34 + LOCAL nNumber1 := -95842.00 + LOCAL lValue := .T. + LOCAL dDate := Date() + ? "working with String" + ? "Current String is", cString + ? "All uppercased", Transform( cString, "@!" ) + ? "Date is", dDate + ? "Date is", Transform( dDate, "@D" ) + ? Transform( nNumber, "@L 99999999" ) // --> "009923.34" + ? Transform( 0 , "@L 9999" ) // --> "0000" + $STATUS$ + R + $COMPLIANCE$ + The @L function template is a FoxPro/Xbase++ Extension + $PLATFORMS$ + All + $FILES$ + Library is core + $SEEALSO$ + @...SAY, DevOutPict() + $END$ + */ diff --git a/doc/en/treport.txt b/doc/en/treport.txt index 7d65fa6ed1..ef1f0a0b2b 100644 --- a/doc/en/treport.txt +++ b/doc/en/treport.txt @@ -1,12 +1,6 @@ -/* - * Copyright 1999 Luiz Rafael Culik - * Documentation - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Luiz Rafael Culik $TEMPLATE$ Command $NAME$ @@ -36,28 +30,28 @@ Report heading $DESCRIPTION$ This command prints out the report named , which is a - standard FRM file. The file extension is not required because .frm - will be assumed. The SET PATH TO and SET DEFAULT TO commands affect + standard FRM file. The file extension is not required because `.frm` + will be assumed. The `SET PATH TO` and `SET DEFAULT TO` commands affect the search for the file ; unless a drive and path are specified in , REPORT will search the path specified in - the SET PATH command if it cannot find the report form in the + the `SET PATH` command if it cannot find the report form in the current directory. The output of the report will be offset based on the setting of the - SET MARGIN TO value. + `SET MARGIN TO` value. By default, output will go to the console; however, it may be - controlled via either the TO PRINTER or TO FILE clause. If the + controlled via either the `TO PRINTER` or `TO FILE` clause. If the output is to go to the file, the name of the alternate file is specified in . Unless specified in , the default file - extension will be TXT. + extension will be `.txt`. is the scope for this command. Valid scopes include - NEXT (where is the number of records), RECORD + `NEXT ` (where is the number of records), `RECORD ` (a specific record to be displayed), REST (all records from the current record position), and ALL (all records). The default is ALL. - Both logical expressions may work in conjuntion with one another, + Both logical expressions may work in conjunction with one another, where is the logical expression for the FOR condition (for records to be displayed within a given range) and for the WHILE condition (for records to be displayed until the condition @@ -75,7 +69,7 @@ HEADING clause if both are included. If the NOEJECT clause is used, the initial page eject on the report - will not be issued when the output clause TO PRINTER is specified. + will not be issued when the output clause `TO PRINTER` is specified. Otherwise, this clause has no effect. If the SUMMARY Clause is specified, the report will contain only @@ -85,11 +79,8 @@ If the NOCONSOLE clause is specified, output to the console will be turned off while this command is being executed. $EXAMPLES$ - PROCEDURE Main() - USE test NEW - REPORT FORM test.frm - dbCloseArea() - RETURN + USE test NEW + REPORT FORM test.frm $STATUS$ R $COMPLIANCE$ diff --git a/doc/en/typefile.txt b/doc/en/typefile.txt new file mode 100644 index 0000000000..472a206308 --- /dev/null +++ b/doc/en/typefile.txt @@ -0,0 +1,131 @@ +/* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem + $TEMPLATE$ + Function + $NAME$ + __TypeFile() + $CATEGORY$ + API + $SUBCATEGORY$ + Terminal + $ONELINER$ + Show the content of a file on the console and/or printer + $SYNTAX$ + __TypeFile( , [] ) --> NIL + $ARGUMENTS$ + is a name of the file to display. If the file have an + extension, it must be specified (there is no default value). + + is an optional logical value that specifies whether the + output should go only to the screen (.F.) or to both the screen and + printer (.T.), the default is (.F.). + $RETURNS$ + __TypeFile() always return NIL. + $DESCRIPTION$ + __TypeFile() function type the content of a text file on the screen + with an option to send this information also to the printer. The + file is displayed as is without any headings or formatting. + + If contain no path, __TypeFile() try to find the file first + in the `SET DEFAULT` directory and then in search all of the `SET PATH` + directories. If cannot be found a run-time error occur. + + Use `SET CONSOLE OFF` to suppress screen output. + You can pause the output using , press any key to resume. + + __TypeFile() function is used in the preprocessing of the TYPE + command. + $EXAMPLES$ + // The following examples assume a file name `test.txt` exist in all + // specified paths, a run-time error would displayed if it does not + + // display test.txt file on screen + __TypeFile( "test.txt" ) + + // display test.txt file on screen and printer + __TypeFile( "test.txt", .T. ) + + // display test.txt file on printer only + SET CONSOLE OFF + __TypeFile( "test.txt", .T. ) + SET CONSOLE ON + $STATUS$ + R + $COMPLIANCE$ + C + $FILES$ + Library is core + $SEEALSO$ + COPY FILE, SET DEFAULT, SET PATH, SET PRINTER, TYPE + $END$ + */ + +/* $DOC$ + $AUTHOR$ + Copyright 2000 Chen Kedem + $TEMPLATE$ + Command + $NAME$ + TYPE + $CATEGORY$ + Command + $SUBCATEGORY$ + FileSys + $ONELINER$ + Show the content of a file on the console, printer or file + $SYNTAX$ + TYPE [TO PRINTER] [TO FILE ] + $ARGUMENTS$ + is a name of the file to display. If the file have an + extension, it must be specified (there is no default value). + It can be specified as literal file name or as a character + expression enclosed in parentheses. + + `TO PRINTER` is an optional keyword that specifies that the output + should go to both the screen and printer. + + `TO FILE` copy the source also to a file. If no + extension is given `.txt` is added to the output file name. + can be specified as literal file name or as a character + expression enclosed in parentheses. + $DESCRIPTION$ + TYPE command type the content of a text file on the screen + with an option to send this information also to the printer or to + an alternate file. The file is displayed as is without any headings + or formatting. + + If contain no path, TYPE try to find the file first in the + `SET DEFAULT` directory and then in search all of the `SET PATH` + directories. If cannot be found a run-time error occur. + + If contain no path it is created in the `SET DEFAULT` + directory. + + Use `SET CONSOLE OFF` to suppress screen output. + You can pause the output using , press any key to resume. + $EXAMPLES$ + // The following examples assume a file name `test.txt` exist in all + // specified paths, a run-time error would displayed if it does not + + // display test.txt file on screen + TYPE test.txt + + // display test.txt file on screen and printer + TYPE test.txt TO PRINTER + + // display test.txt file on printer only + SET CONSOLE OFF + TYPE test.txt TO PRINTER + SET CONSOLE ON + + // display test.txt file on screen and into a file myreport.txt + TYPE test.txt TO FILE myreport + $STATUS$ + R + $COMPLIANCE$ + C + $SEEALSO$ + COPY FILE, SET DEFAULT, SET PATH, SET PRINTER, __TypeFile() + $END$ + */ diff --git a/doc/en/var.txt b/doc/en/var.txt index 765e39a735..9ef82b39e3 100644 --- a/doc/en/var.txt +++ b/doc/en/var.txt @@ -1,24 +1,6 @@ -/* - * Copyright 1999 Ryszard Glab - * Documentation for: __mvPublic(), __mvPrivate(), __mvXRelease(), - * __mvRelease(), __mvScope(), __mvClear(), - * __mvDbgInfo(), __mvGet(), __mvPut(), MemVarBlock(), - * Type() - * - * Copyright 1999 Chen Kedem - * Documentation for: FieldBlock(), FieldWBlock() - * - * Copyright 2001 Chen Kedem - * Documentation for: __mvExist() - * - * Copyright 2002 Walter Negro - * Documentation for: hb_PIsByRef() - * - * See COPYING.txt for licensing terms. - * - */ - /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -39,14 +21,12 @@ Nothing $DESCRIPTION$ This function can be called either by the Harbour compiler or by user. - The compiler always passes the item of IT_SYMBOL type that stores the + The compiler always passes the item of HB_IT_SYMBOL type that stores the name of variable. If a variable with the same name exists already then the new variable is not created - the previous value remains unchanged. If it is first variable with this name then the variable is initialized with .T. value. - $EXAMPLES$ - None Avaliable $STATUS$ R $COMPLIANCE$ @@ -59,6 +39,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -79,13 +61,11 @@ Nothing $DESCRIPTION$ This function can be called either by the Harbour compiler or by user. - The compiler always passes the item of IT_SYMBOL type that stores the + The compiler always passes the item of HB_IT_SYMBOL type that stores the name of variable. If a variable with the same name exists already then the value of old variable is hidden until the new variable is released. The new variable is always initialized to NIL value. - $EXAMPLES$ - None Avaliable $STATUS$ R $COMPLIANCE$ @@ -96,6 +76,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -125,25 +107,27 @@ a new value to released variable without any side effects. It releases variable even if this variable was created in different - procedure + procedure. $EXAMPLES$ + MEMVAR mPrivate + PROCEDURE Main() PRIVATE mPrivate := "PRIVATE from Main()" - ? mPrivate // PRIVATE from Main() + ? mPrivate // --> PRIVATE from Main() Test() - ? mPrivate // PRIVATE from Main() + ? mPrivate // --> PRIVATE from Main() RETURN - PROCEDURE Main() + STATIC PROCEDURE Test() - PRIVATE mPrivate := "PRIVATE from Main()" + PRIVATE mPrivate := "PRIVATE from Test()" - ? mPrivate // PRIVATE from Main() + ? mPrivate // --> PRIVATE from Test() RELEASE mPrivate - ? mPrivate // NIL + ? mPrivate // --> NIL mPrivate := "Again in Main()" RETURN @@ -157,6 +141,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -179,7 +165,7 @@ Nothing $DESCRIPTION$ This function releases values stored in memory variables. It shouldn't - be called directly, it should be placed into RELEASE ALL command. + be called directly, it should be placed into `RELEASE ALL` command. If the released variable is a PRIVATE variable then previously hidden variable with the same name becomes visible after exit from the procedure where released variable was created. If you access @@ -187,8 +173,6 @@ was created the the NIL value is returned. You can however assign a new value to released variable without any side effects. PUBLIC variables are not changed by this function. - $EXAMPLES$ - None Avaliable $STATUS$ R $COMPLIANCE$ @@ -199,6 +183,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -215,36 +201,41 @@ = a string with a variable name to check $RETURNS$ The symbolic values are defined in hbmemvar.ch - HB_MV_NOT_FOUND =variable is not declared (not found in symbol table) - HB_MV_UNKNOWN =if variable doesn't exist (but found in symbol table) - HB_MV_ERROR =if information cannot be obtained (memory error - or argument error) - HB_MV_PUBLIC =for public variables - HB_MV_PRIVATE_GLOBAL =for private variables declared outside of current - function/procedure - HB_MV_PRIVATE_LOCAL =for private variables declared in current - function/procedure + + HB_MV_NOT_FOUND variable is not declared (not found in symbol table) + HB_MV_UNKNOWN if variable doesn't exist (but found in symbol table) + HB_MV_ERROR if information cannot be obtained (memory error or argument error) + HB_MV_PUBLIC for public variables + HB_MV_PRIVATE_GLOBAL for private variables declared outside of current function/procedure + HB_MV_PRIVATE_LOCAL for private variables declared in current function/procedure + $EXAMPLES$ + #include "hbmemvar.ch" + + MEMVAR pPublic + MEMVAR mPrivateGlobal + MEMVAR mPrivateLocal + PROCEDURE Main() - PUBLIC mPublic + PUBLIC pPublic PRIVATE mPrivateGlobal CallProc() - ? __mvScope( "mPrivateLocal" ) // HB_MV_UNKNOWN + ? __mvScope( "mPrivateLocal" ) // --> HB_MV_UNKNOWN RETURN - PROCEDURE CallProc() + STATIC PROCEDURE CallProc() PRIVATE mPrivateLocal - ? __mvScope( "mPublic" ) // HB_MV_PUBLIC - ? __mvScope( "mPrivateGlobal" ) // HB_MV_PRIVATE_GLOBAL - ? __mvScope( "mPrivateLocal" ) // HB_MV_PRIVATE_LOCAL - ? __mvScope( "mFindMe" ) // HB_MV_NOT_FOUND + ? __mvScope( "pPublic" ) // --> HB_MV_PUBLIC + ? __mvScope( "mPrivateGlobal" ) // --> HB_MV_PRIVATE_GLOBAL + ? __mvScope( "mPrivateLocal" ) // --> HB_MV_PRIVATE_LOCAL + ? __mvScope( "mFindMe" ) // --> HB_MV_NOT_FOUND - IF __mvScope( "mPublic" ) > HB_MV_ERROR + IF __mvScope( "pPublic" ) > HB_MV_ERROR ? "Variable exists" ELSE ? "Variable not created yet" @@ -257,12 +248,12 @@ H $FILES$ Library is core - $SEEALSO$ - include/hbmemvar.ch $END$ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -281,7 +272,7 @@ Nothing $DESCRIPTION$ This function releases all PRIVATE and PUBLIC variables. - It is used to implement CLEAR MEMORY statement. + It is used to implement `CLEAR MEMORY` statement. The memory occupied by all visible variables are released - any attempt to access the variable will result in a runtime error. You have to reuse PRIVATE or PUBLIC statement to create again @@ -298,6 +289,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -312,9 +305,13 @@ __mvDbgInfo( [, [, @] ] ) $ARGUMENTS$ = the scope of variables for which an information is asked - Supported values (defined in hbmemvar.ch) - HB_MV_PUBLIC - HB_MV_PRIVATE (or any other value) + + Supported values (defined in hbmemvar.ch) + + HB_MV_PUBLIC + HB_MV_PRIVATE (or any other value) + + = the position of asked variable on the list of variables with specified scope - it should start from position 1 = the value is filled with a variable name if passed by @@ -331,7 +328,7 @@ If requested variable doesn't exist (requested position is greater then the number of defined variables) then NIL value is - returned and variable name is set to "?" + returned and variable name is set to `?`. The dynamic symbols table is used to find a PUBLIC variable then the PUBLIC variables are always sorted alphabetically. The PRIVATE @@ -340,23 +337,26 @@ Note: Due to dynamic nature of memvar variables there is no guarantee that - successive calls to retrieve the value of PUBLIC variable will + successive calls to retrieve the value of Nth PUBLIC variable will return the value of the same variable. $EXAMPLES$ #include "hbmemvar.ch" + MEMVAR cPublic + MEMVAR cPrivate + MEMVAR ccPublic + MEMVAR ccPrivate + PROCEDURE Main() - LOCAL nCount, i, xValue, cName + LOCAL nCount, tmp, xValue, cName nCount := __mvDbgInfo( HB_MV_PUBLIC ) - FOR i := 1 TO nCount - xValue := __mvDbgInfo( HB_MV_PUBLIC, i, @cName ) - ? i, cName, xValue + FOR tmp := 1 TO nCount + xValue := __mvDbgInfo( HB_MV_PUBLIC, tmp, @cName ) + ? tmp, cName, xValue NEXT - // - ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) @@ -378,9 +378,9 @@ RETURN - PROCEDURE CountMemvars() + STATIC PROCEDURE CountMemvars() - LOCAL i, nCnt, xVal, cName + LOCAL nCount, tmp, xValue, cName PUBLIC ccPublic := "ccPublic" PRIVATE ccPrivate := "ccPrivate" @@ -394,16 +394,16 @@ ? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC ) ? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE ) - nCnt := __mvDbgInfo( HB_MV_PRIVATE ) + 1 - FOR i := 1 TO nCnt - xVal := __mvDbgInfo( HB_MV_PRIVATE, i, @cName ) - ? i, "=", cName, xVal + nCount := __mvDbgInfo( HB_MV_PRIVATE ) + 1 + FOR tmp := 1 TO nCount + xValue := __mvDbgInfo( HB_MV_PRIVATE, tmp, @cName ) + ? tmp, "=", cName, xValue NEXT - nCnt := __mvDbgInfo( HB_MV_PUBLIC ) + 1 - FOR i := 1 TO nCnt - xVal := __mvDbgInfo( HB_MV_PUBLIC, i, @cName ) - ? i, "=", cName, xVal + nCount := __mvDbgInfo( HB_MV_PUBLIC ) + 1 + FOR tmp := 1 TO nCount + xValue := __mvDbgInfo( HB_MV_PUBLIC, tmp, @cName ) + ? tmp, "=", cName, xValue NEXT RETURN @@ -417,6 +417,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2001 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -428,7 +430,7 @@ $ONELINER$ Determine if a given name is a PUBLIC or PRIVATE memory variable $SYNTAX$ - __mvExist( ) --> + __mvExist( ) --> lVariableExist $ARGUMENTS$ - string that specifies the name of variable to check $RETURNS$ @@ -441,11 +443,11 @@ STATIC TheStatic PUBLIC ThePublic PRIVATE ThePrivate - ? __mvExist( "NotExist" ) // .F. - ? __mvExist( "TheLocal" ) // .F. - ? __mvExist( "TheStatic" ) // .F. - ? __mvExist( "ThePublic" ) // .T. - ? __mvExist( "ThePrivate" ) // .T. + ? __mvExist( "NotExist" ) // --> .F. + ? __mvExist( "TheLocal" ) // --> .F. + ? __mvExist( "TheStatic" ) // --> .F. + ? __mvExist( "ThePublic" ) // --> .T. + ? __mvExist( "ThePrivate" ) // --> .T. $STATUS$ R $COMPLIANCE$ @@ -458,6 +460,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -469,7 +473,7 @@ $ONELINER$ This function returns value of memory variable $SYNTAX$ - __mvGet( ) --> + __mvGet( ) --> xVar $ARGUMENTS$ - string that specifies the name of variable $RETURNS$ @@ -479,7 +483,8 @@ this variable exists otherwise it generates a runtime error. The variable is specified by its name passed as the function parameter. $EXAMPLES$ - FUNCTION MemVarBlock( cMemvar ) + ? ValType( MemVarBlock( "myvar" ) ) + STATIC FUNCTION MemVarBlock( cMemvar ) RETURN {| x | ; iif( PCount() == 0, ; __mvGet( cMemvar ), ; @@ -496,6 +501,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -507,7 +514,7 @@ $ONELINER$ This function set the value of memory variable $SYNTAX$ - __mvGet( [, ] ) --> + __mvPut( [, ] ) --> xValue $ARGUMENTS$ - string that specifies the name of variable - a value of any type that will be set - if it is not @@ -521,7 +528,8 @@ parameter. If a value is not specified then the NIL is assumed $EXAMPLES$ - FUNCTION MemVarBlock( cMemvar ) + ? ValType( MemVarBlock( "myvar" ) ) + STATIC FUNCTION MemVarBlock( cMemvar ) RETURN {| x | ; iif( PCount() == 0, ; __mvGet( cMemvar ), ; @@ -538,6 +546,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -549,7 +559,7 @@ $ONELINER$ Returns a codeblock that sets/gets a value of memvar variable $SYNTAX$ - MemVarBlock( ) --> + MemVarBlock( ) --> bBlock $ARGUMENTS$ - a string that contains the name of variable $RETURNS$ @@ -563,16 +573,12 @@ value of given variable - the passed value is also returned as a value of the codeblock evaluation. $EXAMPLES$ - PROCEDURE Main() + LOCAL cbSetGet + PUBLIC xPublic - LOCAL cbSetGet - PUBLIC xPublic - - cbSetGet := MemVarBlock( "xPublic" ) - Eval( cbSetGet, "new value" ) - ? "Value of xPublic variable", Eval( cbSetGet ) - - RETURN + cbSetGet := MemVarBlock( "xPublic" ) + Eval( cbSetGet, "new value" ) + ? "Value of xPublic variable", Eval( cbSetGet ) $STATUS$ R $COMPLIANCE$ @@ -585,6 +591,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2001 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -616,20 +624,20 @@ Note that FieldBlock() works on the current work area, if you need a specific work area code block use FieldWBlock() instead. $EXAMPLES$ - // open a file named test.dbf that have a field named "name" - LOCAL bFiled := FieldBlock( "name" ) - + // open a file named test.dbf that have a field named "first" + LOCAL bField USE test - ? "Original value of field 'name':", Eval( bField ) + bField := FieldBlock( "first" ) + ? "Original value of field 'first':", Eval( bField ) Eval( bField, "Mr X new name" ) - ? "New value for the field 'name':", Eval( bField ) + ? "New value for the field 'first':", Eval( bField ) $STATUS$ R $COMPLIANCE$ If the block is evaluate and there is no field with the name in the current work area, the code block return NIL. - CA-Cl*pper would raise BASE/1003 error if the field does not exist. + CA-Cl*pper would raise `BASE/1003` error if the field does not exist. $FILES$ Library is core $SEEALSO$ @@ -638,6 +646,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999-2001 Chen Kedem $TEMPLATE$ Function $NAME$ @@ -670,21 +680,20 @@ with the name in work area number , the code block return NIL. $EXAMPLES$ - // this block work on the field "name" that exist on work area 2 - LOCAL bFiled := FieldBlock( "name", 2 ) - // open a file named One in work area 1 - // that have a field named "name" + LOCAL bField + // open a file named 'one' in work area 1 that has a field named "first" SELECT 1 USE one - // open a file named Two in work area 2 - // it also have a field named "name" + // open a file named 'two' in work area 2 that also has a field named "first" SELECT 2 USE two SELECT 1 - ? "Original names:", One->name, Two->name - ? "Name value for file Two:", Eval( bField ) - Eval( bField, "Two has new name" ) - ? "and now:", One->name, Two->name + // this block works on the field "first" that exists on work area 2 + bField := FieldWBlock( "first", 2 ) + ? "Original 'first' values:", one->first, two->first + ? "'first' value for file 'two':", Eval( bField ) + Eval( bField, "'two' has updated 'first'" ) + ? "and now:", one->first, two->first $STATUS$ R $COMPLIANCE$ @@ -700,6 +709,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 1999 Ryszard Glab $TEMPLATE$ Function $NAME$ @@ -711,28 +722,28 @@ $ONELINER$ Retrieves the type of an expression $SYNTAX$ - Type( ) --> + Type( ) --> cRetType $ARGUMENTS$ must be a character expression. $RETURNS$ a string indicating the type of the passed expression. - Meaning + Meaning - "A" Array - "B" Block - "C" Character (string) - "D" Date - "L" Logical - "M" Memo - "N" Numeric - "O" Object - "P" Pointer - "S" Symbol - "U" NIL, local or static variable, or not linked-in function - "UE" syntax error in the expression or invalid arguments - "UI" function with non-reserved name was requested + "A" Array + "B" Block + "C" Character (string) + "D" Date + "L" Logical + "M" Memo + "N" Numeric + "O" Object + "P" Pointer + "S" Symbol + "U" NIL, local or static variable, or not linked-in function + "UE" syntax error in the expression or invalid arguments + "UI" function with non-reserved name was requested
$DESCRIPTION$ This function returns a string which represents the data type @@ -749,26 +760,24 @@ This causes that Type() cannot determine a type of local or static variables - only symbols visible at runtime can be checked. - Notice the subtle difference between TYPE and VALTYPE functions. + Notice the subtle difference between Type() and ValType() functions. ValType() function doesn't call a macro compiler - it simply checks the type of passed argument of any type. Type() requires a string argument with a valid Harbour expression - the data type of this expression is returned. $EXAMPLES$ - ? Type( "{ 1, 2 }" ) // prints "A" - ? Type( "iif( .T., SubStr( "TYPE", 2, 1 ), .F. )" ) // prints "C" - ? Type( "At( "OK", MyUDF() ) > 0" ) // prints "UI" - ? Type( "{ 1, 2 }[ 5 ]" ) // prints "UE" + LOCAL c, cFilter + MEMVAR a, b - //-------------------------------------------------------- + ? Type( "{ 1, 2 }" ) // --> "A" + ? Type( 'iif( .T., SubStr( "TYPE", 2, 1 ), .F. )' ) // --> "C" + ? Type( 'At( "OK", MyUDF() ) > 0' ) // --> "UI" + ? Type( "{ 1, 2 }[ 5 ]" ) // --> "UE" - LOCAL c PRIVATE a := "A", b := "B" - ? Type( "a + b + c" ) // prints: "U" ('C' variable is a local one) + ? Type( "a + b + c" ) // --> "U" ('c' variable is a local one) - //-------------------------------------------------------- - - LOCAL cFilter := Space( 60 ) + cFilter := Space( 60 ) ACCEPT "Enter filter expression:" TO cFilter IF Type( cFilter ) $ "CDLMN" // this is a valid expression @@ -780,9 +789,10 @@ - Incompatibility with CA-Cl*pper: In the following code: + ``` PRIVATE lCond := 0 ? Type( "iof( lCond, 'true', MyUDF() )" ) - + ``` CA-Cl*pper will print "UE" - in Harbour the output will be "UI" - If "UI" is returned then the syntax of the expression is @@ -811,43 +821,41 @@ $ONELINER$ Retrieves the data type of an expression $SYNTAX$ - ValType( ) --> + ValType( ) --> cRetType $ARGUMENTS$ is any valid expression. $RETURNS$ a character indicating the type of the passed expression. - Meaning + Meaning - "A" Array - "B" Block - "C" Character (string) - "D" Date - "L" Logical - "M" Memo - "N" Numeric - "O" Object - "P" Pointer - "S" Symbol - "U" NIL + "A" Array + "B" Block + "C" Character (string) + "D" Date + "L" Logical + "M" Memo + "N" Numeric + "O" Object + "P" Pointer + "S" Symbol + "U" NIL
$DESCRIPTION$ This function returns one character which represents the data type of the argument. $EXAMPLES$ - PROCEDURE Main() - ? ValType( Array( 1 ) ) // "A" - ? ValType( {|| 1 + 1 } ) // "B" - ? ValType( "Harbour" ) // "C" - ? ValType( Date() ) // "D" - ? ValType( .T. ) // "L" - ? ValType( 1 ) // "N" - ? ValType( TBrowse() ) // "O" - ? ValType( hb_idleAdd() ) // "P" Harbour extension - ? ValType( @QOut() ) // "S" Harbour extension - ? ValType( NIL ) // "U" - RETURN + ? ValType( Array( 1 ) ) // --> "A" + ? ValType( {|| 1 + 1 } ) // --> "B" + ? ValType( "Harbour" ) // --> "C" + ? ValType( Date() ) // --> "D" + ? ValType( .T. ) // --> "L" + ? ValType( 1 ) // --> "N" + ? ValType( TBrowse() ) // --> "O" + ? ValType( hb_idleAdd() ) // --> "P" Harbour extension + ? ValType( @QOut() ) // --> "S" Harbour extension + ? ValType( NIL ) // --> "U" $STATUS$ R $COMPLIANCE$ @@ -861,6 +869,8 @@ */ /* $DOC$ + $AUTHOR$ + Copyright 2002 Walter Negro $TEMPLATE$ Function $NAME$ @@ -872,7 +882,7 @@ $ONELINER$ Determine if a parameter is passed by reference. $SYNTAX$ - hb_PIsByRef( nParam ) --> + hb_PIsByRef( nParam ) --> lParamIsByRef $ARGUMENTS$ is the parameter number to test. $RETURNS$ @@ -902,10 +912,10 @@ RETURN STATIC PROCEDURE Test( Arg1, Arg2, Arg3, Arg4 ) - ? hb_PIsByRef( 1 ) // .T. - ? hb_PIsByRef( 2 ) // .T. - ? hb_PIsByRef( 3 ) // .F. - ? hb_PIsByRef( 4 ) // .F. + ? hb_PIsByRef( 1 ) // --> .T. + ? hb_PIsByRef( 2 ) // --> .T. + ? hb_PIsByRef( 3 ) // --> .F. + ? hb_PIsByRef( 4 ) // --> .F. RETURN $STATUS$ S diff --git a/doc/hdr_tpl.txt b/doc/hdr_tpl.txt index b4e23f813c..6549608de8 100644 --- a/doc/hdr_tpl.txt +++ b/doc/hdr_tpl.txt @@ -5,69 +5,12 @@ FILE HEADER TEMPLATE ==================== -/* - * {one-liner description about the purpose of this source file} - * - * Copyright 2010 {list of individual authors and e-mail addresses} - * - * 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, 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; see the file LICENSE.txt. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -FILE HEADER TEMPLATE (OPTIONAL ADDITION FOR PARTIAL COPYRIGHTS) -=============================================================== - -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2010 {name} <{e-mail address}> - * {function or subsystem name} - * - * See COPYING.txt for licensing terms. - * - */ - FUNCTION HEADER TEMPLATE ======================== /* $DOC$ + $AUTHOR$ + Copyright YYYY FirstName LastName $NAME$ StartHere() $CATEGORY$ diff --git a/doc/xhb-diff.txt b/doc/xhb-diff.txt index adb1cac87e..a4e8b2fe32 100644 --- a/doc/xhb-diff.txt +++ b/doc/xhb-diff.txt @@ -68,11 +68,11 @@ sensitive file systems what can be seen in above example where it converts For users which have old Clipper code written for DOS file systems with mixed upper and lower letters in file names used directly or indirectly by procedure name, Harbour provides compile time switches which enable -automatic filename conversions for all files opened by compiler: - -fn[:[l|u]|-] set filename casing (l=lower u=upper) +automatic file name conversions for all files opened by compiler: + -fn[:[l|u]|-] set file name casing (l=lower u=upper) -fd[:[l|u]|-] set directory casing (l=lower u=upper) -fp[:] set path separator - -fs[-] turn filename space trimming on or off (default) + -fs[-] turn file name space trimming on or off (default) This functionality is also local to Harbour so cannot be used with xHarbour as workaround for above problem though it should be easy to add it to this compiler in the future. @@ -81,7 +81,7 @@ Both compilers support runtime switches for file name conversions. SET FILECASE LOWER | UPPER | MIXED SET DIRCASE LOWER | UPPER | MIXED SET DIRSEPARATOR - set( _SET_TRIMFILENAME, ) + Set( _SET_TRIMFILENAME, ) which can be used in programs not intended to work with different file system(s) and with different OS(s). @@ -108,7 +108,7 @@ file system(s) and with different OS(s). s := "abcdefghijk" FOR EACH c IN @s IF c $ "aei" - c := UPPER( c ) + c := Upper( c ) ENDIF NEXT ? s // AbcdEfghIjk @@ -139,7 +139,7 @@ file system(s) and with different OS(s). next endif return - In xHarbour there is function HB_ENUMINDEX() which is supported by + In xHarbour there is function hb_enumIndex() which is supported by Harbour in XHB library. 2. WITH OBJECT / END[WITH] @@ -158,8 +158,8 @@ file system(s) and with different OS(s). return It also uses OOP interface just like FOR EACH, so it's possible to use :__withObject() to access / assign current WITH OBJECT value. - In xHarbour there are functions HB_QWITH(), HB_WITHOBJECTCOUNTER() - and HB_RESETWITH() which are supported by Harbour in XHB library. + In xHarbour there are functions hb_QWith(), hb_WithObjectCounter() + and hb_ResetWith() which are supported by Harbour in XHB library. 3. SWITCH / [ CASE / [EXIT] / ... ] OTHERWISE / END[SWITCH] In Harbour it uses jump table with predefined values what gives @@ -193,7 +193,7 @@ file system(s) and with different OS(s). [ FINALLY ] END TRY gives exactly the same functionality as: - BEGIN SEQUENCE WITH { |e| break(e) } + BEGIN SEQUENCE WITH {| e | Break( e ) } With the exception to SWITCH implementation, in all other statements described above, xHarbour causes performance reduction in PCODE evaluation @@ -207,12 +207,12 @@ different way which does not cause any overhead and slowness for other code. Both compilers support compile time extended codeblocks which allow to use statements but with a little bit different syntax. Harbour uses standard Clipper codeblock delimiters {}, f.e.: - ? eval( { | p1, p2, p3 | + ? Eval( {| p1, p2, p3 | ? p1, p2, p3 return p1 + p2 + p3 }, 1, 2, 3 ) and xHarbour <>, f.e.: - ? eval( < | p1, p2, p3 | + ? Eval( <| p1, p2, p3 | ? p1, p2, p3 return p1 + p2 + p3 >, 1, 2, 3 ) @@ -239,7 +239,7 @@ warning giving unexpected results at runtime: exit return p * 10 > - ?? eval( cb, i ) + ?? Eval( cb, i ) next return It's possible to create many other similar examples which are mostly @@ -257,38 +257,38 @@ like string, date, non integer number or pointer (in Harbour) items. They can be created using => for list of keys and values enclosed inside {}, f.e.: hVal := { "ABC" => 123.45, ; - 100.1 => date(), ; + 100.1 => Date(), ; 100.2 => 10, ; 100 => 5, ; - date()-1 => .t. } + Date()-1 => .t. } and then items can be accessed using [] operator, f.e.: ? hVal[ "ABC" ] // 123.45 ? hVal[ 100 ] // 5 - ? hVal[ date()-1 ] // .t. + ? hVal[ Date()-1 ] // .t. ? hVal[ 100.2 ] // 10 - ? hVal[ 100.1 ] // date() + ? hVal[ 100.1 ] // Date() By default hash items in both compiler support automatic adding new elements on assign operation. It can be disabled using one of hash item functions. -Harbour has additional extension which allows to enable autoadd with default +Harbour has additional extension which allows to enable auto-add with default values also for access operation and reference operator. It also supports well passing hash array items by reference and has some other minor extensions. -xHarbour does not support autoadd on access or reference operations and +xHarbour does not support auto-add on access or reference operations and passing hash array items by reference does not work (see passing array and hash item by reference). Both compilers have set of functions to make different operations on hash arrays which give similar functionality. In Harbour they use HB_H prefix -(f.e. HB_HSCAN()) in xHarbour H prefix (f.e. HSCAN()) +(f.e. hb_HScan()) in xHarbour H prefix (f.e. HScan()) xHarbour has additional functionality which can be enabled for each hash array using HSetAACompatibility() function. It's an index where is stored information about the order in which items were added to hash array and set of functions with HAA prefix to operate on hash array items using this -index instead of real position in hash array, i.e. HAAGETVALUEAT() which -works like HGETVALUEAT(). +index instead of real position in hash array, i.e. haAGetValueAt() which +works like HGetValueAt(). In Harbour such functionality also exists and is enabled by default in all hash array but the internal implementation is completely different. Harbour does not emulate associative arrays by special index which keeps assign order @@ -302,7 +302,7 @@ added to hash array. Harbour emulates HAA*() xHarbour functions in XHB library but only for compatibility with existing xHarbour code. This functionality can be disabled for each hash array in Harbour by -HB_HKEEPORDER() function which sorts key-value pairs in hash array and +hb_HKeepOrder() function which sorts key-value pairs in hash array and removes the access index. @@ -313,7 +313,7 @@ In xHarbour the behavior of references stored in array is reverted in comparison to Clipper or Harbour. In Clipper and Harbour VM executing code like: aVal[ 1 ] := 100 -clears unconditionally 1-st item in aVal array and assigns to it value 100. +clears unconditionally 1st item in aVal array and assigns to it value 100. xHarbour checks if aVal[ 1 ] is an reference and in such case it resolves the reference and then assign 100 to the destination item. On access Clipper and Harbour VM executing code like: @@ -335,9 +335,9 @@ It can be seen in code like: x2 := aParams[ 2 ] x3 := aParams[ 3 ] - x1 := lower( x1 ) + "1" - x2 := lower( x2 ) + "2" - x3 := lower( x3 ) + "3" + x1 := Lower( x1 ) + "1" + x2 := Lower( x2 ) + "2" + x3 := Lower( x3 ) + "3" Harbour and Clipper shows: A B C @@ -349,7 +349,7 @@ but xHarbour: It's not Clipper compatible so in some cases it may cause portability problems. F.e. code like above was used in Clipper as workaround for limited number of parameters (32 in Clipper). But it allows to directly -assign items of arrays returned by hb_aParams() and updating corresponding +assign items of arrays returned by hb_AParams() and updating corresponding variables passed by references (see functions with variable number of parameters below). Anyhow the fact that xHarbour does not have '...' operator which can @@ -358,12 +358,12 @@ named parameters in functions with variable number of parameters causes that reverted references introduce limitation, f.e. it's not possible to make code like: func f( ... ) - local aParams := hb_aParams() - if len( aParams ) == 1 + local aParams := hb_AParams() + if Len( aParams ) == 1 return f1( aParams[ 1 ] ) - elseif len( aParams ) == 2 + elseif Len( aParams ) == 2 return f2( aParams[ 1 ], aParams[ 2 ] ) - elseif len( aParams ) >= 3 + elseif Len( aParams ) >= 3 return f3( aParams[ 1 ], aParams[ 2 ], aParams[ 3 ] ) endif return 0 @@ -407,7 +407,7 @@ only and does not work for SETGET methods. In Harbour it works correctly. This code illustrates the problem: proc main() - local oBrw := tbrowseNew() + local oBrw := TBrowseNew() ? oBrw:autoLite oBrw:autoLite := !oBrw:autoLite ?? "=>", oBrw:autoLite @@ -452,7 +452,7 @@ This simple code illustrates it: AllTrim( Str( Memory( 104 ) ) ) proc main( x ) local n, a - a := array( N_LOOPS ) + a := Array( N_LOOPS ) FREE MEMORY for n := 1 to N_LOOPS a[n] := f( x ) @@ -461,8 +461,8 @@ This simple code illustrates it: return func f(x) local cb, tmp, ref - tmp := space( 60000 ) - if empty( x ) + tmp := Space( 60000 ) + if Empty( x ) cb := {|| .t. } else cb := {|| ref } @@ -490,13 +490,13 @@ illustrates it: local cb, n := 100 mk_block( @cb, @n ) ? "after detaching:" - ? eval( cb ), n + ? Eval( cb ), n return proc mk_block( cb, n ) n := 100 cb := {|| ++n } ? "before detaching:" - ? eval( cb ), n + ? Eval( cb ), n return Above code compiled by Clipper shows: @@ -533,10 +533,10 @@ illustrated by the following example: /*** tst.prg ***/ proc main() - local cb := {|| qout( n + 5 ), qout( f ) } // (*) + local cb := {|| QOut( n + 5 ), QOut( f ) } // (*) field f in table local n := 10 - eval( cb ) + Eval( cb ) return In the line which initializes cb code (*) we are using local variable n @@ -546,10 +546,10 @@ and uses their later declarations. If you compile above code using Clipper with -n -w -es2 switches, i.e. cl tst -n -w -es2 then it's compiled without any compile time warnings or errors. Then -during execution it shows 15 for the first QOUT() function call and +during execution it shows 15 for the first QOut() function call and generates runtime error Error BASE/1002 Alias does not exist: TABLE -for the second QOUT() call. It means that it correctly recognized scope +for the second QOut() call. It means that it correctly recognized scope of both variables and also bound alias TABLE with field F though it was declared one line below codeblock initialization. @@ -614,7 +614,7 @@ i.e. this code: proc main() local n static s := {|| n } - eval( s ) + Eval( s ) return is cleanly compiled by Clipper and Xbase++ but it causes RTE in @@ -632,7 +632,7 @@ named parameters and then unnamed just like in many other languages, f.e.: The unnamed parameters can be used in different statements passing them by '...' operator, f.e. as array items: proc main() - AEval( F( "1", "2", "A", "B", "C" ), {|x, i| qout( i, x ) } ) + AEval( F( "1", "2", "A", "B", "C" ), {|x, i| QOut( i, x ) } ) func f( p1, p2, ... ) ? "P1:", p1 ? "P2:", p2 @@ -648,15 +648,15 @@ or as array indexes: or as function parameters: proc main() info( "test1" ) - info( "test2", 10, date(), .t. ) + info( "test2", 10, Date(), .t. ) proc info( msg, ... ) - qout( "[" + msg +"]: ", ... ) + QOut( "[" + msg +"]: ", ... ) The '...' operator saves references when push parameters and it can be used also in codeblocks, f.e.: - bCode := { | a, b, c, ... | qout( a, b, c ), qout( "[", ..., "]" ) } + bCode := {| a, b, c, ... | QOut( a, b, c ), QOut( "[", ..., "]" ) } -All parameters can be accessed also using hb_aParams() function but +All parameters can be accessed also using hb_AParams() function but in xHarbour it works correctly only for functions which does not use any local parameters or declared with variable number of parameters or when number of declared parameters is not smaller then number of @@ -668,61 +668,61 @@ passed parameters. This code illustrates it: p4("A","B","C") p5("A","B","C") proc p1 - ? procname()+"(), parameters:", pcount() - aeval( hb_aParams(), {|x,i| qout(i,"=>",x) } ) + ? ProcName()+"(), parameters:", PCount() + AEval( hb_AParams(), {|x,i| QOut(i,"=>",x) } ) proc p2 local l - ? procname()+"(), parameters:", pcount() - aeval( hb_aParams(), {|x,i| qout(i,"=>",x) } ) + ? ProcName()+"(), parameters:", PCount() + AEval( hb_AParams(), {|x,i| QOut(i,"=>",x) } ) proc p3(x) - ? procname()+"(), parameters:", pcount() - aeval( hb_aParams(), {|x,i| qout(i,"=>",x) } ) + ? ProcName()+"(), parameters:", PCount() + AEval( hb_AParams(), {|x,i| QOut(i,"=>",x) } ) proc p4(...) - ? procname()+"(), parameters:", pcount() - aeval( hb_aParams(), {|x,i| qout(i,"=>",x) } ) + ? ProcName()+"(), parameters:", PCount() + AEval( hb_AParams(), {|x,i| QOut(i,"=>",x) } ) proc p5(a,b,c,d,e) - ? procname()+"(), parameters:", pcount() - aeval( hb_aParams(), {|x,i| qout(i,"=>",x) } ) + ? ProcName()+"(), parameters:", PCount() + AEval( hb_AParams(), {|x,i| QOut(i,"=>",x) } ) In xHarbour it's only possible to declare all parameters as unnamed, f.e.: func f( ... ) -and then access them using hb_aParams() or PVALUE() (in Harbour it's called -HB_PVALUE()) function. There is no support for named parameters and ... +and then access them using hb_AParams() or PValue() (in Harbour it's called +hb_PValue()) function. There is no support for named parameters and ... operator. In xHarbour due to reverted behavior of references stored in array items -assign operation to items in array returned by hb_aParams() changes +assign operation to items in array returned by hb_AParams() changes corresponding parameters passed by reference. It does not happen in Harbour where item references stored in arrays work like in Clipper. -### HB_ARRAYTOPARAMS() FUNCTION ### +### hb_ArrayToParams() FUNCTION ### ========================================= Harbour has special function which allows to convert array into list of items which can be used as function parameters, array values or array indexes in the same way as '...' operator: - hb_arrayToParams( ) -> [ 1 ] [, [ N ] ] + hb_ArrayToParams( ) -> [ 1 ] [, [ N ] ] i.e.: proc main( ... ) - local aParams := hb_aParams(), n + local aParams := hb_AParams(), n /* remove parameters starting with "--" */ n := 1 - while n < len( aParams ) - if left( aParams[ n ], 2 ) == "--" - hb_adel( aParams, n, .t. ) + while n < Len( aParams ) + if Left( aParams[ n ], 2 ) == "--" + hb_ADel( aParams, n, .t. ) else ++n endif enddo - ? "Public parameters:", hb_arrayToParams( aParams ) + ? "Public parameters:", hb_ArrayToParams( aParams ) return -Note for Clipper users: 'hb_adel( aParams, n, .t. )' in above example -works like 'adel( aParams, n ); asize( aParams, len( aParams ) - 1 )'. +Note for Clipper users: 'hb_ADel( aParams, n, .t. )' in above example +works like 'ADel( aParams, n ); ASize( aParams, Len( aParams ) - 1 )'. This functionality is unique to Harbour and xHarbour does not support -hb_arrayToParams() or similar function. +hb_ArrayToParams() or similar function. @@ -755,20 +755,20 @@ i.e.: By default Harbour is Cl*pper compatible and also generates such compile time error (E0042). Many people do not know about this functionality in Clipper and Harbour -and are quite often surprised when hear about it. +and are quite often surprised when hearing about it. Harbour offers two compiler switches to control this feature. It can be completely disabled by -km compiler switch. - -km => turn off macrotext substitution + -km => turn off macro-text substitution When this switch is used for constant strings with "&" character inside -faster code is generate which does not activate macrocompiler at runtime +faster code is generated which does not activate macro-compiler at runtime so they are taken as is. This switch does not affect real macros. It only changes the runtime behavior of strings constants with "&" -character inside (macrotext). +character inside (macro-text). The second switch -kd extends above functionality and allows to use -macrotexts and macros with declared symbols: +macro-texts and macros with declared symbols: -kd => accept macros with declared symbols It means that also fields, local and static variables can be used in -macrotexts and macros. +macro-texts and macros. The above example compiled with -kd switch does not generate compile time error and final application shows "text" on the screen. When -km switch is used then "&var" is shown by final application. @@ -781,20 +781,20 @@ or: or: ? &cLocalPref.func&cPriv1( cPriv2, &cStatic ) etc. -If it's possible then for macrocodeblocks Harbour compiler tries to +If it's possible then for macro-codeblocks Harbour compiler tries to generate early eval code in which macros are expanded when codeblock is created. Otherwise macros are expanded each time codeblock is evaluated. -In xHarbour macrotext substitution for pure strings is always enabled +In xHarbour macro-text substitution for pure strings is always enabled like in Clipper but it does not detect situation when fields, local -or static variables are used in macrotexts so it does not generate +or static variables are used in macro-texts so it does not generate compile time errors in such case. xHarbour has similar to -kd extension always enabled but limited to macro variables used inside code blocks and it works only if other macros are not used in the same expression. When more complicated examples are used xHarbour compiler generates broken code which causes RTE or GPF during execution. It also does not support -codeblocks which contain mixed macros and refuse to compile such +codeblocks which contain mixed macros and refuses to compile such code. This example illustrates macros with declared symbols. @@ -811,12 +811,12 @@ This example illustrates macros with declared symbols. private nPrivate := 10000 private cPriv1 := "test1", cPriv2 := "abc" #ifndef __XHARBOUR__ - cbVar1 := {|| &cLocal + nPrivate + val( &cStatic ) } + cbVar1 := {|| &cLocal + nPrivate + Val( &cStatic ) } cbVar2 := {|| &cLocalPref.func&cPriv1( cPriv2, &cStatic ) } - ? eval( cbVar1 ) - ? eval( cbVar2 ) + ? Eval( cbVar1 ) + ? Eval( cbVar2 ) #endif - ? &cLocal + nPrivate + val( &cStatic ) + ? &cLocal + nPrivate + Val( &cStatic ) cLocal := "upp" ? &cLocal.er( &cStatic ) ? hb_funcTest1( cPriv2, &cStatic ) @@ -830,7 +830,7 @@ This example illustrates macros with declared symbols. Above code can be compiled by xHarbour but it will not work exploiting some problems in this compiler and generated code. -This feature can be useful also in porting some other xbase compatible +This feature can be useful also in porting some other xBase compatible code to Harbour because some compilers just like xHarbour accepted in some limited way officially unsupported syntax with macros using declared symbols. @@ -844,14 +844,14 @@ Clipper does not. This example shows such macro messages usage: proc main() memvar var - local o := errorNew(), msg := "cargo" + local o := ErrorNew(), msg := "cargo" private var := "CAR" o:&msg := "" o:&var.go += "" o:&msg += "" o:&( msg ) += "" - o:&( upper( msg ) ) += "" + o:&( Upper( msg ) ) += "" xHarbour does not support macro messages in assignment context. Older xHarbour versions for macro messages with = operators @@ -863,9 +863,9 @@ depends on the used context. -### MULTIVALUE MACROS ### -=============================== -In the early Harbour days was added basic support for multivalue macros +### MULTI-VALUE MACROS ### +================================ +In the early Harbour days was added basic support for multi-value macros which can be evaluated to list of values, f.e.: ? &("1,2,3") should show: @@ -873,14 +873,14 @@ should show: The implementation of this extension was not accepted by many of Harbour developers and it was one of the main reasons of the xHarbour fork. In Harbour it was later fully removed and implemented from scratch using -different internal algorithms and structures. Now Harbour supports multivalue +different internal algorithms and structures. Now Harbour supports multi-value macros in code like: proc main() local s1 := "'a', 'b', 'c'", s2 := "1,3", a ? &s1 a := { { "|", &s1, 'x', &s2, 'y' }, 'x', &s2 } ? "a[1] items:" - aeval( a[1], { |x,i| qout( i, x ) } ) + AEval( a[ 1 ], {| x, i | QOut( i, x ) } ) ? "a["+s2+"] =>", a[ &s2 ] return @@ -902,9 +902,9 @@ This code can be compiled and executed by both compilers: proc main() local s := "ABCDEFG" ? s, "=>", s[2], s[4], s[6] - s[2] := lower( s[2] ) - s[4] := lower( s[4] ) - s[6] := lower( s[6] ) + s[2] := Lower( s[2] ) + s[4] := Lower( s[4] ) + s[6] := Lower( s[6] ) ?? " =>", s return @@ -924,7 +924,7 @@ for strings in XHB.LIB for his own preferences removing the RTE. ============================================================================ xHarbour supports negative indexes in [] operator. They are used to access items from tail, f.e. aVal[ -1 ] is the same as -aVal[ len( aVal ) ] or ATail( aVal ). +aVal[ Len( aVal ) ] or ATail( aVal ). By default Harbour core code does not give such functionality but it has strong enough OOP API to allow adding such extension without touching core code even by user at .prg level. It was implemented @@ -963,7 +963,7 @@ This code can be compiled and executed by both compilers: #endif proc main() local c := "A" - ? c * 10, c - 10, c + 10, c * " ", chr( 2 ) ^ "!" + ? c * 10, c - 10, c + 10, c * " ", Chr( 2 ) ^ "!" return and gives the same results. @@ -971,11 +971,11 @@ Anyhow the emulation is not full here. It works only for .prg code. In xHarbour standard C API functions/macros were modified to use one byte string items as numbers. It's potential source of very serious problems, f.e. ordSetFocus("1") should chose index called "1" or maybe -index 49 or what should return ascan( {49,"1"}, "1" ) (1 or 2)? so +index 49 or what should return AScan( {49,"1"}, "1" ) (1 or 2)? so Harbour developers decided to not add anything like that to core code so in Harbour functions written in C refuse to accept one byte string as number and code like - ? str( "0" ) + ? Str( "0" ) generates runtime error instead of printing ' 48'. @@ -1020,7 +1020,7 @@ In Harbour and xHarbour $ operator can be used to check if some key or hash pair belongs to hash, f.e.: ? "abc" $ { "qwe"=>100, "abc"=>200, "zxc"=>300 } In xHarbour $ operator can be also used to check if value belongs -to array. It works like ASCAN() but with exact comparison for strings, +to array. It works like AScan() but with exact comparison for strings, f.e.: ? "abc" $ { "qwe", "abc", "zxc" } // result .T. ? "a" $ { "qwe", "abc", "zxc", { "a" } } // result .F. @@ -1044,10 +1044,10 @@ Warning! Xbase++ also supports $ operator for arrays but it makes non should create own code to overload $ operators used for arrays which will follow exact Xbase++ rules. CLIP also has some code for such extension but it has two bugs. - 1-st is a semi bug: it uses non exact comparison but reverts + 1st is a semi bug: it uses non exact comparison but reverts arguments so ` "abc" $ { "a" } ' gives .T. - 2-nd which is critical: it has wrong stop condition so does - not stop scanning when locates 1-st matching item. It should + 2nd which is critical: it has wrong stop condition so does + not stop scanning when locates 1st matching item. It should be fixed and I do not know what will be the final CLIP behavior. @@ -1064,11 +1064,11 @@ Harbour does not have such operators but it has set of bit functions (HB_BIT*()) which are fully optimized at compile time giving such functionality without extending language syntax and introducing new operators: - & => HB_BITAND( , ) - | => HB_BITOR( , ) - ^^ => HB_BITXOR( , ) - << => HB_BITSHIFT( , ) - >> => HB_BITSHIFT( , - ) + & => hb_bitAnd( , ) + | => hb_bitOr( , ) + ^^ => hb_bitXor( , ) + << => hb_bitShift( , ) + >> => hb_bitShift( , - ) @@ -1078,9 +1078,9 @@ xHarbour has three operators defined as identifier: IN, HAS, LIKE IN is synonym of $ operator and it's translated by lexer to $. It does not give any new functionality. For portable code use $. HAS and LIKE are regular expressions operators. In Harbour they have -the same functionality as HB_REGEXHAS() and HB_REGEXLIKE() functions: - HAS => HB_REGEXHAS( , ) - LIKE => HB_REGEXLIKE( , ) +the same functionality as hb_regexHas() and hb_regexLike() functions: + HAS => hb_regexHas( , ) + LIKE => hb_regexLike( , ) Using identifiers as operators is not compatible with Clipper preprocessor precedence rules and introduces bugs to language syntax so Harbour will @@ -1140,12 +1140,12 @@ Here is simple code which illustrates it: proc main() local a, i, n - a := afill( array( 10 ), 100 ) + a := AFill( Array( 10 ), 100 ) i := n := 0 - while i < len( a ) + while i < Len( a ) a[ ++i ] -= n++ enddo - aeval( a, { |x| qout( x ) } ) + AEval( a, {| x | QOut( x ) } ) return This problem is also fixed in Xbase++ so it's possible to exchange code @@ -1167,7 +1167,7 @@ are send to exactly the same object. This example illustrates it: proc main() local o - o := errorNew() + o := ErrorNew() ? "assign..." ?? f( o ):cargo := 0 ? "predec..." @@ -1181,7 +1181,7 @@ are send to exactly the same object. This example illustrates it: In Harbour and Xbase++ function F() is executed only once for each expression but in Clipper and xHarbour once for 'assign', then twice for -'predec' and finaly three times for 'postinc'. In this code function f() +'predec' and finally three times for 'postinc'. In this code function f() returns the same object 'o' on each call so it's not a problem but code where the expression can return different objects will not work correctly so OOP programmers working with Clipper or xHarbour should remember about @@ -1194,12 +1194,12 @@ it and not create such code. xHarbour supports application wide static variables called GLOBALs. To declare GLOBAL variable you have to put GLOBAL [ := ] -before the 1-st function in compiled .prg module and use -n compiler +before the 1st function in compiled .prg module and use -n compiler switch. In xHarbour GLOBAL variables cannot be declared inside function body. If user wants to use GLOBAL variable in different .prg module then he has to add declaration GLOBAL EXTERNAL -to his code before the 1-st function in compiled .prg module and use +to his code before the 1st function in compiled .prg module and use -n compiler switch. Also, GLOBAL EXTERNAL declaration cannot be used in function body. Unlike other variables GLOBALs declared in xHarbour reserve used names so they cannot be used in the same module in local @@ -1226,7 +1226,7 @@ Harbour does not support GLOBALs. Both compilers support DATETIME/TIMESTAMP values though they use different implementation. -In Harbour it's new type TIMESTAMP for which VALTYPE() function returns +In Harbour it's new type TIMESTAMP for which ValType() function returns "T". It has its own HVM arithmetic similar to the one used by DATE type but not exactly the same. The difference (-) between two TIMESTAMP values is represented as number where integer part is number of days and fractional @@ -1264,7 +1264,7 @@ In xHarbour DATE type was extended to hold information about time. Clipper compatible DATE arithmetic in HVM was modified to respect fractional part in numbers which was used for time part. The xHarbour DATETIME implementation introduces incompatibilities to Clipper -(f.e. compare Clipper and xHarbour results in code like: '? date() + 1.125' +(f.e. compare Clipper and xHarbour results in code like: '? Date() + 1.125' so in some cases existing Clipper code has to be carefully adopted to work correctly with xHarbour but it's fully functional solution though it needs some minor fixes in conversions between datetime values and numbers. @@ -1272,10 +1272,10 @@ some minor fixes in conversions between datetime values and numbers. The difference between Harbour and xHarbour can be seen in this code: proc main() local dVal, tVal - dVal := date() + dVal := Date() tVal := dVal + {^ 02:00 } // {^ 02:00 } timestamp // constant, see below - ? valtype(dVal), valtype(tVal) + ? ValType(dVal), ValType(tVal) ? dVal; ? tVal dVal += 1.125 // In Clipper and Harbour it increases // date value by 1 @@ -1283,7 +1283,7 @@ The difference between Harbour and xHarbour can be seen in this code: // and 6 hours ? dVal; ? tVal ? dVal = tVal // In Harbour .T. because date part is the same - ? date() + 0.25, date() + 0.001 == date() + ? Date() + 0.25, Date() + 0.001 == Date() return Harbour shows: D T @@ -1331,15 +1331,15 @@ gives the same results as: Harbour does not set any default date value when timestamp constant contains only time part. Harbour supports VFP syntax only in Compiler. It's not supported in -macrocompiler and it can be disabled in the future so it's not suggested +macro-compiler and it can be disabled in the future so it's not suggested to use with Harbour programs. -Only Harbour supports date constant (in compiler and macrocompiler) in the +Only Harbour supports date constant (in compiler and macro-compiler) in the form d"YYYY-MM-DD" f.e.: d"2009-05-20" Also delimiter "/" or "." can be used instead of "-". -Only Harbour supports timestamp constant (in compiler and macrocompiler) +Only Harbour supports timestamp constant (in compiler and macro-compiler) in the form t"YYYY-MM-DD HH:MM:SS.fff" The exact accepted timestamp pattern is is: YYYY-MM-DD [H[H][:M[M][:S[S][.f[f[f[f]]]]]]] [PM|AM] @@ -1353,39 +1353,39 @@ f.e.: The following characters can be used as date delimiters: "-", "/", "." if PM or AM is used HH is in range < 1 : 12 > otherwise in range < 0 : 23 > -Harbour compiler and macrocompiler support also date constants in the +Harbour compiler and macro-compiler support also date constants in the form 0dYYYYMMDD f.e.: 0d20090520. -### EXTENDED LITERAL STRING IN COMPILER AND MACROCOMPILER ### -=================================================================== +### EXTENDED LITERAL STRING IN COMPILER AND MACRO-COMPILER ### +==================================================================== Harbour and xHarbour support extended strings with C like escaped values as e"...", f.e.: ? e"Helow\r\nWorld \x21\041\x21\000abcdefgh" -They works in compiler and macrocompiler but xHarbour macrocompiler does +They works in compiler and macro-compiler but xHarbour macro-compiler does not support strings with embedded 0 so they are not fully functional here. ### SYMBOL ITEMS AND FUNCTION REFERENCES ### ================================================== -Harbour supports SYMBOL items ( VALTYPE(funcSym) == "S" ) which can be used +Harbour supports SYMBOL items ( ValType(funcSym) == "S" ) which can be used as function or message references. They have similar functionality to SYMBOL objects in Class(y) and understands NAME, EXEC and EVAL messages. They can be created literally by compiler using @(), f.e: - funcSym := @str() + funcSym := @Str() and in such case they also create explicit reference (link time binding) to given functions or by macro compiler, f.e.: - funcSym := &("@upper()") + funcSym := &("@Upper()") what does not create any explicit bindings. This is simple code which uses symbol items: proc main() local funcSym - funcSym := @str() + funcSym := @Str() ? funcSym:name, "=>", funcSym:exec( 123.456, 10, 5 ) - funcSym := &("@upper()") + funcSym := &("@Upper()") ? funcSym:name, "=>", funcSym:exec( "Harbour" ) return @@ -1393,9 +1393,9 @@ xHarbour does not have such functionality though it can create at compile time function references using a little bit different syntax: ( @([]) ) the different syntax is side effect of bugs in grammar rules only and -probably will be fixed somewhere (macrocompiler does not support such +probably will be fixed somewhere (macro-compiler does not support such syntax at all). -In xHarbour above code creates pointer item ( VALTYPE(funcSym) == "P" ) +In xHarbour above code creates pointer item ( ValType(funcSym) == "P" ) which can be used in some cases like in Harbour but because xHarbour VM does not know if given pointer item is function reference or not then in such context xHarbour has to accept any pointer items as function @@ -1419,7 +1419,7 @@ at runtime. In Harbour and xHarbour 'AS ' has to be repeated after each variable so in above code only var2 is strongly typed but not var1. To declare both variables as logical ones it should be changed to: LOCAL var1 AS STRING, var2 AS STRING -and to make implicit initialication user has to write code like: +and to make implicit initialization user has to write code like: LOCAL var1 AS STRING := "foo", var2 AS STRING := "bar" instead of: LOCAL var := "foo", var2 := "bar" AS STRING @@ -1429,7 +1429,7 @@ Such syntax is also not compatible with syntax of typed object variables declares both variables as logical ones. This can strongly confuse users so in the future adding fully functional support for strong typed variables probably it will be changed to syntax -compatible with other xBase like languages. +compatible with other xBase-like languages. Now please remember that neither Harbour nor xHarbour make type validation during compilation and at runtime and typed variables are not implicitly initialized to empty value of given type. @@ -1455,13 +1455,13 @@ and: It's also possible to give unprotected access to all other functions declared in the same .prg module just like in xHarbour by using 'MODULE FRIENDLY' clause in class declaration, i.e.: - CLASS myCls FROM parent MODULE FRIENDLY + CREATE CLASS myCls INHERIT parent MODULE FRIENDLY [...] ENDCLASS So in Harbour all scopes aspects are explicitly controlled by programmer and AFAIK there are no side effects forced by internal implementation. Important is also the fact in Harbour each codeblock block created explicitly -or by macrocompiler inherits rights from functions when it was created +or by macro-compiler inherits rights from functions when it was created and then has the same scope. It means that it's not possible to break scope protection using codeblocks and it's very important functionality for real private (hidden) data because it makes it accessible for codeblocks created @@ -1472,8 +1472,8 @@ on module symbol table. -### OOP AND MULTIINHERITANCE ### -====================================== +### OOP AND MULTI-INHERITANCE ### +======================================= Harbour and xHarbour support multiple inheritance just like Class(y). Anyhow only Harbour correctly resolves possible name conflicts by casting. xHarbour and Class(y) in Clipper does not work correctly @@ -1500,7 +1500,7 @@ explicit casting is used. This code illustrate the problem: ? o:var, o:cls1:var, o:cls2:var, o:cls3:var return - CREATE CLASS MYCLS FROM CLS1, CLS2, CLS3 + CREATE CLASS MYCLS INHERIT CLS1, CLS2, CLS3 EXPORTED: VAR VAR ENDCLASS @@ -1540,8 +1540,8 @@ important thing. -### OOP AND PRIVATE/HIDDEN DATAs ### -========================================== +### OOP AND PRIVATE/HIDDEN DATA ### +========================================= In bigger projects where different programmers work on different classes which are later used as ancestors of some new classes it's extremely important to give support for real private (hidden) data for each class programmer @@ -1552,13 +1552,13 @@ big projects such name conflicts can be nightmare a which eliminates some languages. Harbour resolves this problem automatically. All hidden variables and -messages are automatically casted to the class which is the owner of +messages are automatically cast to the class which is the owner of calling code. To make it working Harbour needs fully functional scope -protection and multiinheritance (see OOP SCOPES and OOP AND MULTIINHERITANCE). +protection and multi-inheritance (see OOP SCOPES and OOP AND MULTI-INHERITANCE). Everything is done automatically without any explicit casting or other then declaring variables or methods as HIDDEN source code modification. This code illustrates it. We have two classes and each of them has its own -_private_ 'temp' instance variable and 'set' method. 3-rd class inherits +_private_ 'temp' instance variable and 'set' method. 3rd class inherits from both of them and executes it's public methods which internally access hidden ones but without any explicit casting. In Harbour all is done automatically by HVM: @@ -1572,7 +1572,7 @@ automatically by HVM: WAIT RETURN - CREATE CLASS MYCLS FROM CLS1, CLS2 + CREATE CLASS MYCLS INHERIT CLS1, CLS2 EXPORTED: METHOD ACTION ENDCLASS @@ -1595,7 +1595,7 @@ automatically by HVM: IF ::TEMP == NIL ::TEMP := "C1" ENDIF - ::TEMP += ":" + UPPER( x ) + ::TEMP += ":" + Upper( x ) RETURN Self METHOD PLUS( x ) @@ -1614,7 +1614,7 @@ automatically by HVM: IF ::TEMP == NIL ::TEMP := "c2" ENDIF - ::TEMP -= ">" + LOWER( x ) + ::TEMP -= ">" + Lower( x ) RETURN Self METHOD MINUS( x ) @@ -1674,7 +1674,7 @@ programmer should use: o := mycls():new( p1, p2, p3 ) otherwise the code will not work with future Harbour versions supporting real class objects. Even if programmer do not plan to pass any parameters -to constructor then he shold call :NEW() method: +to constructor then he should call :NEW() method: o := mycls():new() and please remember that :NEW() will be class method so it should not be redefined as constructor in user class. Instead :INIT() method should @@ -1725,7 +1725,7 @@ ENDCLASS definition to: __clsUnlockDef( @s_oClass, oClass ) ;; end sequence ;; oInstance := oClass:Instance() ;; - if __ObjHasMsg( oInstance, "InitClass" ) ;; + if __objHasMsg( oInstance, "InitClass" ) ;; oInstance:InitClass( HB_CLS_PARAM_LIST ) ;; end ;; else ;; @@ -1765,12 +1765,12 @@ initialize numeric and logical values to 0 and .f. ================================ Both Harbour and xHarbour support object destructors and both compilers uses reference counters and garbage collector to -execute destructors. Anyhow the low level implementation is +execute destructors. Anyhow the low-level implementation is different in the two compilers. In Harbour HVM is reentrant safe so the implementation of destructors is much simpler. It also keeps full control about reference counters and detects user code errors bound with complex items in .prg and C code what -greatly helps to detect problems in user code or 3-rd party +greatly helps to detect problems in user code or 3rd party libraries and gives protection against internal HVM memory corruption. In the last years it also helped to located few very hard to exploit bugs in core code. @@ -1787,9 +1787,9 @@ protecting against corruption. The xHarbour version behavior is random because this .prg code corrupts internal HVM memory. It's possible that it will be executed without any visible errors or it will generate GPF or internal error. But in all -cases it can be well seen using tools like valgrind or CodeGuard +cases it can be well seen using tools like Valgrind or CodeGuard that it corrupts internal memory so the results are unpredictable. -I.e. this is part of valgrind log generated during execution +I.e. this is part of Valgrind log generated during execution of above destruct.prg compiled by xHarbour: ==22709== Invalid read of size 2 @@ -1833,7 +1833,7 @@ Harbour executes above code cleanly without any errors: Missing protection and error detection is not only problem for programmers. It also causes that in xHarbour core code few bad bugs have not been fixed so far though they exist for years. It also extremely time consuming problem -for core developers when users or 3-rd party developers reports problems with +for core developers when users or 3rd party developers reports problems with some memory corruption and it's necessary to locate the reason. I remember how much time I lost for such things working on xHarbour in the past so later when I moved to Harbour it was one of the main goal @@ -1881,12 +1881,12 @@ Both compilers uses array and string preallocation to optimize resize operation, f.e. in code like: s := "" for i := 0 to 255 - s += chr( i ) + s += Chr( i ) next or: a := {} for i := 0 to 255 - aadd( a, repl( chr( i ), 5 ) ) + AAdd( a, Replicate( Chr( i ), 5 ) ) next the string inside 's' variable and array inside 'a' variable are not resized 256 times but much seldom. It gives noticeable speed improvement @@ -1911,12 +1911,12 @@ seen in code like: memvar v local t, i, s private v := "" - t := secondsCPU() + t := SecondsCPU() s := "v" for i := 1 to 100000 - &s += l2bin( i ) + &s += L2Bin( i ) next - t := secondsCPU() - t + t := SecondsCPU() - t ? "time:", t, "sec." return it's enough to compare time difference: @@ -1989,7 +1989,7 @@ anything like that at least as documented language extension. ======================== xHarbour has compile time support for namespaces which uses by default static bindings with optional support for dynamic bindings in HVM which -is necessary for .hrb and macrocompiler. To exchange information about +is necessary for .hrb and macro-compiler. To exchange information about defined by user namespaces xHarbour generates .xns files during compilation of .prg ones which define public functions in given namespace. These files are automatically included by xHarbour compiler @@ -2040,8 +2040,8 @@ completely different thing then namespaces in current xHarbour. Harbour allows to initialize more then one GT drivers at runtime and switch between active GTs in single application. It can be done using the following functions: - HB_GTCREATE( , [], [], [] ) -> - HB_GTSELECT( ) -> + hb_gtCreate( , [], [], [] ) -> + hb_gtSelect( ) -> if all references to allocated GT drivers are cleaned in visible items then GT windows is automatically closed. @@ -2077,7 +2077,7 @@ extensively use multi window functionality like GTWVG, GTQTC. Not all GTs in Harbour has been adopted to work simultaneously in multi thread mode with more then one instance so user should not allocate more then one instance of the following GTs GTDOS, GTWIN, GTOS2, GTCRS, GTSLN, -GTPCA, GTALLEG. +GTPCA. These GTs are limited by resources or have alternative GT drivers with similar functionality so it's hard to say if Harbour developers invest @@ -2133,14 +2133,14 @@ are thread local which ones are shared and how they are initialized: - public variable GetList := {} (of course if public variables are not shared with parent thread). - - error block (initialized by calling ERRORSYS()) + - error block (initialized by calling ErrorSys()) - math error handler and math error block - default macro compiler features setting (controlled by - hb_setMacro()) - - RDDI_* settings in core RDDs (some 3-rd party RDDs may use + hb_SetMacro()) + - RDDI_* settings in core RDDs (some 3rd party RDDs may use global settings) - thread static variables - - SETKEY() are reset to empty array (Clipper compatible automatic + - SetKey() are reset to empty array (Clipper compatible automatic binding between F1 key and HELP() if such function/procedure was registered in HVM is done only for main thread). Other thread local resources: @@ -2252,9 +2252,9 @@ that each thread has its own independent work areas and aliases. Anyhow it's possible to move work area from one thread to other one using known from Xbase++ zero space. In Xbase++ each thread can move his work area to zero space using: - DbRelease( [|], [] ) --> lSuccess + dbRelease( [|], [] ) --> lSuccess Then this work area can be attached by other thread using: - DbRequest( [], [], ; + dbRequest( [], [], ; [<@bAreaBlock>], [] ) --> lSuccess In Harbour above functions are available in XPP emulation library. There are also core Harbour functions giving this functionality: @@ -2271,7 +2271,7 @@ and move work area to zero space. Then each thread which wants to make some operations on work area has to encapsulate it in lock/unlock code, i.e.: LOCK WORKAREA "DOCUMENTS" - COUNT TO nInvoices FOR year( DOCUMENTS->DATE ) == year( date() ) + COUNT TO nInvoices FOR Year( DOCUMENTS->DATE ) == Year( Date() ) UNLOCK WORKAREA In xHarbour by default work areas are global to the application and there @@ -2284,10 +2284,10 @@ in xHarbour, i.e. mutexes). Later support for thread local work areas was added to xHarbour but without any mechanism which allows to move work area from one thread to another. This can be controlled by global SET: - SET( _SET_WORKAREAS_SHARED, ) + Set( _SET_WORKAREAS_SHARED, ) or commands: - SET WORKAREAS SHARED => SET( _SET_WORKAREAS_SHARED, .T. ) - SET WORKAREAS PRIVATE => SET( _SET_WORKAREAS_SHARED, .F. ) + SET WORKAREAS SHARED => Set( _SET_WORKAREAS_SHARED, .T. ) + SET WORKAREAS PRIVATE => Set( _SET_WORKAREAS_SHARED, .F. ) (SETs are global not thread local in xHarbour MT model) Setting _SET_WORKAREAS_SHARED to .F. disables global work areas and switches to thread local ones. @@ -2356,22 +2356,22 @@ and in such form it will never be supported by HVM because it can work only in some very limited situations and then can be source of very bad bugs like internal HVM memory corruption or absolutely unexpected runtime behaviors. Compiled PCODE contains references to symbol tables or even -memory addresses (i.e. macrocompiled codeblocks). If application stores +memory addresses (i.e. macro-compiled codeblocks). If application stores such codeblock in some external holder, i.e. memo file then after restoring by different instance of the same application memory addresses can be -different so for macrocompiled codeblocks it's not safe at all. For +different so for macro-compiled codeblocks it's not safe at all. For codeblocks compiled by compiler it can work until exactly the same application is used. But any modifications in the code can change symbol table so after restoring the result can be unpredictable. Codeblock like: - {|x| qout( x ) } -can be defined in code where just after QOUT() in symbol table is FERASE(). + {|x| QOut( x ) } +can be defined in code where just after QOut() in symbol table is FErase(). Small modification in application code can cause that symbols will be -moved and above codeblock after restoring will effectively execute FERASE() -instead of QOUT(). What does it mean for programs which makes something like: - eval( cb, "The most import file is:" ) - eval( cb, cDataFile ) - eval( cb, "Please make backup." ) +moved and above codeblock after restoring will effectively execute FErase() +instead of QOut(). What does it mean for programs which makes something like: + Eval( cb, "The most import file is:" ) + Eval( cb, cDataFile ) + Eval( cb, "Please make backup." ) I do not have to explain. With full respect to xHarbour users IMO such "extension" is giving knife into monkey hands. @@ -2400,7 +2400,7 @@ file server on TCP IP socket. In Harbour it's possible to dynamically register many alternative RDD IO APIs and use them simultaneously in one application. HBNETIO library in Harbour implements this so without touching even -single line in RDD code it works for all core RDDs and also 3-rd +single line in RDD code it works for all core RDDs and also 3rd party ones if they use Harbour RDD IO API (hb_file*() functions). Additionally client and server code in HBNETIO are fully MT safe so can be used in MT programs without any problems. @@ -2415,17 +2415,17 @@ limited only by OS and file format structures. Neither Harbour nor xHarbour introduce own limits here. The maximal file size for DBFs is limited by number of records 2^32-1 = 4294967295 and maximal record size: 2^16-1 = 65535 what -gives nearly 2^48 = 256TB as maximal .dbf file size. +gives nearly 2^48 = 256 TiB as maximal .dbf file size. The maximal memo format size depends on used memo type: DBT, FPT or SMT and size of memo block. It's limited by maximal number of memo blocks = 2^32 and size of memo block so it's 2^32*. The default memo block size for DBT is 512 bytes, FPT - 64 bytes and for SMT 32 bytes. So for standard memo block sizes the maximum are: -DBT->l2TB, FPT->256GB, SMT->128GB. The maximal memo block size in +DBT-> 2 TiB, FPT-> 256 GiB, SMT-> 128 GiB. The maximal memo block size in Harbour is 2^32 and minimal is 1 byte and it can be any value between -1 and 65536 and then any number of 64KB blocks. The last limitation +1 and 65536 and then any number of 64 KiB blocks. The last limitation is introduced as workaround for some wrongly implemented in other -languages memo drivers which were setting only 16 bits in 32bit field +languages memo drivers which were setting only 16 bits in 32-bit field in memo header. Most of other languages has limit for memo block size at 2^15 and the block size has to be power of 2. Some of them also introduce minimal block size limits. If programmers plans to share @@ -2433,25 +2433,25 @@ data with programs compiled by such languages then he should check their documentation to not create memo files which cannot be accessed by them. -Maximal NTX file size for standard NTX files is 4GB and it's limited -by internal NTX structures. Enabling 64bit locking in [x]Harbour change -slightly used NTX format and increase maximum NTX file size to 4TB. +Maximal NTX file size for standard NTX files is 4 GiB and it's limited +by internal NTX structures. Enabling 64-bit locking in [x]Harbour change +slightly used NTX format and increase maximum NTX file size to 4 TiB. The NTX format in [x]Harbour has also many other extensions like support -for multitag indexes or using record number as hidden part of index key +for multi-tag indexes or using record number as hidden part of index key and many others which are unique to [x]Harbour. In practice all of CDX extensions are supported by NTX in [x]Harbour. -The NSX format in [x]Harbour is also limited by default to 4GB but like -in NTX enabling 64bit locking extend this limit to 4TB. It also supports +The NSX format in [x]Harbour is also limited by default to 4 GiB but like +in NTX enabling 64-bit locking extend this limit to 4 TiB. It also supports common to NTX and CDX set of features. -The CDX format is limited to 4GB by it's internal structure. In Harbour -just like in NTX and NSX enabling 64bit locking slightly change the -format increasing maximum index size to 2TB for standard CDX page length +The CDX format is limited to 4 GiB by it's internal structure. In Harbour +just like in NTX and NSX enabling 64-bit locking slightly change the +format increasing maximum index size to 2 TiB for standard CDX page length (512 bytes). DBFCDX and SIXCDX RDDs in Harbour support also user defined index page size. It can be set as power of 2 value from 512 up to 8192. Longer index pages also increase maximum file size. For 8192 bytes pages -maximum CDX file size in Harbour is 32TB. Enabling longer index pages +maximum CDX file size in Harbour is 32 TiB. Enabling longer index pages automatically change internal index format to the same as used with -64bit locking. Longer index pages allow to use longer index key and can +64-bit locking. Longer index pages allow to use longer index key and can interact with total index size and performance. User can make test with different values. Harbour RDDs automatically recognize index format so can open to work with all versions without any user settings. @@ -2481,7 +2481,7 @@ supports few different regular expression libraries and it's possible to use platform or CRTL native libs or PCRE which is included in Harbour. Harbour always uses native for given library API. xHarbour supports only PCRE modified to use POSIX regex interface which does not support strings -with embedded chr(0) characters. +with embedded Chr( 0 ) characters. Both compilers can store and reuse compiled regular expressions. xHarbour stores them in string items and Harbour in GC pointer items. @@ -2492,13 +2492,13 @@ Portable code should respect these differences. ### INET SOCKETS ### ========================== Both compilers support IP4 sockets with similar .prg API created by -Giancarlo Niccolai though both use different low level implementations. +Giancarlo Niccolai though both use different low-level implementations. In xHarbour IP4 functions have Inet*() prefix. In Harbour they have hb_inet*() prefix in core code and xHarbour Inet*() functions are available in XHB library. Harbour has also public C socket API (hbsocket.h) which is not reduced -to IP4 protocols only and is the base low level code used for .prg level +to IP4 protocols only and is the base low-level code used for .prg level [hb_]inet*() function implementation. This socket implementation was rewritten from scratch, it's MT safe and was designed to hide platform differences in BSD socket implementation. It also works in DOS builds @@ -2511,11 +2511,11 @@ This API is available for users also at PRG level by hb_socket*() functions. ========================== Harbour and xHarbour compilers have build-in support for internationalization (I18N) and it's enabled during compilation using -the same compiler time switch -j[] but the low level implementation +the same compiler time switch -j[] but the low-level implementation in compilers and at runtime is completely different. In xHarbour during compilation with -j switch compiler looks for all -call like I18N( ) collects them and then stores them using +call like i18n( ) collects them and then stores them using internal xHarbour binary format in file with .hil. The base name of such file is taken from compiler .prg module or set by user by optional argument of -j switch. If file already exists then strings extracted from @@ -2525,8 +2525,8 @@ checking for duplicated strings. Duplicated strings are eliminated by This programs reads .hil file show all existing strings and allow to type translation for each existing string and then saves the translation table in files with .hit extension using another internal xHarbour binary -format. At runtime application may load .hit file and then I18N() function -will look if string passed as 1-st parameter exists in translation table +format. At runtime application may load .hit file and then i18n() function +will look if string passed as 1st parameter exists in translation table and if yes then it returns translated string and if not it returns original string. Only pure 1 to 1 translation exists without any extensions like context domains, support for plural forms or automatic CP translations. @@ -2562,7 +2562,7 @@ macros instead of direct calls to hb_i18n_[n]gettext*() functions, i.e.: #xtranslate _I( ) => hb_i18n_gettext( ) #xtranslate _IN( ) => hb_i18n_ngettext( ) or: - #xtranslate I18N( ) => hb_i18n_gettext( ) + #xtranslate i18n( ) => hb_i18n_gettext( ) It allows to keep source code shorter and if necessary easy switch to STRICT (for strict parameter validation) or NOOP (disabled at compile time I18N support) versions. @@ -2581,8 +2581,8 @@ runtime gettext support as optional user I18N interface. ================== Harbour RTL gives support at .prg level to ZLIB (HB_Z*()) and GZIP (HB_GZ*()) functions. In xHarbour RTL only ZLIB compression/decompression -is available by: HB_COMPRESS(), HB_UNCOMPRESS(), HB_COMPRESSBUFLEN(), -HB_COMPRESSERROR() and HB_COMPRESSERRORDESC() functions. +is available by: hb_Compress(), hb_Uncompress(), hb_CompressBufLen(), +hb_CompressError() and hb_CompressErrorDesc() functions. In Harbour these functions are available in XHB library. Original Harbour ZLIB API is different. It does not have any non MT safe extensions, it's protected against possible overflows and it's more closer @@ -2592,13 +2592,13 @@ to original ZLIB one. ### SERIAL PORT SUPPORT ### ================================= -Harbour gives common multiplatform PRG and C level API for serial port +Harbour gives common multi-platform PRG and C level API for serial port communication by hb_com*() functions in core libraries. It also implements few other known in Clipper serial port interfaces in contrib libraries -like CT3 COM_*() functions in hbct library or basic support for Telepathy -interface in hbtpathy library. All such implementations use at low level +like CT3 COM_*() functions in hbct library or basic support for Telepath(y) +interface in hbtpathy library. All such implementations use at low-level code the core hb_com*() interface so they can work on all platforms. -xHarbour CVS contains only telepath library with some very basic Telepathy +xHarbour CVS contains only telepath library with some very basic Telepath(y) interface which is not available for all platforms. xHarbour.com distribute also library compatible with CT3 COM*() interface but only for MS-Windows builds. @@ -2615,11 +2615,11 @@ API so it's portable between different OS-es. In Harbour macro compiler supports the same expressions as compiler. The only one and documented difference is support for VFP like datetime constant values {^...} which are supported only by compiler. -It's guaranteed that any valid expressions not longer then 8MB will be +It's guaranteed that any valid expressions not longer then 8 MiB will be cleanly compiled and executed by Harbour. It's possible to compile and execute longer expressions (in practice there is no maximal size limit) but in such case it's not guaranteed that all expressions can be compiled, -f.e. macro expressions containing string constant values longer then 16MB +f.e. macro expressions containing string constant values longer then 16 MiB cannot be compiled. It's only guaranteed that if Harbour cannot compile macro expression then it generates RT error and never generates broken code. @@ -2627,11 +2627,11 @@ code. In xHarbour there are differences between macro compiler and compiler and not all expressions supported at compile time can be used in macro compiler. The maximum size for valid expressions which are always correctly -compiled by xHarbour is 32KB. Expressions longer then 32KB can be compiled +compiled by xHarbour is 32 KiB. Expressions longer then 32 KiB can be compiled without any RT error by xHarbour but it's possible that wrong code will be generated for them which may cause any unpredictable behavior so user should not use such expressions. There is no clean way in xHarbour to check if macro -expression longer then 32KB will be correctly compiled. +expression longer then 32 KiB will be correctly compiled. Just like Clipper neither Harbour nor xHarbour support statements in macro compiler so extended codeblocks also cannot be compiled. @@ -2714,8 +2714,8 @@ future. ========================= Both compilers were ported to many different platforms on different hardware. The list of supported platforms is really long: different *nixes (Linux, -MacOSX, SunOS, HP-UX, *BSD,...) on little and big endian 32 and 64 bit -machines, DOS, OS2, Win32, Win64 and WinCE (Harbour only). +macOS, SunOS, HP-UX, *BSD,...) on little and big-endian 32 and 64-bit +machines, DOS, OS2, Windows (32/64-bit) and WinCE (Harbour only). In practice they can be ported quite easy to nearly each OS and hardware if it passes two important conditions: it's ASCII based machine and has support for 8bit bytes. Due to cleaner code it's easier to port Harbour @@ -2734,13 +2734,13 @@ attribute and does not remove it from returned values. It helps to keep code clean and locate places where string constant values are overwritten what is illegal. It also helps C compiler to better optimize the code because it has additional information that some -variables/memory regions are readonly and cannot be modified during +variables/memory regions are read-only and cannot be modified during code execution what can give some additional speed improvement. If some C code does not respect it then during compilation with Harbour header files C compilers usually generate warning and C++ ones errors, i.e. code like: char * pszValue = hb_parc( 1 ); -is wrong because hb_parc() returns pointer to readonly strings +is wrong because hb_parc() returns pointer to read-only strings which cannot be changed by user code. So this code should be changed to: const char * pszValue = hb_parc( 1 ); @@ -2748,7 +2748,7 @@ Now if compiled code tries to make something like: pszValue[ index ] = 'X'; what is illegal in Harbour, xHarbour and also in Clipper for pointers returned by _parc() function then compiler generate warning or error -about writing to readonly location. +about writing to read-only location. In summary it means that Harbour forces to keep code clean and use more strict declarations but xHarbour and Clipper don't and wrong code can be silently compiled without any warnings or errors. @@ -2783,7 +2783,7 @@ protection it generates exception and application crash. To make the above code safe programmer should change it to: HB_FUNC( NOT ) { - int iValue = ISNUM( 1 ) ? _parni( 1 ) : 0; + int iValue = HB_ISNUM( 1 ) ? _parni( 1 ) : 0; hb_retni( ~iValue ); } or: @@ -2860,7 +2860,7 @@ activation in memory manager. These are only examples and anyone can find many other similar problems in xHarbour core code so in my opinion API separation with core code cleanup is something what has to be done in xHarbour in the future. -Of course such separation does not mean that we can forbid 3-rd party +Of course such separation does not mean that we can forbid 3rd party programmers to access HVM internals. Programmers creating code for Harbour can include before any other Harbour header files "hbvmint.h", i.e.: #include "hbvmint.h" @@ -2972,7 +2972,7 @@ Harbour is ~75% faster in ST mode and over 100% faster in MT mode. In harbour/tests/speedtst.prg we have simple test which can be used to compare performance of different compilers. The tests below were done using AMD Phenom(tm) 8450 Triple-Core Processor -2100 MHZ with 32bit Linux kernels. +2100 MHZ with 32-bit Linux kernels. Here are results for ST mode: @@ -2999,31 +2999,31 @@ Here are results for ST mode: [ T015: x := F_D ]..............................................0.10 [ T016: x := o:Args ]...........................................0.14 [ T017: x := o[2] ].............................................0.10 - [ T018: round( i / 1000, 2 ) ]..................................0.21 - [ T019: str( i / 1000 ) ].......................................0.55 - [ T020: val( s ) ]..............................................0.28 - [ T021: val( a [ i % 16 + 1 ] ) ]...............................0.39 - [ T022: dtos( d - i % 10000 ) ].................................0.33 - [ T023: eval( { || i % 16 } ) ].................................0.36 - [ T024: eval( bc := { || i % 16 } ) ]...........................0.20 - [ T025: eval( { |x| x % 16 }, i ) ].............................0.29 - [ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.20 - [ T027: eval( { |x| f1( x ) }, i ) ]............................0.31 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.24 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.23 - [ T030: x := &( "f1(" + str(i) + ")" ) ]........................2.95 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]................2.97 - [ T032: x := valtype( x ) + valtype( i ) ].....................0.34 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.62 + [ T018: Round( i / 1000, 2 ) ]..................................0.21 + [ T019: Str( i / 1000 ) ].......................................0.55 + [ T020: Val( s ) ]..............................................0.28 + [ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.39 + [ T022: DToS( d - i % 10000 ) ].................................0.33 + [ T023: Eval( { || i % 16 } ) ].................................0.36 + [ T024: Eval( bc := { || i % 16 } ) ]...........................0.20 + [ T025: Eval( { |x| x % 16 }, i ) ].............................0.29 + [ T026: Eval( bc := { |x| x % 16 }, i ) ].......................0.20 + [ T027: Eval( { |x| f1( x ) }, i ) ]............................0.31 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]......................0.24 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.23 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]........................2.95 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]................2.97 + [ T032: x := ValType( x ) + ValType( i ) ].....................0.34 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.62 [ T034: x := a[ i % 16 + 1 ] == s ].............................0.21 [ T035: x := a[ i % 16 + 1 ] = s ]..............................0.23 [ T036: x := a[ i % 16 + 1 ] >= s ].............................0.23 [ T037: x := a[ i % 16 + 1 ] <= s ].............................0.23 [ T038: x := a[ i % 16 + 1 ] < s ]..............................0.23 [ T039: x := a[ i % 16 + 1 ] > s ]..............................0.23 - [ T040: ascan( a, i % 16 ) ]....................................0.24 - [ T041: ascan( a, { |x| x == i % 16 } ) ].......................2.34 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....0.70 + [ T040: AScan( a, i % 16 ) ]....................................0.24 + [ T041: AScan( a, { |x| x == i % 16 } ) ].......................2.34 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s,s2,a2 ]....0.70 [ T043: x := a ]................................................0.04 [ T044: x := {} ]...............................................0.12 [ T045: f0() ]..................................................0.06 @@ -3036,7 +3036,7 @@ Here are results for ST mode: [ T052: f2( a ) ]...............................................0.11 [ T053: x := f4() ].............................................0.45 [ T054: x := f5() ].............................................0.22 - [ T055: x := space(16) ]........................................0.17 + [ T055: x := Space(16) ]........................................0.17 [ T056: f_prv( c ) ]............................................0.31 ==================================================================== [ total application time: ]....................................20.27 @@ -3065,31 +3065,31 @@ Here are results for ST mode: [ T015: x := F_D ]..............................................0.10 [ T016: x := o:Args ]...........................................0.27 [ T017: x := o[2] ].............................................0.05 - [ T018: round( i / 1000, 2 ) ]..................................0.30 - [ T019: str( i / 1000 ) ].......................................0.69 - [ T020: val( s ) ]..............................................0.34 - [ T021: val( a [ i % 16 + 1 ] ) ]...............................0.51 - [ T022: dtos( d - i % 10000 ) ].................................0.44 - [ T023: eval( { || i % 16 } ) ].................................0.54 - [ T024: eval( bc := { || i % 16 } ) ]...........................0.36 - [ T025: eval( { |x| x % 16 }, i ) ].............................0.43 - [ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.33 - [ T027: eval( { |x| f1( x ) }, i ) ]............................0.58 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.48 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.51 - [ T030: x := &( "f1(" + str(i) + ")" ) ]........................4.70 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]................5.62 - [ T032: x := valtype( x ) + valtype( i ) ].....................0.64 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.87 + [ T018: Round( i / 1000, 2 ) ]..................................0.30 + [ T019: Str( i / 1000 ) ].......................................0.69 + [ T020: Val( s ) ]..............................................0.34 + [ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.51 + [ T022: DToS( d - i % 10000 ) ].................................0.44 + [ T023: Eval( { || i % 16 } ) ].................................0.54 + [ T024: Eval( bc := { || i % 16 } ) ]...........................0.36 + [ T025: Eval( { |x| x % 16 }, i ) ].............................0.43 + [ T026: Eval( bc := { |x| x % 16 }, i ) ].......................0.33 + [ T027: Eval( { |x| f1( x ) }, i ) ]............................0.58 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]......................0.48 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.51 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]........................4.70 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]................5.62 + [ T032: x := ValType( x ) + ValType( i ) ].....................0.64 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.87 [ T034: x := a[ i % 16 + 1 ] == s ].............................0.28 [ T035: x := a[ i % 16 + 1 ] = s ]..............................0.28 [ T036: x := a[ i % 16 + 1 ] >= s ].............................0.27 [ T037: x := a[ i % 16 + 1 ] <= s ].............................0.28 [ T038: x := a[ i % 16 + 1 ] < s ]..............................0.27 [ T039: x := a[ i % 16 + 1 ] > s ]..............................0.28 - [ T040: ascan( a, i % 16 ) ]....................................0.47 - [ T041: ascan( a, { |x| x == i % 16 } ) ].......................3.95 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....0.89 + [ T040: AScan( a, i % 16 ) ]....................................0.47 + [ T041: AScan( a, { |x| x == i % 16 } ) ].......................3.95 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s,s2,a2 ]....0.89 [ T043: x := a ]................................................0.01 [ T044: x := {} ]...............................................0.11 [ T045: f0() ]..................................................0.14 @@ -3102,7 +3102,7 @@ Here are results for ST mode: [ T052: f2( a ) ]...............................................0.18 [ T053: x := f4() ].............................................0.81 [ T054: x := f5() ].............................................0.49 - [ T055: x := space(16) ]........................................0.33 + [ T055: x := Space(16) ]........................................0.33 [ T056: f_prv( c ) ]............................................0.75 ==================================================================== [ total application time: ]....................................34.52 @@ -3133,31 +3133,31 @@ And here are results for MT mode: [ T015: x := F_D ]..............................................0.10 [ T016: x := o:Args ]...........................................0.15 [ T017: x := o[2] ].............................................0.09 - [ T018: round( i / 1000, 2 ) ]..................................0.22 - [ T019: str( i / 1000 ) ].......................................0.62 - [ T020: val( s ) ]..............................................0.28 - [ T021: val( a [ i % 16 + 1 ] ) ]...............................0.41 - [ T022: dtos( d - i % 10000 ) ].................................0.39 - [ T023: eval( { || i % 16 } ) ].................................0.44 - [ T024: eval( bc := { || i % 16 } ) ]...........................0.27 - [ T025: eval( { |x| x % 16 }, i ) ].............................0.38 - [ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.24 - [ T027: eval( { |x| f1( x ) }, i ) ]............................0.40 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.29 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.31 - [ T030: x := &( "f1(" + str(i) + ")" ) ]........................2.83 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]................3.16 - [ T032: x := valtype( x ) + valtype( i ) ].....................0.38 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.75 + [ T018: Round( i / 1000, 2 ) ]..................................0.22 + [ T019: Str( i / 1000 ) ].......................................0.62 + [ T020: Val( s ) ]..............................................0.28 + [ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.41 + [ T022: DToS( d - i % 10000 ) ].................................0.39 + [ T023: Eval( { || i % 16 } ) ].................................0.44 + [ T024: Eval( bc := { || i % 16 } ) ]...........................0.27 + [ T025: Eval( { |x| x % 16 }, i ) ].............................0.38 + [ T026: Eval( bc := { |x| x % 16 }, i ) ].......................0.24 + [ T027: Eval( { |x| f1( x ) }, i ) ]............................0.40 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]......................0.29 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.31 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]........................2.83 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]................3.16 + [ T032: x := ValType( x ) + ValType( i ) ].....................0.38 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.75 [ T034: x := a[ i % 16 + 1 ] == s ].............................0.28 [ T035: x := a[ i % 16 + 1 ] = s ]..............................0.29 [ T036: x := a[ i % 16 + 1 ] >= s ].............................0.29 [ T037: x := a[ i % 16 + 1 ] <= s ].............................0.29 [ T038: x := a[ i % 16 + 1 ] < s ]..............................0.29 [ T039: x := a[ i % 16 + 1 ] > s ]..............................0.29 - [ T040: ascan( a, i % 16 ) ]....................................0.30 - [ T041: ascan( a, { |x| x == i % 16 } ) ].......................2.87 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....0.81 + [ T040: AScan( a, i % 16 ) ]....................................0.30 + [ T041: AScan( a, { |x| x == i % 16 } ) ].......................2.87 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s,s2,a2 ]....0.81 [ T043: x := a ]................................................0.03 [ T044: x := {} ]...............................................0.13 [ T045: f0() ]..................................................0.07 @@ -3170,7 +3170,7 @@ And here are results for MT mode: [ T052: f2( a ) ]...............................................0.11 [ T053: x := f4() ].............................................0.45 [ T054: x := f5() ].............................................0.24 - [ T055: x := space(16) ]........................................0.19 + [ T055: x := Space(16) ]........................................0.19 [ T056: f_prv( c ) ]............................................0.38 ==================================================================== [ total application time: ]....................................23.10 @@ -3199,31 +3199,31 @@ And here are results for MT mode: [ T015: x := F_D ]..............................................0.07 [ T016: x := o:Args ]...........................................0.36 [ T017: x := o[2] ].............................................0.05 - [ T018: round( i / 1000, 2 ) ]..................................0.43 - [ T019: str( i / 1000 ) ].......................................0.83 - [ T020: val( s ) ]..............................................0.41 - [ T021: val( a [ i % 16 + 1 ] ) ]...............................0.65 - [ T022: dtos( d - i % 10000 ) ].................................0.56 - [ T023: eval( { || i % 16 } ) ].................................0.78 - [ T024: eval( bc := { || i % 16 } ) ]...........................0.47 - [ T025: eval( { |x| x % 16 }, i ) ].............................0.66 - [ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.49 - [ T027: eval( { |x| f1( x ) }, i ) ]............................0.88 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.73 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.72 - [ T030: x := &( "f1(" + str(i) + ")" ) ]........................5.69 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]................6.18 - [ T032: x := valtype( x ) + valtype( i ) ].....................0.79 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........1.12 + [ T018: Round( i / 1000, 2 ) ]..................................0.43 + [ T019: Str( i / 1000 ) ].......................................0.83 + [ T020: Val( s ) ]..............................................0.41 + [ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.65 + [ T022: DToS( d - i % 10000 ) ].................................0.56 + [ T023: Eval( { || i % 16 } ) ].................................0.78 + [ T024: Eval( bc := { || i % 16 } ) ]...........................0.47 + [ T025: Eval( { |x| x % 16 }, i ) ].............................0.66 + [ T026: Eval( bc := { |x| x % 16 }, i ) ].......................0.49 + [ T027: Eval( { |x| f1( x ) }, i ) ]............................0.88 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]......................0.73 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.72 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]........................5.69 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]................6.18 + [ T032: x := ValType( x ) + ValType( i ) ].....................0.79 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........1.12 [ T034: x := a[ i % 16 + 1 ] == s ].............................0.37 [ T035: x := a[ i % 16 + 1 ] = s ]..............................0.36 [ T036: x := a[ i % 16 + 1 ] >= s ].............................0.42 [ T037: x := a[ i % 16 + 1 ] <= s ].............................0.36 [ T038: x := a[ i % 16 + 1 ] < s ]..............................0.37 [ T039: x := a[ i % 16 + 1 ] > s ]..............................0.38 - [ T040: ascan( a, i % 16 ) ]....................................0.64 - [ T041: ascan( a, { |x| x == i % 16 } ) ].......................6.21 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....1.29 + [ T040: AScan( a, i % 16 ) ]....................................0.64 + [ T041: AScan( a, { |x| x == i % 16 } ) ].......................6.21 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s,s2,a2 ]....1.29 [ T043: x := a ]................................................0.00 [ T044: x := {} ]...............................................0.15 [ T045: f0() ]..................................................0.21 @@ -3236,7 +3236,7 @@ And here are results for MT mode: [ T052: f2( a ) ]...............................................0.27 [ T053: x := f4() ].............................................0.99 [ T054: x := f5() ].............................................0.65 - [ T055: x := space(16) ]........................................0.38 + [ T055: x := Space(16) ]........................................0.38 [ T056: f_prv( c ) ]............................................1.24 ==================================================================== [ total application time: ]....................................50.90 @@ -3247,7 +3247,7 @@ Harbour have not been implemented so far so it's hard to say how may look final performance. Recently I've repeated above tests on the same Hardware but using 64-bit -Linux kernels and 64bit Harbour builds and here the difference is even +Linux kernels and 64-bit Harbour builds and here the difference is even bigger. Here are results for ST mode: 2009-10-27 13:24:41 Linux 2.6.31.3-1-desktop x86_64 @@ -3273,31 +3273,31 @@ bigger. Here are results for ST mode: [ T015: x := F_D ]..............................................0.08 [ T016: x := o:Args ]...........................................0.11 [ T017: x := o[2] ].............................................0.06 - [ T018: round( i / 1000, 2 ) ]..................................0.15 - [ T019: str( i / 1000 ) ].......................................0.32 - [ T020: val( s ) ]..............................................0.18 - [ T021: val( a [ i % 16 + 1 ] ) ]...............................0.28 - [ T022: dtos( d - i % 10000 ) ].................................0.28 - [ T023: eval( { || i % 16 } ) ].................................0.29 - [ T024: eval( bc := { || i % 16 } ) ]...........................0.18 - [ T025: eval( { |x| x % 16 }, i ) ].............................0.24 - [ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.18 - [ T027: eval( { |x| f1( x ) }, i ) ]............................0.27 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.22 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.22 - [ T030: x := &( "f1(" + str(i) + ")" ) ]........................2.05 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]................2.41 - [ T032: x := valtype( x ) + valtype( i ) ].....................0.27 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.54 + [ T018: Round( i / 1000, 2 ) ]..................................0.15 + [ T019: Str( i / 1000 ) ].......................................0.32 + [ T020: Val( s ) ]..............................................0.18 + [ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.28 + [ T022: DToS( d - i % 10000 ) ].................................0.28 + [ T023: Eval( { || i % 16 } ) ].................................0.29 + [ T024: Eval( bc := { || i % 16 } ) ]...........................0.18 + [ T025: Eval( { |x| x % 16 }, i ) ].............................0.24 + [ T026: Eval( bc := { |x| x % 16 }, i ) ].......................0.18 + [ T027: Eval( { |x| f1( x ) }, i ) ]............................0.27 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]......................0.22 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.22 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]........................2.05 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]................2.41 + [ T032: x := ValType( x ) + ValType( i ) ].....................0.27 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.54 [ T034: x := a[ i % 16 + 1 ] == s ].............................0.17 [ T035: x := a[ i % 16 + 1 ] = s ]..............................0.19 [ T036: x := a[ i % 16 + 1 ] >= s ].............................0.18 [ T037: x := a[ i % 16 + 1 ] <= s ].............................0.19 [ T038: x := a[ i % 16 + 1 ] < s ]..............................0.19 [ T039: x := a[ i % 16 + 1 ] > s ]..............................0.18 - [ T040: ascan( a, i % 16 ) ]....................................0.22 - [ T041: ascan( a, { |x| x == i % 16 } ) ].......................2.01 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....0.53 + [ T040: AScan( a, i % 16 ) ]....................................0.22 + [ T041: AScan( a, { |x| x == i % 16 } ) ].......................2.01 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s,s2,a2 ]....0.53 [ T043: x := a ]................................................0.02 [ T044: x := {} ]...............................................0.08 [ T045: f0() ]..................................................0.05 @@ -3310,7 +3310,7 @@ bigger. Here are results for ST mode: [ T052: f2( a ) ]...............................................0.08 [ T053: x := f4() ].............................................0.34 [ T054: x := f5() ].............................................0.16 - [ T055: x := space(16) ]........................................0.12 + [ T055: x := Space(16) ]........................................0.12 [ T056: f_prv( c ) ]............................................0.21 ==================================================================== [ total application time: ]....................................15.60 @@ -3339,31 +3339,31 @@ bigger. Here are results for ST mode: [ T015: x := F_D ]..............................................0.11 [ T016: x := o:Args ]...........................................0.30 [ T017: x := o[2] ].............................................0.07 - [ T018: round( i / 1000, 2 ) ]..................................0.32 - [ T019: str( i / 1000 ) ].......................................0.87 - [ T020: val( s ) ]..............................................0.32 - [ T021: val( a [ i % 16 + 1 ] ) ]...............................0.48 - [ T022: dtos( d - i % 10000 ) ].................................0.43 - [ T023: eval( { || i % 16 } ) ].................................0.62 - [ T024: eval( bc := { || i % 16 } ) ]...........................0.40 - [ T025: eval( { |x| x % 16 }, i ) ].............................0.47 - [ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.37 - [ T027: eval( { |x| f1( x ) }, i ) ]............................0.66 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.56 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.58 - [ T030: x := &( "f1(" + str(i) + ")" ) ]........................5.95 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]................6.57 - [ T032: x := valtype( x ) + valtype( i ) ].....................0.76 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.90 + [ T018: Round( i / 1000, 2 ) ]..................................0.32 + [ T019: Str( i / 1000 ) ].......................................0.87 + [ T020: Val( s ) ]..............................................0.32 + [ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.48 + [ T022: DToS( d - i % 10000 ) ].................................0.43 + [ T023: Eval( { || i % 16 } ) ].................................0.62 + [ T024: Eval( bc := { || i % 16 } ) ]...........................0.40 + [ T025: Eval( { |x| x % 16 }, i ) ].............................0.47 + [ T026: Eval( bc := { |x| x % 16 }, i ) ].......................0.37 + [ T027: Eval( { |x| f1( x ) }, i ) ]............................0.66 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]......................0.56 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.58 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]........................5.95 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]................6.57 + [ T032: x := ValType( x ) + ValType( i ) ].....................0.76 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.90 [ T034: x := a[ i % 16 + 1 ] == s ].............................0.25 [ T035: x := a[ i % 16 + 1 ] = s ]..............................0.25 [ T036: x := a[ i % 16 + 1 ] >= s ].............................0.24 [ T037: x := a[ i % 16 + 1 ] <= s ].............................0.25 [ T038: x := a[ i % 16 + 1 ] < s ]..............................0.25 [ T039: x := a[ i % 16 + 1 ] > s ]..............................0.24 - [ T040: ascan( a, i % 16 ) ]....................................0.46 - [ T041: ascan( a, { |x| x == i % 16 } ) ].......................4.10 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....0.92 + [ T040: AScan( a, i % 16 ) ]....................................0.46 + [ T041: AScan( a, { |x| x == i % 16 } ) ].......................4.10 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s,s2,a2 ]....0.92 [ T043: x := a ]................................................0.04 [ T044: x := {} ]...............................................0.16 [ T045: f0() ]..................................................0.21 @@ -3376,15 +3376,15 @@ bigger. Here are results for ST mode: [ T052: f2( a ) ]...............................................0.24 [ T053: x := f4() ].............................................0.94 [ T054: x := f5() ].............................................0.63 - [ T055: x := space(16) ]........................................0.41 + [ T055: x := Space(16) ]........................................0.41 [ T056: f_prv( c ) ]............................................0.86 ==================================================================== [ total application time: ]....................................37.14 [ total real time: ]...........................................37.16 -Harbour is noticeable faster in 64 bit mode and xHarbour slower but +Harbour is noticeable faster in 64-bit mode and xHarbour slower but I haven't analyzed the reasons. Few years ago xHarbour was also faster -in 64bit modes so it's probably problem with some compile time settings. +in 64-bit modes so it's probably problem with some compile time settings. Harbour build system allows to use different compile time switches for static and shared libraries and the bigger difference is probably result of better tuned switches for static libraries which cannot be @@ -3415,31 +3415,31 @@ The last test we can make is scalability in real multi CPU environment. [ T015: x := F_D ]____________________________________ 0.32 0.17 -> 1.94 [ T016: x := o:Args ]_________________________________ 0.44 0.24 -> 1.81 [ T017: x := o[2] ]___________________________________ 0.29 0.16 -> 1.83 - [ T018: round( i / 1000, 2 ) ]________________________ 0.59 0.28 -> 2.12 - [ T019: str( i / 1000 ) ]_____________________________ 1.21 0.69 -> 1.74 - [ T020: val( s ) ]____________________________________ 0.61 0.33 -> 1.86 - [ T021: val( a [ i % 16 + 1 ] ) ]_____________________ 0.93 0.50 -> 1.85 - [ T022: dtos( d - i % 10000 ) ]_______________________ 0.90 0.56 -> 1.60 - [ T023: eval( { || i % 16 } ) ]_______________________ 1.00 1.24 -> 0.81 - [ T024: eval( bc := { || i % 16 } ) ]_________________ 0.59 0.32 -> 1.83 - [ T025: eval( { |x| x % 16 }, i ) ]___________________ 0.81 1.03 -> 0.79 - [ T026: eval( bc := { |x| x % 16 }, i ) ]_____________ 0.59 0.30 -> 1.96 - [ T027: eval( { |x| f1( x ) }, i ) ]__________________ 0.93 1.10 -> 0.85 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]____________ 0.71 0.38 -> 1.89 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ]_______ 0.70 0.40 -> 1.74 - [ T030: x := &( "f1(" + str(i) + ")" ) ]______________ 5.71 3.36 -> 1.70 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]______ 6.36 4.21 -> 1.51 - [ T032: x := valtype( x ) + valtype( i ) ]___________ 0.86 0.51 -> 1.68 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ] 1.52 0.85 -> 1.80 + [ T018: Round( i / 1000, 2 ) ]________________________ 0.59 0.28 -> 2.12 + [ T019: Str( i / 1000 ) ]_____________________________ 1.21 0.69 -> 1.74 + [ T020: Val( s ) ]____________________________________ 0.61 0.33 -> 1.86 + [ T021: Val( a [ i % 16 + 1 ] ) ]_____________________ 0.93 0.50 -> 1.85 + [ T022: DToS( d - i % 10000 ) ]_______________________ 0.90 0.56 -> 1.60 + [ T023: Eval( { || i % 16 } ) ]_______________________ 1.00 1.24 -> 0.81 + [ T024: Eval( bc := { || i % 16 } ) ]_________________ 0.59 0.32 -> 1.83 + [ T025: Eval( { |x| x % 16 }, i ) ]___________________ 0.81 1.03 -> 0.79 + [ T026: Eval( bc := { |x| x % 16 }, i ) ]_____________ 0.59 0.30 -> 1.96 + [ T027: Eval( { |x| f1( x ) }, i ) ]__________________ 0.93 1.10 -> 0.85 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]____________ 0.71 0.38 -> 1.89 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ]_______ 0.70 0.40 -> 1.74 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]______________ 5.71 3.36 -> 1.70 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]______ 6.36 4.21 -> 1.51 + [ T032: x := ValType( x ) + ValType( i ) ]___________ 0.86 0.51 -> 1.68 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ] 1.52 0.85 -> 1.80 [ T034: x := a[ i % 16 + 1 ] == s ]___________________ 0.62 0.35 -> 1.80 [ T035: x := a[ i % 16 + 1 ] = s ]____________________ 0.67 0.38 -> 1.75 [ T036: x := a[ i % 16 + 1 ] >= s ]___________________ 0.66 0.37 -> 1.76 [ T037: x := a[ i % 16 + 1 ] <= s ]___________________ 0.66 0.38 -> 1.73 [ T038: x := a[ i % 16 + 1 ] < s ]____________________ 0.67 0.38 -> 1.75 [ T039: x := a[ i % 16 + 1 ] > s ]____________________ 0.65 0.33 -> 1.98 - [ T040: ascan( a, i % 16 ) ]__________________________ 0.67 0.33 -> 2.01 - [ T041: ascan( a, { |x| x == i % 16 } ) ]_____________ 5.87 3.63 -> 1.62 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s ] 1.88 1.45 -> 1.29 + [ T040: AScan( a, i % 16 ) ]__________________________ 0.67 0.33 -> 2.01 + [ T041: AScan( a, { |x| x == i % 16 } ) ]_____________ 5.87 3.63 -> 1.62 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s ] 1.88 1.45 -> 1.29 [ T043: x := a ]______________________________________ 0.15 0.07 -> 1.96 [ T044: x := {} ]_____________________________________ 0.37 1.00 -> 0.37 [ T045: f0() ]________________________________________ 0.23 0.14 -> 1.58 @@ -3452,7 +3452,7 @@ The last test we can make is scalability in real multi CPU environment. [ T052: f2( a ) ]_____________________________________ 0.31 0.16 -> 1.95 [ T053: x := f4() ]___________________________________ 0.96 0.57 -> 1.66 [ T054: x := f5() ]___________________________________ 0.59 0.39 -> 1.53 - [ T055: x := space(16) ]______________________________ 0.48 0.32 -> 1.50 + [ T055: x := Space(16) ]______________________________ 0.48 0.32 -> 1.50 [ T056: f_prv( c ) ]__________________________________ 0.86 0.56 -> 1.53 ============================================================================ [ TOTAL ]_________________________________________ 46.76 30.75 -> 1.52 @@ -3484,31 +3484,31 @@ The last test we can make is scalability in real multi CPU environment. [ T015: x := F_D ]____________________________________ 0.53 0.28 -> 1.87 [ T016: x := o:Args ]_________________________________ 1.04 0.96 -> 1.09 [ T017: x := o[2] ]___________________________________ 0.51 0.25 -> 2.04 - [ T018: round( i / 1000, 2 ) ]________________________ 1.15 0.98 -> 1.17 - [ T019: str( i / 1000 ) ]_____________________________ 1.97 1.51 -> 1.30 - [ T020: val( s ) ]____________________________________ 1.19 0.86 -> 1.38 - [ T021: val( a [ i % 16 + 1 ] ) ]_____________________ 1.65 1.23 -> 1.35 - [ T022: dtos( d - i % 10000 ) ]_______________________ 1.54 1.14 -> 1.35 - [ T023: eval( { || i % 16 } ) ]_______________________ 1.91 2.78 -> 0.68 - [ T024: eval( bc := { || i % 16 } ) ]_________________ 1.46 1.34 -> 1.09 - [ T025: eval( { |x| x % 16 }, i ) ]___________________ 1.60 2.77 -> 0.58 - [ T026: eval( bc := { |x| x % 16 }, i ) ]_____________ 1.32 1.30 -> 1.02 - [ T027: eval( { |x| f1( x ) }, i ) ]__________________ 2.13 3.10 -> 0.69 - [ T028: eval( bc := { |x| f1( x ) }, i ) ]____________ 1.75 1.78 -> 0.98 - [ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ]_______ 1.77 1.79 -> 0.99 - [ T030: x := &( "f1(" + str(i) + ")" ) ]______________ 11.34 14.11 -> 0.80 - [ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]______ 13.19 17.26 -> 0.76 - [ T032: x := valtype( x ) + valtype( i ) ]___________ 2.11 1.65 -> 1.28 - [ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ] 2.80 1.78 -> 1.57 + [ T018: Round( i / 1000, 2 ) ]________________________ 1.15 0.98 -> 1.17 + [ T019: Str( i / 1000 ) ]_____________________________ 1.97 1.51 -> 1.30 + [ T020: Val( s ) ]____________________________________ 1.19 0.86 -> 1.38 + [ T021: Val( a [ i % 16 + 1 ] ) ]_____________________ 1.65 1.23 -> 1.35 + [ T022: DToS( d - i % 10000 ) ]_______________________ 1.54 1.14 -> 1.35 + [ T023: Eval( { || i % 16 } ) ]_______________________ 1.91 2.78 -> 0.68 + [ T024: Eval( bc := { || i % 16 } ) ]_________________ 1.46 1.34 -> 1.09 + [ T025: Eval( { |x| x % 16 }, i ) ]___________________ 1.60 2.77 -> 0.58 + [ T026: Eval( bc := { |x| x % 16 }, i ) ]_____________ 1.32 1.30 -> 1.02 + [ T027: Eval( { |x| f1( x ) }, i ) ]__________________ 2.13 3.10 -> 0.69 + [ T028: Eval( bc := { |x| f1( x ) }, i ) ]____________ 1.75 1.78 -> 0.98 + [ T029: Eval( bc := &("{ |x| f1( x ) }"), i ) ]_______ 1.77 1.79 -> 0.99 + [ T030: x := &( "f1(" + Str(i) + ")" ) ]______________ 11.34 14.11 -> 0.80 + [ T031: bc := &( "{|x|f1(x)}" ), Eval( bc, i ) ]______ 13.19 17.26 -> 0.76 + [ T032: x := ValType( x ) + ValType( i ) ]___________ 2.11 1.65 -> 1.28 + [ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ] 2.80 1.78 -> 1.57 [ T034: x := a[ i % 16 + 1 ] == s ]___________________ 1.17 0.69 -> 1.71 [ T035: x := a[ i % 16 + 1 ] = s ]____________________ 1.21 0.57 -> 2.10 [ T036: x := a[ i % 16 + 1 ] >= s ]___________________ 1.15 0.62 -> 1.87 [ T037: x := a[ i % 16 + 1 ] <= s ]___________________ 1.10 0.60 -> 1.86 [ T038: x := a[ i % 16 + 1 ] < s ]____________________ 1.11 0.63 -> 1.75 [ T039: x := a[ i % 16 + 1 ] > s ]____________________ 1.14 0.61 -> 1.88 - [ T040: ascan( a, i % 16 ) ]__________________________ 1.66 1.17 -> 1.41 - [ T041: ascan( a, { |x| x == i % 16 } ) ]_____________ 12.39 13.63 -> 0.91 - [ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s ] 2.95 2.79 -> 1.06 + [ T040: AScan( a, i % 16 ) ]__________________________ 1.66 1.17 -> 1.41 + [ T041: AScan( a, { |x| x == i % 16 } ) ]_____________ 12.39 13.63 -> 0.91 + [ T042: iif( i%1000==0, a:={}, ) , AAdd(a,{i,1,.T.,s ] 2.95 2.79 -> 1.06 [ T043: x := a ]______________________________________ 0.37 0.19 -> 1.94 [ T044: x := {} ]_____________________________________ 0.70 2.29 -> 0.31 [ T045: f0() ]________________________________________ 0.78 0.73 -> 1.07 @@ -3521,7 +3521,7 @@ The last test we can make is scalability in real multi CPU environment. [ T052: f2( a ) ]_____________________________________ 0.92 0.85 -> 1.08 [ T053: x := f4() ]___________________________________ 2.45 1.95 -> 1.26 [ T054: x := f5() ]___________________________________ 1.75 1.75 -> 1.00 - [ T055: x := space(16) ]______________________________ 1.19 1.02 -> 1.16 + [ T055: x := Space(16) ]______________________________ 1.19 1.02 -> 1.16 [ T056: f_prv( c ) ]__________________________________ 4.51 4.36 -> 1.03 ============================================================================ [ TOTAL ]_________________________________________106.08 105.94 -> 1.00 @@ -3530,7 +3530,7 @@ The last test we can make is scalability in real multi CPU environment. [ total real time: ]..........................................212.02 As we can see in xHarbour we do not have any improvement executing MT -programs on MultiCPU machines while in Harbour the speed is noticeably +programs on multi-CPU machines while in Harbour the speed is noticeably better. It means that Harbour is quite well scalable and users should expect speed improvement executing MT parallel programs on multi CPU machines. For some programs like MT servers it may be critical - programs diff --git a/package/harbour-wce.spec.in b/package/harbour-wce.spec.in index c93a6db140..8414ea806a 100644 --- a/package/harbour-wce.spec.in +++ b/package/harbour-wce.spec.in @@ -2,7 +2,7 @@ # Copyright 2007 Przemyslaw Czerpak (druzus/at/priv.onet.pl), # Harbour-WinCE cross build RPM spec file # -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- ###################################################################### diff --git a/package/harbour-win.spec.in b/package/harbour-win.spec.in index 9b4ba7e36e..4ede3373b8 100644 --- a/package/harbour-win.spec.in +++ b/package/harbour-win.spec.in @@ -2,7 +2,7 @@ # Copyright 2007 Przemyslaw Czerpak (druzus/at/priv.onet.pl), # Harbour-MinGW cross build RPM spec file # -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- ###################################################################### diff --git a/package/harbour.spec b/package/harbour.spec index f3226daa9d..3583e39d6e 100644 --- a/package/harbour.spec +++ b/package/harbour.spec @@ -3,13 +3,13 @@ # Dave Pearson # Harbour RPM spec file # -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- # --------------------------------------------------------------- # HOWTO .rpm docs: -# http://fedoraproject.org/wiki/PackageMaintainers/CreatingPackageHowTo -# http://www.gurulabs.com/downloads/GURULABS-RPM-LAB/GURULABS-RPM-GUIDE-v1.0.PDF +# https://fedoraproject.org/wiki/How_to_create_an_RPM_package +# https://www.gurulabs.com/media/files/courseware-samples/GURULABS-RPM-GUIDE-v1.0.PDF # --------------------------------------------------------------- # TOFIX: Contrib packages with dependencies will be packaged diff --git a/package/mpkg_rpm.sh b/package/mpkg_rpm.sh index fef088bc99..09e972211e 100755 --- a/package/mpkg_rpm.sh +++ b/package/mpkg_rpm.sh @@ -1,10 +1,10 @@ #!/bin/sh # --------------------------------------------------------------- -# Copyright 2003 Przemyslaw Czerpak +# Copyright 2003 Przemyslaw Czerpak (druzus/at/priv.onet.pl) # simple script to build RPMs from Harbour sources # -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- test_reqrpm() diff --git a/package/mpkg_rpm_wce.sh b/package/mpkg_rpm_wce.sh index 58af23fcb4..ff3f5b6fad 100755 --- a/package/mpkg_rpm_wce.sh +++ b/package/mpkg_rpm_wce.sh @@ -4,7 +4,7 @@ # Copyright 2007 Przemyslaw Czerpak (druzus/at/priv.onet.pl) # simple script to build Harbour-WinCE cross build RPMs # -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- test_reqrpm() diff --git a/package/mpkg_rpm_win.sh b/package/mpkg_rpm_win.sh index 29d4fae4ec..7c1086e30d 100755 --- a/package/mpkg_rpm_win.sh +++ b/package/mpkg_rpm_win.sh @@ -2,9 +2,9 @@ # --------------------------------------------------------------- # Copyright 2007 Przemyslaw Czerpak (druzus/at/priv.onet.pl) -# simple script to build Harbour-Win32 cross build RPMs +# simple script to build Harbour-Windows cross build RPMs # -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- test_reqrpm() diff --git a/package/mpkg_src.sh b/package/mpkg_src.sh index a7cc2b71f0..e7ecb2635c 100755 --- a/package/mpkg_src.sh +++ b/package/mpkg_src.sh @@ -1,6 +1,6 @@ #!/bin/sh -# This script requires "TAR" utilities for compression. +# This script requires 'GNU tar' tool for compression. if [ "$1" = "zip" ] || [ "$1" = "ZIP" ]; then hb_archbin="zip" diff --git a/package/mpkg_ver.sh b/package/mpkg_ver.sh index 040b850161..d48c560da6 100755 --- a/package/mpkg_ver.sh +++ b/package/mpkg_ver.sh @@ -4,7 +4,7 @@ # Copyright 2003 Przemyslaw Czerpak # small set of functions used by Harbour scripts # -# See COPYING.txt for licensing terms. +# See LICENSE.txt for licensing terms. # --------------------------------------------------------------- get_hbver() diff --git a/src/rtl/achoice.prg b/src/rtl/achoice.prg index 9aa8ebb426..f88be15228 100644 --- a/src/rtl/achoice.prg +++ b/src/rtl/achoice.prg @@ -208,7 +208,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo ELSE DispBegin() DispLine( acItems[ nPos ], nTop + nPos - nAtTop, nLeft, Ach_Select( alSelect, nPos ), .F., nNumCols ) - hb_Scroll( nTop, nLeft, nBottom, nRight, nNewPos - ( nAtTop + nNumRows - 1 ) ) + Scroll( nTop, nLeft, nBottom, nRight, nNewPos - ( nAtTop + nNumRows - 1 ) ) nAtTop := nNewPos nPos := Max( nPos, nAtTop + nNumRows - 1 ) DO WHILE nPos > nNewPos @@ -250,7 +250,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo ELSE DispBegin() DispLine( acItems[ nPos ], nTop + nPos - nAtTop, nLeft, Ach_Select( alSelect, nPos ), .F., nNumCols ) - hb_Scroll( nTop, nLeft, nBottom, nRight, nNewPos - ( nAtTop + nNumRows - 1 ) ) + Scroll( nTop, nLeft, nBottom, nRight, nNewPos - ( nAtTop + nNumRows - 1 ) ) nAtTop := nNewPos - nNumRows + 1 nPos := Max( nPos, nAtTop ) DO WHILE nPos < nNewPos diff --git a/src/rtl/getsys53.prg b/src/rtl/getsys53.prg index ceb80a6299..5f896e8051 100644 --- a/src/rtl/getsys53.prg +++ b/src/rtl/getsys53.prg @@ -2,6 +2,7 @@ * GET system module (default) * * Copyright 1999-2001 Antonio Linares + * Copyright 2001 Luiz Rafael Culik (Support for CA-Cl*pper 5.3 GET-system) * * 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 @@ -44,16 +45,6 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2001 Luiz Rafael Culik - * Support for CA-Cl*pper 5.3 Getsystem - * - * See COPYING.txt for licensing terms. - * - */ - #ifdef HB_COMPAT_C53 PROCEDURE GUIReader( oGet, oGetlist, oMenu, aMsg ) diff --git a/src/rtl/tgetlist.prg b/src/rtl/tgetlist.prg index c8f1ccc0d4..7d9171e8ae 100644 --- a/src/rtl/tgetlist.prg +++ b/src/rtl/tgetlist.prg @@ -2,6 +2,7 @@ * HBGetList Class * * Copyright 1999 Antonio Linares + * Copyright 2001 Luiz Rafael Culik (Support for CA-Cl*pper 5.3 GET-system) * * 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 @@ -44,16 +45,6 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2001 Luiz Rafael Culik - * Support for CA-Cl*pper 5.3 Getsystem - * - * See COPYING.txt for licensing terms. - * - */ - #include "hbclass.ch" #include "button.ch" @@ -149,7 +140,7 @@ CREATE CLASS HBGetList ENDCLASS -/* -------------------------------------------- */ +/* --- */ #ifdef HB_COMPAT_C53 METHOD ReadModal( nPos, oMenu, nMsgRow, nMsgLeft, nMsgRight, cMsgColor ) CLASS HBGetList @@ -179,7 +170,7 @@ METHOD ReadModal() CLASS HBGetList cMsgColor := GetClrPair( SetColor(), 1 ) ENDIF - hb_Scroll( nMsgRow, nMsgLeft, nMsgRow, nMsgRight ) + Scroll( nMsgRow, nMsgLeft, nMsgRow, nMsgRight ) ::cMsgSaveS := SaveScreen( nMsgRow, nMsgLeft, nMsgRow, nMsgRight ) ENDIF @@ -412,7 +403,7 @@ METHOD GetApplyKey( nKey, oGet, oMenu, aMsg ) CLASS HBGetList IF ! HB_ISOBJECT( oMenu ) nButton := 0 - ELSEIF !( oMenu:ClassName() == "TOPBARMENU" ) + ELSEIF ! oMenu:ClassName() == "TOPBARMENU" nButton := 0 ELSEIF ( nButton := oMenu:hitTest( nMRow, nMCol ) ) != 0 ::nMenuID := MenuModal( oMenu, nHotItem, aMsg[ MSGROW ], aMsg[ MSGLEFT ], aMsg[ MSGRIGHT ], aMsg[ MSGCOLOR ] ) @@ -809,6 +800,7 @@ METHOD ShowScoreboard() CLASS HBGetList RETURN Self METHOD DateMsg() CLASS HBGetList + LOCAL nKey IF Set( _SET_SCOREBOARD ) @@ -912,7 +904,7 @@ METHOD GUIReader( oGet, oMenu, aMsg ) CLASS HBGetList oGet:varPut( oGUI:value ) EXIT ENDIF - /* fall through */ + /* fallthrough */ OTHERWISE oGet:varPut( oGUI:buffer ) ENDSWITCH @@ -1086,7 +1078,7 @@ METHOD GUIApplyKey( oGet, oGUI, nKey, oMenu, aMsg ) CLASS HBGetList IF ! HB_ISOBJECT( oMenu ) nButton := 0 - ELSEIF !( oMenu:ClassName() == "TOPBARMENU" ) + ELSEIF ! oMenu:ClassName() == "TOPBARMENU" nButton := 0 ELSEIF ( nButton := oMenu:hitTest( nMRow, nMCol ) ) != 0 ::nMenuID := MenuModal( oMenu, nHotItem, aMsg[ MSGROW ], aMsg[ MSGLEFT ], aMsg[ MSGRIGHT ], aMsg[ MSGCOLOR ] ) @@ -1146,7 +1138,7 @@ METHOD GUIPreValidate( oGet, oGUI, aMsg ) CLASS HBGetList lWhen := Eval( oGet:preBlock, oGet, aMsg ) - IF !( oGUI:ClassName() == "TBROWSE" ) + IF ! oGUI:ClassName() == "TBROWSE" oGet:display() ENDIF @@ -1180,7 +1172,7 @@ METHOD GUIPostValidate( oGet, oGUI, aMsg ) CLASS HBGetList RETURN .T. // NOTE ENDIF - IF !( oGUI:ClassName() == "TBROWSE" ) + IF ! oGUI:ClassName() == "TBROWSE" xOldValue := oGet:varGet() SWITCH oGUI:ClassName() CASE "LISTBOX" @@ -1189,13 +1181,13 @@ METHOD GUIPostValidate( oGet, oGUI, aMsg ) CLASS HBGetList xNewValue := oGUI:value EXIT ENDIF - /* fall through */ + /* fallthrough */ OTHERWISE xNewValue := oGUI:buffer ENDSWITCH ENDIF - IF !( xOldValue == xNewValue ) + IF ! xOldValue == xNewValue oGet:varPut( xNewValue ) ::lUpdated := .T. ENDIF @@ -1211,7 +1203,7 @@ METHOD GUIPostValidate( oGet, oGUI, aMsg ) CLASS HBGetList SetPos( oGet:row, oGet:col ) ::ShowScoreBoard() - IF !( oGUI:ClassName() == "TBROWSE" ) + IF ! oGUI:ClassName() == "TBROWSE" oGUI:Select( oGet:varGet() ) ENDIF @@ -1302,7 +1294,7 @@ METHOD TBApplyKey( oGet, oTB, nKey, oMenu, aMsg ) CLASS HBGetList IF ! HB_ISOBJECT( oMenu ) nButton := 0 - ELSEIF !( oMenu:ClassName() == "TOPBARMENU" ) + ELSEIF ! oMenu:ClassName() == "TOPBARMENU" nButton := 0 ELSEIF ( nButton := oMenu:hitTest( nMRow, nMCol ) ) != 0 ::nMenuID := MenuModal( oMenu, nHotItem, aMsg[ MSGROW ], aMsg[ MSGLEFT ], aMsg[ MSGRIGHT ], aMsg[ MSGCOLOR ] ) @@ -1441,7 +1433,7 @@ METHOD Accelerator( nKey, aMsg ) CLASS HBGetList oGet := ::aGetList[ nGet ] IF HB_ISOBJECT( oGet:control ) .AND. ; - !( oGet:Control:ClassName() == "TBROWSE" ) + ! oGet:Control:ClassName() == "TBROWSE" cCaption := oGet:control:caption ELSE @@ -1662,7 +1654,7 @@ METHOD EraseGetMsg( aMsg ) CLASS HBGetList RETURN Self -/* -------------------------------------------- */ +/* --- */ METHOD New( GetList ) CLASS HBGetList diff --git a/src/rtl/tlabel.prg b/src/rtl/tlabel.prg index 8c6fcf413a..308874c169 100644 --- a/src/rtl/tlabel.prg +++ b/src/rtl/tlabel.prg @@ -307,7 +307,7 @@ METHOD SampleLabels() CLASS HBLabelForm cKey := hb_keyChar( Inkey( 0 ) ) DispOut( cKey ) IF Row() == MaxRow() - hb_Scroll( 0, 0, MaxRow(), MaxCol(), 1 ) + Scroll( 0, 0, MaxRow(), MaxCol(), 1 ) SetPos( MaxRow(), 0 ) ELSE SetPos( Row() + 1, 0 ) diff --git a/src/rtl/tmenusys.prg b/src/rtl/tmenusys.prg index 1494f42c70..0f13a11ba0 100644 --- a/src/rtl/tmenusys.prg +++ b/src/rtl/tmenusys.prg @@ -133,7 +133,7 @@ METHOD Modal( nSelection, nMsgRow, nMsgLeft, nMsgRight, cMsgColor, GetList ) CLA ::cMsgColor := GetClrPair( SetColor(), 1 ) ENDIF - hb_Scroll( ::nMsgRow, ::nMsgLeft, ::nMsgRow, ::nMsgRight ) + Scroll( ::nMsgRow, ::nMsgLeft, ::nMsgRow, ::nMsgRight ) ::cMsgSaveS := SaveScreen( ::nMsgRow, ::nMsgLeft, ::nMsgRow, ::nMsgRight ) ENDIF diff --git a/tests/hbdoc.prg b/tests/hbdoc.prg index 77ba54491b..ec53404a14 100644 --- a/tests/hbdoc.prg +++ b/tests/hbdoc.prg @@ -2,7 +2,6 @@ * HBDOC reader test * * Copyright 2010 Viktor Szakats (vszakats.net/harbour) - * */ #include "directry.ch" diff --git a/tests/langmsg.prg b/tests/langmsg.prg index 4ae62e9326..01cc37c00b 100644 --- a/tests/langmsg.prg +++ b/tests/langmsg.prg @@ -1,6 +1,6 @@ /* * Copyright 2003 Przemyslaw Czerpak - * See COPYING.txt for licensing terms. + * See LICENSE.txt for licensing terms. */ #include "hblang.ch" @@ -9,7 +9,7 @@ PROCEDURE Main( cLng ) LOCAL i, a, aDay, aMnt, aErr, aInt, cDtFrm, cTrue, cFalse - hb_langSelect( "EN" ) + hb_langSelect( "en" ) aDay := GET_DAYS() aMnt := GET_MONTHS() aErr := GET_ERR() @@ -23,41 +23,41 @@ PROCEDURE Main( cLng ) ENDIF ? hb_langName() - ? "HB_LANG_ITEM_BASE_ID ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_ID ) + "]" - ? "HB_LANG_ITEM_BASE_MONTH ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_MONTH ) + "]" - ? "HB_LANG_ITEM_BASE_DAY ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_DAY ) + "]" - ? "HB_LANG_ITEM_BASE_NATMSG ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_NATMSG ) + "]" + ? "HB_LANG_ITEM_BASE_ID ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_ID ) + "]" + ? "HB_LANG_ITEM_BASE_MONTH ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_MONTH ) + "]" + ? "HB_LANG_ITEM_BASE_DAY ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_DAY ) + "]" + ? "HB_LANG_ITEM_BASE_NATMSG ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_NATMSG ) + "]" ? "HB_LANG_ITEM_BASE_ERRDESC", "[" + hb_langMessage( HB_LANG_ITEM_BASE_ERRDESC ) + "]" ? "HB_LANG_ITEM_BASE_ERRINTR", "[" + hb_langMessage( HB_LANG_ITEM_BASE_ERRINTR ) + "]" - ? "HB_LANG_ITEM_BASE_TEXT ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_TEXT ) + "]" + ? "HB_LANG_ITEM_BASE_TEXT ", "[" + hb_langMessage( HB_LANG_ITEM_BASE_TEXT ) + "]" ? "hb_langErrMsg(0)", hb_langErrMsg( 0 ) ? - ? "date format: " + hb_langMessage( HB_LANG_ITEM_BASE_TEXT ) + " (" + cDtFrm + ")" - ? " TRUE val: " + hb_langMessage( HB_LANG_ITEM_BASE_TEXT + 1 ) + " (" + cTrue + ")" - ? " FALSE val: " + hb_langMessage( HB_LANG_ITEM_BASE_TEXT + 2 ) + " (" + cFalse + ")" + ? "date format:", hb_langMessage( HB_LANG_ITEM_BASE_TEXT ) + " (" + cDtFrm + ")" + ? " TRUE val:", hb_langMessage( HB_LANG_ITEM_BASE_TEXT + 1 ) + " (" + cTrue + ")" + ? " FALSE val:", hb_langMessage( HB_LANG_ITEM_BASE_TEXT + 2 ) + " (" + cFalse + ")" ? Inkey( 0 ) ? "Errors:" - ? "-------" + ? a := GET_ERR() FOR i := 1 TO Len( a ) - ? PadR( a[ i, 1 ], 15 ) + "|" + PadR( aErr[ i, 2 ], 30 ) + "|" + PadR( a[ i, 2 ], 32 ) + ? PadR( a[ i ][ 1 ], 15 ) + "|" + PadR( aErr[ i ][ 2 ], 30 ) + "|" + PadR( a[ i ][ 2 ], 32 ) NEXT ? Inkey( 0 ) ? "Internal errors:" - ? "----------------" + ? a := GET_IERR() FOR i := 1 TO Len( a ) - ? PadR( a[ i, 1 ], 15 ) + "|" + PadR( aInt[ i, 2 ], 30 ) + "|" + PadR( a[ i, 2 ], 32 ) + ? PadR( a[ i ][ 1 ], 15 ) + "|" + PadR( aInt[ i ][ 2 ], 30 ) + "|" + PadR( a[ i ][ 2 ], 32 ) NEXT ? Inkey( 0 ) ? "Days:" - ? "-----" + ? a := GET_DAYS() FOR i := 1 TO Len( a ) ? " " + PadR( aDay[ i ], 15 ) + a[ i ] @@ -66,7 +66,7 @@ PROCEDURE Main( cLng ) Inkey( 0 ) ? "Months:" - ? "-------" + ? a := GET_MONTHS() FOR i := 1 TO Len( a ) ? " " + PadR( aMnt[ i ], 15 ) + a[ i ] @@ -76,7 +76,7 @@ PROCEDURE Main( cLng ) RETURN -FUNCTION GET_DAYS() +STATIC FUNCTION GET_DAYS() LOCAL i, n, aDays[ 7 ], dt := Date() @@ -88,7 +88,7 @@ FUNCTION GET_DAYS() RETURN aDays -FUNCTION GET_MONTHS() +STATIC FUNCTION GET_MONTHS() LOCAL i, n, aMonths[ 12 ], dt := Date() @@ -102,11 +102,8 @@ FUNCTION GET_MONTHS() RETURN aMonths -FUNCTION GET_ERR() - - LOCAL aErr - - aErr := { ; +STATIC FUNCTION GET_ERR() + RETURN { ; { "EG_ARG ", hb_langErrMsg( 1 ) }, ; { "EG_BOUND ", hb_langErrMsg( 2 ) }, ; { "EG_STROVERFLOW ", hb_langErrMsg( 3 ) }, ; @@ -158,17 +155,11 @@ FUNCTION GET_ERR() { "EG_NOTARRAY ", hb_langErrMsg( 49 ) }, ; { "EG_CONDITION ", hb_langErrMsg( 50 ) } } - RETURN aErr - -FUNCTION HB_LANGERRINTR( n ) - +STATIC FUNCTION HB_LANGERRINTR( n ) RETURN hb_langMessage( HB_LANG_ITEM_BASE_ERRINTR + n - 9000 ) -FUNCTION GET_IERR() - - LOCAL aErr - - aErr := { ; +STATIC FUNCTION GET_IERR() + RETURN { ; { "HB_EI_ERRUNRECOV ", HB_LANGERRINTR( 9000 ) }, ; { "HB_EI_ERRRECFAILURE ", HB_LANGERRINTR( 9001 ) }, ; { "HB_EI_ERRNOBLOCK ", HB_LANGERRINTR( 9002 ) }, ; @@ -195,5 +186,3 @@ FUNCTION GET_IERR() { "HB_EI_XGRABNULLSIZE ", HB_LANGERRINTR( 9023 ) }, ; { "HB_EI_XREALLOCNULLSIZE", HB_LANGERRINTR( 9024 ) }, ; { "HB_EI_XALLOCNULLSIZE ", HB_LANGERRINTR( 9025 ) } } - - RETURN aErr diff --git a/tests/rto_get.prg b/tests/rto_get.prg index cb533717fd..c6f649e441 100644 --- a/tests/rto_get.prg +++ b/tests/rto_get.prg @@ -51,11 +51,11 @@ #include "inkey.ch" #ifndef __HARBOUR__ - #define hb_eol() ( Chr( 13 ) + Chr( 10 ) ) - #define hb_ntos( n ) LTrim( Str( n ) ) + #define hb_eol() ( Chr( 13 ) + Chr( 10 ) ) + #define hb_ntos( n ) LTrim( Str( n ) ) #endif -#translate TEST_LINE( ) => TEST_CALL( o, #, {|| } ) +#xtranslate TEST_LINE( ) => TEST_CALL( o, #, {|| } ) STATIC s_cTest := "" STATIC s_xVar := NIL diff --git a/tests/rto_tb.prg b/tests/rto_tb.prg index 14761d188a..a1af77bc6c 100644 --- a/tests/rto_tb.prg +++ b/tests/rto_tb.prg @@ -1,7 +1,8 @@ /* - * Regression tests for classes TBrowse/TBColumn + * Regression tests for classes TBrowse()/TBColumn() * * Copyright 1999-2007 Viktor Szakats (vszakats.net/harbour) + * Copyright 2007 Przemyslaw Czerpak (eInstVar() - from RTL) * * 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 @@ -44,35 +45,25 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * - * Copyright 2007 Przemyslaw Czerpak - * eInstVar() (from RTL) - * - * See COPYING.txt for licensing terms. - * - */ - /* NOTE: This source can be compiled with both Harbour and CA-Cl*pper. */ #include "error.ch" #include "fileio.ch" #ifndef __HARBOUR__ - #define hb_eol() ( Chr( 13 ) + Chr( 10 ) ) - #define hb_ntos( n ) LTrim( Str( n ) ) + #define hb_eol() ( Chr( 13 ) + Chr( 10 ) ) + #define hb_ntos( n ) LTrim( Str( n ) ) #endif #ifdef __XHARBOUR__ #ifndef HB_COMPAT_C53 - /* It makes xhb crash. */ + /* It makes xHarbour crash. */ /* #define HB_COMPAT_C53 */ #endif #endif -#translate TEST_L_TBR( ) => TEST_C_TBR( o, #, {|| } ) -#translate TEST_L_TBC( ) => TEST_C_TBC( o, #, {|| } ) +#xtranslate TEST_L_TBR( ) => TEST_C_TBR( o, #, {|| } ) +#xtranslate TEST_L_TBC( ) => TEST_C_TBC( o, #, {|| } ) STATIC s_cTest := "" STATIC s_xVar := NIL