Announcement

Collapse
No announcement yet.

Problem with String.Find

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with String.Find

    Hi,

    im struggeling with String.Find. I want to read the content from a textfile into a variable. Then i want to search if the string contains something specific. Heres the code:

    local var2 = TextFile.ReadToString(SessionVar.Expand("%AppFolde r%").."\\file.ini");
    local var3 = String.Find(var2, "SpecificContent");

    The syntax check is happy. But when the installer runs, it complains that arguement 1 of String.Find has to be of type string.

    Can anyone please help?

  • #2
    You may want to add runtime checks to make sure that the file exists and is not empty. Also, if it is indeed an INI file, you may get results with less effort using the specific INIFile actions to look for a certain value.

    Ulrich

    Comment

    Working...
    X