Cual es el error de este código , no me crea el obj
- Code: Select all Expand view RUN
/*******************************************************************************
* Program Id: bit.c
* Version: 1.00
********************************************************************************
*
* Purpose: Sets the given bit in a passed bit string. Returns the previous
* value. Be sure to pass the string by reference. NOTE. In order
* to stay as fast as possible, minimal parameter checking is
* performed. It is up to the user to not be too stupid.
*
* Syntax: bit( <OptC String>, <OptN (1...n) Offset> [, <OptL Set/Clear>] )
*
********************************************************************************
#include <extend.h>
CLIPPER bit( void )
{
unsigned char mask,
*ptr;
unsigned int loc,
offset = _parni( 2 ) - 1,
res = 0;
loc = offset / 8;
if ( loc < _parclen( 1 ) )
{
ptr = _parc( 1 ) + loc;
loc = offset % 8;
res = *ptr << loc & 0x80;
if ( PCOUNT > 2 )
{
mask = (unsigned char ) 0x80 >> loc;
if ( _parl( 3 ) )
*ptr = *ptr | mask;
else
*ptr = *ptr & ~mask;
}
}
_retl( res );
}
y
- Code: Select all Expand view RUN
/*
* ieereal.c
*
* callable from Clipper only (S'87 or 5.0)
*
* syntax: ieereal( nIEEVar )
* returns: char string of length 8. each char in string represents
* the appropriate byte of nIEEVar.
*
* syntax: realiee( cIEEStr )
* returns: double. converts cIEEStr to it's double equivalent
*
* compile: msc 5.1 -- cl /W3 /Ox /AL /Gs /c /FPa /Zl ieereal.c
*
*/
#include "extend.h"
/*
CLIPPER ieereal(void);
CLIPPER realiee(void);
*/
union {
double n;
char s[8];
} v;
/*
* purpose: to convert a Clipper numeric to spreadsheet format
* syntax: ieereal( nValue )
* returns: char string of length 8. each char in string represents
* the appropriate byte of nIEEVar.
*/
CLIPPER ieereal()
{
double n;
n = _parnd(1);
_retclen( (char far *) &n, 8);
}
/*
* purpose: to convert a spreadsheet string into its numeric value
* syntax: realiee( cIEEStr )
* returns: nValue
*/
CLIPPER realiee()
{
char i;
char far *t;
t = _parc(1);
for (i = 0; i < 8; i++)
v.s[i] = *t++;
_retnd( v.n );
}