Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  124

•  TDictionary Custom Sort  3 311

•  Fast Watermark Sources  3 060

•  3D Designer  4 817

•  Sik Screen Capture  3 313

•  Patch Maker  3 527

•  Айболит (remote control)  3 628

•  ListBox Drag & Drop  2 990

•  Доска для игры Реверси  81 535

•  Графические эффекты  3 921

•  Рисование по маске  3 226

•  Перетаскивание изображений  2 607

•  Canvas Drawing  2 731

•  Рисование Луны  2 555

•  Поворот изображения  2 162

•  Рисование стержней  2 160

•  Paint on Shape  1 564

•  Генератор кроссвордов  2 223

•  Головоломка Paletto  1 764

•  Теорема Монжа об окружностях  2 209

•  Пазл Numbrix  1 682

•  Заборы и коммивояжеры  2 052

•  Игра HIP  1 278

•  Игра Go (Го)  1 224

•  Симулятор лифта  1 470

•  Программа укладки плитки  1 214

•  Генератор лабиринта  1 542

•  Проверка числового ввода  1 351

•  HEX View  1 488

•  Физический маятник  1 355

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Несколько функций для TStream



Оформил: DeeCo

{ 
 These are three utility functions to write strings to a TStream. 
 Nothing fancy, but I just ended up coding this repeatedly so 
 I made these functions. }

 { 
 Hier sind einige TStreaam Hilfsfunktionen um strings 
 in einen TStream zu schreiben. 
}


 unit ClassUtils;

 interface

 uses
   SysUtils,
   Classes;

 {: Write a string to the stream 
   @param Stream is the TStream to write to. 
   @param s is the string to write 
   @returns the number of bytes written. }
 function Writestring(_Stream: TStream; const _s: string): Integer;

 {: Write a string to the stream appending CRLF 
   @param Stream is the TStream to write to. 
   @param s is the string to write 
   @returns the number of bytes written. }
 function WritestringLn(_Stream: TStream; const _s: string): Integer;

 {: Write formatted data to the stream appending CRLF 
   @param Stream is the TStream to write to. 
   @param Format is a format string as used in sysutils.format 
   @param Args is an array of const as used in sysutils.format 
   @returns the number of bytes written. }
 function WriteFmtLn(_Stream: TStream; const _Format: string;
   _Args: array of const): Integer;

 implementation

 function Writestring(_Stream: TStream; const _s: string): Integer;
 begin
   Result := _Stream.Write(PChar(_s)^, Length(_s));
 end;

 function WritestringLn(_Stream: TStream; const _s: string): Integer;
 begin
   Result := Writestring(_Stream, _s);
   Result := Result + Writestring(_Stream, #13#10);
end;

function WriteFmtLn(_Stream: TStream; const _Format: string;
   _Args: array of const): Integer;
 begin
   Result := WritestringLn(_Stream, Format(_Format, _Args));
 end;




Похожие по теме исходники

Нейросеть для распознавания образов

Механизм станка качалки для нефти

Весы для взвешивания

Кувшины для воды

 

Доска для игры Реверси

TStream Progress Adapter




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте