Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.08.08;
Скачать: [xml.tar.bz2];

Вниз

StringToReal   Найти похожие ветки 

 
c0pYc@t   (2002-07-26 08:57) [0]

Подскажите как real"у присвоить стринг


 
MBo   (2002-07-26 09:01) [1]

ты когда-нибудь в хелп смотришь?


 
Lord Warlock   (2002-07-26 09:02) [2]

StrToFloat или Format


 
c0pYc@t   (2002-07-26 09:04) [3]

Спасибо


 
Седой   (2002-07-26 10:19) [4]

Не занаю как Format а StrToFloat работает.Проверено


 
Седой   (2002-07-26 10:21) [5]

Не занаю как Format а FloatToStr работает.Проверено


 
Robin   (2002-07-26 12:41) [6]

Может этот пример тебе поможет.

Function RealToStr(Value:real;n:integer):string;
var str1,str2:shortstring;
k,i,m:byte;
begin
str1:=FloatToStr(Value);
str2:=" ";
k:=1;
while (str1[k]<>",") and (k<length(str1)) do inc(k);
m:=n+k;
if m>length(str1) then m:=length(str1);
for i:=1 to m do str2[i]:=str1[i];
RealToStr:=Str2;
end;


 
Alx2   (2002-07-26 12:57) [7]

>Robin (26.07.02 12:41)
Смайлик забыл, или это серьезно?


 
Stranger71   (2002-07-26 14:50) [8]

А еще есть пережитки старого доброго Паскаля - процедура Val.

Кусок их делфишного хэлпа:
procedure Val(S; var V; var Code: Integer);

Description

Val converts the string value S to its numeric representation, as if it were read from a text file with Read.

S is a string-type expression; it must be a sequence of characters that form a signed real number.

V is an integer-type or real-type variable. If V is an integer-type variable, S must form a whole number.

Code is a variable of type 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.


 
Vlad1   (2002-07-28 15:18) [9]

И ещё для Delphi6:
r1:=StrToFloatDef(s,r2);

(если s невозможно преобразовать в real, то r1 станет равным r2)



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

Форум: "Основная";
Текущий архив: 2002.08.08;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.007 c
3-23854
RDA
2002-07-16 11:14
2002.08.08
Изучая SQL - NEW и OLD


4-24285
Fellomena
2002-05-28 11:16
2002.08.08
WH_MOUSE - troubleshooting + BONUS (Вопрос о приведении типов).


14-24179
Cobalt
2002-07-12 07:48
2002.08.08
УК РФ, Статья 242. Незаконное распространение порнографических ма


4-24271
DeMoN-777
2002-06-02 03:31
2002.08.08
Элементы листбокса чужой программы.


14-24169
Evyshka
2002-07-12 08:59
2002.08.08
Advantage database Server





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский