CONST opfile="data\options.txt"
DIM options AS QSTRINGLIST
FUNCTION getoption(key AS STRING,default AS INTEGER) AS INTEGER
DIM s AS STRING, thiskey AS STRING, thisarg AS STRING
DIM i AS INTEGER
FOR i=0 TO options.itemcount-1
s=options.item(i)
thiskey=FIELD$(s,"=",1)
IF LCASE$(thiskey)=LCASE$(key) THEN
thisarg=FIELD$(s,"=",2)
getoption=VAL(thisarg)
EXIT FUNCTION
END IF
NEXT
getoption=default
END FUNCTION
FUNCTION getoptionstr(key AS STRING,default AS STRING) AS STRING
DIM s AS STRING, thiskey AS STRING, thisarg AS STRING
DIM i AS INTEGER, placeegal AS INTEGER
FOR i=0 TO options.itemcount-1
s=options.item(i)
thiskey=FIELD$(s,"=",1)
IF LCASE$(thiskey)=LCASE$(key) THEN
placeegal=INSTR(s,"=")
thisarg=MID$(s,placeegal+1,LEN(s)-placeegal)
IF LEFT$(thisarg,1)=CHR$(34) THEN thisarg=MID$(thisarg,2,LEN(thisarg)-2)
getoptionstr=thisarg
EXIT FUNCTION
END IF
NEXT
getoptionstr=default
END FUNCTION
CHDIR appdir
IF FILEEXISTS(opfile) THEN options.loadfromfile(opfile)
DEFINT defaultformwidth=screen.width*getoption("defaultformwidth",0.875)
DEFINT defaultformheight=screen.height*getoption("defaultformheight",0.83)
DEFINT addphoneprefix=getoption("addphoneprefix",0)
DEFSTR phoneprefix=getoptionstr("phoneprefix","")
DEFSTR appfont=getoptionstr("appfontname","Tahoma")
DEFINT appfontsize=getoption("appfontsize",9)
IF screen.width<1000 THEN appfontsize--
CREATE appQfont AS QFONT
name=appfont
size=appfontsize
END CREATE
CREATE appsmallfont AS QFONT
name=appfont
size=appfontsize-1
END CREATE
DEFSTR UsespecialKey=getoptionstr("UsespecialKey","")
DEFSTR UsespecialPrefix=getoptionstr("UsespecialPrefix","")
DEFSTR UsespecialSuffix=getoptionstr("UsespecialSuffix","")
DEFINT showweekend=getoption("showweekend",0)
DEFINT nbjours=IIF(showweekend=0,5,7)
DEFINT firstdaydisplayed=IIF(showweekend=0,1,firstdayofweek)
DEFINT nbheures=getoption("nbheures",12)
DEFINT heure1=getoption("heure1",7)
DEFINT quartdheure=getoption("hoursubdiv",4)
|