Page 1 of 1 1
Topic Options
#157589 - 2006-02-22 01:12 AM SetOption("NoEnvVarsInStrings","On")
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
Hi All,
We currently have the ability to turn off the resolution of macros and variables in strings, but not environmental variables. I know it is not often a problem but when you do a lot of work with SQL like clauses, it can cause some headaches. It is by no means a big deal, but I believe this should be easy to do and would complete the disabling of resolution in strings.
Cheers,
Richard

ps. Please enable stdout and COM events!


Edited by It_took_my_meds (2006-02-22 06:45 AM)

Top
#157590 - 2006-02-22 06:11 AM Re: SetOption("NoEnvVarsInStrings","On")
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
It would only cause a headache if you're using a LIKE that contains the same string as an envrionment variable.
_________________________
There are two types of vessels, submarines and targets.

Top
#157591 - 2006-02-22 06:31 AM Re: SetOption("NoEnvVarsInStrings","On")
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
That's actually not true. Try:

Code:
 ? "Without a double %%: %test%"
? "With a double %%: %%test%%"
get $



It evaluates it to nothing... When you are passing sql commands through an execute function, the headaches start to occur.

Richard

Top
#157592 - 2006-02-23 10:22 AM Re: SetOption("NoEnvVarsInStrings","On")
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
That is a pain. It used to work in the way that Doc suggested, where only environment variables with values got expanded.

To get over the problem in the short term, specify the percent symbols individually, or use a short function:
Code:
"String with 'LIKE' pattern match: "+udfLikeVar("TEST")+@CRLF

Function udfLikeVar($s) $udfLikeVar=Chr(37)+$s+Chr(37) EndFunction


Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 643 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.051 seconds in which 0.021 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org