Archive: Determine did var contains with some text!


Determine did var contains with some text!
How to determine for sample did contains var result with text "MSG"?


StrCmp or ${If}

Stu


I mean CONTAINS,not equals...


You can use the WordFind macro from the WordFunc Header (NSIS user manual E.3)

${WordFind} "$sample" "MSG" "#" $R0
${If} $R0 > 0
DetailPrint '"MSG" found in string $sample ($R0 times)'
${Else}
DetailPrint '"MSG" not found in string $sample'
${EndIf}
You can use WordFindS to search case sensitive if needed.

10x my friend!