From: Mitra <mi...@ea...> - 2003-07-03 23:00:11
|
{variable} expands to "{variable}" when it doesn't exist to avoid unecessarily catching it when people inadvertantly put { or } in something that they don't want expanded. This happens most often with Javascript in a view. One reminder ..... if you have a problem, add &errcheck=1 to the URL , it catches many errors (including undefined variables). In fact I have this code in my config.php3 ... if ($GLOBALS[REMOTE_ADDR] == "203.43.123.456") { $errcheck = 1; # $debugcache = 1; # $debugupload = 1; # $debugsi = 1; // Debug Storeitem # $debugfill = 1; # $debugimport = 1; $trace = 1; // On error messages try to display a trace of where the problem is. } So that if it spots the user is me (based on an IP address that I use, but the users don't) then it sets errcheck=1 (commented out alternatives for debugging other sorts of problems). - Mitra At 11:54 AM +0200 3/7/03, Norbert Brazda wrote: >I used what you have suggested. Result is: "NOT{variable}EMPTY". The >problem is that variable is NOT DEFINED (i.e. it is not empty, but >does not exist at all). I think that switch should show "other" >option, not "not empty" option in such case. > >I have solved this in our case, but would like to say that this >behavior is not expected and might cause problems to other people >using switch function. > > >norbert >br...@ch... > > > >From: "Mitra" <mi...@ea...> >> I use this syntax all the time (actually I use >> >> {switch({variable}).+:NOTEMPTY::EMPTY} >> >> but I think they behave the same way. I would suggest outputing >> {variable} and checking that its really empty. Like >> >> {switch({variable}).+:NOT{variable}EMPTY::EMPTY} >> >> >> - Mitra >> >> >> At 5:22 PM +0200 2/7/03, Norbert Brazda wrote: >> >We have found that {switch():} function is not behaving as expected... >> > >> >{switch({variable}).+:NOTEMPTY:EMPTY} >> >should output NOTEMPTY string if the variable is not empty and EMPTY >> >string if variable is empty. This works. >> > >> >One would expected that if variable is not defined, switch function >> >would output EMPTY string. But it outputs NOTEMPTY string. >> > >> >Please, correct it. >> > >> > >> > >> > Norbert Brazda >> > >> > CHANGENET.SK >> > Mlynske nivy 41, 821 09 Bratislava >> > tel/fax: 02-55560026, 0905-729359 >> > >> > >> > SPAJAME LUDI, KTORI MENIA SVET >> > ________________________________________________________________ >> > Prinasame pohlad na svet ocami aktivnych obcanov. Vytvarame >> >nezavisly priestor >> > pre kriticke nazory a reflexiu diania okolo nas. Poskytujeme >> >nekomercne internetove >> > sluzby pre neziskove organizacie a samospravy. >> > >> > >> > >> >------------------------------------------------------- >> >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >> >Data Reports, E-commerce, Portals, and Forums are available now. >> >Download today and enter to win an XBOX or Visual Studio .NET. >> >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 >> >_______________________________________________ >> >Apc-aa-coders mailing list >> >Apc...@li... >> >https://lists.sourceforge.net/lists/listinfo/apc-aa-coders >> >> >> -- >> Mitra Technology Consulting - www.mitra.biz - mi...@mi... >> home office 02-6684-8096 mobile 0414-648-722 work 02-6684-6182 >> >> Life is a Mystery to be Lived, not a Problem to be Solved >> > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 >_______________________________________________ >Apc-aa-coders mailing list >Apc...@li... >https://lists.sourceforge.net/lists/listinfo/apc-aa-coders -- Mitra Technology Consulting - www.mitra.biz - mi...@mi... home office 02-6684-8096 mobile 0414-648-722 work 02-6684-6182 Life is a Mystery to be Lived, not a Problem to be Solved |