Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 4 of 4 total |
Delphi conversion syntax |
Mon, Nov 25 2013 7:58 PM | Permanent Link |
Colin Wood VirtualTec P/L | The following line of code related to the LocalConfigPath will compile but raises a warning "implicit string cast with potential data lost from TMaskedText to AnsiString".
with FritzE2Session1 do begin SessionType := stLocal; LoginPassword := 'EDBDefault'; LoginUser := 'Administrator'; LocalConfigPath := CreateConfig1Edit.Text; end; What would be the better way to write this to avoid the typecasting problem? Thanks Colin |
Tue, Nov 26 2013 12:03 PM | Permanent Link |
Adam Brett Orixa Systems | Colin
The problem is happening because of the datatype of the CreateConfig1Edit.Text property is not ANSIString, but EDB's LocalConfigPath is. Provided that users do not type in non-ANSI characters this code will work fine. If your users are in Russia or India and type into the text property it will explode in flames, well cause an AV at least >>What would be the better way to write this to avoid the typecasting problem? If all your users will always be ANSI-character users you don't really need to worry about it. I have quite a few of these messages in my compiles and I ignore them. If you want to be super safe, then you can test for the characters in the Edit being ANSI, and if they are not you can warn / stop the user. |
Tue, Nov 26 2013 9:48 PM | Permanent Link |
Colin Wood VirtualTec P/L | Thanks Adam, One more thing not to have to worry about is a good thing. Currently my program is being used in Australia and New Zealand so it sounds like I'm fairly safe for the time being.
Regards Col |
Mon, Dec 2 2013 2:45 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Adam,
<< If your users are in Russia or India and type into the text property it will explode in flames, well cause an AV at least >> It won't AV, but the user may not get the string conversion that you want, depending upon their current system locale. Note: this won't be an issue anymore with the next minor release and the ANSI/Unicode property switch functionality since the EDB string properties will always be the same type as the default string type of the Delphi/C++Builder compiler that you're using. The ANSI/Unicode conversion will automatically occur in the internals of the engine. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |