Hi all,
Just to clarify
the 23 standard line pairs in my code are for cEntry1 to cEntry24
as an example cEntry1 might be a path statement -
cPath = ' '
1 - readpwini(inifile,'write',cSection,cEntry1,cPath)
2 - Strtofile(cEntry1 +' ' +cPath+Chr(013)+Chr(10),'garble.log'),.T.)
I am trying to do better code by putting these actions in a for next loop
- the first line writes a new value (cPath) to the ini file for the each entry cEntryn
- the second line writes to my log file which saves a record of the action.
As is the code works perfectly for the 24 variables.
I'm sorry I didn't say this before.
Now to the code offers
Code:
lcLine = ""
FOR lnI = 1 to 24
lcI = TRANSFORM(lnI)
lcLine = EVAL("cEntry) + lcI) + " " + cPath + CHR(13) + CHR(10))
ENDFOR
STRTOFILE(lcLine, "garble.log")
I believe the strtofile should be within the for next as I want a line in my log for each action.
so
Code:
lcLine = ""
FOR lnI = 1 to 24
lcI = TRANSFORM(lnI)
lcLine = EVAL("cEntry) + lcI) + " " + cPath + CHR(13) + CHR(10))
STRTOFILE(lcLine, "garble.log")
ENDFOR
this leaves the code to write to the ini file which also belongs in the for next loop.
readpwini(inifile,'write',cSection,cEntry1,cPath)
I need to get the content of each cEntry
Mike,
Unfortunately the line
lcLine = EVAL("cEntry) + lcI) + " " + cPath + CHR(13) + CHR(10))
compiles with an error
GenDev