Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone convert this C code to VB????

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Please help me convert these two C routines to Visual Basic!


void WriteVarLen(register unsigned long value)
{
register unsigned long buffer;
buffer = value & 0x7F;

while ( (value >>= 7) )
{
buffer <<= 8;
buffer |= ((value & 0x7F) | 0x80);
}

while (TRUE)
{
putc(buffer,outfile);
if (buffer & 0x80)
buffer >>= 8;
else
break;
}
}

unsigned long ReadVarLen()
{
register unsigned long value;
register unsigned char c;

if ( (value = getc(infile)) & 0x80 )
{
value &= 0x7F;
do
{
value = (value <<7) + ((c = getc(infile)) & 0x7F);
} while (c & 0x80);
}
}
return(value);
}
 

Hmmm... maybe we could transform it into
C, given the VB code. This is a question for
the VB forum I think.

regards

abp :cool: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mail me at abpillai@excite.com if you want additional help. I dont promise that I can solve your problem, but I will try my best.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top