Unknown Code
- Posted by timmy <tim781 at PACBELL.NET> Feb 02, 2001
- 466 views
HI, I'm writting to ask if someone will translate these few lines of C code to Euphoria. I'm studying MIDI and understand everything except how to convert "variable length quantities". These are needed for storing delta-time. I can't figure out which bits are to be discarded and don't know if << 7 shift equals an 8-bit shift or not. ..thanks timmy :) 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); }