Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.07.29;
Скачать: CL | DM;

Вниз

Уважаемые мастера, Как обработать ошибку???   Найти похожие ветки 

 
DARS73 ©   (2002-07-17 00:59) [0]

Tекстовое поле Edit1.text:="*11" я выполняю команду strtofloat(edit1.text) и получаю ошибку, мне нужно эту ошибку обработать.
То есть мне нужно определить, введеные символы в edit1.text являются числом или нет, кто может помогите. За ранее благодарен.


 
Ev_genus ©   (2002-07-17 01:13) [1]

Есть такая процедура
procedure Val(S; var V; var Code: Integer);

If the string is invalid, the index of the offending character is stored in Code; otherwise, Code is set to zero. For a null-terminated string, the error position returned in Code is one larger than the actual zero-based index of the character in error.

Номер символа на котором происходит ошибка сохраняется в Code. Eсли Code = 0 , то все = OK :)


 
Ev_genus ©   (2002-07-17 01:15) [2]

Есть такая процедура
procedure Val(S; var V; var Code: Integer);

If the string is invalid, the index of the offending character is stored in Code; otherwise, Code is set to zero. For a null-terminated string, the error position returned in Code is one larger than the actual zero-based index of the character in error.

Номер символа на котором происходит ошибка сохраняется в Code. Eсли Code = 0 , то все := OK :)


 
Alexander_D6_XP   (2002-07-17 01:24) [3]

Например можно так:

try
strtofloat();
showmessage("ok");
except
showmessage("entered text isn"t a number!");
end;



Страницы: 1 вся ветка

Текущий архив: 2002.07.29;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.014 c
6-95464
Vladimir Melia
2002-05-17 16:45
2002.07.29
Работа с модемом


14-95492
Fellomena
2002-06-27 12:11
2002.07.29
Vortex1 + Win2k -> Дикий гемор с 11-ым прерыванием!!!


6-95471
aaZ
2002-05-19 23:33
2002.07.29
ServerSocket


1-95298
firsor
2002-07-17 09:51
2002.07.29
Как создать непрямоугольную форму


1-95416
andrey_pst
2002-07-16 14:17
2002.07.29
Отчеты в Excel