114 lines
2.4 KiB
C
114 lines
2.4 KiB
C
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* SixAPI Project source code:
|
|
*
|
|
* Copyright 2010 Andi Jahja <xharbour@telkom.net.id>
|
|
*
|
|
* 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 software; see the file COPYING. If not, write to
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
|
*/
|
|
#include "sxapi.h"
|
|
|
|
HB_FUNC( SX_RECCOUNT )
|
|
{
|
|
WORD iWorkArea = SX_DUMMY_NUMBER;
|
|
|
|
if( ! _sx_Used() )
|
|
{
|
|
hb_retnl( 0 );
|
|
return;
|
|
}
|
|
|
|
if( ! HB_ISNIL( 1 ) )
|
|
iWorkArea = _sx_select( hb_param( 1, HB_IT_ANY ) );
|
|
|
|
hb_retnl( sx_RecCount() );
|
|
|
|
if( iWorkArea != SX_DUMMY_NUMBER )
|
|
sx_Select( iWorkArea );
|
|
}
|
|
|
|
HB_FUNC( SX_LASTREC )
|
|
{
|
|
HB_FUNCNAME( SX_RECCOUNT ) ();
|
|
}
|
|
|
|
HB_FUNC( SX_RECALL )
|
|
{
|
|
WORD iWorkArea = SX_DUMMY_NUMBER;
|
|
|
|
if( ! _sx_Used() )
|
|
{
|
|
hb_ret();
|
|
return;
|
|
}
|
|
|
|
if( ! HB_ISNIL( 1 ) )
|
|
iWorkArea = _sx_select( hb_param( 1, HB_IT_ANY ) );
|
|
|
|
sx_Recall();
|
|
|
|
if( iWorkArea != SX_DUMMY_NUMBER )
|
|
sx_Select( iWorkArea );
|
|
}
|
|
|
|
HB_FUNC( SX_RECNO )
|
|
{
|
|
WORD iWorkArea = SX_DUMMY_NUMBER;
|
|
|
|
if( ! _sx_Used() )
|
|
{
|
|
hb_retnl( 0 );
|
|
return;
|
|
}
|
|
|
|
if( ! HB_ISNIL( 1 ) )
|
|
iWorkArea = _sx_select( hb_param( 1, HB_IT_ANY ) );
|
|
|
|
hb_retnl( sx_RecNo() );
|
|
|
|
if( iWorkArea != SX_DUMMY_NUMBER )
|
|
sx_Select( iWorkArea );
|
|
}
|
|
|
|
HB_FUNC( SX_RECSIZE )
|
|
{
|
|
WORD iWorkArea = SX_DUMMY_NUMBER;
|
|
|
|
if( ! _sx_Used() )
|
|
{
|
|
hb_retnl( 0 );
|
|
return;
|
|
}
|
|
|
|
if( ! HB_ISNIL( 1 ) )
|
|
iWorkArea = _sx_select( hb_param( 1, HB_IT_ANY ) );
|
|
|
|
hb_retnl( sx_RecSize() );
|
|
|
|
if( iWorkArea != SX_DUMMY_NUMBER )
|
|
sx_Select( iWorkArea );
|
|
}
|
|
|
|
HB_FUNC( SX_RECTOSTRING )
|
|
{
|
|
hb_retc( ( char * ) sx_RecToString( ( PBYTE ) hb_parc( 1 ) /* cpRecStruc */,
|
|
( WORD ) hb_parni( 2 ) /* iLength */
|
|
) );
|
|
}
|