I saw in some blitz3d code somewhere that used colons out of nowhere. What do they do? it was set up something like this:
[code] : [code] : [code]
All in one line.
[code] : [code] : [code]
All in one line.
;-------------------------------------------------------------------------- ; PNG signature. WriteByte(fh%,137):WriteByte(fh%,80):WriteByte(fh%,78):WriteByte(fh%,71) WriteByte(fh%,13):WriteByte(fh%,10):WriteByte(fh%,26):WriteByte(fh%,10) ;--------------------------------------------------------------------------The only reason I split the above code into 2 lines was to prevent the line length exceeding 80 characters (for when other people are browsing my code).
sfx_array(SFX_BIGEXP)\sound = LoadSound(folder$ + "" + sfx_array(SFX_BIGEXP)\filename$) error$ = error$ + sfx_errorCheck$(i) : i=i+1 sfx_array(SFX_LASER)\sound = LoadSound(folder$ + "" + sfx_array(SFX_LASER)\filename$) error$ = error$ + sfx_errorCheck$(i) : i=i+1 sfx_array(SFX_SHOOT)\sound = LoadSound(folder$ + "" + sfx_array(SFX_SHOOT)\filename$) error$ = error$ + sfx_errorCheck$(i) : i=i+1 sfx_array(SFX_ZAPPER)\sound = LoadSound(folder$ + "" + sfx_array(SFX_ZAPPER)\filename$) error$ = error$ + sfx_errorCheck$(i) : i=i+1Looks complex if you do not know the context for the code. Colon use here just seems to be a neater method of formatting the code and infers that "sort the error string out and move to the next part" - is one operation.
if (x>6) { y=7; } else { y=8; } // is equivilent to y = (x>6) ? 7 : 8;
