DEFINT A-Z
DECLARE FUNCTION FileLEN% (FileName AS STRING)

CLS
PRINT "Building XGmae.. please wait..."
LOCATE 2, 1: PRINT "-[       ]-"

st# = TIMER
SHELL "BC XGMAE.BAS/O/T/C:512; >TEMP1.TMP"
IF FileLEN("TEMP1.TMP") <> 10 THEN PRINT "Error in XGMAE.BAS.": PRINT STRING$(80, "Ä"): SHELL "TYPE TEMP1.TMP": PRINT STRING$(80, "Ä"): END
LOCATE 2, 1: PRINT "-[þ      ]-"

SHELL "BC IPXLIB.BAS/O/T/C:512; >TEMP2.TMP"
IF FileLEN("TEMP2.TMP") <> 10 THEN PRINT "Error in IPXLIB.BAS.": PRINT STRING$(80, "Ä"): SHELL "TYPE TEMP2.TMP": PRINT STRING$(80, "Ä"): END
LOCATE 2, 1: PRINT "-[þþ     ]-"

SHELL "BC XGGLMM.BAS/O/T/C:512; >TEMP3.TMP"
IF FileLEN("TEMP3.TMP") <> 10 THEN PRINT "Error in XGGLMM.BAS.": PRINT STRING$(80, "Ä"): SHELL "TYPE TEMP3.TMP": PRINT STRING$(80, "Ä"): END
LOCATE 2, 1: PRINT "-[þþþ    ]-"

SHELL "BC XGMUSICM.BAS/O/T/C:512; >TEMP4.TMP"
IF FileLEN("TEMP4.TMP") <> 10 THEN PRINT "Error in XGMUSICM.BAS.": PRINT STRING$(80, "Ä"): SHELL "TYPE TEMP4.TMP": PRINT STRING$(80, "Ä"): END
LOCATE 2, 1: PRINT "-[þþþþ   ]-"

SHELL "BC XGCINEMA.BAS/O/T/C:512; >TEMP5.TMP"
IF FileLEN("TEMP5.TMP") <> 10 THEN PRINT "Error in XGCINEMA.BAS.": PRINT STRING$(80, "Ä"): SHELL "TYPE TEMP5.TMP": PRINT STRING$(80, "Ä"): END
LOCATE 2, 1: PRINT "-[þþþþþ  ]-"

SHELL "BC DS4QBPP.BAS/O/T/C:512; >TEMP6.TMP"
IF FileLEN("TEMP6.TMP") <> 10 THEN PRINT "Error in DS4QBPP.BAS.": PRINT STRING$(80, "Ä"): SHELL "TYPE TEMP6.TMP": PRINT STRING$(80, "Ä"): END
LOCATE 2, 1: PRINT "-[þþþþþþ ]-"

SHELL "XGLINK.BAT"
IF FileLEN("TEMP7.TMP") <> 4 THEN PRINT "Error when Linking.": PRINT STRING$(80, "Ä"): SHELL "TYPE TEMP6.TMP": PRINT STRING$(80, "Ä"): END
LOCATE 2, 1: PRINT "-[þþþþþþþ]-"

PRINT "Operation sucsessfull."
t# = TIMER - st#
PRINT "Compiled in"; t#; "seconds."

Handle = FREEFILE
OPEN "COMPILE.OK" FOR BINARY AS #Handle
 PUT #Handle, , t#
CLOSE

SHELL "DEL *.OBJ"
SHELL "DEL *.TMP"

FUNCTION FileLEN% (FileName AS STRING)
 Lent = 0
 F = FREEFILE
 OPEN FileName FOR INPUT AS #F
  DO
   INPUT #F, d$
   Lent = Lent + 1
  LOOP UNTIL EOF(F)
 CLOSE #F
 FileLEN = Lent
END FUNCTION

