In a script I want to check whether it's time to do a backup. I do not understand why I get this error message.
Error: Expected a String but got a Func.
▶ 021: lastBackup := IniRead (iniFile, "Control", "lastBackup")
022: MsgBox((lastBackup))
023: later := DateAdd(A_Now, 25, "days")
The ini file itself is quite simple
[Control]
lastBackup = 2024-01-25
What is wrong in line 21?
How to use IniRead function
How to use IniRead function
Klaus Daube, Zürich, CH
Re: How to use IniRead function
Looks like you have a space between IniRead and the opening parenthesis - which shouldn't be there if you choose to use this function syntax.
Compare https://www.autohotkey.com/docs/v2/Functions.htm#param
Compare https://www.autohotkey.com/docs/v2/Functions.htm#param
Re: How to use IniRead function
Thank you Gregster. That was the reason. Syntax errors have been my "specialty" since the days of Fortran.
Klaus Daube, Zürich, CH
Re: How to use IniRead function
@kdaube ( just a note )
FORTRAN , . long ago , never learned, just began with a small SHARP BASIC pocket computer with 4-kB , 1980
Dartmouth BASIC ... I can use this 60 years old program on WIN-11 64-bit / example run GWBASIC / dBaseIII+ :
https://www.softpedia.com/get/Programming/Other-Programming-Files/vDos.shtml ;- vDos lets you conveniently run DOS applications by emulating an extended DOS PC in a window.
------------------
http://www.bitsavers.org/pdf/dartmouth/BASIC_Oct64.pdf
https://www.youtube.com/watch?v=WYPNjSoDrqw -- Birth of BASIC
John G. Kemeny speaks to students ( at 28:35 ) :
....
"If this had been built on a language like ALGOL or FORTRAN, instead of teaching students in 2 or 3 hours how to use BASIC,
one would have spent easily a full week trying to have them understand ALGOL and FORTRAN and a lot of students would've just lost interest.
Writing this program in BASIC is your next assignment."
------------------
FORTRAN , . long ago , never learned, just began with a small SHARP BASIC pocket computer with 4-kB , 1980
Dartmouth BASIC ... I can use this 60 years old program on WIN-11 64-bit / example run GWBASIC / dBaseIII+ :
https://www.softpedia.com/get/Programming/Other-Programming-Files/vDos.shtml ;- vDos lets you conveniently run DOS applications by emulating an extended DOS PC in a window.
------------------
http://www.bitsavers.org/pdf/dartmouth/BASIC_Oct64.pdf
https://www.youtube.com/watch?v=WYPNjSoDrqw -- Birth of BASIC
John G. Kemeny speaks to students ( at 28:35 ) :
....
"If this had been built on a language like ALGOL or FORTRAN, instead of teaching students in 2 or 3 hours how to use BASIC,
one would have spent easily a full week trying to have them understand ALGOL and FORTRAN and a lot of students would've just lost interest.
Writing this program in BASIC is your next assignment."
------------------