Have you put a trace in PREFERENCES_Get to see what is happening? You can use a 
trace in a 4D method that is called by Active4D. It's possible that PROCESS 
HTML TAGS is failing.

On Mar 14, 2013, at 1:56 PM, Darin Schroeder <[email protected]> 
wrote:

> I use a preference table quite frequently for getting default values
> and I've noticed a situation where the wrong info is being passed
> back. Here's how it is set up:
> 
> Let's say I have 3 preferences:
> [Preferences]Name:="Pref1"
> [Preferences]Value:="A<!--#4DTEXT
> PREFERENCES_Get("Pref2")--><!--#4DHTML PREFERENCES_Get("Pref3")-->"
> 
> [Preferences]Name:="Pref2"
> [Preferences]Value:="B"
> 
> [Preferences]Name:="Pref3"
> [Preferences]Value:="C"
> 
> I use HTML tags in the preference definition to allow me to "nest" the
> preferences together.
> 
> My PREFERENCES_Get is as follows:
> // Method: Preferences_Get
> C_TEXT($1;$prefName_t)
> C_TEXT($0;$Value_t)
> C_BOOLEAN($processTags_b)
> $prefName_t:=$1
> $Value_t:=""
> 
> QUERY([Preferences];[Preferences]Name=$prefName_t)
> $Value_t:=[Preferences]Value
> UNLOAD RECORD([Preferences])
> 
> $processTags_b:=((Position("4DHTML";$Value_t)>0) |
> (Position("4DTEXT";$Value_t)>0))
> 
> If ($processTags_b)
> PROCESS HTML TAGS($Value_t;$Value_t)
> End if
> 
> $0:=$Value_t
> 
> I've created a simple method to test:
> //Test Method
> C_TEXT($Result_t)
> $Result_t:=PREFERENCES_Get ("Pref1")
> ALERT($Result_t)
> 
> Running the test method on a client returns "ABC", which is expected.
> The same is also returned when I execute it on the server.
> 
> Problem is when I create a simple test.a4d file, "ABC" is not returned
> in the browser, but "APref2Pref3" is. Here's what the test.a4d file
> looks like:
> <html><body>
> <%
> c_text($Command_t)
> $Command_t:=PREFERENCES_Get ("Pref1")
> write ($Command_t)
> %>
> </body></html>
> 
> I'm not sure why the same commands are performing differently among
> the 3 different method calls.
> 
> I just downloaded and installed the latest version of A4D (6.0r11).
> Server and client running on Windows 7 (4D v12.4)
> 
> Any ideas?
> 
> Thanks,
> 
> Darin
> _______________________________________________
> Active4D-dev mailing list
> [email protected]
> http://list.aparajitaworld.com/listinfo/active4d-dev
> Archives: http://active4d-nabble.aparajitaworld.com/

Regards,

   Aparajita

_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to