Delphi — W1048 Небезопасный тип «строка» в «TFormatSettings»
4 RBA [2012-11-01 12:34:00]
Я переношу старый проект в Delphi XE, и я получаю это предупреждение в приведенном ниже коде.
даже FormatSettings.ThousandSeparator имеет тип char.
LE: Я спрашиваю, может ли кто-нибудь сказать мне, почему это предупреждение происходит. Код старый, и он будет переделан.
LE2: Чтобы получить это предупреждение, все предупреждения должны быть установлены в true в Компиляторе Delphi-подсказки и предупреждения
LE3: Если кому-то это нужно — <$ WARN UNSAFE_CAST OFF>, предупреждение отключается.
LE4: снимок экрана предупреждения для тех, кто считает, что предупреждение трудно поверить.
1 ответ
4 Решение kludg [2012-11-01 13:53:00]
Происхождение предупреждения — это объявление переменной FormatSettings в SysUtils.pas :
который строит строку ( CurrencyString ) для записи ( TFormatSettings ).
Delphi — W1048 Небезопасный тип «строка» в «TFormatSettings» — delphi
Я переношу старый проект в Delphi XE, и я получаю это предупреждение в приведенном ниже коде.
даже FormatSettings.ThousandSeparator имеет тип char.
LE: Я спрашиваю, может ли кто-нибудь сказать мне, почему это предупреждение происходит. Код старый, и он будет переделан.
LE2: Чтобы получить это предупреждение, все предупреждения должны быть установлены в true в Компиляторе Delphi-подсказки и предупреждения
LE3: Если кому-то это нужно — <$ WARN UNSAFE_CAST OFF>, предупреждение отключается.
LE4: снимок экрана предупреждения для тех, кто считает, что предупреждение трудно поверить.
-
2 1
- 30 окт 2020 2020-10-30 14:56:56
- RBA
1 ответ
Происхождение предупреждения — это объявление переменной FormatSettings в SysUtils.pas :
который строит строку ( CurrencyString ) для записи ( TFormatSettings ).
FormatSettings.DecimalSeparator
Здравствуйте. Не могли бы вы мне объяснить почему в FormatSettings он выдаёт ошибку
[Error] Unit1.pas(43): Undeclared identifier: ‘FormatSettings’
[Error] Unit1.pas(43): Missing operator or semicolon
[Error] Unit1.pas(43): Statement expected, but expression of type ‘Char’ found
[Error] Unit1.pas(44): Incompatible types
[Error] Unit1.pas(44): ‘)’ expected but ‘,’ found
[Error] Unit1.pas(48): Constant expression expected
[Error] Unit1.pas(62): Missing operator or semicolon
[Error] Unit1.pas(62): Statement expected, but expression of type ‘Char’ found
[Error] Unit1.pas(63): Incompatible types
[Error] Unit1.pas(63): ‘)’ expected but ‘,’ found
[Error] Unit1.pas(74): Statement expected but end of file found
[Error] Unit1.pas(20): Unsatisfied forward or external declaration: ‘TForm1.Edit2KeyDown’
[Error] Unit1.pas(22): Unsatisfied forward or external declaration: ‘TForm1.Edit2KeyPress’
[Error] Unit1.pas(23): Unsatisfied forward or external declaration: ‘TForm1.FormClick’
[Fatal Error] Project1.dpr(6): Could not compile used unit ‘Unit1.pas’
Добавлено через 11 минут
чё никто не знает что ли.
TFormatSettings — Тип Delphi
Making sure you have your e111 for your
holiday is absolutely essential
A new book on thinking . now on Amazon
Delphi Basics | ||
Delphi Basics supplies reference up to release XE1 | ||
This web site provides help and reference for the fundamentals of the Delphi© language. It gives an introduction to the Delphi Object Oriented Language for newcomers, and provides a ready reference for experienced programmers.
It limits itself to a broad base of the language in order to keep things simple and manageable. The approach taken is to present the most useable basics of Delphi Programming in as accessible a manner as possible. Feel free to contact the author about any aspects of the site. Every effort will be made to respond to all emails received. New : An independent review of «Learn to program in Pascal», an online course for those starting out on Delphi programming. Currently at a 60% discount |
||
Learn Javascript course
Currently at a 70% discount |
A complete version of the web site has been converted into a Windows executable.
It looks and behaves like the site, but with the added benefits of :
- No adverts
- Search facility for finding Run Time Library entries and .Net Methods.
- Fast access to 1,000+ pages of tutorial/reference pages — the full site and more
- System.Drawing.Graphics .Net >Download the Windows program : now only Ј5
Run Time Library Reference | |||||||
By first letter | |||||||
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z $ | |||||||
By Functionality | |||||||
|
|||||||
By Unit | |||||||
|
|||||||
By Category | |||||||
|
|||||||