Title: TRtcParse.HasValue[index:string] Post by: Dany on September 09, 2015, 03:09:49 PM Almost the same as for TRtcHttpValues the parser would benefit from a neat and performance tuned property/function to find out if a value is present at all IMHO.
Title: Re: TRtcParse.HasValue[index:string] Post by: D.Tkalcec (RTC) on September 09, 2015, 03:50:24 PM In the TRtcParser class, the Value[] property returning an empty string means that a value has not been assigned to a variable.
Best Regards, Danijel Tkalcec Title: Re: TRtcParse.HasValue[index:string] Post by: D.Tkalcec (RTC) on September 09, 2015, 06:04:39 PM Anyway ... I've added the "HasValue" property to the TRtcParse class in RTC SDK v7.00 (just uploaded).
Best Regards, Danijel Tkalcec Title: Re: TRtcParse.HasValue[index:string] Post by: Dany on September 10, 2015, 10:02:37 AM Maybe i posted too fast, i want the function in order to find out if the placeholder exists in the template that i just loaded into the parser. This in order to be able to skip costly processing. I made a helper class that does the job it looks like this and it's here just for clarification.
Code: type TRtcParseHack = class(TRtcParse) end; All good, /Dany Title: Re: TRtcParse.HasValue[index:string] Post by: D.Tkalcec (RTC) on September 10, 2015, 11:03:00 AM This is actually what the "HasValue" property now does. Here is the implementation for the new "HasValue" property on TRtcParse class in RTC SDK v7.00, which is (as you can see) quite similar to what you did in your "hack class":
Code: // return TRUE if a value is assigned to variable named 'Index' Best Regards, Danijel Tkalcec |