apman
Aug 5th, 2001, 05:05 PM
HI everyone!
I have a C function that I need to rewrite in VB, unfortunately I have NO C experience... if anyone can do this for me please, I would be very thankful.
Here is the function I need translated:
void randomize_guid(unsigned char *buf)
{
int digit, dig;
time_t curtime;
*buf++='{';
time(&curtime);
srand(curtime);
for (digit=0; digit <32; digit++)
{
if (digit==8 || digit == 12 || digit == 16 || digit == 20) *buf++='-';
dig = rand()%0xf;
if (dig<10)
*buf++='0'+dig;
else
*buf++='A'+(dig-10);
}
*buf++='}';
*buf++='\0';
}
Thanks,
Alan
I have a C function that I need to rewrite in VB, unfortunately I have NO C experience... if anyone can do this for me please, I would be very thankful.
Here is the function I need translated:
void randomize_guid(unsigned char *buf)
{
int digit, dig;
time_t curtime;
*buf++='{';
time(&curtime);
srand(curtime);
for (digit=0; digit <32; digit++)
{
if (digit==8 || digit == 12 || digit == 16 || digit == 20) *buf++='-';
dig = rand()%0xf;
if (dig<10)
*buf++='0'+dig;
else
*buf++='A'+(dig-10);
}
*buf++='}';
*buf++='\0';
}
Thanks,
Alan