PDA

View Full Version : "Does Not Contain", does not work



NewsArchive
04-02-2009, 01:35 AM
Poetry aside:

Build 6.9.2537.0
Trying to detect presence of spaces in a path to be used for
redirection. Path has spaces. SB tells me no space. Redirection fails,
because I don't quote the path.

My script first splits the path into part containing clarion root
(%T1%), and part not containing clarion root (%T2%). I added a message
for debugging.

See attached screen shots.

Note the combined test: path contains clarion root AND T2 DOES NOT
CONTAIN the space character.

The message appears only when SB says T2 does not have spaces. Note
that at runtime, a message appears clearly showing T2 containing spaces.

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-02-2009, 01:36 AM
Hi Phil

I think that is because SB does a TRIM() on strings so may be looking for "" instead
of " ". Hence the failure.

I had problems trying to concat strings with leading spaces.

See what Friedrich comes up with.

John Griffiths

NewsArchive
04-02-2009, 01:37 AM
Phil,

Please try the attached one (see screenshot and demo project). Does this
work?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-03-2009, 02:35 AM
The search argument can be either a string literal or a string variable.

Premise: If the programmer explicitly coded trailing space(s) in a
string literal, (s)he obviously intended them to be there.

Logical Conclusion:
Never trim string literals.

The "instring" function works correctly with a string literal argument
containing spaces. "Contains" should internally call "instring". They
mean exactly the same thing.

But, I will use the instring workaround.

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-03-2009, 02:36 AM
Friedrich,

That script works correctly. (Not surprised, I have used that in other
scripts)

Phil