2012-11-27 02:03 UTC+0100 Viktor Szakats (harbour syenar.net)
* doc/en/datetime.txt
* doc/en/input.txt
* doc/en/misc.txt
* doc/en/string.txt
* doc/en/terminal.txt
* doc/en/var.txt
* cleaned away remaining $TESTS$ sections (mostly
by merging with $EXAMPLES$)
! some portability fixes applied along the way
This commit is contained in:
@@ -10,6 +10,17 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2012-11-27 02:03 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* doc/en/datetime.txt
|
||||
* doc/en/input.txt
|
||||
* doc/en/misc.txt
|
||||
* doc/en/string.txt
|
||||
* doc/en/terminal.txt
|
||||
* doc/en/var.txt
|
||||
* cleaned away remaining $TESTS$ sections (mostly
|
||||
by merging with $EXAMPLES$)
|
||||
! some portability fixes applied along the way
|
||||
|
||||
2012-11-27 00:36 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbct/tests/test.prg
|
||||
! fixed one expected test result
|
||||
|
||||
@@ -114,7 +114,6 @@
|
||||
This function returns the current system date.
|
||||
$EXAMPLES$
|
||||
? Date()
|
||||
$TESTS$
|
||||
? "Today is ", Day( Date() ), " of ", CMonth( Date() ), " of ", Year( Date() )
|
||||
$STATUS$
|
||||
R
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
? "Please press the ESC key."
|
||||
DO WHILE Inkey( 0.1 ) != K_ESC
|
||||
ENDDO
|
||||
$TESTS$
|
||||
//
|
||||
KEYBOARD "AB"; ? Inkey(), Inkey() // ==> 65 66
|
||||
$STATUS$
|
||||
S
|
||||
@@ -142,7 +142,7 @@
|
||||
KEYBOARD Chr( 13 )
|
||||
// Clear the keyboard buffer
|
||||
CLEAR TYPEAHEAD
|
||||
$TESTS$
|
||||
//
|
||||
KEYBOARD Chr( 13 ); ? Inkey() // ==> 13
|
||||
KEYBOARD ";" ? Inkey() // ==> 13
|
||||
KEYBOARD "HELLO"; CLEAR TYPEAHEAD; ? Inkey() // ==> 0
|
||||
@@ -183,8 +183,6 @@
|
||||
be inserted.
|
||||
$EXAMPLES$
|
||||
// Stuff an Alt+PgDn key into the keyboard buffer
|
||||
hb_keyPut( K_ALT_PGDN )
|
||||
$TESTS$
|
||||
hb_keyPut( K_ALT_PGDN ) ; ? Inkey() // ==> 417
|
||||
hb_keyPut( K_F11 ) ; ? Inkey() // ==> -40
|
||||
$STATUS$
|
||||
@@ -236,7 +234,7 @@
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDDO
|
||||
$TESTS$
|
||||
//
|
||||
KEYBOARD "AB"; ? NextKey(), NextKey() // ==> 65 65
|
||||
$STATUS$
|
||||
R
|
||||
@@ -281,7 +279,7 @@
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDDO
|
||||
$TESTS$
|
||||
//
|
||||
KEYBOARD "AB"; ? Inkey(), LastKey() // ==> 65 65
|
||||
$STATUS$
|
||||
R
|
||||
@@ -327,7 +325,7 @@
|
||||
KEYBOARD Chr( 13 )
|
||||
// Clear the keyboard buffer
|
||||
CLEAR TYPEAHEAD
|
||||
$TESTS$
|
||||
//
|
||||
KEYBOARD Chr( 13 ); ? Inkey() // ==> 13
|
||||
KEYBOARD "HELLO"; CLEAR TYPEAHEAD; ? Inkey() // ==> 0
|
||||
$STATUS$
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
Tone( 499, 5 )
|
||||
Tone( 700, 5 )
|
||||
ENDIF
|
||||
$TESTS$
|
||||
//
|
||||
Tone( 800, 1 ) // same as ? Chr( 7 )
|
||||
Tone( 32000, 200 ) // any dogs around yet?
|
||||
Tone( 130.80, 1 ) // musical note - C
|
||||
@@ -293,7 +293,7 @@
|
||||
Tone( 700 ) // short beep
|
||||
Tone( 10, 18.2 ) // 1 second delay
|
||||
Tone( -1 ) // 1/18.2 second delay
|
||||
Tone( ) // 1/18.2 second delay
|
||||
Tone() // 1/18.2 second delay
|
||||
$STATUS$
|
||||
S
|
||||
$COMPLIANCE$
|
||||
|
||||
@@ -370,13 +370,13 @@
|
||||
If 3rd and 4th parameters is not specified, then hb_RAt() is equal
|
||||
to RAt().
|
||||
$EXAMPLES$
|
||||
? 'hb_RAt( "cde", "abcdefgfedcba" ) = ' + ;
|
||||
Str( hb_RAt( "cde", "abcdefgfedcba" ) ) // 3
|
||||
$TESTS$
|
||||
LOCAL cString
|
||||
LOCAL cSearch
|
||||
LOCAL i, y, r, nLen
|
||||
|
||||
? 'hb_RAt( "cde", "abcdefgfedcba" ) = ', ;
|
||||
hb_RAt( "cde", "abcdefgfedcba" ) // -> 3
|
||||
|
||||
cString := "acdefcdeedcb"
|
||||
cSearch := "cde"
|
||||
nLen := Len( cString )
|
||||
@@ -704,13 +704,12 @@
|
||||
$DESCRIPTION$
|
||||
HB_VALTOSTR can be used to convert any scalar value to a string.
|
||||
$EXAMPLES$
|
||||
? hb_ValToStr( 4 )
|
||||
? hb_ValToStr( "String" )
|
||||
$TESTS$
|
||||
SET DATE ANSI
|
||||
SET CENTURY ON
|
||||
? hb_ValToStr( 4 ) == " 4"
|
||||
? hb_ValToStr( 4.0 / 2 ) == " 2.00"
|
||||
? hb_ValToStr( "String" ) == "String"
|
||||
? hb_ValToStr( hb_SToD( "20010101" ) ) == "01/01/01"
|
||||
? hb_ValToStr( hb_SToD( "20010101" ) ) == "2001.01.01"
|
||||
? hb_ValToStr( NIL ) == "NIL"
|
||||
? hb_ValToStr( .F. ) == ".F."
|
||||
? hb_ValToStr( .T. ) == ".T."
|
||||
@@ -748,13 +747,16 @@
|
||||
size of a hash table. If it is used with a multidimensional array it
|
||||
returns the size of the first dimension.
|
||||
$EXAMPLES$
|
||||
? Len( "Harbour" ) // 7
|
||||
? Len( { "One", "Two" } ) // 2
|
||||
$TESTS$
|
||||
PROCEDURE Main()
|
||||
LOCAL cName := ""
|
||||
LOCAL cName
|
||||
|
||||
? Len( "Harbour" ) // --> 7
|
||||
? Len( { "One", "Two" } ) // --> 2
|
||||
|
||||
cName := ""
|
||||
ACCEPT "Enter your name: " TO cName
|
||||
? Len( cName )
|
||||
|
||||
RETURN
|
||||
$STATUS$
|
||||
R
|
||||
@@ -789,9 +791,8 @@
|
||||
This function checks if an expression has empty value and returns a
|
||||
logical indicating whether it the expression is empty or not.
|
||||
$EXAMPLES$
|
||||
? Empty( "I'm not empty" ) // .F.
|
||||
$TESTS$
|
||||
PROCEDURE Main()
|
||||
? Empty( "I'm not empty" ) // .F.
|
||||
? Empty( NIL ) // .T.
|
||||
? Empty( 0 ) // .T.
|
||||
? Empty( .F. ) // .T.
|
||||
|
||||
@@ -371,15 +371,9 @@
|
||||
characters (0x0d 0x0a, Chr( 13 ) + Chr( 10 )).
|
||||
$EXAMPLES$
|
||||
// Get the newline character(s) for the current OS.
|
||||
// Get the newline character(s) for the current OS.
|
||||
STATIC s_cNewLine
|
||||
...
|
||||
s_cNewLine := hb_eol()
|
||||
...
|
||||
OutStd( "Hello World!" + s_cNewLine )
|
||||
$TESTS$
|
||||
OutStd( "Hello World!" + hb_eol() )
|
||||
? ValType( hb_eol() ) == "C"
|
||||
? Len( hb_eol() ) == 1
|
||||
? Len( hb_eol() ) <= 2
|
||||
$STATUS$
|
||||
R
|
||||
$COMPLIANCE$
|
||||
@@ -592,7 +586,7 @@
|
||||
$EXAMPLES$
|
||||
// Wait for a key stroke
|
||||
__Wait( "Press a key to continue" )
|
||||
$TESTS$
|
||||
//
|
||||
DO WHILE !( cKey == "Q" )
|
||||
cKey := __Wait( "Press 'Q' to continue" )
|
||||
ENDDO
|
||||
|
||||
@@ -350,17 +350,18 @@
|
||||
$EXAMPLES$
|
||||
#include "hbmemvar.ch"
|
||||
|
||||
LOCAL nCount, i, xValue, cName
|
||||
|
||||
nCount := _mvDBGINFO( HB_MV_PUBLIC )
|
||||
FOR i := 1 TO nCount
|
||||
xValue := __mvDbgInfo( HB_MV_PUBLIC, i, @cName )
|
||||
? i, cName, xValue
|
||||
NEXT
|
||||
$TESTS$
|
||||
#include "hbmemvar.ch"
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nCount, i, xValue, cName
|
||||
|
||||
nCount := __mvDbgInfo( HB_MV_PUBLIC )
|
||||
FOR i := 1 TO nCount
|
||||
xValue := __mvDbgInfo( HB_MV_PUBLIC, i, @cName )
|
||||
? i, cName, xValue
|
||||
NEXT
|
||||
|
||||
//
|
||||
|
||||
? "PUBLIC=", __mvDbgInfo( HB_MV_PUBLIC )
|
||||
? "PRIVATE=", __mvDbgInfo( HB_MV_PRIVATE )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user