Substring failing if string contains %'s

-Set variable FOO to [ %hello ] (in the GUI, you type this as “%%hello”
-String Substring (Specify string, start string=[, end string =] )


At runtime, FinalBuilder generates an exception complaining about a mismatched %.

In my actual example, the variable is actually being set by a File Contents Iterator, so I guess I will have to do a search/replace % with %% as a workaround. This isn’t a contrived example, I’m actually parsing a file that has lines starting with %…:slight_smile:

Steve

Steve,

What you can do is prevent FB from expanding variables within variables, so for example your file iterator will put each line into a variable, say FileLine, and then you need to pass this into the substring as %FileLine%, but if you use this syntax %!FileLine% then FB will expand FileLine and not attempt to further look for variables within the contents.

hth.

Ah, I didn’t know about that syntax, thanks!

Steve