test program for extend system
This commit is contained in:
50
harbour/tests/working/extend1.prg
Normal file
50
harbour/tests/working/extend1.prg
Normal file
@@ -0,0 +1,50 @@
|
||||
// Testing Harbour Extended system.
|
||||
//
|
||||
// NOTE: compile extend1.prg and extend2.c and link both files
|
||||
|
||||
function Main()
|
||||
|
||||
SET CENTURY ON
|
||||
|
||||
QOut( "Testing Harbour Extended system:" )
|
||||
QOut( "================================" )
|
||||
QOut( "" );
|
||||
|
||||
QOut( "Strings:" )
|
||||
QOut( ' _parc() and _retc() with Strings1( "Hello" ) =>', Strings1( "Hello" ) )
|
||||
QOut( ' _parc() and _retc() with Strings2( { "Hello" } ) =>', Strings2( { "Hello" } ) )
|
||||
QOut( ' _parclen() with Length( "Hello word" ) => ', Length( "Hello word" ) )
|
||||
QOut( "" );
|
||||
|
||||
QOut( "Logicals:" )
|
||||
QOut( ' _parl() and _retl() with Logical1( .T. ) =>', Logical1( .T. ) )
|
||||
QOut( ' _parl() and _parl() with Logical2( { .T. } ) =>', Logical2( { .T. } ) )
|
||||
QOut( "" );
|
||||
|
||||
QOut( "Dates: (SET CENTURY ON)" )
|
||||
QOut( ' _pards() and _retds() with Date1( CToD( "01/01/2000" ) ) =>', Date1( CToD( "01/01/2000" ) ) )
|
||||
QOut( ' _pards() and retds() with Date2( { CToD( "01/01/2000" ) } ) =>', Date2( { CToD( "01/01/2000" ) } ) )
|
||||
QOut( "" );
|
||||
|
||||
QOut( "Numbers:" )
|
||||
QOut( ' _parni() and _retni() with Int1( 1 ) =>', Int1( 1 ) )
|
||||
QOut( ' _parni() and _retni() with Int2( { 1 } ) =>', Int2( { 1 } ) )
|
||||
QOut( ' _parnl() and _retnl() with Long1( 123456789 ) =>', Long1( 123456789 ) )
|
||||
QOut( ' _parnl() and _retnl() with Long2( { 123456789 } ) =>', Long2( { 123456789 } ) )
|
||||
QOut( ' _parnd() and _retnd() with Double1( 1234567.89 ) =>', Double1( 1234567.89 ) )
|
||||
QOut( ' _parnd() and _retnd() with Double2( { 1234567.89 } ) =>', Double2( { 1234567.89 } ) )
|
||||
QOut( "" );
|
||||
|
||||
__Accept( "Press return to continue..." )
|
||||
|
||||
QOut( "Arrays:" )
|
||||
QOut( ' _parinfa() with Arrays( { 1, "a", .T. }, 0 ) =>', Arrays( { 1, "a", .T. }, 0 ) )
|
||||
QOut( ' _parinfa() with Arrays( { 1, "a", .T. }, 2 ) =>', Arrays( { 1, "a", .T. }, 2 ), "( IT_STRING )" )
|
||||
QOut( "" );
|
||||
|
||||
QOut( "Parameters info:" )
|
||||
QOut( ' _parinfo() with Params( 1, "a", .T., 0 ) =>', Params( 1, "a", .T., 0 ) )
|
||||
QOut( ' _parinfo() with Params( 1, "a", .T., 3 ) =>', Params( 1, "a", .T., 3 ), "( IT_LOGICAL )" )
|
||||
QOut( "" );
|
||||
|
||||
return nil
|
||||
79
harbour/tests/working/extend2.c
Normal file
79
harbour/tests/working/extend2.c
Normal file
@@ -0,0 +1,79 @@
|
||||
// Testing Harbour Extended system.
|
||||
//
|
||||
// NOTE: compile extend1.prg and extend2.c and link both files
|
||||
#include <extend.api>
|
||||
|
||||
HARBOUR HB_STRINGS1()
|
||||
{
|
||||
_retc( _parc( 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_STRINGS2()
|
||||
{
|
||||
_retc( _parc( 1, 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_LENGTH()
|
||||
{
|
||||
_retni( _parclen( 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_LOGICAL1()
|
||||
{
|
||||
_retl( _parl( 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_LOGICAL2()
|
||||
{
|
||||
_retl( _parl( 1, 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_DATE1()
|
||||
{
|
||||
_retds( _pards( 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_DATE2()
|
||||
{
|
||||
_retds( _pards( 1, 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_INT1()
|
||||
{
|
||||
_retni( _parni( 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_INT2()
|
||||
{
|
||||
_retni( _parni( 1, 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_LONG1()
|
||||
{
|
||||
_retnl( _parnl( 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_LONG2()
|
||||
{
|
||||
_retnl( _parnl( 1, 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_DOUBLE1()
|
||||
{
|
||||
_retnd( _parnd( 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_DOUBLE2()
|
||||
{
|
||||
_retnd( _parnd( 1, 1 ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_ARRAYS()
|
||||
{
|
||||
_retnl( _parinfa( 1, _parni( 2 ) ) );
|
||||
}
|
||||
|
||||
HARBOUR HB_PARAMS()
|
||||
{
|
||||
_retni( _parinfo( _parni( 4 ) ) );
|
||||
}
|
||||
Reference in New Issue
Block a user