$IFDEF FRANCAIS
CONST demofile="data\demoFR.txt"
CONST s_firstuse="Apparemment, tu exécutes ce programme pour la première fois. Je vais préparer des données de démonstration."
$ELSE
CONST demofile="data\demoEN.txt"
CONST s_firstuse="It seems you're using this program for the first time. Let me build demo data for you."
$ENDIF
SUB createdemo(filename AS STRING)
DIM demolist AS QSTRINGLIST
DIM s AS STRING
CHDIR appdir
demolist.clear
demolist.loadfromfile(demofile)
FOR i=0 TO demolist.itemcount-1
s=demolist.item(i)
IF s<>"" THEN
IF LEFT$(s,1)<>"'" THEN
IF s="# "+filename THEN GOTO foundstart
END IF
END IF
NEXT
EXIT SUB
foundstart:
DIM demosavelist AS QSTRINGLIST
demosavelist.clear
DO
i++
s=demolist.item(i)
IF LEFT$(s,6)="<date>" THEN s=lundi+s-"<date>"
demosavelist.additems(s)
LOOP UNTIL (LEFT$(s,1)="#")OR(i=demolist.itemcount-1)
IF i<>demolist.itemcount-1 THEN demosavelist.delitems(demosavelist.itemcount-1)
CHDIR appdir
demosavelist.savetofile("data\"+filename+".txt")
END SUB
SUB demo
CHDIR appdir
IF FILEEXISTS(demofile)=false THEN EXIT SUB
IF FILEEXISTS(wkfile) THEN EXIT SUB
IF FILEEXISTS(adfile) THEN EXIT SUB
IF FILEEXISTS(trfile) THEN EXIT SUB
IF FILEEXISTS(lkfile) THEN EXIT SUB
IF FILEEXISTS(prfile) THEN EXIT SUB
SHOWMESSAGE(s_firstuse)
createdemo(wkfile-"data\"-".txt")
createdemo(adfile-"data\"-".txt")
createdemo(addeffile-"data\"-".txt")
createdemo(trfile-"data\"-".txt")
createdemo(lkfile-"data\"-".txt")
createdemo(prfile-"data\"-".txt")
createdemo(opfile-"data\"-".txt")
END SUB
|