Coniah 4 Posted February 4, 2021 I just finally got upgraded from Delphi 10.3.3 to 10.4.1. In recompiling one of my applications, I am getting "EVariantTypeCastError' 'Could not convert variant of type (UnicodeString) into type (Boolean)'. Upon closer inspection, the field value returned in the TClientDataSet is a widestring 'T', instead of a boolean 'True'. Compiling with 10.3.3 returns 'True' while 10.4.1 returns 'T' which is not in the default expected values for TrueBoolStrs. While I can work around this by either modifying TrueBoolStrs or comparing the returned value against 'T', I'd prefer to understand what changed when I went from 10.3.3 to 10.4.1. I noticed that the TRESTResponseDataSetAdapter has a new property 'TypesMode' which defaults to 'StringOnly'. What is this property? Thanks Coniah Share this post Link to post
eivindbakkestuen 47 Posted February 5, 2021 On 2/4/2021 at 10:33 AM, Coniah said: I noticed that the TRESTResponseDataSetAdapter has a new property 'TypesMode' which defaults to 'StringOnly'. What is this property? /// <summary> /// Specifies the field type definition mode. When it is: /// * TJSONTypesMode.Rich, then adapter will try to derive field type from the JSON content. /// * TJSONTypesMode.JSONOnly, then adapter will use only JSON value types. /// * TJSONTypesMode.StringOnly, then all fields will be represented by ftWideString. /// Default value is TJSONTypesMode.Rich. /// </summary> Share this post Link to post
Coniah 4 Posted February 5, 2021 Thanks. I modified the TrueBoolStrs to include 'T' as a work around, but would prefer to have the parser return 'True' instead of 'T'. Any ideas on what caused the change from 10.3.3 to 10.4.1? Is it a configuration issue? Share this post Link to post