llresult = (a = b) IF llresult THEN * Code here ENDIF RETURN llresultis better than
IF NOT (a = b) THEN RETURN .F. ELSE * Code here ENDIFThis applies to ordering CASE statements as well.
PARAMETERS lcAl3File * Is the below the nominal case? IF TYPE('lcAl3File')= "L" .OR. EMPTY(lcAl3File) * no path sent so look for it in temp folder RETURN .F. ENDIF PRIVATE lcat lcat = 0 lcat = RAT("\", lcAl3File) * I'd make 'AL3.NET' a variable, it'll make the * program small and referencing the varible is * just as fast as the literal. Plus, if you want * to ever change the filename, there's only one * place you'll have to do it. * You could also do this * IF (lcA13File == JUSTSTEM(lcA13File)) THEN * lcAL3NewFile = ADDBS(JUSTPATH(lcA13File)) + 'AL3.NEW' * ELSE * tdir + 'AL3.NEW' * ENDIF IF lcat > 0 PRIVATE lcAL3NewFile lcAL3NewFile = LEFT(lcAl3File, lcat) + 'AL3.NEW' ELSE * no path available so store it in the temporary folder lcAL3NewFile = tdir + 'AL3.NEW' ENDIF * Again, what's the nominal case? m.handle = FOPEN(lcAl3File, 0) IF m.handle < 0 WAIT WINDOW "Could not open Download file." RETURN ELSE m.sizeof = FSEEK(m.handle, 0, 2) ENDIF m.output = FCREATE(lcAL3NewFile, 0) * Nominal case? IF m.output < 0 WAIT WINDOW "An error ocurred expanding the file. Press anykey..." RETURN ENDIF ************************ PROCEDURE Hex2Dec ************************ * Convert Hex 00 - FF to decimal 0 - 255 PARAMETER hexvalue2 * Why not, RETURN EVALUATE('0x' + hexvalue2)? RETURN (DECIVALUE(LEFT(hexvalue2,1))*16) + DECIVALUE(RIGHT(hexvalue2,1))