Title: RtcScript - accessing array value with expression Post by: Theprasit on November 19, 2014, 08:14:12 PM Hi,
According to RtcScript document, using accessing fields in an array using "( expression )". When using SESSION variable is working fine but using script variable return nothing. Code: <? Code: <? These happen with Record and DataSet (under script) too. Could you give me any advise? Thank you and Regards, Theprasit P.S. I'm using RTC 6.20 Title: Re: RtcScript - accessing array value with expression Post by: D.Tkalcec (RTC) on November 19, 2014, 08:33:49 PM With the latest RTC SDK version (v6.44), the following script works just fine:
<? $lines:= new array; $lines:= ('ABC', 'DEF'); for $i:= 0 to $lines.count- 1 do begin $lines($i); end; ?> ... it returns "ABCDEF" in Delphi 7 as well as Delphi XE7. You can find a simple Project for testing RTC Scripts in the "QuickStart\rtcScript" folder. Check your script code again to make sure you do not have a syntax error. If your script code is correct, then post an example which reproduces the problem. Best Regards, Danijel Tkalcec Title: Re: RtcScript - accessing array value with expression Post by: Theprasit on November 20, 2014, 08:13:49 AM Hi Danijel,
Sorry to mentioned that I used RTC script to generate dynamic content to access via web browser. I did further testing with "QuickStart\rtcScript" demo, both of the code are working fine (seem that using Win32 client is fine). My project used RTC_WebPackaging as a guide line so, I did modify RTC_WebPackaging demo for tesing as Code: function TCommandsDispatcher.DoIndexPage(msg: string): string; and modify an Index.html template by insert the script code, the result is the same as my project return as $lines.0 -> return array element value, working $lines($i) -> return nothing I did on both RTC 620 and 642 (Delphi XE) with the same result. Best Regards, Theprasit Title: Re: RtcScript - accessing array value with expression Post by: D.Tkalcec (RTC) on November 20, 2014, 09:14:35 AM The Script you have provided as an example works, so the problem is somewhere else. To investigate further, I need the exact contents of your modified "index.htm" file for testing. You can send me the file by E-Mail to:
(http://sf.realthinclient.com/supportmail.gif) Best Regards, Danijel Tkalcec Title: Re: RtcScript - accessing array value with expression Post by: D.Tkalcec (RTC) on November 20, 2014, 02:44:08 PM Thank you for the Example Project. I've found the cause of this problem. It was a local boolean variable which has not been initialized to FALSE before use, which sometimes resulted in strange behavior or Access Violations. The problem should now be fixed. Please, download the latest RTC SDK update (v6.45) and let me know if you are still experiencing issues with the RTC Scripting Engine.
Best Regards, Danijel Tkalcec Title: Re: RtcScript - accessing array value with expression Post by: Theprasit on November 20, 2014, 04:32:03 PM Hi Danijel,
Just testing with RTC SDK 6.45 and it's work as expect. Regarding of single element array, it's also working just fine. RTC SDK is great., and your kind support is very much appreciate. Best Regards, Theprasit Title: Re: RtcScript - accessing array value with expression Post by: D.Tkalcec (RTC) on November 20, 2014, 04:34:20 PM Thank you for your feedback.
Best Regards, Danijel Tkalcec |