Archive: Check if in 2 Fields is the same text


Check if in 2 Fields is the same text
Hi, I've a question.

I created a custom page with some fields. Is it possibible that NSIS checks if in one of them is the same text like in an other one.

If it is the same text NSIS should show a "Error window"

"Same text"

If that is possible could you explain me how I can do this and give me perhaps a example?

Would be very friendly!

Here a screenshot from the fields:


Call this function from your PageLeaveConfig function.

Function FindSameText
ReadINIStr $2 "$PLUGINSDIR\config.ini" "field 2" "State"
ReadINIStr $4 "$PLUGINSDIR\config.ini" "field 4" "State"
ReadINIStr $6 "$PLUGINSDIR\config.ini" "field 6" "State"
ReadINIStr $8 "$PLUGINSDIR\config.ini" "field 8" "State"

StrCmp $2 $4 error
StrCmp $2 $6 error
StrCmp $2 $8 error
StrCmp $4 $6 error
StrCmp $4 $8 error
StrCmp $6 $8 error
goto next

error:
MessageBox MB_ICONSTOP|MB_OK "error!"
Abort

next:
FunctionEnd

WOW THANKS Red Wine :)