http://www.ousob.com --- Legacy Redefined #include <extend50.h> #define SPACE 0x20 CLIPPER b_binary() { char buff[32]; typedef struct{ unsigned int bit0 : 1; unsigned int bit1 : 1; unsigned int bit2 : 1; unsigned int bit3 : 1; unsigned int bit4 : 1; unsigned int bit5 : 1; unsigned int bit6 : 1; unsigned int bit7 : 1; unsigned int bit8 : 1; unsigned int bit9 : 1; unsigned int bit10 : 1; unsigned int bit11 : 1; unsigned int bit12 : 1; unsigned int bit13 : 1; unsigned int bit14 : 1; unsigned int bit15 : 1; } ANINT; union{ unsigned int num; ANINT theIntiger; } theUnion; if( !ISNUM(1) || _parni(1) < 0 || _parni(1) > 65535 ){ buff[0] = SPACE; buff[1] = NULL; _retc(buff); return; } theUnion.num = _parni(1); if( theUnion.num > 255 ){ sprintf(buff,"%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d\0",theUnion.theIntiger.bit15 ,theUnion.theIntiger.bit14 ,theUnion.theIntiger.bit13 ,theUnion.theIntiger.bit12 ,theUnion.theIntiger.bit11 ,theUnion.theIntiger.bit10 ,theUnion.theIntiger.bit9 ,theUnion.theIntiger.bit8 ,theUnion.theIntiger.bit7 ,theUnion.theIntiger.bit6 ,theUnion.theIntiger.bit5 ,theUnion.theIntiger.bit4 ,theUnion.theIntiger.bit3 ,theUnion.theIntiger.bit2 ,theUnion.theIntiger.bit1 ,theUnion.theIntiger.bit0); } else{ sprintf(buff,"%d%d%d%d%d%d%d%d\0",theUnion.theIntiger.bit7 ,theUnion.theIntiger.bit6 ,theUnion.theIntiger.bit5 ,theUnion.theIntiger.bit4 ,theUnion.theIntiger.bit3 ,theUnion.theIntiger.bit2 ,theUnion.theIntiger.bit1 ,theUnion.theIntiger.bit0); } _retc(buff); }