I just tried this:
C_TEXT($1;$0)
ARRAY TEXT($keys;3)
$keys{1}:="foo<!--#4DTEXT PREFERENCES_Get(\"2\")--><!--#4DTEXT
PREFERENCES_Get(\"3\")-->"
$keys{2}:="bar"
$keys{3}:="baz"
PROCESS HTML TAGS($keys{Num($1)};$0)
Made sure to set the method property "Available through 4D HTML tags". Called
the method from Active4D:
write(PREFERENCES_Get("1"))
It return the correct result, "foobarbaz".
Mac OS X 10.8 and Windows 7, 4D 12.4, Active4D v6.0r11.
Did you set the method property "Available through 4D HTML tags"?
On Mar 14, 2013, at 3:38 PM, Darin Schroeder <[email protected]>
wrote:
> I did put a trace in, and it does fail, but only when called from the
> .a4d file. Running it locally or via a server process works fine.
>
> I don't have a lot of places where I do this, so I'm just going to
> roll out my own nesting routine, but it does seem odd.
>
> Darin
>
> On Thu, Mar 14, 2013 at 2:06 PM, Aparajita Fishman
> <[email protected]> wrote:
>> 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/
> _______________________________________________
> 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/