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

•  Animation Loaders  1 034

•  DeLiKaTeS Tetris (Тетрис)  5 967

•  TDictionary Custom Sort  7 907

•  Fast Watermark Sources  7 568

•  3D Designer  10 806

•  Sik Screen Capture  8 139

•  Patch Maker  8 323

•  Айболит (remote control)  8 384

•  ListBox Drag & Drop  7 235

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

•  Графические эффекты  8 441

•  Рисование по маске  7 810

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

•  Canvas Drawing  6 784

•  Рисование Луны  6 715

•  Поворот изображения  5 824

•  Рисование стержней  4 772

•  Paint on Shape  3 470

•  Генератор кроссвордов  4 477

•  Головоломка Paletto  3 608

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

•  Пазл Numbrix  2 855

•  Заборы и коммивояжеры  3 804

•  Игра HIP  2 572

•  Игра Go (Го)  2 582

•  Симулятор лифта  2 964

•  Программа укладки плитки  2 395

•  Генератор лабиринта  3 149

•  Проверка числового ввода  2 631

•  HEX View  3 039

 
скрыть

  Форум  

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-2026 "Delphi Sources" by «SiteAnalyzer». Delphi World FAQ

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