Could you or anyone else tell me where I'm going wrong please
Function .onInit
Push hello
Push 1
Push "$INSTDIR\file.txt"
Call WriteToFileLine
Function WriteToFileLine
Exch $0 ;file
Exch
Exch $1 ;line number
Exch 2
Exch $2 ;string to write
Exch 2
Push $3
Push $4
FileOpen $4 $0 w
StrCpy $3 0
loop:
IntOp $3 $3 + 1
ClearErrors
FileRead $4 $0
IfErrors +2
StrCmp $3 $1 0 loop
FileWrite $4 "$\r$\n$2$\r$\n"
FileClose $4
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd