Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder 2 Preview » View Thread |
Messages 1 to 3 of 3 total |
Awkward JSON Object Property Names! |
Tue, Jun 16 2015 12:23 PM | Permanent Link |
Mark Brooks Slikware | Hi Tim,
I am making extensive use of the JSON reading / writing capabilities for class published properties. This functionality is really useful and straightforward to use. It's also very fast! However, one of the properties in the JSON that is returned from the API is called "create". I cannot seem to read this since the compiler won't let me define a published property like this: published property Create: boolean read fCreate write fCreate; It causes a compiler error further down the code inside the Create override. Do you have a neat way around this? Thanks Mark |
Sat, Jun 20 2015 6:52 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< It causes a compiler error further down the code inside the Create override. Do you have a neat way around this? >> You'll have to do a custom load with this property in the TPersistent.LoadProperty method for your class: function TMyComponent.LoadProperty(AReader: TReader): Boolean; var TempPropertyName: String; begin Result:=False; TempPropertyName:=AReader.GetPropertyName; if (TempPropertyName <> '') then begin if SameText(TempPropertyName,'create') then // Handle special property name here.... else inherited LoadProperty(AReader); end; end; Tim Young Elevate Software www.elevatesoft.com |
Sat, Jun 20 2015 11:43 AM | Permanent Link |
Mark Brooks Slikware | "Tim Young [Elevate Software]" wrote:
>>You'll have to do a custom load with this property in the >>TPersistent.LoadProperty method for your class: Of course ....... doh ...... cheers Tim |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |