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
This commit is contained in:
@@ -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 <me@example.org>
|
||||
$NAME$
|
||||
|
||||
$CATEGORY$
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009 April White <bright.tigra gmail.com>
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2009 April White <bright.tigra gmail.com>
|
||||
$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 <URL:https://vszakats.github.io/harbour-core/>.
|
||||
If you have any problems with this copy of Harbour please visit our web
|
||||
The Harbour website is at <https://vszakats.github.io/harbour-core/>.
|
||||
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
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: ASort()
|
||||
*
|
||||
* Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -22,7 +12,7 @@
|
||||
$ONELINER$
|
||||
Create an uninitialized array of specified length
|
||||
$SYNTAX$
|
||||
Array( <nElements> [, <nElements>...] ) --> aArray
|
||||
Array( <nElements>[, <nElements>...] ) --> aArray
|
||||
$ARGUMENTS$
|
||||
<nElements> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -73,29 +62,28 @@
|
||||
$ONELINER$
|
||||
Dynamically add an element to an array
|
||||
$SYNTAX$
|
||||
AAdd( <aArray>[, <xValue>] ) --> Value
|
||||
AAdd( <aArray>, [<xValue>] ) --> xValue
|
||||
$ARGUMENTS$
|
||||
<aArray> The name of an array
|
||||
|
||||
<xValue> Element to add to array <aArray>
|
||||
$RETURNS$
|
||||
<Value> if specified <xValue>, <xValue> will return , otherwise this
|
||||
function returns a NIL value.
|
||||
<xValue> if specified <xValue>, <xValue> will be returned,
|
||||
otherwise this function returns a NIL value.
|
||||
$DESCRIPTION$
|
||||
This function dynamically increases the length of the array named
|
||||
<aArray> by one element and stores the value of <xValue> to that
|
||||
newly created element.
|
||||
This function dynamically increases the length of the <aArray>
|
||||
by adding one new element to the end of the array and optionally
|
||||
stores the value <xValue> to that newly created element.
|
||||
|
||||
<xValue> may be an array reference pointer, which in turn may be
|
||||
stored to an array's subscript position.
|
||||
<xValue> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -119,25 +109,29 @@
|
||||
$ONELINER$
|
||||
Adjust the size of an array
|
||||
$SYNTAX$
|
||||
ASize( <aArray>, <nLen> ) --> aTarget
|
||||
ASize( <aArray>, <nLen> ) --> aArray
|
||||
$ARGUMENTS$
|
||||
<aArray> Name of array to be dynamically altered
|
||||
|
||||
<nLen> Numeric value representing the new size of <aArray>
|
||||
<nLen> Numeric value representing the new size (i.e. number of elements)
|
||||
of <aArray>
|
||||
$RETURNS$
|
||||
<aTarget> an array pointer reference to <aTarget>.
|
||||
The function returns a reference to <aArray>.
|
||||
$DESCRIPTION$
|
||||
This function will dynamically increase or decrease the size of
|
||||
<aArray> by adjusting the length of the array to <nLen> subscript
|
||||
positions.
|
||||
|
||||
If the length of the array <aArray> 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 <aArray> 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 <culik@sl.conex.net>
|
||||
$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( <aArray> ) --> Element
|
||||
ATail( <aArray> ) --> xValue
|
||||
$ARGUMENTS$
|
||||
<aArray> is the array.
|
||||
$RETURNS$
|
||||
<Element> the expression of the last element in the array.
|
||||
<xValue> the value of the last element in the array.
|
||||
$DESCRIPTION$
|
||||
This function return the value of the last element in the array
|
||||
named <aArray>. This function does not alter the size of the
|
||||
array or any of the subscript values.
|
||||
named <aArray>. 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -197,13 +194,13 @@
|
||||
$ONELINER$
|
||||
Insert a NIL value at an array subscript position.
|
||||
$SYNTAX$
|
||||
AIns( <aArray>, <nPos> ) --> aTarget
|
||||
AIns( <aArray>, <nPos> ) --> aArray
|
||||
$ARGUMENTS$
|
||||
<aArray> Array name.
|
||||
|
||||
<nPos> Subscript position in <aArray>
|
||||
$RETURNS$
|
||||
<aTarget> an array pointer reference.
|
||||
a reference to <aArray>.
|
||||
$DESCRIPTION$
|
||||
This function inserts a NIL value in the array named <aArray>
|
||||
at the <nPos>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 <aArray>
|
||||
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. <pete_westg@yahoo.gr>
|
||||
$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>, [<nPos>], [<xValue>], [<lAutoSize>] ) --> aArray
|
||||
$ARGUMENTS$
|
||||
<aArray> The array name into which the value <xValue> will be inserted.
|
||||
|
||||
<nPos> Subscript position in <aArray>. Default: 1st position
|
||||
|
||||
<xValue> Value to be inserted
|
||||
|
||||
<lAutoSize> Boolean flag to increase or not the size of <aArray>.
|
||||
Default value: .F.
|
||||
$RETURNS$
|
||||
A reference to array <aArray>
|
||||
$DESCRIPTION$
|
||||
This function inserts <xValue> in the <nPos> position of the array,
|
||||
moving all the items one position down in the array list.
|
||||
If <lAutoSize> 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 <lAutoSize> is .F. (or is not passed) the function behaves like AIns(),
|
||||
that is, the size of <aArray> won't change and the last item of <aArray>
|
||||
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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -239,26 +296,31 @@
|
||||
$SUBCATEGORY$
|
||||
Array
|
||||
$ONELINER$
|
||||
Delete an element form an array.
|
||||
Delete an element from an array.
|
||||
$SYNTAX$
|
||||
ADel( <aArray>, <nPos> ) --> aTarget
|
||||
ADel( <aArray>, <nPos> ) --> aArray
|
||||
$ARGUMENTS$
|
||||
<aArray> Name of array from which an element is to be removed.
|
||||
|
||||
<nPos> Subscript of the element to be removed.
|
||||
$RETURNS$
|
||||
<aTarget> an array pointer reference.
|
||||
<aArray> an array pointer reference.
|
||||
$DESCRIPTION$
|
||||
This function deletes the element found at <nPos> subscript position
|
||||
in the array <aArray>. All elements in the array <aArray> below the
|
||||
given subscript position <nPos> will move up one position in the
|
||||
array. In other words, what was formerly the sixth subscript position
|
||||
given subscript position <nPos> 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
|
||||
<aArray> 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. <pete_westg@yahoo.gr>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
hb_ADel()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Array
|
||||
$ONELINER$
|
||||
Delete an element from an array.
|
||||
$SYNTAX$
|
||||
hb_ADel( <aArray>, [<nPos>], [<lAutoSize>] ) --> aArray
|
||||
$ARGUMENTS$
|
||||
<aArray> Name of array from which an element is to be removed.
|
||||
|
||||
<nPos> Subscript of the element to be removed. Default value: 1.
|
||||
|
||||
<lAutoSize> Boolean flag specifying if the array will be resized or not.
|
||||
Default value: .F. (no resize).
|
||||
$RETURNS$
|
||||
<aArray> an array pointer reference.
|
||||
$DESCRIPTION$
|
||||
This function deletes the element value (not the element itself!)
|
||||
stored in position <nPos> and shifts all the following values,
|
||||
one position up.
|
||||
|
||||
If <lAutoSize> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -282,7 +396,7 @@
|
||||
$ONELINER$
|
||||
Fill an array with a specified value
|
||||
$SYNTAX$
|
||||
AFill( <aArray>, <xValue>, [<nStart>], [<nCount>] ) --> aTarget
|
||||
AFill( <aArray>, <xValue>, [<nStart>], [<nCount>] ) --> aArray
|
||||
$ARGUMENTS$
|
||||
<aArray> Name of array to be filled.
|
||||
|
||||
@@ -292,23 +406,26 @@
|
||||
|
||||
<nCount> Number of subscript to be filled
|
||||
$RETURNS$
|
||||
<aTarget> an array pointer.
|
||||
<aArray> pointer to the array.
|
||||
$DESCRIPTION$
|
||||
This function will fill each element of an array named <aArray> with
|
||||
the value <xValue>. If specified, <nStart> denotes the beginning
|
||||
element to be filled and the array elements will continue to be
|
||||
filled for <nCount> positions. If Not specified, the value of
|
||||
<nStart> will be 1, and the value of <nCount> will be the value
|
||||
of Len( <aArray> ); thus, all subscript positions in the array
|
||||
<aArray> will be filled with the value of <xValue>.
|
||||
filled for <nCount> positions.
|
||||
|
||||
If neither <nStart>/<nCount> specified, the value of <nStart> will be 1,
|
||||
and the value of <nCount> will be the value of `Len( <aArray> )`;
|
||||
thus, all subscript positions in the array <aArray> will be filled
|
||||
with the value of <xValue>.
|
||||
|
||||
This function will work on only a single dimension of <aArray>.
|
||||
If there are array pointer references within a subscript <aArray>,
|
||||
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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -332,9 +451,9 @@
|
||||
$ONELINER$
|
||||
Scan array elements for a specified condition
|
||||
$SYNTAX$
|
||||
AScan( <aTarget>, <xSearch>, [<nStart>], [<nCount>] ) --> nStoppedAt
|
||||
AScan( <aArray>, <xSearch>, [<nStart>], [<nCount>] ) --> nStoppedAt
|
||||
$ARGUMENTS$
|
||||
<aTarget> Array to be scanned.
|
||||
<aArray> Array to be scanned.
|
||||
|
||||
<xSearch> Expression to search for in <aTarget>
|
||||
|
||||
@@ -345,18 +464,15 @@
|
||||
<nStoppedAt> A numeric value of subscript position where <xSearch>
|
||||
was found, or 0 if <xSearch> is not found.
|
||||
$DESCRIPTION$
|
||||
This function scan the content of array named <aTarget> for the
|
||||
This function scan the content of array named <aArray> for the
|
||||
value of <xSearch>. The return value is the position in the array
|
||||
<aTarget> in which <xSearch> was found. If it was not found, the
|
||||
<aArray> in which <xSearch> 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 <nStart>. The default
|
||||
is 1.
|
||||
|
||||
If specified, the number of array elements to scan may be set with
|
||||
the value passed as <nCount>. The default is the number of elements
|
||||
in the array <aTarget>.
|
||||
<nStart> is the position from which to start scanning. The default
|
||||
is 1. (1st element)
|
||||
<nCount>, if specified, is the number of array elements to be scanned.
|
||||
The default is all elements in the array <aArray>.
|
||||
|
||||
If <xSearch> 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. <pete_westg@yahoo.gr>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
hb_AScan()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Array
|
||||
$ONELINER$
|
||||
Scan array elements for a specified condition
|
||||
$SYNTAX$
|
||||
hb_AScan( <aArray>, <xSearch>, [<nStart>], [<nCount>], [<lExact>] ) --> nPosition
|
||||
$ARGUMENTS$
|
||||
<aArray> Array to be scanned.
|
||||
|
||||
<xSearch> Expression to search for in <aArray>
|
||||
|
||||
<nStart> Beginning subscript position at which to start the search.
|
||||
Default value: 1
|
||||
|
||||
<nCount> Number of elements to be scanned within <aArray>.
|
||||
Default value: All elements.
|
||||
|
||||
<lExact> Boolean flag specifying if an "Exact" search will be
|
||||
performed or not. Default value: .F.
|
||||
$RETURNS$
|
||||
<nPosition> A numeric value > 0 indicating the array position
|
||||
where <xSearch> was found, or 0 if nothing found.
|
||||
$DESCRIPTION$
|
||||
The function scans (left to right) for <xSearch> into <aArray>
|
||||
and returns <nPosition> of <aArray> in which <xSearch>
|
||||
was found or 0 (zero) if nothing found.
|
||||
|
||||
If <lExact> is .T., then an exact search will be performed.
|
||||
When <xSearch> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -401,20 +578,29 @@
|
||||
$RETURNS$
|
||||
<aArray> an array pointer reference.
|
||||
$DESCRIPTION$
|
||||
This function will evaluate and process the subscript elements
|
||||
in <aArray>. A code block passed as <bBlock> defines the operation
|
||||
to be executed on each element of the array. All elements in <aArray>
|
||||
will be evaluated unless specified by a beginning subscript position
|
||||
in <nStart> for <nCount> elements.
|
||||
This function evaluates the elements of <aArray>, and executes for each
|
||||
of them the processing that's defined with <bBlock>.
|
||||
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 <bBlock>. The individual
|
||||
elements in an array are the first parameter and the subscript position
|
||||
is the second.
|
||||
If <nStart> and/or <nCount> parameters are given, then the processing
|
||||
starts from <nStart> element and continues for the next <nCount> 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 <bBlock> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -454,18 +642,15 @@
|
||||
<aTarget> an array pointer reference
|
||||
$DESCRIPTION$
|
||||
This function copies array elements from <aSource> to <aTarget>.
|
||||
|
||||
<nStart> is the beginning element to be copied from <aSource>;
|
||||
the default is 1.
|
||||
|
||||
<nCount> is the number of elements to be copied from <aSource>;
|
||||
the default is the entire array.
|
||||
|
||||
<nTargetPos> is the subscript number in the target array, <aTarget>,
|
||||
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 <aSource> to <aTarget>.
|
||||
|
||||
If an array element in <aSource> is a pointer reference to another
|
||||
array, that array pointer will be copied to <aTarget>; 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 <aTarget> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -517,13 +705,12 @@
|
||||
a complete set of arrays values for all dimensions within the
|
||||
original array <aSource>
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -554,10 +743,10 @@
|
||||
<nStart> The first element to start the sort from, default is 1.
|
||||
|
||||
<nCount> Number of elements starting from <nStart> to sort, default
|
||||
is all elements.
|
||||
is all elements.
|
||||
|
||||
<bSort> 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$
|
||||
<aArray> reference to the now sorted <aArray> 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 <bSort> 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 <bSort> 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$
|
||||
|
||||
50
doc/en/ati.txt
Normal file
50
doc/en/ati.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
2016 Pete D. <pete_westg@yahoo.gr>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
hb_AtI()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Strings
|
||||
$ONELINER$
|
||||
Locates the position of a substring in a main string.
|
||||
$SYNTAX$
|
||||
hb_AtI( <cSearch>, <cString>, [<nStart>], [<nEnd>] ) --> nPos
|
||||
$ARGUMENTS$
|
||||
<cSearch> the sub-string to search for
|
||||
|
||||
<cString> The main string to search into, for <cSearch>
|
||||
|
||||
<nStart> Beginning search position into <cString>, default: 1
|
||||
|
||||
<nEnd> Ending search position, default: Length of <cString> (i.e. entire <cString>)
|
||||
|
||||
$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 <nStart> can be defined the position into main string
|
||||
from where the search of <cSearch> must begin and with <nEnd> the position
|
||||
where it must stop. If neither of them is defined, <nStart> is 1st position
|
||||
and <nEnd> the ending of <cString>.
|
||||
$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$
|
||||
*/
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: Bin2I(), Bin2L(), I2Bin(), L2Bin()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -26,7 +20,7 @@
|
||||
$RETURNS$
|
||||
Bin2I() return numeric integer (or 0 if <cBuffer> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -87,7 +81,7 @@
|
||||
$RETURNS$
|
||||
Bin2L() return numeric integer (or 0 if <cBuffer> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
Bin2W()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Conversion
|
||||
$ONELINER$
|
||||
Convert unsigned short encoded bytes into Harbour numeric
|
||||
$SYNTAX$
|
||||
Bin2W( <cBuffer> ) --> nNumber
|
||||
$ARGUMENTS$
|
||||
<cBuffer> 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 <cBuffer> 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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$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( <nDouble> ) --> <nInteger>
|
||||
Word( <nDouble> ) --> nInteger
|
||||
$ARGUMENTS$
|
||||
<nDouble> is a numeric double value.
|
||||
$RETURNS$
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: Browse(), dbEdit(), TBrowseDB()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -43,22 +37,22 @@
|
||||
into idle mode. If <xUserFunc> 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: <nMode>, <nCurrentColumn>. 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 <nMode> and return codes).
|
||||
|
||||
<xColumnSayPictures> is an optional picture. If <xColumnSayPictures>
|
||||
is a character string, all columns would used this value as a
|
||||
picture string. If <xColumnSayPictures> 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.
|
||||
|
||||
<xColumnHeaders> 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 <acColumns> or field name if <acColumns> 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(): </par>
|
||||
---------------------------------------------------
|
||||
Following are active keys that handled by dbEdit():
|
||||
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
|
||||
When <xUserFunc> is omitted, two more keys are active:
|
||||
@@ -125,12 +118,11 @@
|
||||
</table>
|
||||
|
||||
When dbEdit() execute <xUserFunc> it pass the following arguments:
|
||||
nMode and the index of current record in <acColumns>. If <acColumns>
|
||||
is omitted, the index number is the FIELD() number of the open
|
||||
<nMode> and the index of current record in <acColumns>. If <acColumns>
|
||||
is omitted, the index number is the FieldName() number of the open
|
||||
database structure.
|
||||
|
||||
dbEdit() nMode could be one of the following: </par>
|
||||
---------------------------------------------
|
||||
dbEdit() <nMode> could be one of the following:
|
||||
|
||||
<table>
|
||||
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: </par>
|
||||
--------------------------- </par>
|
||||
User function return codes:
|
||||
|
||||
<table>
|
||||
dbedit.ch Meaning
|
||||
@@ -195,6 +186,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
$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()
|
||||
</table>
|
||||
|
||||
On top of the screen you see a status line with the following
|
||||
indication:
|
||||
|
||||
<table>
|
||||
<table>
|
||||
Record ###/### Current record number / Total number of records.
|
||||
<none> There are no records, the file is empty.
|
||||
<new> 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 <niki@actcom.co.il>
|
||||
$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$
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Brian Hays <bhays@abacuslaw.com>
|
||||
* Documentation for the commands
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Brian Hays <bhays@abacuslaw.com>
|
||||
$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 <bhays@abacuslaw.com>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -102,7 +103,7 @@
|
||||
<DataName1> Name of the VAR
|
||||
|
||||
<type> Optional data type specification from the following:
|
||||
Character, Numeric, Date, Logical, Codeblock, Nil.
|
||||
Character, Numeric, Date, Logical, Codeblock, NIL.
|
||||
|
||||
<uValue> 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 <type>" clause to enforce that the VAR is
|
||||
You can use the `AS <type>` 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 <uValue>" clause to initialize that VAR to <uValue>
|
||||
Use the `INIT <uValue>` clause to initialize that VAR to <uValue>
|
||||
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 <bhays@abacuslaw.com>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -182,23 +190,24 @@
|
||||
<DataName1> Name of the VAR
|
||||
|
||||
<type> Optional data type specification from the following:
|
||||
Character, Numeric, Date, Logical, Codeblock, Nil
|
||||
Character, Numeric, Date, Logical, Codeblock, NIL
|
||||
|
||||
<uValue> 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 <type>" clause to enforce that the CLASS VAR is
|
||||
You can use the `AS <type>` 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 <uValue>" clause to initialize that VAR to <uValue>
|
||||
Use the `INIT <uValue>` clause to initialize that `VAR` to <uValue>
|
||||
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 <bhays@abacuslaw.com>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -227,19 +238,12 @@
|
||||
Declare a METHOD for a class in the class header
|
||||
$SYNTAX$
|
||||
METHOD <MethodName>( [<params,...>] ) [CONSTRUCTOR]
|
||||
|
||||
METHOD <MethodName>( [<params,...>] ) INLINE <Code,...>
|
||||
|
||||
METHOD <MethodName>( [<params,...>] ) BLOCK <CodeBlock>
|
||||
|
||||
METHOD <MethodName>( [<params,...>] ) EXTERN <NAME>( [<args,...>] )
|
||||
|
||||
METHOD <MethodName>( [<params,...>] ) SETGET
|
||||
|
||||
METHOD <MethodName>( [<params,...>] ) VIRTUAL
|
||||
|
||||
METHOD <MethodName>( [<param>] ) OPERATOR <op>
|
||||
|
||||
METHOD <MethodName>( [<params,...>] ) CLASS <ClassName>
|
||||
$ARGUMENTS$
|
||||
<MethodName> Name of the method to define
|
||||
@@ -254,8 +258,8 @@
|
||||
|
||||
METHOD <MethodName>( [<params,...>] ) CLASS <ClassName>
|
||||
|
||||
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 <Code,...> following INLINE receives a parameter
|
||||
The <Code, ...> 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
|
||||
<CodeBlock> must be Self, as in:
|
||||
|
||||
METHOD <MethodName> BLOCK {| Self, <arg1>, <arg2>, ..., <argN> | ... }
|
||||
METHOD `<MethodName> BLOCK {| Self, <arg1>, <arg2>, ..., <argN> | ... }`
|
||||
|
||||
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
|
||||
... <code> ...
|
||||
... <code> ...
|
||||
// ... <code> ...
|
||||
// ... <code> ...
|
||||
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 <bhays@abacuslaw.com>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -336,7 +344,6 @@
|
||||
Route a method call to another Method
|
||||
$SYNTAX$
|
||||
MESSAGE <MessageName> METHOD <MethodName>( [<params,...>] )
|
||||
|
||||
MESSAGE <MessageName>() METHOD <MethodName>( [<params,...>] )
|
||||
$ARGUMENTS$
|
||||
<MessageName> 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 <bhays@abacuslaw.com>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -397,12 +408,17 @@
|
||||
|
||||
<params,...> 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 <bhays@abacuslaw.com>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -432,13 +450,18 @@
|
||||
|
||||
<params,...> 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 <bhays@abacuslaw.com>
|
||||
$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$
|
||||
*/
|
||||
|
||||
@@ -8,132 +8,138 @@
|
||||
$SUBCATEGORY$
|
||||
Compiler
|
||||
$DESCRIPTION$
|
||||
<b>Invoking the Harbour compiler: </b> </par>
|
||||
============================== </par>
|
||||
<b>Invoking the Harbour compiler:</b>
|
||||
==============================
|
||||
|
||||
harbour <file[.prg]> [options] </par>
|
||||
or </par>
|
||||
harbour [options] <file[.prg]> </par>
|
||||
or </par>
|
||||
harbour [options] <file[.prg]> [options] </par>
|
||||
```
|
||||
harbour <file[.prg]> [options]
|
||||
```
|
||||
or
|
||||
```
|
||||
harbour [options] <file[.prg]>
|
||||
```
|
||||
or
|
||||
```
|
||||
harbour [options] <file[.prg]> [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.
|
||||
|
||||
<b>The Harbour command-line options: </b> </par>
|
||||
================================= </par>
|
||||
<b>The Harbour command-line options:</b>
|
||||
=================================
|
||||
|
||||
/a automatic memvar declaration </par>
|
||||
================= </par>
|
||||
`-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 </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-b` debug info
|
||||
|
||||
The compiler generates all information required for debugging
|
||||
|
||||
/build display detailed version info </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-build` display detailed version info
|
||||
|
||||
/credits display credits </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-credits` display credits
|
||||
|
||||
/d<id>[=<val>] #define <id> </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-d<id>[=<val>]` `#define <id>`
|
||||
|
||||
/es[<level>] set exit severity </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-es[<level>]` 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) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-fn[:[l|u]|-]` set file name casing (`l`=lower `u`=upper)
|
||||
|
||||
/fd[:[l|u]|-] set directory casing (l=lower u=upper) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-fd[:[l|u]|-]` set directory casing (`l`=lower `u`=upper)
|
||||
|
||||
/fp[:<char>] set path separator </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-fp[:<char>]` set path separator
|
||||
|
||||
/fs[-] turn filename space trimming on or off (default) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-fs[-]` turn file name space trimming on or off (default)
|
||||
|
||||
/g<type> output type generated is <type> </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-g<type>` output type generated is <type>
|
||||
|
||||
/gc[<type>] output type: C source (.c) (default)
|
||||
<type>: 0=compact (default) 1=normal 2=verbose
|
||||
3=generate real C code
|
||||
`-gc[<type>]` output type: C source `.c` (default)
|
||||
<type>: `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[.<destext>] generate dependencies list into (.d) file
|
||||
`-gd[.<destext>]` generate dependencies list into `.d` file
|
||||
|
||||
/ge[<mode>] error output <mode>: 0=Clipper (default)
|
||||
1=IDE friendly
|
||||
`-ge[<mode>]` error output <mode>: `0`=Clipper (default)
|
||||
`1`=IDE friendly
|
||||
|
||||
/i<path> #include file search path </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-i<path>` #include file search path
|
||||
|
||||
/i[-|+] disable/enable support for INCLUDE envvar </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-i[-|+]` disable/enable support for INCLUDE envvar
|
||||
|
||||
/j[<file>] generate i18n gettext file (.pot) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-j[<file>]` generate i18n gettext file `.pot`
|
||||
|
||||
/k<mode> compilation mode (type -k? for more data) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-k<mode>` 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 </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-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 </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-m` compile module only
|
||||
|
||||
/n[<type>] no implicit starting procedure </par>
|
||||
================= </par>
|
||||
<type>: 0=no implicit starting procedure
|
||||
1=no starting procedure at all
|
||||
2=add starting procedure if necessary
|
||||
=================
|
||||
`-n[<type>]` no implicit starting procedure
|
||||
|
||||
<type>: `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<path> object file drive and/or path </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-o<path>` object file drive and/or path
|
||||
|
||||
/p generate pre-processed output (.ppo) file </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-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 </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-p+` generate pre-processor trace `.ppt` file
|
||||
|
||||
/q quiet </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-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[<lib>] request linker to search <lib> (or none) </par>
|
||||
================= </par>
|
||||
`-ql` suppress line number information
|
||||
|
||||
=================
|
||||
`-r[<lib>]` request linker to search <lib> (or none)
|
||||
|
||||
Currently not supported in Harbour.
|
||||
|
||||
/r=<max> sets maximum number of preprocessor iterations </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-r=<max>` 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] </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-s[m]` syntax check only [minimal for dependencies list]
|
||||
|
||||
The compiler checks the syntax only. No output file is generated.
|
||||
|
||||
/t<path> path for temp file creation </par>
|
||||
================= </par>
|
||||
|
||||
=================
|
||||
`-t<path>` path for temp file creation
|
||||
|
||||
Currently not used in Harbour (the Harbour compiler does not
|
||||
create any temporary files).
|
||||
|
||||
/u[<file>] use command def set in <file> (or none) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-u[<file>]` use command def set in <file> (or none)
|
||||
|
||||
/u+<file> add command def set from <file> </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-u+<file>` add command def set from <file>
|
||||
|
||||
/undef:<id> #undef <id> </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-undef:<id>` `#undef <id>`
|
||||
|
||||
/v variables are assumed M-> </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-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[<level>] set warning level number (0..3, default 1) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-w[<level>]` 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[<prefix>] set symbol init function name prefix (for .c only) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-x[<prefix>]` 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.) </par>
|
||||
================= </par>
|
||||
=================
|
||||
`-z` suppress shortcutting (`.AND.` & `.OR.`)
|
||||
|
||||
Compilation in batch mode. </par>
|
||||
========================== </par>
|
||||
Compilation in batch mode.
|
||||
==========================
|
||||
|
||||
@<file> compile list of modules in <file> </par>
|
||||
================= </par>
|
||||
`@file` compile list of modules in <file>
|
||||
|
||||
Not supported yet.
|
||||
|
||||
<b>Known incompatibilities between Harbour and CA-Cl*pper compilers </b> </par>
|
||||
============================================================= </par>
|
||||
<b>Known incompatibilities between Harbour and CA-Cl*pper compilers</b>
|
||||
=============================================================
|
||||
|
||||
NOTE: </par>
|
||||
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.
|
||||
|
||||
<b>Passing an undeclared variable by the reference </b> </par>
|
||||
=============================================== </par>
|
||||
<b>Passing an undeclared variable by the reference</b>
|
||||
===============================================
|
||||
|
||||
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 </par>
|
||||
=========================== </par>
|
||||
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: </par>
|
||||
1) faster </par>
|
||||
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)
|
||||
|
||||
<b>Initialization of static variables </b></par>
|
||||
================================== </par>
|
||||
<b>Initialization of static variables</b>
|
||||
==================================
|
||||
|
||||
There is a difference in the initialization of static
|
||||
variables that are initialized with a codeblock that refers to
|
||||
a local variable. For example:
|
||||
|
||||
<fixed>
|
||||
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 )
|
||||
</fixed>
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -47,6 +41,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -122,6 +120,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -198,6 +200,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -271,6 +277,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -286,12 +294,12 @@
|
||||
$ARGUMENTS$
|
||||
<dDateString> Any date
|
||||
$RETURNS$
|
||||
<dDate> Character represention of date
|
||||
<dDate> Character representation of date
|
||||
$DESCRIPTION$
|
||||
This function converts any date expression (a field or variable)
|
||||
expressed as <dDateString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -327,7 +337,7 @@
|
||||
<dDate> String notation of the date
|
||||
$DESCRIPTION$
|
||||
This function returns the value of <dDateString> as a character
|
||||
string in the format of YYYYMMDD. If the value of <dDateString> is
|
||||
string in the format of `YYYYMMDD`. If the value of <dDateString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -354,14 +366,14 @@
|
||||
$SUBCATEGORY$
|
||||
Date/Time
|
||||
$ONELINER$
|
||||
Calculates elapted time.
|
||||
Calculates elapsed time.
|
||||
$SYNTAX$
|
||||
ElapTime( <cStartTime>, <cEndTime> ) --> cDiference
|
||||
ElapTime( <cStartTime>, <cEndTime> ) --> cDifference
|
||||
$ARGUMENTS$
|
||||
<cStartTime> Start in time as a string format
|
||||
<cEndTime> End time as a string format
|
||||
$RETURNS$
|
||||
<cDiference> Difference between the times
|
||||
<cDifference> Difference between the times
|
||||
$DESCRIPTION$
|
||||
This function returns a string that shows the difference between
|
||||
the starting time represented as <cStartTime> and the ending time
|
||||
@@ -389,6 +401,58 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
2017 Pete D. <pete_westg@yahoo.gr>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
hb_Week()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Date/Time
|
||||
$ONELINER$
|
||||
Returns the week number of year.
|
||||
$SYNTAX$
|
||||
hb_Week( <dDate>, [@<nYear>], [@<nDayOfWeek>] ) --> nWeekNumber
|
||||
$ARGUMENTS$
|
||||
<dDate> Any valid date expression.
|
||||
|
||||
<nYear> Optional parameter to hold the year of the given date.
|
||||
|
||||
<nDayOfWeek> Optional parameter to hold the day number of week.
|
||||
$RETURNS$
|
||||
<nWeekNumber> The ordinal week number of the year into which falls
|
||||
the given <dDate>.
|
||||
$DESCRIPTION$
|
||||
This function returns the week number of year for the given <dDate>.
|
||||
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 <dDate>, if the <nYear> and/or <nDayOfWeek>
|
||||
parameters have been passed by reference.
|
||||
If <dDate> 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 <culik@sl.conex.net>
|
||||
$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 <dDate>. If a NULL date (CToD( "" )) is passed to the
|
||||
date expression <dDate>. 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -464,6 +530,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -500,6 +568,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -518,7 +588,7 @@
|
||||
<cTime> 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 <culik@sl.conex.net>
|
||||
$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( <cDate> ) --> nYear
|
||||
Year( <dDate> ) --> nYear
|
||||
$ARGUMENTS$
|
||||
<dDate> Any valid date expression
|
||||
$RETURNS$
|
||||
<nYear> The year portion of the date.
|
||||
$DESCRIPTION$
|
||||
This function returns the numeric value for the year in <dDate>.
|
||||
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 <dDate>
|
||||
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 <tDateTime> value from a <dDate> parameter
|
||||
$SYNTAX$
|
||||
hb_DToT( <dDate> [, <cTime|nSeconds>] ) --> <tDateTime>
|
||||
$ARGUMENTS$
|
||||
<dDate> Any valid date expression.
|
||||
|
||||
Optional: <cTime|nSeconds> representing a time of the day value.
|
||||
<cTime> is a string in a valid time format: "hh:mm:ss.nnn".
|
||||
<nSeconds> is a numeric value in seconds in the range from
|
||||
0 to 86399.999~ ( 60 secs * 60 mins * 24 hours - 1 millisecond )
|
||||
$RETURNS$
|
||||
<tDateTime> a dateTime value
|
||||
$DESCRIPTION$
|
||||
This function returns a <tDateTime> value from a <dDate> 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$
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2001-2002 David G. Holm <dholm@jsd-llc.com>
|
||||
* Documentation for: __dbDelim()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001-2002 David G. Holm <dholm@jsd-llc.com>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -29,11 +23,11 @@
|
||||
If a file extension is not specified, ".txt" is used by default.
|
||||
|
||||
<xcDelim> 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.
|
||||
|
||||
<aFields> An aray of field names to limit the processint to. If
|
||||
<aFields> An array of field names to limit the processing to. If
|
||||
not specified, or if empty, then all fields are processed.
|
||||
|
||||
<bFor> An optional code block containing a FOR expression that
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2001-2002 David G. Holm <dholm@jsd-llc.com>
|
||||
* Documentation for: __dbSDF()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001-2002 David G. Holm <dholm@jsd-llc.com>
|
||||
$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( <lExport>, <xcFile>, [<aFields>],
|
||||
[<bFor>], [<bWhile>], [<nNext>], [<nRecord>], <lRest> )
|
||||
[<bFor>], [<bWhile>], [<nNext>], [<nRecord>], <lRest> )
|
||||
$ARGUMENTS$
|
||||
<lExport> If set to .T., copies records to an SDF file.
|
||||
If set to .F., append records from an SDF file.
|
||||
@@ -28,34 +22,35 @@
|
||||
<xcFile> The name of the text file to copy to or append from.
|
||||
If a file extension is not specified, ".txt" is used by default.
|
||||
|
||||
<aFields> An aray of field names to limit the processint to. If
|
||||
not specified, or if empty, then all fields are processed.
|
||||
<aFields> An array of field names to limit the processing to. If not
|
||||
specified, or if empty, then all fields are processed.
|
||||
|
||||
<bFor> An optional code block containing a FOR expression that
|
||||
will reduce the number of records to be processed.
|
||||
<bFor> An optional code block containing a FOR expression that will
|
||||
reduce the number of records to be processed.
|
||||
|
||||
<bWhile> An optional code block containing a WHILE expression
|
||||
that will reduce the number of records to be processed.
|
||||
<bWhile> An optional code block containing a WHILE expression that will
|
||||
reduce the number of records to be processed.
|
||||
|
||||
<nNext> If present, but <nRecord> is not present, specifies to
|
||||
process this number of records, starting with the current record.
|
||||
<nNext> If present, but <nRecord> is not present, specifies to process
|
||||
this number of records, starting with the current record.
|
||||
A value of 0 means to process no records.
|
||||
|
||||
<nRecord> If present, specifies the only record to process. A
|
||||
value of 0 means to process no records. Overrides <nNext> and <lRest>.
|
||||
<nRecord> If present, specifies the only record to process. A value of 0
|
||||
means to process no records. Overrides <nNext> and <lRest>.
|
||||
|
||||
<lRest> If <lExport> is .T., then if <lRest> is set to .T. and there are no
|
||||
<nRecord>, <nNext>, or <bWhile> arguments, processes all records from
|
||||
<lRest> If <lExport> is .T., then if <lRest> is set to .T. and there are
|
||||
no <nRecord>, <nNext>, or <bWhile> 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
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
* 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -22,7 +14,7 @@
|
||||
$SYNTAX$
|
||||
__dbCopyStruct( <cFileName>, [<aFieldList>] )
|
||||
$ARGUMENTS$
|
||||
<cFileName> is the name of the new database file to create. (.dbf)
|
||||
<cFileName> is the name of the new database file to create. `.dbf`
|
||||
is the default extension if none is given.
|
||||
|
||||
<aFieldList> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -76,22 +70,22 @@
|
||||
$SYNTAX$
|
||||
COPY STRUCTURE TO <xcFileName> [FIELDS <field,...>]
|
||||
$ARGUMENTS$
|
||||
<b>TO <xcFileName></b> 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.
|
||||
|
||||
<b>FIELDS <field,...></b> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -126,27 +122,27 @@
|
||||
$SYNTAX$
|
||||
__dbCopyXStruct( <cFileName> ) --> lSuccess
|
||||
$ARGUMENTS$
|
||||
<cFileName> is the name of target definition file to create. (.dbf)
|
||||
<cFileName> 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 <cFileName> with a
|
||||
pre-defined structure (also called "structure extended file"):
|
||||
|
||||
<table>
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
</table>
|
||||
|
||||
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 @@
|
||||
|
||||
<fixed>
|
||||
FIELD->FIELD_DEC := Int( nLength / 256 )
|
||||
FIELD->FIELD_LEN := ( nLength % 256 )
|
||||
FIELD->FIELD_LEN := nLength % 256
|
||||
</fixed>
|
||||
|
||||
Later if you want to calculate the length of a field you can use
|
||||
@@ -168,7 +164,7 @@
|
||||
FIELD->FIELD_LEN )
|
||||
</fixed>
|
||||
|
||||
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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -205,24 +203,24 @@
|
||||
COPY STRUCTURE EXTENDED TO <xcFileName>
|
||||
$ARGUMENTS$
|
||||
<xcFileName> 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 <cFileName> with
|
||||
`COPY STRUCTURE EXTENDED` create a new database named <cFileName> with
|
||||
a pre-defined structure (also called "structure extended file"):
|
||||
|
||||
<table>
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
</table>
|
||||
|
||||
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 @@
|
||||
|
||||
<fixed>
|
||||
FIELD->FIELD_DEC := Int( nLength / 256 )
|
||||
FIELD->FIELD_LEN := ( nLength % 256 )
|
||||
FIELD->FIELD_LEN := nLength % 256
|
||||
</fixed>
|
||||
|
||||
Later if you want to calculate the length of a field you can use
|
||||
@@ -244,7 +242,7 @@
|
||||
FIELD->FIELD_LEN )
|
||||
</fixed>
|
||||
|
||||
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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -278,7 +278,7 @@
|
||||
$SYNTAX$
|
||||
__dbCreate( <cFileName>, [<cFileFrom>], [<cRDDName>], [<lNew>], [<cAlias>] ) --> lUsed
|
||||
$ARGUMENTS$
|
||||
<cFileName> is the target file name to create and then open. (.dbf)
|
||||
<cFileName> is the target file name to create and then open. `.dbf`
|
||||
is the default extension if none is given.
|
||||
|
||||
<cFileFrom> is an optional structure extended file name from which
|
||||
@@ -298,9 +298,9 @@
|
||||
<cAlias> is an optional alias to USE the target file with. If not
|
||||
specified, alias is based on the root name of <cFileName>.
|
||||
$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 (<lNew> is ignored). The new
|
||||
file has the following structure:
|
||||
|
||||
<table>
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
</table>
|
||||
|
||||
The CREATE command is preprocessed into the __dbCopyStruct() function
|
||||
during compile time and uses this mode.
|
||||
@@ -338,10 +338,10 @@
|
||||
|
||||
<fixed>
|
||||
FIELD->FIELD_DEC := Int( nLength / 256 )
|
||||
FIELD->FIELD_LEN := ( nLength % 256 )
|
||||
FIELD->FIELD_LEN := nLength % 256
|
||||
</fixed>
|
||||
|
||||
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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -392,16 +394,16 @@
|
||||
$SYNTAX$
|
||||
CREATE <xcFileName> [VIA <xcRDDName>] [ALIAS <xcAlias>]
|
||||
$ARGUMENTS$
|
||||
<xcFileName> is the target file name to create and then open. (.dbf)
|
||||
<xcFileName> 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.
|
||||
|
||||
<b>VIA <xcRDDName></b> 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.
|
||||
|
||||
<b>ALIAS <xcAlias></b> 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
|
||||
<xcFileName>.
|
||||
$DESCRIPTION$
|
||||
@@ -409,14 +411,14 @@
|
||||
and then open it in the current work-area. The new file has the
|
||||
following structure:
|
||||
|
||||
<table>
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
</table>
|
||||
|
||||
CREATE command is preprocessed into __dbCopyStruct() function during
|
||||
compile time and use this mode.
|
||||
@@ -454,6 +456,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -467,29 +471,29 @@
|
||||
$SYNTAX$
|
||||
CREATE <xcFileName> FROM <xcFileFrom> [VIA <xcRDDName>] [NEW] [ALIAS <xcAlias>]
|
||||
$ARGUMENTS$
|
||||
<xcFileName> is the target file name to create and then open. (.dbf)
|
||||
<xcFileName> 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.
|
||||
|
||||
<b>FROM <xcFileFrom></b> is a structure extended file name from
|
||||
`FROM xcFileFrom` is a structure extended file name from
|
||||
which the target file <xcFileName> is going to be built. It can be
|
||||
specified as literal file name or as a character expression enclosed
|
||||
in parentheses.
|
||||
|
||||
<b>VIA <xcRDDName></b> 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.
|
||||
|
||||
<b>NEW</b> open the target file name <xcFileName> in the next
|
||||
`NEW` open the target file name <xcFileName> in the next
|
||||
available unused work-area and making it the current work-area. If
|
||||
omitted open the target file in current work-area.
|
||||
|
||||
<b>ALIAS <xcAlias></b> 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
|
||||
<xcFileName>.
|
||||
$DESCRIPTION$
|
||||
CREATE FROM open a structure extended file <xcFileFrom> where each
|
||||
`CREATE FROM` open a structure extended file <xcFileFrom> 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 <xcFileName> is
|
||||
@@ -503,13 +507,13 @@
|
||||
|
||||
<fixed>
|
||||
FIELD->FIELD_DEC := Int( nLength / 256 )
|
||||
FIELD->FIELD_LEN := ( nLength % 256 )
|
||||
FIELD->FIELD_LEN := nLength % 256
|
||||
</fixed>
|
||||
|
||||
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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -539,14 +545,14 @@
|
||||
structure, which is usually the output from dbStruct(), where each
|
||||
array element has the following structure:
|
||||
|
||||
<table>
|
||||
<table>
|
||||
Position Description dbstruct.ch
|
||||
|
||||
1 cFieldName DBS_NAME
|
||||
2 cFieldType DBS_TYPE
|
||||
3 nFieldLength DBS_LEN
|
||||
4 nDecimals DBS_DEC
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<aFieldList> 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 <aStruct> MUST be specified in uppercase
|
||||
or else no match would found.
|
||||
Note that field names in <aStruct> _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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -634,14 +642,14 @@
|
||||
structure, which is usually the output from dbStruct(), where each
|
||||
array element has the following structure:
|
||||
|
||||
<table>
|
||||
<table>
|
||||
Position Description dbstruct.ch
|
||||
|
||||
1 cFieldName DBS_NAME
|
||||
2 cFieldType DBS_TYPE
|
||||
3 nFieldLength DBS_LEN
|
||||
4 nDecimals DBS_DEC
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<aFieldList> 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 <aStruct> MUST be specified in uppercase
|
||||
Note that field names in <aStruct> _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
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: __Dir(), DIR, ADir()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -137,7 +135,7 @@
|
||||
Fill pre-defined arrays with file/directory information
|
||||
$SYNTAX$
|
||||
ADir( [<cFileMask>], [<aName>], [<aSize>], [<aDate>],
|
||||
[<aTime>], [<aAttr>] ) --> nDirEnries
|
||||
[<aTime>], [<aAttr>] ) --> nDirEntries
|
||||
$ARGUMENTS$
|
||||
<cFileMask> 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"
|
||||
|
||||
167
doc/en/dirdrive.txt
Normal file
167
doc/en/dirdrive.txt
Normal file
@@ -0,0 +1,167 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
DirRemove()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
FileSys
|
||||
$ONELINER$
|
||||
Attempt to remove an directory
|
||||
$SYNTAX$
|
||||
DirRemove( <cDirectory> ) --> nError
|
||||
$ARGUMENTS$
|
||||
<cDirectory> The name of the directory you want to remove.
|
||||
$RETURNS$
|
||||
<nError> 0 if directory was successfully removed, otherwise
|
||||
the number of the last error.
|
||||
$DESCRIPTION$
|
||||
This function attempt to remove the specified directory in <cDirectory>
|
||||
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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
DirChange()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
FileSys
|
||||
$ONELINER$
|
||||
Changes the directory
|
||||
$SYNTAX$
|
||||
DirChange( <cDirectory> ) --> nError
|
||||
$ARGUMENTS$
|
||||
<cDirectory> The name of the directory you want do change into.
|
||||
$RETURNS$
|
||||
<nError> 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 <cDirectory>. 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
MakeDir()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
FileSys
|
||||
$ONELINER$
|
||||
Create a new directory
|
||||
$SYNTAX$
|
||||
MakeDir( <cDirectory> ) --> nError
|
||||
$ARGUMENTS$
|
||||
<cDirectory> The name of the directory you want to create.
|
||||
$RETURNS$
|
||||
<nError> 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 <cDirectory>. 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
IsDisk()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
FileSys
|
||||
$ONELINER$
|
||||
Verify if a drive is ready
|
||||
$SYNTAX$
|
||||
IsDisk( <cDrive> ) --> lSuccess
|
||||
$ARGUMENTS$
|
||||
<cDrive> An valid drive letter
|
||||
$RETURNS$
|
||||
<lSuccess> .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$
|
||||
*/
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Paul Tucker <ptucker@sympatico.ca>
|
||||
* Documentation for: DiskSpace() and related functions
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Paul Tucker <ptucker@sympatico.ca>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -18,7 +12,7 @@
|
||||
$ONELINER$
|
||||
Get the amount of space available on a disk
|
||||
$SYNTAX$
|
||||
DiskSpace( [<nDrive>] ) --> nDiskbytes
|
||||
DiskSpace( [<nDrive>] ) --> nDiskBytes
|
||||
$ARGUMENTS$
|
||||
<nDrive> 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 <ptucker@sympatico.ca>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -61,7 +57,7 @@
|
||||
$ONELINER$
|
||||
Get the amount of space available on a disk
|
||||
$SYNTAX$
|
||||
hb_DiskSpace( [<cDrive>] [, <nType>] ) --> nDiskbytes
|
||||
hb_DiskSpace( [<cDrive>] [, <nType>] ) --> nDiskBytes
|
||||
$ARGUMENTS$
|
||||
<cDrive> 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$
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: ErrorSys()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* Documentation for: Eval()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -36,15 +30,13 @@
|
||||
specified in the parameter list <xVal> 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$
|
||||
|
||||
416
doc/en/file.txt
416
doc/en/file.txt
@@ -1,20 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: __TypeFile(), TYPE
|
||||
*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* Documentation for: FOpen(), FClose(), FWrite(), FSeek(), FRead(), File(),
|
||||
* FReadStr(), FRename(), FError(), RENAME, ERASE, CurDir(),
|
||||
* DirMake(), DirChange(), IsDisk(), DirRemove(), DiskChange()
|
||||
*
|
||||
* Copyright 2000 David G. Holm <Harbour@SpaceMoose.com>
|
||||
* Documentation for: hb_FEof()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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$
|
||||
<nHandle> Numeric file handle to be used in other operations.
|
||||
$DESCRIPTION$
|
||||
This function creates a new file with a filename of <cFile>. The
|
||||
This function creates a new file with a file name of <cFile>. The
|
||||
default value of <nAttribute> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -203,6 +191,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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( <cBuffer> ) or <nBytes>.
|
||||
by FWrite() is equal to either `Len( cBuffer )` or <nBytes>.
|
||||
|
||||
The value of <cBuffer> is the string or variable to be written to the
|
||||
open file <nHandle>.
|
||||
@@ -240,7 +230,7 @@
|
||||
The disk write begins with the current file position in <nHandle>. If
|
||||
this variable is not used, the entire contents of <cBuffer> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -272,7 +264,7 @@
|
||||
$ONELINER$
|
||||
Reports the error status of low-level file functions
|
||||
$SYNTAX$
|
||||
FError() --> <nErrorCode>
|
||||
FError() --> nErrorCode
|
||||
$RETURNS$
|
||||
<nErrorCode> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -331,7 +325,7 @@
|
||||
$ONELINER$
|
||||
Closes an open file
|
||||
$SYNTAX$
|
||||
FClose( <nHandle> ) --> <lSuccess>
|
||||
FClose( <nHandle> ) --> lSuccess
|
||||
$ARGUMENTS$
|
||||
<nHandle> File handle
|
||||
$RETURNS$
|
||||
@@ -377,7 +371,7 @@
|
||||
$DESCRIPTION$
|
||||
This function deletes the file specified in <cFile> from the disk.
|
||||
No extensions are assumed. The drive and path my be included in
|
||||
<cFile>; neither the SET DEFAULT not the SET PATH command controls
|
||||
<cFile>; 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -421,33 +417,33 @@
|
||||
$SYNTAX$
|
||||
FRename( <cOldFile>, <cNewFile> ) --> nSuccess
|
||||
$ARGUMENTS$
|
||||
<cOldFile> Old filename to be changed
|
||||
<cOldFile> Old file name to be changed
|
||||
|
||||
<cNewFile> New filename
|
||||
<cNewFile> New file name
|
||||
$RETURNS$
|
||||
<nSuccess> If successful, a 0 will be returned otherwise,
|
||||
a -1 will be returned.
|
||||
$DESCRIPTION$
|
||||
This function renames the specified file <cOldFile> to <cNewFile>.
|
||||
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 <cNewFile> and
|
||||
this path is different from either the path specified in <cOldFile>
|
||||
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 <cOldFile>. 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 <cNewFile> 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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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( <cFileSpec> ) --> lExists
|
||||
$ARGUMENTS$
|
||||
<cFileSpec> Filename skeleton or file name to find.
|
||||
<cFileSpec> File name skeleton or file name to find.
|
||||
$RETURNS$
|
||||
<lExists> 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
|
||||
<cFileSpec> exist.
|
||||
|
||||
Filename skeletons symbols may be used in the filename in <cFileSpec>,
|
||||
File name skeletons symbols may be used in the file name in <cFileSpec>,
|
||||
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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -639,6 +641,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -652,13 +656,13 @@
|
||||
$SYNTAX$
|
||||
RENAME <cOldFile> TO <cNewFile>
|
||||
$ARGUMENTS$
|
||||
<cOldFile> Old filename
|
||||
<cOldFile> Old file name
|
||||
|
||||
<cNewFile> New Filename
|
||||
<cNewFile> New File name
|
||||
$DESCRIPTION$
|
||||
This command changes the name of <cOldFile> to <cNewFile>. Both
|
||||
<cOldFile> and <cNewFile> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -693,9 +699,9 @@
|
||||
$ARGUMENTS$
|
||||
<xcFile> 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$
|
||||
<xcFile> 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( <cFile>, [<lPrint>] ) --> NIL
|
||||
$ARGUMENTS$
|
||||
<cFile> is a name of the file to display. If the file have an
|
||||
extension, it must be specified (there is no default value).
|
||||
|
||||
<lPrint> 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 <cFile> 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 <cFile> 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 <xcFile> [TO PRINTER] [TO FILE <xcDestFile>]
|
||||
$ARGUMENTS$
|
||||
<xcFile> 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 <xcDestFile> copy the source <xcFile> also to a file. If no
|
||||
extension is given (.txt) is added to the output file name.
|
||||
<xcDestFile> 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 <xcFile> 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 <xcFile> can not be found a run-time error occur.
|
||||
|
||||
If <xcDestFile> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -928,20 +808,20 @@
|
||||
$ONELINER$
|
||||
Copies a file.
|
||||
$SYNTAX$
|
||||
COPY FILE <cfile> TO <cfile1>
|
||||
COPY FILE <cFile> TO <cFile1>
|
||||
$ARGUMENTS$
|
||||
<cFile> Filename of source file
|
||||
<cFile1> Filename of target file
|
||||
<cFile> File name of source file
|
||||
<cFile1> File name of target file
|
||||
$DESCRIPTION$
|
||||
This command makes an exact copy of <cFile> and names it <cFile1>.
|
||||
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. <cFile1> 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 <Harbour@SpaceMoose.com>
|
||||
$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( <cDirectory> ) --> nError
|
||||
$ARGUMENTS$
|
||||
<cDirectory> The name of the directory you want to remove.
|
||||
$RETURNS$
|
||||
<nError> 0 if directory was successfully removed, otherwise
|
||||
the number of the last error.
|
||||
$DESCRIPTION$
|
||||
This function attempt to remove the specified directory in <cDirectory>
|
||||
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( <cDirectory> ) --> nError
|
||||
$ARGUMENTS$
|
||||
<cDirectory> The name of the directory you want do change into.
|
||||
$RETURNS$
|
||||
<nError> 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 <cDirectory>. 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( <cDirectory> ) --> nError
|
||||
$ARGUMENTS$
|
||||
<cDirectory> The name of the directory you want to create.
|
||||
$RETURNS$
|
||||
<nError> 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 <cDirectory>. 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( <cDrive> ) --> lSuccess
|
||||
$ARGUMENTS$
|
||||
<cDrive> An valid Drive letter
|
||||
$RETURNS$
|
||||
<lSuccess> .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$
|
||||
*/
|
||||
|
||||
@@ -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 </par>
|
||||
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 </par>
|
||||
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 </par>
|
||||
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$
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Alejandro de Garate <alex_degarate@hotmail.com>
|
||||
* Documentation for: SetMode()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Alejandro de Garate <alex_degarate@hotmail.com>
|
||||
$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:
|
||||
|
||||
<table-noheader>
|
||||
12 rows x 40 columns 12 rows x 80 columns
|
||||
@@ -49,7 +44,7 @@
|
||||
50 rows x 80 columns
|
||||
</table>
|
||||
|
||||
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$
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
$CATEGORY$
|
||||
Document
|
||||
$DESCRIPTION$
|
||||
<b>Language extensions:</b> </par>
|
||||
<b>Language extensions:</b>
|
||||
--------------------
|
||||
|
||||
* Class generation and management.
|
||||
@@ -19,16 +19,16 @@
|
||||
Entire applications can be designed and coded in Object Oriented
|
||||
style.
|
||||
|
||||
* @<FunctionName>() </par>
|
||||
* `@<FunctionName>()`
|
||||
|
||||
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.
|
||||
|
||||
<b>RTL enhanced functionality:</b> </par>
|
||||
<b>RTL enhanced functionality:</b>
|
||||
---------------------------
|
||||
|
||||
- hb_vfDirSpace( <nDir>, <nType> )
|
||||
- `hb_vfDirSpace( <nDir>, <nType> )`
|
||||
|
||||
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$
|
||||
*/
|
||||
|
||||
1011
doc/en/hashfunc.txt
Normal file
1011
doc/en/hashfunc.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,9 +11,9 @@
|
||||
Locks part or all of any file
|
||||
$SYNTAX$
|
||||
hb_FLock( <nHandle>, <nOffset>, <nBytes> [, <nType ] )
|
||||
--> <lSuccess>
|
||||
--> lSuccess
|
||||
$ARGUMENTS$
|
||||
<nHandle> Dos file handle
|
||||
<nHandle> OS file handle
|
||||
|
||||
set> Offset of the first byte of the region to be locked.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<lSuccess> .T. if the lock was obtained, else .F.
|
||||
$DESCRIPTION$
|
||||
This function attempts to lock a region of the file whose file handle
|
||||
is <nHandle>. This is a low level file function. To lock Harbour
|
||||
is <nHandle>. This is a low-level file function. To lock Harbour
|
||||
data files use either the FLock() or RLock() function.
|
||||
|
||||
The value of <nHandle> is obtained from either a call to the FOpen()
|
||||
@@ -36,14 +36,14 @@
|
||||
|
||||
<nBytes> 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 ( <nType> = 0x0000 ) - the default, and shared
|
||||
locks( <nType> = 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.
|
||||
<nType> is the type of lock requested. There are two types of locks:
|
||||
exclusive write locks ( <nType> = 0x0000 ) - the default, and shared
|
||||
read locks ( <nType> = 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( <nHandle>, <nOffset>, <nBytes> ) --> <lSuccess>
|
||||
hb_FUnlock( <nHandle>, <nOffset>, <nBytes> ) --> lSuccess
|
||||
$ARGUMENTS$
|
||||
<nHandle> Dos file handle
|
||||
<nHandle> OS file handle
|
||||
|
||||
set> Offset of the first byte of the region to be locked.
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<lSuccess> .T. if the lock was removed, else .F.
|
||||
$DESCRIPTION$
|
||||
This function attempts to unlock a region of the file whose file
|
||||
handle is <nHandle>. This is a low level file function. To
|
||||
handle is <nHandle>. This is a low-level file function. To
|
||||
unlock Harbour data files use the dbUnlock() function.
|
||||
|
||||
The value of <nHandle> is obtained from either a call to the FOpen()
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
<nBytes> 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$
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
68
doc/en/hbtoken.txt
Normal file
68
doc/en/hbtoken.txt
Normal file
@@ -0,0 +1,68 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
2016 Pete D. <pete_westg@yahoo.gr>
|
||||
$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( <cString>, [<cDelim>|<lEOL>], [<lSkipStrings>], ;
|
||||
[<lDoubleQuoteOnly>] ) --> aTokens
|
||||
$ARGUMENTS$
|
||||
<cString> Complex string to be parsed.
|
||||
|
||||
<cDelim>|<lEOL Character(s) used as delimiter of separate tokens.
|
||||
If <lEOL> flag defined instead of <cDelim>,
|
||||
then end of line marker(s) will be used as delimiter.
|
||||
|
||||
<lSkipStrings> Boolean flag indicating if quoted substrings
|
||||
will be tokenized or not.
|
||||
|
||||
<lDoubleQuoteOnly> Boolean flag indicating that only double-quoted
|
||||
substrings will be tokenized.
|
||||
$RETURNS$
|
||||
<aTokens> A character array, filled with the individual tokens found.
|
||||
$DESCRIPTION$
|
||||
This function analyses the complex string <cString> and splits it
|
||||
into separate sub-strings (tokens) that are delimited by <cDelim>
|
||||
or by space character, if no <cDelim> delimiter is passed, or by EOL marker
|
||||
if <lEOL> instead of <cDelim> is specified.
|
||||
|
||||
The located tokens, are stored in an array which is returned by the function.
|
||||
|
||||
If <lSkipStrings> is .T. (default: .F.), the quoted sub-strings (if any)
|
||||
within <cString> are not tokenized. If <lDoubleQuoteOnly> is .T.
|
||||
only the double quote `"` is recognized as a quote sign.
|
||||
This argument is meaningful only when <lSkipStrings> is .T.
|
||||
|
||||
$NOTES$
|
||||
1) the tokenization process is case sensitive, in the (rare) case
|
||||
where <cDelim> 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$
|
||||
*/
|
||||
185
doc/en/hvm.txt
185
doc/en/hvm.txt
@@ -1,136 +1,3 @@
|
||||
/*
|
||||
* Copyright 1999 Jose Lanin <dezac@corevia.com>
|
||||
* Documentation for: ProcLine(), ProcFile(), ProcName()
|
||||
*
|
||||
* Copyright 1999 Eddie Ruina
|
||||
* Documentation for: __dbgVMVarLGet()
|
||||
*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: CLIPINIT(), __SetHelpK()
|
||||
*
|
||||
* Copyright 1999 Ryszard Glab <rglab@imid.med.pl>
|
||||
* 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( <nLevel> ) --> <cProcName>
|
||||
$ARGUMENTS$
|
||||
<nLevel> is the function level required.
|
||||
$RETURNS$
|
||||
<cProcName> 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 <nLevel>.
|
||||
$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( <nLevel> ) --> <nLine>
|
||||
$ARGUMENTS$
|
||||
<nLevel> is the function level required.
|
||||
$RETURNS$
|
||||
<nLine> 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 <nLevel>.
|
||||
$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( <xExp> ) --> <cEmptyString>
|
||||
$ARGUMENTS$
|
||||
<xExp> is any valid type.
|
||||
$RETURNS$
|
||||
<cEmptyString> 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( <nArg> ) --> <xExp>
|
||||
hb_PValue( <nArg> ) --> 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() --> <nArgs>
|
||||
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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -279,6 +153,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -288,13 +164,13 @@
|
||||
$SUBCATEGORY$
|
||||
Internal
|
||||
$ONELINER$
|
||||
Set F1 as the default help key
|
||||
Set <F1> as the default help key
|
||||
$SYNTAX$
|
||||
__SetHelpK()
|
||||
$ARGUMENTS$
|
||||
None.
|
||||
$DESCRIPTION$
|
||||
Set F1 to execute a function called HELP if such a function is
|
||||
Set <F1> 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( <xExp> )
|
||||
$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 <rglab@imid.med.pl>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -351,7 +229,7 @@
|
||||
$ONELINER$
|
||||
Calls a procedure or a function
|
||||
$SYNTAX$
|
||||
Do( <xFuncProc> [, <xArguments...>] ) --> <xRetVal>
|
||||
Do( <xFuncProc> [, <xArguments...>] ) --> xRetVal
|
||||
$ARGUMENTS$
|
||||
<xFuncProc> = Either a string with a function/procedure name to be called
|
||||
or a codeblock to evaluate.
|
||||
@@ -362,24 +240,27 @@
|
||||
<xRetVal> 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 <proc> WITH ... statement.
|
||||
The compiler always passes the item of HB_IT_SYMBOL type that stores the
|
||||
name of procedure specified in `DO <proc> 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 <proc> WITH <args...>
|
||||
It is also used internally to implement `DO <proc> WITH <args...>`
|
||||
In this case <xFuncProc> 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$
|
||||
|
||||
@@ -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( <nHandle> ) --> <bAction>
|
||||
hb_idleDel( <nHandle> ) --> bAction
|
||||
$ARGUMENTS$
|
||||
<nHandle> 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$
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: ReadKey()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$TEMPLATE$
|
||||
Function
|
||||
@@ -30,32 +22,32 @@
|
||||
treated as if it were not present.
|
||||
|
||||
<nEvents> 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.
|
||||
|
||||
<table>
|
||||
inkey.ch Meaning
|
||||
<table>
|
||||
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.
|
||||
</table>
|
||||
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.
|
||||
</table>
|
||||
|
||||
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_<event> values listed in inkey.ch. Keyboard
|
||||
represented by the `K_<event>` 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 <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
|
||||
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 <Alt+Ctrl> 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 <Esc> key
|
||||
? "Please press the <Esc> 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 @@
|
||||
<cString> 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 <Alt+PgDn> 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( [<nInputMask>] ) --> nKey
|
||||
$ARGUMENTS$
|
||||
nInputMask is an optional integer value composed of one or more
|
||||
<nInputMask> 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 <Esc>.
|
||||
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( [<nInputMask>] ) --> nKey
|
||||
$ARGUMENTS$
|
||||
nInputMask is an optional integer value composed of one or more
|
||||
<nInputMask> 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$
|
||||
<nKey> 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 <Esc> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -354,20 +355,20 @@
|
||||
to the return code.
|
||||
|
||||
<table-doubleheader>
|
||||
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
|
||||
</table>
|
||||
|
||||
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$
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* Documentation for: hb_langName(), hb_langSelect()
|
||||
*
|
||||
* Copyright 2004 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: hb_langErrMsg(), hb_langMessage(), hb_cdpSelect(),
|
||||
* hb_Translate()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2004 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -24,7 +14,7 @@
|
||||
$SYNTAX$
|
||||
hb_langErrMsg( <nErrorCode> ) --> cErrorMessage
|
||||
$ARGUMENTS$
|
||||
<nErrorCode> is one of the generic error codes (EG_...) defined
|
||||
<nErrorCode> 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 <niki@actcom.co.il>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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( "<non-existent>" )
|
||||
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( "<non-existent>" )
|
||||
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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -178,69 +164,67 @@
|
||||
module strings are automatically converted by Harbour.
|
||||
|
||||
<table>
|
||||
Language <cNewLang>
|
||||
Language <cNewLang>
|
||||
|
||||
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
|
||||
</table>
|
||||
$RETURNS$
|
||||
<cOldLang> The old language indentifier
|
||||
<cOldLang> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -272,85 +258,83 @@
|
||||
Codepage library, sorted by language.
|
||||
|
||||
<table>
|
||||
Language Codepage <cNewLang>
|
||||
Language Codepage <cNewLang>
|
||||
|
||||
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
|
||||
</table>
|
||||
$RETURNS$
|
||||
<cOldLang> The old language indentifier
|
||||
<cOldLang> 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 <niki@actcom.co.il>
|
||||
$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$
|
||||
|
||||
88
doc/en/left.txt
Normal file
88
doc/en/left.txt
Normal file
@@ -0,0 +1,88 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
2016 Pete D. <pete_westg@yahoo.gr>
|
||||
$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( <cString>, <cSubString> ) --> lMatch
|
||||
$ARGUMENTS$
|
||||
<cString> Main string of comparison.
|
||||
|
||||
<cSubString> Sub-string compared to leftmost part of <cString>
|
||||
$RETURNS$
|
||||
<lMatch> Boolean flag indicating if the matching was successful
|
||||
$DESCRIPTION$
|
||||
This function checks if all characters (one by one and with the given order)
|
||||
of <cSubString> match to leftmost (same length) part of <cString>
|
||||
or in other words, checks if <cString> starts with <cSubString>,
|
||||
in which case returns .T., otherwise .F.
|
||||
|
||||
Basically it's equivalent to the expression:
|
||||
`Left( <cString>, Len( <cSubString> ) ) == <cSubString>`
|
||||
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. <pete_westg@yahoo.gr>
|
||||
$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( <cString>, <cSubString> ) --> lMatch
|
||||
$ARGUMENTS$
|
||||
<cString> Main string of comparison.
|
||||
|
||||
<cSubString> Sub-string compared to leftmost part of <cString>.
|
||||
$RETURNS$
|
||||
<lMatch> 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$
|
||||
*/
|
||||
@@ -8,14 +8,18 @@
|
||||
$SUBCATEGORY$
|
||||
Compiler
|
||||
$DESCRIPTION$
|
||||
<b>Invoking the macro compiler: </b> </par>
|
||||
============================== </par>
|
||||
|
||||
&variable </par>
|
||||
or </par>
|
||||
&( expression ) </par>
|
||||
or </par>
|
||||
&variable.text </par>
|
||||
<b>Invoking the macro compiler:</b>
|
||||
```
|
||||
&variable
|
||||
```
|
||||
or
|
||||
```
|
||||
&( expression )
|
||||
```
|
||||
or
|
||||
```
|
||||
&variable.text
|
||||
```
|
||||
$END$
|
||||
*/
|
||||
|
||||
@@ -31,9 +35,9 @@
|
||||
$ONELINER$
|
||||
Enable/disable the macro compiler runtime features.
|
||||
$SYNTAX$
|
||||
hb_SetMacro( <nOption>, [<lOnOff>] ) --> <lOldSetting>
|
||||
hb_SetMacro( <nOption>, [<lOnOff>] ) --> lOldSetting
|
||||
$ARGUMENTS$
|
||||
<nOption> One of the HB_SM_* constants defined in set.ch.
|
||||
<nOption> One of the `HB_SM_*` constants defined in set.ch.
|
||||
|
||||
<lOnOff> .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:</par>
|
||||
<b>HB_SM_HARBOUR</b> - enables Harbour extensions:
|
||||
operators: ++, --, +=, -=, *=, /=, ^=
|
||||
objects: assigments to an instance variable
|
||||
Available features are:
|
||||
|
||||
<b>HB_SM_XBASE</b> - enables other Xbase++ dialects extensions:</par>
|
||||
expanding of expresions lists
|
||||
`HB_SM_HARBOUR` - enables Harbour extensions:
|
||||
operators: `++`, `--`, `+=`, `-=`, `*=`, `/=`, `^=`
|
||||
objects: assignments to an instance variable
|
||||
|
||||
<b>HB_SM_SHORTCUTS</b> - enables optimized evaluation of
|
||||
logical operators (.and., .or.)
|
||||
`HB_SM_XBASE` - enables other Xbase++ dialects extensions:
|
||||
expanding of expressions lists
|
||||
|
||||
<b>HB_SM_PREPROC</b> - 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
|
||||
|
||||
170
doc/en/math.txt
170
doc/en/math.txt
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* Documentation for: Abs(), Exp(), Log(), Int(), Max()
|
||||
* Min(), Sqrt(), Round()
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
* Documentation for API
|
||||
* $SUBCATEGORY$
|
||||
* Math functions
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -23,7 +12,7 @@
|
||||
$ONELINER$
|
||||
Return the absolute value of a number.
|
||||
$SYNTAX$
|
||||
Abs( <nNumber> ) --> <nAbsNumber>
|
||||
Abs( <nNumber> ) --> nAbsNumber
|
||||
$ARGUMENTS$
|
||||
<nNumber> Any number.
|
||||
$RETURNS$
|
||||
@@ -32,16 +21,14 @@
|
||||
This function yields the absolute value of the numeric value or
|
||||
expression <nNumber>.
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -67,14 +56,14 @@
|
||||
$ONELINER$
|
||||
Calculates the value of e raised to the passed power.
|
||||
$SYNTAX$
|
||||
Exp( <nNumber> ) --> <nValue>
|
||||
Exp( <nNumber> ) --> nValue
|
||||
$ARGUMENTS$
|
||||
<nNumber> Any real number.
|
||||
$RETURNS$
|
||||
<nValue> The anti-logarithm of <nNumber>
|
||||
$DESCRIPTION$
|
||||
This function returns the value of e raised to the power of
|
||||
<nNumber>. It is the inverse of Log().
|
||||
<nNumber>. It is the inverse of Log().
|
||||
$EXAMPLES$
|
||||
? Exp( 45 )
|
||||
$STATUS$
|
||||
@@ -91,6 +80,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -102,7 +93,7 @@
|
||||
$ONELINER$
|
||||
Return the integer port of a numeric value.
|
||||
$SYNTAX$
|
||||
Int( <nNumber> ) --> <nIntNumber>
|
||||
Int( <nNumber> ) --> nIntNumber
|
||||
$ARGUMENTS$
|
||||
<nNumber> Any numeric value.
|
||||
$RETURNS$
|
||||
@@ -130,6 +121,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -141,7 +134,7 @@
|
||||
$ONELINER$
|
||||
Returns the natural logarithm of a number.
|
||||
$SYNTAX$
|
||||
Log( <nNumber> ) --> <nLog>
|
||||
Log( <nNumber> ) --> nLog
|
||||
$ARGUMENTS$
|
||||
<nNumber> Any numeric expression.
|
||||
$RETURNS$
|
||||
@@ -167,6 +160,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -178,7 +173,7 @@
|
||||
$ONELINER$
|
||||
Returns the maximum of two numbers or dates.
|
||||
$SYNTAX$
|
||||
Max( <xValue>, <xValue1> ) --> <xMax>
|
||||
Max( <xValue>, <xValue1> ) --> xMax
|
||||
$ARGUMENTS$
|
||||
<xValue> Any date or numeric value.
|
||||
|
||||
@@ -186,7 +181,7 @@
|
||||
$RETURNS$
|
||||
<xMax> 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
|
||||
<xValue> and <xValue1> 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 <xValue> and <xValue1>
|
||||
@@ -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 <culik@sl.conex.net>
|
||||
$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( <xValue>, <xValue1> ) --> <xMin>
|
||||
Min( <xValue>, <xValue1> ) --> xMin
|
||||
$ARGUMENTS$
|
||||
<xValue> Any date or numeric value.
|
||||
|
||||
@@ -228,12 +225,12 @@
|
||||
$RETURNS$
|
||||
<xMin> 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.
|
||||
<xValue> and <xValue1> 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$
|
||||
<nRemainder> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -298,14 +297,14 @@
|
||||
$ONELINER$
|
||||
Calculates the square root of a number.
|
||||
$SYNTAX$
|
||||
Sqrt( <nNumber> ) --> <nSqrt>
|
||||
Sqrt( <nNumber> ) --> nSqrt
|
||||
$ARGUMENTS$
|
||||
<nNumber> Any numeric value.
|
||||
$RETURNS$
|
||||
<nSqrt> The square root of <number>.
|
||||
$DESCRIPTION$
|
||||
This function returns the square root of <nNumber>. 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 <nNumber> will always return a 0.
|
||||
$EXAMPLES$
|
||||
Set( _SET_DECIMALS, 5 )
|
||||
@@ -325,6 +324,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -336,7 +337,7 @@
|
||||
$ONELINER$
|
||||
Rounds off a numeric expression.
|
||||
$SYNTAX$
|
||||
Round( <nNumber>, <nPlace> ) --> <nResult>
|
||||
Round( <nNumber>, <nPlace> ) --> nResult
|
||||
$ARGUMENTS$
|
||||
<nNumber> Any numeric value.
|
||||
|
||||
@@ -366,8 +367,10 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$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$
|
||||
<iMathErrorType>
|
||||
$DESCRIPTION$
|
||||
@@ -423,8 +427,10 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
C Function
|
||||
$NAME$
|
||||
hb_mathResetError()
|
||||
$CATEGORY$
|
||||
@@ -459,8 +465,10 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
C Function
|
||||
$NAME$
|
||||
hb_mathIsMathErr()
|
||||
$CATEGORY$
|
||||
@@ -497,8 +505,10 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
C Function
|
||||
$NAME$
|
||||
hb_mathSetHandler()
|
||||
$CATEGORY$
|
||||
@@ -538,8 +548,10 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
C Function
|
||||
$NAME$
|
||||
hb_mathGetHandler()
|
||||
$CATEGORY$
|
||||
@@ -577,8 +589,10 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$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
|
||||
<table-noheader>
|
||||
HB_MATH_ERRMODE_DEFAULT
|
||||
HB_MATH_ERRMODE_CDEFAULT
|
||||
HB_MATH_ERRMODE_USER
|
||||
HB_MATH_ERRMODE_USERDEFAULT
|
||||
HB_MATH_ERRMODE_USERCDEFAULT
|
||||
</table>
|
||||
$RETURNS$
|
||||
ioldmode old math error handling mode
|
||||
$DESCRIPTION$
|
||||
@@ -621,8 +637,10 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
C Function
|
||||
$NAME$
|
||||
hb_mathGetErrMode()
|
||||
$CATEGORY$
|
||||
@@ -659,6 +677,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -670,15 +690,17 @@
|
||||
$ONELINER$
|
||||
Set/Get math error handling mode
|
||||
$SYNTAX$
|
||||
hb_matherMode( [<nNewMode>] ) --> <nOldMode>
|
||||
hb_matherMode( [<nNewMode>] ) --> nOldMode
|
||||
$ARGUMENTS$
|
||||
[<nNumber>] 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
|
||||
<table-noheader>
|
||||
HB_MATH_ERRMODE_DEFAULT
|
||||
HB_MATH_ERRMODE_CDEFAULT
|
||||
HB_MATH_ERRMODE_USER
|
||||
HB_MATH_ERRMODE_USERDEFAULT
|
||||
HB_MATH_ERRMODE_USERCDEFAULT
|
||||
</table>
|
||||
$RETURNS$
|
||||
<nOldMode> old math error handling mode
|
||||
$DESCRIPTION$
|
||||
@@ -700,6 +722,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2001 IntTec GmbH, Martin Vogel <vogel@inttec.de>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -711,7 +735,7 @@
|
||||
$ONELINER$
|
||||
Set/Get math error handling codeblock
|
||||
$SYNTAX$
|
||||
hb_matherBlock( [<bNewBlock>] ) --> <bOldBlock>
|
||||
hb_matherBlock( [<bNewBlock>] ) --> bOldBlock
|
||||
$ARGUMENTS$
|
||||
<bNewBlock>
|
||||
$RETURNS$
|
||||
|
||||
106
doc/en/memo.txt
106
doc/en/memo.txt
@@ -1,19 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* MemoTran() documentation
|
||||
* HardCR() documentation
|
||||
*
|
||||
* Copyright 2003 Alejandro de Garate <alex_degarate@hotmail.com>
|
||||
* MemoRead() documentation
|
||||
* MemoWrit() documentation
|
||||
*
|
||||
* Documentation for hb_MemoRead(), hb_MemoWrit()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -25,7 +12,7 @@
|
||||
$ONELINER$
|
||||
Converts hard and soft carriage returns within strings.
|
||||
$SYNTAX$
|
||||
MemoTran( <cString>, <cHard>, <cSoft> ) --> <cConvertedString>
|
||||
MemoTran( <cString>, <cHard>, <cSoft> ) --> cConvertedString
|
||||
$ARGUMENTS$
|
||||
<cString> 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 <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -64,7 +54,7 @@
|
||||
$ONELINER$
|
||||
Replace all soft carriage returns with hard carriages returns.
|
||||
$SYNTAX$
|
||||
HardCR( <cString> ) --> <cConvertedString>
|
||||
HardCR( <cString> ) --> cConvertedString
|
||||
$ARGUMENTS$
|
||||
<cString> 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 <alex_degarate@hotmail.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -99,17 +92,17 @@
|
||||
$SYNTAX$
|
||||
MemoRead( <cFileName> ) --> cString
|
||||
$ARGUMENTS$
|
||||
<cFileName> is the filename to read from disk.
|
||||
<cFileName> 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 <cFileName> cannot be found or read MEMOREAD returns an empty
|
||||
If <cFileName> 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 <alex_degarate@hotmail.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -165,17 +160,17 @@
|
||||
$SYNTAX$
|
||||
hb_MemoRead( <cFileName> ) --> cString
|
||||
$ARGUMENTS$
|
||||
<cFileName> is the filename to read from disk.
|
||||
<cFileName> 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 <cFileName> cannot be found or read HB_MEMOREAD returns an empty
|
||||
If <cFileName> 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 <alex_degarate@hotmail.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -235,7 +232,7 @@
|
||||
$SYNTAX$
|
||||
MemoWrit( <cFileName>, <cString> ) --> lSuccess
|
||||
$ARGUMENTS$
|
||||
<cFileName> is the filename to be written to disk.
|
||||
<cFileName> 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 <cFileName> to the
|
||||
current directory. If <cFileName> 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 <alex_degarate@hotmail.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -292,7 +292,7 @@
|
||||
$SYNTAX$
|
||||
hb_MemoWrit( <cFileName>, <cString> ) --> lSuccess
|
||||
$ARGUMENTS$
|
||||
<cFileName> is the filename to be written to disk.
|
||||
<cFileName> 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 <cFileName> to the
|
||||
current directory. If <cFileName> 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
|
||||
|
||||
@@ -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$
|
||||
<xVar> Name of a memory variable or array.
|
||||
|
||||
<xInit> Value to be assinged to a variable or array
|
||||
<xInit> 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 <xVar>. 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 <xInit> and folling. Is Strong type
|
||||
compile mode is used, the Compiler will check if the value recived
|
||||
matchs the type specified in <xType>.
|
||||
If a variable or an array is to be assigned a start-up value, that
|
||||
expression may be specified in <xInit> and following. Is Strong type
|
||||
compile mode is used, the Compiler will check if the value received
|
||||
matches the type specified in <xType>.
|
||||
|
||||
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$
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* 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`)
|
||||
|
||||
<lSelableItems> - 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.
|
||||
|
||||
<cUserFunction> - 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.
|
||||
|
||||
<bUserBlock> - 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.
|
||||
|
||||
<nInitialItem> - 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 <niki@actcom.co.il>
|
||||
$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 <Esc> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -182,17 +178,18 @@
|
||||
is evaluated to a character string. If <xMsg> 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 <Esc> 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 <niki@actcom.co.il>
|
||||
$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( <bBlock>, <cVariable> ) --> 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 <Esc> 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 <up> arrow while on the first selection the last menu item is
|
||||
highlighted, if the user press <Down> 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.
|
||||
</table>
|
||||
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"
|
||||
?? "<Esc> was pressed"
|
||||
ELSE
|
||||
?? "Selected option is", nChoice
|
||||
ENDIF
|
||||
@@ -308,6 +308,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
$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 <cVariable>
|
||||
$ARGUMENTS$
|
||||
@@ -326,7 +328,7 @@
|
||||
a PRIVATE variable with the name <cVariable> 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 <cVariable> does not exist or not visible,
|
||||
a PRIVATE variable named <cVariable> 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 <Up> arrow while on the first selection the last menu item is
|
||||
highlighted, if the user press <Down> 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`:
|
||||
|
||||
<table>
|
||||
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.
|
||||
</table>
|
||||
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"
|
||||
?? "<Esc> was pressed"
|
||||
ELSE
|
||||
?? "Selected option is", nChoice
|
||||
ENDIF
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: Tone()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$TEMPLATE$
|
||||
Function
|
||||
@@ -18,7 +10,7 @@
|
||||
$ONELINER$
|
||||
Return the current operating system.
|
||||
$SYNTAX$
|
||||
OS() --> <cOperatingSystem>
|
||||
OS() --> cOperatingSystem
|
||||
$RETURNS$
|
||||
<cOperatinSystem> The current operating system.
|
||||
$DESCRIPTION$
|
||||
@@ -46,7 +38,7 @@
|
||||
$ONELINER$
|
||||
Returns the version of Harbour compiler
|
||||
$SYNTAX$
|
||||
Version() --> <cReturn>
|
||||
Version() --> cReturn
|
||||
$ARGUMENTS$
|
||||
None
|
||||
$RETURNS$
|
||||
@@ -80,15 +72,15 @@
|
||||
$ONELINER$
|
||||
Obtains a system environmental setting.
|
||||
$SYNTAX$
|
||||
GetEnv( <cEnviroment> ) --> <cReturn>
|
||||
GetEnv( <cEnviroment> ) --> cReturn
|
||||
$ARGUMENTS$
|
||||
<cEnviroment> Enviromental variable to obtain.
|
||||
<cEnviroment> Environmental variable to obtain.
|
||||
$RETURNS$
|
||||
<cReturn> Value of the Environment Variable.
|
||||
$DESCRIPTION$
|
||||
This function yields a string that is the value of the
|
||||
environment variable <cEnviroment>, 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( <cEnviroment> ) --> <cReturn>
|
||||
GetE( <cEnviroment> ) --> cReturn
|
||||
$ARGUMENTS$
|
||||
<cEnviroment> Enviromental variable to obtain.
|
||||
<cEnviroment> Environmental variable to obtain.
|
||||
$RETURNS$
|
||||
<cReturn> Value of the Environment Variable.
|
||||
$DESCRIPTION$
|
||||
This function yields a string that is the value of the
|
||||
environment variable <cEnviroment>, 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 <cDefaultValue> parameter is a Harbour extension.
|
||||
C
|
||||
$PLATFORMS$
|
||||
All
|
||||
$FILES$
|
||||
@@ -164,9 +153,9 @@
|
||||
$ONELINER$
|
||||
Obtains a system environmental setting.
|
||||
$SYNTAX$
|
||||
hb_GetEnv( <cEnviroment>, [<cDefaultValue>] ) --> <cReturn>
|
||||
hb_GetEnv( <cEnviroment>, [<cDefaultValue>] ) --> cReturn
|
||||
$ARGUMENTS$
|
||||
<cEnviroment> Enviromental variable to obtain.
|
||||
<cEnviroment> Environmental variable to obtain.
|
||||
|
||||
<cDefaultValue> Optional value to return if <cEnvironment> is not found.
|
||||
$RETURNS$
|
||||
@@ -174,7 +163,7 @@
|
||||
$DESCRIPTION$
|
||||
This function yields a string that is the value of the
|
||||
environment variable <cEnviroment>, which is stored at the
|
||||
system level.
|
||||
system-level.
|
||||
|
||||
If no environment variable
|
||||
can be found, the value of the function will be <cDefaultValue>
|
||||
@@ -232,11 +221,13 @@
|
||||
$FILES$
|
||||
Library is core
|
||||
$SEEALSO$
|
||||
RUN
|
||||
RUN, hb_run()
|
||||
$END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
$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$
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* IsAffirm() documentation
|
||||
* IsNegative() documentation
|
||||
* NationMsg() documentation
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -20,15 +12,15 @@
|
||||
$ONELINER$
|
||||
Checks if passed char is an affirmation char
|
||||
$SYNTAX$
|
||||
IsAffirm( <cChar> ) --> <lTrueOrFalse>
|
||||
IsAffirm( <cChar> ) --> lTrueOrFalse
|
||||
$ARGUMENTS$
|
||||
<cChar> is a char or string of chars </par>
|
||||
<cChar> is a char or string of chars
|
||||
$RETURNS$
|
||||
<lTrueOrFalse> True if passed char is an affirmation char, otherwise
|
||||
false </par>
|
||||
false
|
||||
$DESCRIPTION$
|
||||
This function is used to check if a user's input is true or not
|
||||
according to the msgxxx module used. </par>
|
||||
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 <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -57,15 +51,15 @@
|
||||
$ONELINER$
|
||||
Checks if passed char is a negation char.
|
||||
$SYNTAX$
|
||||
IsNegative( <cChar> ) --> <lTrueOrFalse>
|
||||
IsNegative( <cChar> ) --> lTrueOrFalse
|
||||
$ARGUMENTS$
|
||||
<cChar> is a char or string of chars </par>
|
||||
<cChar> is a char or string of chars
|
||||
$RETURNS$
|
||||
<lTrueOrFalse> True if passed char is a negation char, otherwise
|
||||
false. </par>
|
||||
false.
|
||||
$DESCRIPTION$
|
||||
This function is used to check if a user's input is true or not
|
||||
according to the msgxxx module used. </par>
|
||||
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 <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -94,15 +90,15 @@
|
||||
$ONELINER$
|
||||
Returns international strings messages.
|
||||
$SYNTAX$
|
||||
NationMsg( <nMsg> ) --> <cMessage>
|
||||
NationMsg( <nMsg> ) --> cMessage
|
||||
$ARGUMENTS$
|
||||
<nMsg> is the message number you want to get. </par>
|
||||
<nMsg> is the message number you want to get.
|
||||
$RETURNS$
|
||||
<cMessage> if <nMsg> is a valid message selector, returns the message.
|
||||
If <nMsg> is NIL, it returns "Invalid Argument", and if <nMsg> is any
|
||||
other type it returns an empty string. </par>
|
||||
other type it returns an empty string.
|
||||
$DESCRIPTION$
|
||||
NationMsg() returns international message descriptions. </par>
|
||||
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$
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999-2000 Chen Kedem <niki@actcom.co.il>
|
||||
* 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -32,13 +21,13 @@
|
||||
__objHasData() return .T. if the given <cSymbol> exist as VAR
|
||||
(instance variable) in object <oObject), .F. if it does not exist.
|
||||
$DESCRIPTION$
|
||||
__objHasData() is a low level class support function that let you
|
||||
__objHasData() is a low-level class support function that let you
|
||||
find out if a symbol is an instance variable in a given object.
|
||||
$EXAMPLES$
|
||||
oB := TBrowseNew( 0, 0, 24, 79 )
|
||||
? __objHasData( oB, "nLeft" ) // this should return .T.
|
||||
? __objHasData( oB, "lBugFree" ) // hopefully this should be .F.
|
||||
? __objHasData( oB, "Left" ) // .F. since this is a METHOD
|
||||
LOCAL oB := TBrowseNew( 0, 0, 24, 79 )
|
||||
? __objHasData( oB, "nLeft" ) // --> .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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -71,13 +62,13 @@
|
||||
__objHasMethod() return .T. if the given <cSymbol> exist as METHOD
|
||||
(class function) in object <oObject), .F. if it does not exist.
|
||||
$DESCRIPTION$
|
||||
__objHasMethod() is a low level class support function that let you
|
||||
__objHasMethod() is a low-level class support function that let you
|
||||
find out if a symbol is a class function in a given object.
|
||||
$EXAMPLES$
|
||||
oB := TBrowseNew( 0, 0, 24, 79 )
|
||||
? __objHasMethod( oB, "nLeft" ) // .F. since this is a VAR
|
||||
? __objHasMethod( oB, "FixBugs" ) // hopefully this should be .F.
|
||||
? __objHasMethod( oB, "Left" ) // this should return .T.
|
||||
LOCAL oB := TBrowseNew( 0, 0, 24, 79 )
|
||||
? __objHasMethod( oB, "nLeft" ) // --> .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 <niki@actcom.co.il>
|
||||
$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 <nClassType>
|
||||
that allow you to distinguish between VAR and CLASS VAR:
|
||||
|
||||
table>
|
||||
hboo.ch Meaning
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
|
||||
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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -275,28 +274,29 @@
|
||||
$RETURNS$
|
||||
__objSetValueList() return a reference to <oObject>.
|
||||
$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 <aData> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -331,7 +333,7 @@
|
||||
$RETURNS$
|
||||
__objAddMethod() return a reference to <oObject>.
|
||||
$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. <oObject> is unchanged if a symbol with the
|
||||
name <cMethodName> already exist in <oObject>.
|
||||
|
||||
@@ -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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -387,17 +391,18 @@
|
||||
$RETURNS$
|
||||
__objAddInline() return a reference to <oObject>.
|
||||
$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. <oObject> is unchanged if a symbol
|
||||
with the name <cInlineName> already exist in <oObject>.
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -429,12 +436,12 @@
|
||||
$RETURNS$
|
||||
__objAddData() return a reference to <oObject>.
|
||||
$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. <oObject> is unchanged if a symbol with the name
|
||||
<cDataName> already exist in <oObject>.
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -476,7 +485,7 @@
|
||||
$RETURNS$
|
||||
__objModMethod() return a reference to <oObject>.
|
||||
$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. <oObject>
|
||||
is unchanged if a symbol with the name <cMethodName> does not exist
|
||||
in <oObject>. __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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -546,23 +555,25 @@
|
||||
$RETURNS$
|
||||
__objModInline() return a reference to <oObject>.
|
||||
$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.
|
||||
<oObject> is unchanged if a symbol with the name <cInlineName> does
|
||||
not exist in <oObject>. __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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -595,7 +608,7 @@
|
||||
$RETURNS$
|
||||
__objDelMethod() return a reference to <oObject>.
|
||||
$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. <oObject> is
|
||||
unchanged if a symbol with the name <cSymbol> does not exist in
|
||||
<oObject>.
|
||||
@@ -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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -649,30 +663,29 @@
|
||||
<cSymbol> is the symbol name of METHOD or INLINE method to be
|
||||
deleted (removed) from the object.
|
||||
$RETURNS$
|
||||
__objDelInMethod() return a reference to <oObject>.
|
||||
__objDelInline() return a reference to <oObject>.
|
||||
$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. <oObject> is
|
||||
unchanged if a symbol with the name <cSymbol> does not exist in
|
||||
<oObject>.
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -705,17 +720,17 @@
|
||||
$RETURNS$
|
||||
__objDelData() return a reference to <oObject>.
|
||||
$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. <oObject> is unchanged if a symbol
|
||||
with the name <cDataName> does not exist in <oObject>.
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -749,7 +766,7 @@
|
||||
__objDerivedFrom() return a logical TRUE (.T.) if <oObject> is
|
||||
derived from <xSuper>.
|
||||
$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 <oObject> a child or descendant of <xSuper>.
|
||||
$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
|
||||
|
||||
115
doc/en/proc.txt
Normal file
115
doc/en/proc.txt
Normal file
@@ -0,0 +1,115 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
ProcName()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Application
|
||||
$ONELINER$
|
||||
Gets the name of the current function on the stack
|
||||
$SYNTAX$
|
||||
ProcName( <nLevel> ) --> cProcName
|
||||
$ARGUMENTS$
|
||||
<nLevel> is the function level required.
|
||||
$RETURNS$
|
||||
<cProcName> 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 <nLevel>.
|
||||
$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 <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
ProcLine()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Application
|
||||
$ONELINER$
|
||||
Gets the line number of the current function on the stack.
|
||||
$SYNTAX$
|
||||
ProcLine( <nLevel> ) --> nLine
|
||||
$ARGUMENTS$
|
||||
<nLevel> is the function level required.
|
||||
$RETURNS$
|
||||
<nLine> 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 <nLevel>.
|
||||
$EXAMPLES$
|
||||
? ProcLine( 0 )
|
||||
? ProcName( 2 )
|
||||
$STATUS$
|
||||
R
|
||||
$COMPLIANCE$
|
||||
C
|
||||
$FILES$
|
||||
Library is core
|
||||
$SEEALSO$
|
||||
ProcName(), ProcFile()
|
||||
$END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Jose Lanin <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
ProcFile()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Application
|
||||
$ONELINER$
|
||||
This function always returns an empty string.
|
||||
$SYNTAX$
|
||||
ProcFile( <xExp> ) --> cEmptyString
|
||||
$ARGUMENTS$
|
||||
<xExp> is any valid type.
|
||||
$RETURNS$
|
||||
<cEmptyString> 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$
|
||||
*/
|
||||
483
doc/en/rdddb.txt
483
doc/en/rdddb.txt
@@ -1,14 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* db*() documentation
|
||||
* ord*() documentation
|
||||
* rdd*() documentation
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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() --> <cWorkArea>
|
||||
Dbf() --> cWorkArea
|
||||
$RETURNS$
|
||||
<cWorkArea> 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 <culik@sl.conex.net>
|
||||
$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 <lLock> 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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -378,17 +369,17 @@
|
||||
$ONELINER$
|
||||
Creates an empty database from a array.
|
||||
$SYNTAX$
|
||||
dbCreate( <cDatabase>, <aStruct>, [<cDriver>], [<lOpen>],
|
||||
[<cAlias>] )
|
||||
dbCreate( <cFile>, <aStruct>, [<cRDD>], [<lKeepOpen>], [<cAlias>],
|
||||
[<cDelimArg>], [<cCodePage>], [<nConnection>] )
|
||||
$ARGUMENTS$
|
||||
<cDatabase> Name of database to be create
|
||||
<cFile> Name of database file to be create
|
||||
|
||||
<aStruct> Name of a multidimensional array that contains the
|
||||
database structure
|
||||
|
||||
<cDriver> Name of the RDD
|
||||
<cRDD> Name of the RDD
|
||||
|
||||
<lOpenNew> 3-way toggle to Open the file in New or Current workarea:
|
||||
<lKeepOpen> 3-way toggle to Open the file in New or Current work area:
|
||||
|
||||
<table-noheader>
|
||||
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 <cDriver> parameter specifies the name of the Replaceable
|
||||
The <cRDD> 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 <lOpenNew> parameter specifies if the already created database is
|
||||
The <lKeepOpen> 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 <cAlias> 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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -575,6 +570,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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
|
||||
<xRecordNumber>. The position is not affected by an active index or
|
||||
by any enviromental SET condiction.
|
||||
by any environmental SET condition.
|
||||
|
||||
The parameter <xRecordNumber> may be something other than a record
|
||||
number. In some data formats, for example, the value of <xRecordNumber>
|
||||
is a unique primary key while in other formats, <xRecordNumber> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -661,6 +660,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -852,10 +855,10 @@
|
||||
$DESCRIPTION$
|
||||
This function searches for the first record in a database file whose
|
||||
index key matches <expKey>. 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 @@
|
||||
<lSoftSeek> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -910,7 +932,7 @@
|
||||
$ONELINER$
|
||||
Change to another work area
|
||||
$SYNTAX$
|
||||
dbSelectArea( <xArea> ) -
|
||||
dbSelectArea( <xArea> ) --> NIL
|
||||
$ARGUMENTS$
|
||||
<xArea> Alias or work area
|
||||
$DESCRIPTION$
|
||||
@@ -919,23 +941,23 @@
|
||||
select the numeric work area; if <xArea> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -969,9 +993,9 @@
|
||||
selected work area. The default will be "DBFNTX". If specified,
|
||||
<cDriver> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -1001,18 +1027,16 @@
|
||||
$DESCRIPTION$
|
||||
This function moves the record pointer <nRecords> in the selected or
|
||||
aliased work area. The default value for <nRecords> 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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -1224,17 +1257,17 @@
|
||||
used.
|
||||
|
||||
If <lShared> is set to a logical true (.T.) value, the database that
|
||||
is specified in <cName> will be opened by the user EXCLUSIVELY. Thus
|
||||
is specified in <cName> will be opened by the user *exclusively*. Thus
|
||||
locking it from all other nodes or users on the network. If <lShared>
|
||||
is set to a logical false (.F.) value, then the database will be in
|
||||
SHARED mode. If <lShared> is not passed, then the function will turn
|
||||
to the internal setting of SET EXCLUSIVE to determine a setting.
|
||||
|
||||
If <lReadOnly> is specified, the file will be set to READ ONLY mode.
|
||||
If <lReadOnly> 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$
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* db*() documentation
|
||||
* ord*() documentation
|
||||
* rdd*() documentation
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -20,7 +12,7 @@
|
||||
$ONELINER$
|
||||
Fills referenced arrays with database field information
|
||||
$SYNTAX$
|
||||
AFields( <aNames>, [<aTypes>], [<aLen>], [<aDecs>] ) --> <nFields>
|
||||
AFields( <aNames>, [<aTypes>], [<aLen>], [<aDecs>] ) --> nFields
|
||||
$ARGUMENTS$
|
||||
<aNames> Array of field names
|
||||
|
||||
@@ -30,7 +22,7 @@
|
||||
|
||||
<aDecs> Array of field names
|
||||
$RETURNS$
|
||||
<nFields> Number od fields in a database or work area
|
||||
<nFields> 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( [<nWorkArea>] ) --> <cWorkArea>
|
||||
Alias( [<nWorkArea>] ) --> cWorkArea
|
||||
$ARGUMENTS$
|
||||
<nWorkArea> Number of a work area
|
||||
$RETURNS$
|
||||
<cWorkArea> Name of alias
|
||||
$DESCRIPTION$
|
||||
This function returns the alias of the work area indicated by <nWorkArea>
|
||||
This function returns the alias of the work area indicated by <nWorkArea>.
|
||||
If <nWorkArea> 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() --> <lBegin>
|
||||
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() --> <lEnd>
|
||||
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 @@
|
||||
<nFieldPos> is ordinal position of the field.
|
||||
$DESCRIPTION$
|
||||
This function return the ordinal position of the specified field <cField>
|
||||
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 <cField> 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 @@
|
||||
<nBytes> 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 <cAlias>. 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$
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* db*() documentation
|
||||
* ord*() documentation
|
||||
* rdd*() documentation
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -75,17 +67,17 @@
|
||||
work area. If <nOrder> is specidied, it will represent the position
|
||||
in the order list of the target order. If <cOrderName> 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 <cOrderName> is not specified
|
||||
or <nOrder> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -131,10 +125,10 @@
|
||||
order.
|
||||
|
||||
<bForCondition> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -190,7 +186,7 @@
|
||||
macro expanding the value of <cExpKey>.
|
||||
|
||||
If <lUnique> 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 <cOrderBagName> 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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <xOrder> is the name of the order.However, <xOrder> may be an
|
||||
if <xOrder> is the name of the order. However, <xOrder> 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 <culik@sl.conex.net>
|
||||
$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() --> <cExtension>
|
||||
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( <nOrder> ) --> <cIndexKey>
|
||||
IndexKey( <nOrder> ) --> cIndexKey
|
||||
$ARGUMENTS$
|
||||
<nOrder> Index order number
|
||||
$RETURNS$
|
||||
@@ -419,12 +421,13 @@
|
||||
index file
|
||||
|
||||
The index key is displayed for an index file that is designated by
|
||||
<nOrder>, its position in the USE...INDEX or SET INDEX TO command in
|
||||
<nOrder>, 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() --> <nPosition>
|
||||
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
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: ReadVar()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
$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 <F1> 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 <F1> 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
|
||||
|
||||
@@ -39,13 +39,13 @@
|
||||
<cGetColor> 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 <xVar> and is displayed
|
||||
at row, column coordinate <nRow>, <nCol>.
|
||||
|
||||
If the SAY clause is used <cSay> will be displayed starting at
|
||||
<nRow>, <nCol>, with the field variable <xVar> displayed at Row(),
|
||||
Col()+ 1. If <cSayPicr>, the picture template for the SAY expression
|
||||
`Col() + 1`. If <cSayPicr>, the picture template for the SAY expression
|
||||
<cSay>, is used, all formatting rules contained will apply See the
|
||||
TRANSFORM I function for further information.
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
until the condition in <lValid> 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 <lValid>. 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 <xEnd>. Id <xVar> is a date data type, <xStart> and <xEnd> must
|
||||
also be date data types; if <xVar> is a numeric data type <xStart>
|
||||
and <xEnd> 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:
|
||||
|
||||
<table-noheader>
|
||||
@A Allows only alphabetic characters.
|
||||
@@ -121,20 +123,18 @@
|
||||
</table>
|
||||
|
||||
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$
|
||||
|
||||
479
doc/en/set.txt
479
doc/en/set.txt
File diff suppressed because it is too large
Load Diff
@@ -1,19 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* Documentation for: Descend()
|
||||
*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -29,7 +16,7 @@
|
||||
$ARGUMENTS$
|
||||
<cString> Any character string
|
||||
$RETURNS$
|
||||
lAlpha Logical true (.T.) or false (.F.).
|
||||
<lAlpha> Logical true (.T.) or false (.F.).
|
||||
$DESCRIPTION$
|
||||
This function return a logical true (.T.) if the first character
|
||||
in <cString> is an alphabetic character. If not, the function will
|
||||
@@ -51,6 +38,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -66,15 +55,15 @@
|
||||
$ARGUMENTS$
|
||||
<cString> Any character string
|
||||
$RETURNS$
|
||||
lDigit Logical true (.T.) or false (.F.).
|
||||
<lDigit> Logical true (.T.) or false (.F.).
|
||||
$DESCRIPTION$
|
||||
This function takes the character string <cString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -104,15 +95,15 @@
|
||||
$ARGUMENTS$
|
||||
<cString> Any character string
|
||||
$RETURNS$
|
||||
lUpper Logical true (.T.) or false (.F.).
|
||||
<lUpper> Logical true (.T.) or false (.F.).
|
||||
$DESCRIPTION$
|
||||
This function checks to see if the leftmost character
|
||||
if <cString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -142,15 +135,15 @@
|
||||
$ARGUMENTS$
|
||||
<cString> Any character string
|
||||
$RETURNS$
|
||||
lLower Logical true (.T.) or false (.F.).
|
||||
<lLower> Logical true (.T.) or false (.F.).
|
||||
$DESCRIPTION$
|
||||
This function takes the character string <cString> 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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -224,7 +221,7 @@
|
||||
the first string <cSearch>. 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -256,9 +255,9 @@
|
||||
|
||||
<cString> Main string
|
||||
|
||||
<nStart> First position to search in cString, by default 1
|
||||
<nStart> First position to search in <cString>, by default 1
|
||||
|
||||
<nEnd> End position to search, by default cString length
|
||||
<nEnd> End position to search, by default <cString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -311,8 +312,8 @@
|
||||
If the function is unable to find any occurrence of <cSearch> in
|
||||
<cString>, 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -338,15 +341,15 @@
|
||||
$ONELINER$
|
||||
Searches for last occurrence a substring of a string.
|
||||
$SYNTAX$
|
||||
hb_RAt( <cSearch>, <cString>, [<nStart>], [<nEnd>] ) --> nPos
|
||||
hb_RAt( <cSearch>, <cString>, [<nStart>], [<nEnd>] ) --> nPos
|
||||
$ARGUMENTS$
|
||||
<cSearch> Substring to search for
|
||||
|
||||
<cString> Main string
|
||||
|
||||
<nStart> First position to search in cString, by default 1.
|
||||
<nStart> First position to search in <cString>, by default 1.
|
||||
|
||||
<nEnd> End position to search, by default cString length
|
||||
<nEnd> End position to search, by default <cString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -408,10 +413,11 @@
|
||||
$DESCRIPTION$
|
||||
This functions returns the leftmost <nLen> characters of <cString>.
|
||||
It is equivalent to the following expression:
|
||||
|
||||
```
|
||||
SubStr( <cString>, 1, <nLen> )
|
||||
```
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -447,12 +455,14 @@
|
||||
$DESCRIPTION$
|
||||
This functions returns the rightmost <nLen> characters of <cString>.
|
||||
It is equivalent to the following expressions:
|
||||
|
||||
```
|
||||
SubStr( <cString>, -<nLen> )
|
||||
|
||||
```
|
||||
```
|
||||
SubStr( <cString>, Len( <cString> ) - <nLen> + 1, <nLen> )
|
||||
```
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -499,9 +511,9 @@
|
||||
characters from <nStart> to the end of the string is less than <nLen>
|
||||
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 @@
|
||||
|
||||
<nDecimals> is the number of decimal places to return.
|
||||
$RETURNS$
|
||||
Str() returns <nNumber> formatted as a character string. If the
|
||||
Str() returns <nNumber> 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
|
||||
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
$DESCRIPTION$
|
||||
Str() is a numeric conversion function that converts numeric values
|
||||
@@ -576,8 +588,8 @@
|
||||
* If <nLength> is specified but <nDecimals> 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 @@
|
||||
|
||||
<nDecimals> is the number of decimal places to return.
|
||||
$RETURNS$
|
||||
StrZero() returns <nNumber> formatted as a character string. If the
|
||||
StrZero() returns <nNumber> 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
|
||||
|
||||
<table>
|
||||
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
|
||||
</table>
|
||||
$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( <cString> | <aArray> ) --> <nLength>
|
||||
Len( <cString> | <aArray> ) --> nLength
|
||||
$ARGUMENTS$
|
||||
<acString> 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 <dezac@corevia.com>
|
||||
$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
|
||||
<cString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -889,8 +901,8 @@
|
||||
This function converts all alpha characters in <cString> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -946,6 +960,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -982,6 +998,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -1030,6 +1048,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -1078,6 +1098,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -1126,6 +1148,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -1164,6 +1188,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -1272,9 +1302,9 @@
|
||||
<cString>. The length of the character string returned by this
|
||||
function is limited to the memory available.
|
||||
|
||||
A value of 0 for <nSize> will return a NULL string.
|
||||
A value of 0 for <nSize> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -1308,7 +1340,7 @@
|
||||
<cString> A string containing blank spaces
|
||||
$DESCRIPTION$
|
||||
This function returns a string consisting of <nSize> blank spaces.
|
||||
If the value of <nSize> is 0, a NULL string ( "" ) will be returned.
|
||||
If the value of <nSize> 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 <culik@sl.conex.net>
|
||||
$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. <pete_westg@yahoo.gr>
|
||||
$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( <cString>, <cLocString>, [<cRepString>], [<nPos>],
|
||||
[<nOccurrences>] ) --> cReturn
|
||||
hb_ntoc( <nValue>, [<nDecs>] ) --> cValue
|
||||
$ARGUMENTS$
|
||||
<cString> The main string to search
|
||||
<nValue> is the numeric value to convert.
|
||||
|
||||
<cLocString> The string to locate in the main string
|
||||
|
||||
<cRepString> The string to replace the <cLocString>
|
||||
|
||||
<nPos> The first occurrence to be replaced
|
||||
|
||||
<nOccurrences> Number of occurrence to replace
|
||||
<nDecs> decimal digits to retain (if any).
|
||||
$RETURNS$
|
||||
<cReturn> Formated string
|
||||
<cValue> A string representation of <nValue>
|
||||
$DESCRIPTION$
|
||||
This function searches for any occurrence of <cLocString> in <cString>
|
||||
and replaces it with <cRepString>. If <cRepString> is not specified, a
|
||||
NULL byte will replace <cLocString>.
|
||||
This function converts the given <nValue> numeric value
|
||||
to a string value, while (trying to) keep all or at least `nDecs`
|
||||
significant digits in double numbers, unless `<nDecs>` is lesser
|
||||
than actual decimal digits of <nValue>, in which case the result
|
||||
will be rounded.
|
||||
|
||||
If <nPos> is used, its value defines the first occurrence to be
|
||||
replaced. The default value is 1. Additionally, if used, the value of
|
||||
<nOccurrences> tell the function how many occurrences of <cLocString>
|
||||
in <cString> are to the replaced. The default of <nOccurrences> 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 `<nValue>`, preserving all (or at least
|
||||
`<nDecs>`) significant digits, if any.
|
||||
Interestingly, if `<nValue>` 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. <pete_westg@yahoo.gr>
|
||||
$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( <xExpression>, <cTemplate> ) --> cFormatted
|
||||
hb_ntos( <nValue> ) --> cValue
|
||||
$ARGUMENTS$
|
||||
<xExpression> Any expression to be formated.
|
||||
|
||||
<cTemplate> Character string with picture template
|
||||
<nValue> is the numeric value to convert.
|
||||
$RETURNS$
|
||||
<cFormatted> Formatted expression in character format
|
||||
<cValue> A string representation of <nValue>
|
||||
$DESCRIPTION$
|
||||
This function returns <xExpression> in the format of the picture
|
||||
expression passed to the function as <cTemplate>.
|
||||
This function converts any numeric value to a string,
|
||||
trimming all the leading empty spaces. If `<nValue>` is NIL
|
||||
or not numeric, this function will return a null string.
|
||||
|
||||
Their are two components that can make up <cTemplate> : a function
|
||||
string and a template string. Function strings are those functions
|
||||
that globally tell what the format of <xExpression> 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 <cTemplate>, 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.
|
||||
|
||||
<table-noheader>
|
||||
@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.
|
||||
</table>
|
||||
|
||||
The second part of <cTemplate> 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.
|
||||
|
||||
<table-noheader>
|
||||
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
|
||||
</table>
|
||||
Essentially, `hb_ntos()` function is equivalent to
|
||||
`LTrim( Str( <nValue> ) )` 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$
|
||||
*/
|
||||
|
||||
54
doc/en/strtran.txt
Normal file
54
doc/en/strtran.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
StrTran()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Strings
|
||||
$ONELINER$
|
||||
Translate substring value with a main string
|
||||
$SYNTAX$
|
||||
StrTran( <cString>, <cLocString>, [<cRepString>], [<nPos>],
|
||||
[<nOccurrences>] ) --> cReturn
|
||||
$ARGUMENTS$
|
||||
<cString> The main string to search
|
||||
|
||||
<cLocString> The string to locate in the main string
|
||||
|
||||
<cRepString> The string to replace the <cLocString>
|
||||
|
||||
<nPos> The first occurrence to be replaced
|
||||
|
||||
<nOccurrences> Number of occurrence to replace
|
||||
$RETURNS$
|
||||
<cReturn> Formatted string
|
||||
$DESCRIPTION$
|
||||
This function searches for any occurrence of <cLocString> in <cString>
|
||||
and replaces it with <cRepString>. If <cRepString> is not specified, a
|
||||
NULL byte will replace <cLocString>.
|
||||
|
||||
If <nPos> is used, its value defines the first occurrence to be
|
||||
replaced. The default value is 1. Additionally, if used, the value of
|
||||
<nOccurrences> tell the function how many occurrences of <cLocString>
|
||||
in <cString> are to the replaced. The default of <nOccurrences> 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$
|
||||
*/
|
||||
1324
doc/en/subcodes.txt
1324
doc/en/subcodes.txt
File diff suppressed because it is too large
Load Diff
@@ -7,8 +7,8 @@
|
||||
TBrowse class
|
||||
$ONELINER$
|
||||
Create a Browse Object
|
||||
$CONSTRUCTOR$
|
||||
TBrowseNew( <nTop>, <nLeft>, <nBottom>, <nRight> ) --> <oBrowse>
|
||||
$SYNTAX$
|
||||
TBrowseNew( <nTop>, <nLeft>, <nBottom>, <nRight> ) --> oBrowse
|
||||
$ARGUMENTS$
|
||||
<nTop> Top Row
|
||||
|
||||
@@ -22,156 +22,156 @@
|
||||
$DESCRIPTION$
|
||||
This function set up a browsing window at top-left coordinates of
|
||||
<nTop>, <nLeft> to bottom-right coordinates of <nBottom>, <nRight>.
|
||||
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 <nMode> 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( <nKey>[, <bBlock>] ) --> bOldBlock
|
||||
:SetKey( <nKey>[, <bBlock>] ) --> bOldBlock
|
||||
$ARGUMENTS$
|
||||
<nKey> An valid inkey Code
|
||||
|
||||
<bBlock> An optional action to associate to the inkey value.
|
||||
$RETURNS$
|
||||
<bOldBlock> If an Keypress has it code block changes, it will return
|
||||
the previus one; otherwise, it will return the current one
|
||||
<bOldBlock> 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
|
||||
|
||||
<table>
|
||||
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 }
|
||||
</table>
|
||||
|
||||
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 <nKey>. 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 <nKey> is not
|
||||
contained in the dictionary.
|
||||
|
||||
To remove an keypress/code block definition, specify NIL for <bBlock>
|
||||
To remove an key-press/code block definition, specify NIL for <bBlock>
|
||||
```
|
||||
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( <nKey> ) --> nResult
|
||||
:ApplyKey( <nKey> ) --> nResult
|
||||
$ARGUMENTS$
|
||||
<nKey> An valid Inkey code
|
||||
$RETURNS$
|
||||
@@ -263,15 +268,16 @@
|
||||
See Table Below
|
||||
|
||||
<table>
|
||||
Value Meaning
|
||||
-1 User request for the browse lost input focus
|
||||
0 Code block associated with <nkey> was evaluated
|
||||
1 Unable to locate <nKey> in the dictionary, Key was not processed
|
||||
Value Meaning
|
||||
-1 User request for the browse lost input focus
|
||||
0 Code block associated with <nkey> was evaluated
|
||||
1 Unable to locate <nKey> in the dictionary, Key was not processed
|
||||
</table>
|
||||
$DESCRIPTION$
|
||||
This method evaluate an code block associated with <nkey> 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( <oCol> ) --> Self
|
||||
:AddColumn( <oCol> ) --> Self
|
||||
$ARGUMENTS$
|
||||
<oCol> Is an TbColumn object
|
||||
$RETURNS$
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Brian Hays <bhays@abacuslaw.com>
|
||||
* Documentation
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Brian Hays <bhays@abacuslaw.com>
|
||||
$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$
|
||||
*/
|
||||
|
||||
@@ -1,26 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* Documentation for: hb_ColorIndex()
|
||||
*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* Documentation for: __Wait(), __Input()
|
||||
*
|
||||
* Copyright 1999-2000 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: Alert(), __NoNoAlert(), OutStd(), OutErr(),
|
||||
* __XSaveScreen(), SAVE SCREEN, __XRestScreen(),
|
||||
* RESTORE SCREEN, __TextSave(), __TextRestore()
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* Documentation for: DevOutPict()
|
||||
*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* Documentation for: EJECT, MaxRow(), MaxCol(), Row(), Col(), PRow(), PCol()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999-2000 Chen Kedem <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -214,20 +198,20 @@
|
||||
If <xMessage> is an array of Character strings, each element would
|
||||
be displayed in a new line. If <xMessage> 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.
|
||||
|
||||
<aOptions> Array with available response. Each element should be
|
||||
Character string. If omitted, default is { "Ok" }.
|
||||
Character string. If omitted, default is `{ "Ok" }`.
|
||||
|
||||
<cColorNorm> Color string to paint the dialog box with.
|
||||
If omitted, default color is "W+/R".
|
||||
If omitted, default color is `"W+/R"`.
|
||||
|
||||
<nDelay> 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 <Esc> was pressed, return value is zero.
|
||||
|
||||
The return value is NIL
|
||||
if Alert() is called with no parameters, or if <xMessage> 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
|
||||
<Tab> key. To select an option the user can press <Enter>, <Space> 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
|
||||
|
||||
<cColorNorm> is a Harbour extension, or at least un-documented
|
||||
<cColorNorm> is a Harbour extension, or at least undocumented
|
||||
in Clipper 5.2 NG.
|
||||
|
||||
<nDelay> is a Harbour extension.
|
||||
@@ -305,6 +289,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999-2000 Chen Kedem <niki@actcom.co.il>
|
||||
$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( <cColorSpec>, <nIndex> ) --> <cColor>
|
||||
hb_ColorIndex( <cColorSpec>, <nIndex> ) --> cColor
|
||||
$ARGUMENTS$
|
||||
<cColorSpec> 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 <dholm@jsd-llc.com>
|
||||
$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 <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -471,7 +464,7 @@
|
||||
$ONELINER$
|
||||
Stops application
|
||||
$SYNTAX$
|
||||
__Input( <cMessage> ) --> <cString>
|
||||
__Input( <cMessage> ) --> cString
|
||||
$ARGUMENTS$
|
||||
<cMessage> is any valid expression.
|
||||
$RETURNS$
|
||||
@@ -491,6 +484,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999-2000 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -506,9 +501,9 @@
|
||||
$ARGUMENTS$
|
||||
<cFile> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Procedure
|
||||
$NAME$
|
||||
@@ -557,6 +554,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -568,7 +567,7 @@
|
||||
$ONELINER$
|
||||
Stops the application until a key is pressed.
|
||||
$SYNTAX$
|
||||
__Wait( <cMessage> ) --> <cKey>
|
||||
__Wait( <cMessage> ) --> cKey
|
||||
$ARGUMENTS$
|
||||
<cMessage> 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 <niki@actcom.co.il>
|
||||
$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 <niki@actcom.co.il>
|
||||
$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 <culik@sl.conex.net>
|
||||
$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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -778,6 +786,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -813,6 +823,8 @@
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$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$
|
||||
<nPosition> The maximun number of columns possible in current video
|
||||
<nPosition> 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 <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -864,7 +878,7 @@
|
||||
$ARGUMENTS$
|
||||
None.
|
||||
$RETURNS$
|
||||
<nPosition> The maximun number of rows possible in current video
|
||||
<nPosition> The maximum number of rows possible in current video
|
||||
mode
|
||||
$DESCRIPTION$
|
||||
This function returns the current cursor row location. The value
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* Documentation
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -30,21 +24,21 @@
|
||||
This command allows labels to be printed based on the format
|
||||
outlined in LBL file specified as <cLabelName>. 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 <cFile>.
|
||||
|
||||
If no file extension is specified a .txt extension is added.
|
||||
<cScope> is the scope condition for this command. Valid scopes
|
||||
include NEXT <expN> (number of records to be displayed, where <expN>
|
||||
is the number of records), RECORD <expN> (a specific record to be
|
||||
include `NEXT <expN>` (number of records to be displayed, where <expN>
|
||||
is the number of records), `RECORD <expN>` (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 <bFor> is the logical expression for the FOR condition (for
|
||||
records to be displayed whitin a given value range) and <bWhile> for
|
||||
records to be displayed within a given value range) and <bWhile> 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 <cLabelName>
|
||||
$EXAMPLES$
|
||||
PROCEDURE Main()
|
||||
USE test NEW
|
||||
LABEL FORM test.lbl
|
||||
dbCloseArea()
|
||||
RETURN
|
||||
USE test NEW
|
||||
LABEL FORM test.lbl
|
||||
$STATUS$
|
||||
R
|
||||
$COMPLIANCE$
|
||||
|
||||
98
doc/en/transfrm.txt
Normal file
98
doc/en/transfrm.txt
Normal file
@@ -0,0 +1,98 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
Transform()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Strings
|
||||
$ONELINER$
|
||||
Formats a value based on a specific picture template.
|
||||
$SYNTAX$
|
||||
Transform( <xExpression>, <cTemplate> ) --> cFormatted
|
||||
$ARGUMENTS$
|
||||
<xExpression> Any expression to be formatted.
|
||||
|
||||
<cTemplate> Character string with picture template
|
||||
$RETURNS$
|
||||
<cFormatted> Formatted expression in character format
|
||||
$DESCRIPTION$
|
||||
This function returns <xExpression> in the format of the picture
|
||||
expression passed to the function as <cTemplate>.
|
||||
|
||||
Their are two components that can make up <cTemplate> : a function
|
||||
string and a template string. Function strings are those functions
|
||||
that globally tell what the format of <xExpression> 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 <cTemplate>, 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.
|
||||
|
||||
<table-noheader>
|
||||
@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.
|
||||
</table>
|
||||
|
||||
The second part of <cTemplate> 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.
|
||||
|
||||
<table-noheader>
|
||||
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
|
||||
</table>
|
||||
$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$
|
||||
*/
|
||||
@@ -1,12 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* Documentation
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
@@ -36,28 +30,28 @@
|
||||
<cHeading> Report heading
|
||||
$DESCRIPTION$
|
||||
This command prints out the report named <cReportName>, 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 <cReportName>; unless a drive and path are
|
||||
specified in <cReportName>, 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 <cFile>. Unless specified in <cFile>, the default file
|
||||
extension will be TXT.
|
||||
extension will be `.txt`.
|
||||
|
||||
<cScope> is the scope for this command. Valid scopes include
|
||||
NEXT <expN> (where <expN> is the number of records), RECORD <expN>
|
||||
`NEXT <expN>` (where <expN> is the number of records), `RECORD <expN>`
|
||||
(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 <bFor> is the logical expression for the FOR condition (for
|
||||
records to be displayed within a given range) and <bWhile> 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$
|
||||
|
||||
131
doc/en/typefile.txt
Normal file
131
doc/en/typefile.txt
Normal file
@@ -0,0 +1,131 @@
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 2000 Chen Kedem <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
__TypeFile()
|
||||
$CATEGORY$
|
||||
API
|
||||
$SUBCATEGORY$
|
||||
Terminal
|
||||
$ONELINER$
|
||||
Show the content of a file on the console and/or printer
|
||||
$SYNTAX$
|
||||
__TypeFile( <cFile>, [<lPrint>] ) --> NIL
|
||||
$ARGUMENTS$
|
||||
<cFile> is a name of the file to display. If the file have an
|
||||
extension, it must be specified (there is no default value).
|
||||
|
||||
<lPrint> 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 <cFile> 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 <cFile> cannot 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 `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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Command
|
||||
$NAME$
|
||||
TYPE
|
||||
$CATEGORY$
|
||||
Command
|
||||
$SUBCATEGORY$
|
||||
FileSys
|
||||
$ONELINER$
|
||||
Show the content of a file on the console, printer or file
|
||||
$SYNTAX$
|
||||
TYPE <xcFile> [TO PRINTER] [TO FILE <xcDestFile>]
|
||||
$ARGUMENTS$
|
||||
<xcFile> 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` <xcDestFile> copy the source <xcFile> also to a file. If no
|
||||
extension is given `.txt` is added to the output file name.
|
||||
<xcDestFile> 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 <xcFile> 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 <xcFile> cannot be found a run-time error occur.
|
||||
|
||||
If <xcDestFile> 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 `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$
|
||||
*/
|
||||
350
doc/en/var.txt
350
doc/en/var.txt
@@ -1,24 +1,6 @@
|
||||
/*
|
||||
* Copyright 1999 Ryszard Glab <rglab@imid.med.pl>
|
||||
* Documentation for: __mvPublic(), __mvPrivate(), __mvXRelease(),
|
||||
* __mvRelease(), __mvScope(), __mvClear(),
|
||||
* __mvDbgInfo(), __mvGet(), __mvPut(), MemVarBlock(),
|
||||
* Type()
|
||||
*
|
||||
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: FieldBlock(), FieldWBlock()
|
||||
*
|
||||
* Copyright 2001 Chen Kedem <niki@actcom.co.il>
|
||||
* Documentation for: __mvExist()
|
||||
*
|
||||
* Copyright 2002 Walter Negro <anegro@overnet.com.ar>
|
||||
* Documentation for: hb_PIsByRef()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
$AUTHOR$
|
||||
Copyright 1999 Ryszard Glab <rglab@imid.med.pl>
|
||||
$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 <rglab@imid.med.pl>
|
||||
$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 <rglab@imid.med.pl>
|
||||
$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 <rglab@imid.med.pl>
|
||||
$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 <rglab@imid.med.pl>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -215,36 +201,41 @@
|
||||
<cVarName> = 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
|
||||
<table-noheader>
|
||||
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
|
||||
</table>
|
||||
$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 <rglab@imid.med.pl>
|
||||
$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 <rglab@imid.med.pl>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -312,9 +305,13 @@
|
||||
__mvDbgInfo( <nScope> [, <nPosition> [, @<cVarName>] ] )
|
||||
$ARGUMENTS$
|
||||
<nScope> = 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)
|
||||
<table-noheader>
|
||||
HB_MV_PUBLIC
|
||||
HB_MV_PRIVATE (or any other value)
|
||||
</table>
|
||||
|
||||
<nPosition> = the position of asked variable on the list of variables
|
||||
with specified scope - it should start from position 1
|
||||
<cVarName> = 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 <Nth> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -428,7 +430,7 @@
|
||||
$ONELINER$
|
||||
Determine if a given name is a PUBLIC or PRIVATE memory variable
|
||||
$SYNTAX$
|
||||
__mvExist( <cVarName> ) --> <lVariableExist>
|
||||
__mvExist( <cVarName> ) --> lVariableExist
|
||||
$ARGUMENTS$
|
||||
<cVarName> - 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 <rglab@imid.med.pl>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -469,7 +473,7 @@
|
||||
$ONELINER$
|
||||
This function returns value of memory variable
|
||||
$SYNTAX$
|
||||
__mvGet( <cVarName> ) --> <xVar>
|
||||
__mvGet( <cVarName> ) --> xVar
|
||||
$ARGUMENTS$
|
||||
<cVarName> - 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 <rglab@imid.med.pl>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -507,7 +514,7 @@
|
||||
$ONELINER$
|
||||
This function set the value of memory variable
|
||||
$SYNTAX$
|
||||
__mvGet( <cVarName> [, <xValue>] ) --> <xValue>
|
||||
__mvPut( <cVarName> [, <xValue>] ) --> xValue
|
||||
$ARGUMENTS$
|
||||
<cVarName> - string that specifies the name of variable
|
||||
<xValue> - 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 <rglab@imid.med.pl>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -549,7 +559,7 @@
|
||||
$ONELINER$
|
||||
Returns a codeblock that sets/gets a value of memvar variable
|
||||
$SYNTAX$
|
||||
MemVarBlock( <cMemvarName> ) --> <bBlock>
|
||||
MemVarBlock( <cMemvarName> ) --> bBlock
|
||||
$ARGUMENTS$
|
||||
<cMemvarName> - 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 <niki@actcom.co.il>
|
||||
$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
|
||||
<cFieldName> 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 <niki@actcom.co.il>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -670,21 +680,20 @@
|
||||
with the name <cFieldName> in work area number <nWorkArea>, 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 <rglab@imid.med.pl>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -711,28 +722,28 @@
|
||||
$ONELINER$
|
||||
Retrieves the type of an expression
|
||||
$SYNTAX$
|
||||
Type( <cExp> ) --> <cRetType>
|
||||
Type( <cExp> ) --> cRetType
|
||||
$ARGUMENTS$
|
||||
<cExp> must be a character expression.
|
||||
$RETURNS$
|
||||
<cRetType> a string indicating the type of the passed expression.
|
||||
|
||||
<table>
|
||||
<cRetType> Meaning
|
||||
<cRetType> 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
|
||||
</table>
|
||||
$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( <xExp> ) --> <cRetType>
|
||||
ValType( <xExp> ) --> cRetType
|
||||
$ARGUMENTS$
|
||||
<xExp> is any valid expression.
|
||||
$RETURNS$
|
||||
<cRetType> a character indicating the type of the passed expression.
|
||||
|
||||
<table>
|
||||
<cRetType> Meaning
|
||||
<cRetType> 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
|
||||
</table>
|
||||
$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 <anegro@overnet.com.ar>
|
||||
$TEMPLATE$
|
||||
Function
|
||||
$NAME$
|
||||
@@ -872,7 +882,7 @@
|
||||
$ONELINER$
|
||||
Determine if a parameter is passed by reference.
|
||||
$SYNTAX$
|
||||
hb_PIsByRef( nParam ) --> <lParamIsByRef>
|
||||
hb_PIsByRef( nParam ) --> lParamIsByRef
|
||||
$ARGUMENTS$
|
||||
<nParam> 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
|
||||
|
||||
@@ -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 <me@example.org>
|
||||
$NAME$
|
||||
StartHere()
|
||||
$CATEGORY$
|
||||
|
||||
786
doc/xhb-diff.txt
786
doc/xhb-diff.txt
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user