02-24-2003, 11:06 PM
You can use global int variable, or registry functions rget and rset. If file is required, then you can use string functions getfile and setfile. I can help you if it is hard to understand or must be implemented in other way: please send me email.
Alternatively, you can use ini file. Sample below saves variable to ini file. If you run it 5 times, it will show message. Sample equires "winapiQM.txt" file to be selected in Options\Files\Reference_file.
...
int i=GetPrivateProfileInt("Print" "count" 0 "c:\qm.ini") + 1
if(i>=5) i=0; mes ""
str s = i
WritePrivateProfileString("Print" "count" s "c:\qm.ini")
Alternatively, you can use ini file. Sample below saves variable to ini file. If you run it 5 times, it will show message. Sample equires "winapiQM.txt" file to be selected in Options\Files\Reference_file.
...
int i=GetPrivateProfileInt("Print" "count" 0 "c:\qm.ini") + 1
if(i>=5) i=0; mes ""
str s = i
WritePrivateProfileString("Print" "count" s "c:\qm.ini")