Отправляет email-рассылки с помощью сервиса Sendsay
  Все выпуски  

Мастера DELPHI. Новости мира компонент, FAQ, статьи...


Информационный Канал Subscribe.Ru

Ежедневная рассылка сайта Мастера DELPHI

DELPHIMASTER.ru

Выпуск от 25.04.03 09:04

Ghost Installer - достойный инсталлятор для качественных сетапов. Весь спектр возможностей, быстрота и удобство.
Кое-что из нашей кладовки   |x|
  • Работа с функциями FindFirstFile, FindNextFile Leran2002 menshov_s@mail.ru   (24.04.03 17:36)
    Демонстрационная программа показывающая:
    1. Пример работы с функциями FindFirstFile, FindNextFile
    2. Программную отрисовку элементов TComboBox, TListBox
    »»» Скачать: исходные тексты (173кб) посмотреть скриншот
  • TQRLabel под любым углом (однострочный) Leran2002 menshov_s@mail.ru   (24.04.03 17:33)
    Компонент потомок от TQRLabel позволяющий выводить однострочные текстовые надписи в отчете под любым углом.
    »»» Скачать: исходные тексты (1кб)
Лучшее из нашего FAQ   |x|
Как перевести RTF в HTML?
Здесь процедура, которую я использую для конвертации содержимого RichEdit в код SGML. Она не создает полноценный HTML-файл, но Вы можете расширить функциональность, указал, какие RTF-коды Вы желаете конвертировать в какие-либо HTML-тэги.

function rtf2sgml (text : string) : string;
{Funktion for att konvertera en RTF-rad till SGML-text.}
var
temptext : string;
start : integer;
begin
text := stringreplaceall (text,'&','##amp;');
text := stringreplaceall (text,'##amp','&');
text := stringreplaceall (text,'\'+chr(39)+'e5','a');
text := stringreplaceall (text,'\'+chr(39)+'c5','A');
text := stringreplaceall (text,'\'+chr(39)+'e4','a');
text := stringreplaceall (text,'\'+chr(39)+'c4','A');
text := stringreplaceall (text,'\'+chr(39)+'f6','o');
text := stringreplaceall (text,'\'+chr(39)+'d6','O');
text := stringreplaceall (text,'\'+chr(39)+'e9','e');
text := stringreplaceall (text,'\'+chr(39)+'c9','E! ');
text := stringreplaceall (text,'\'+chr(39)+'e1','a');
text := stringreplaceall (text,'\'+chr(39)+'c1','A');
text := stringreplaceall (text,'\'+chr(39)+'e0','a');
text := stringreplaceall (text,'\'+chr(39)+'c0','A');
text := stringreplaceall (text,'\'+chr(39)+'f2','o');
text := stringreplaceall (text,'\'+chr(39)+'d2','O');
text := stringreplaceall (text,'\'+chr(39)+'fc','u');
text := stringreplaceall (text,'\'+chr(39)+'dc','U');
text := stringreplaceall (text,'\'+chr(39)+'a3','?');
text := stringreplaceall (text,'\}','#]#');
text := stringreplaceall (text,'\{','#[#');
text := stringreplaceall (text,'{\rtf1\ansi\deff0\deftab720','');{Skall alltid tas bort}
text := stringreplaceall (text,'{\fonttbl',''); {Skall alltid tas bort}
text := stringreplaceall (text,'{\f0\fnil MS Sans Serif;}','');{Skall alltid tas bort}
text := stringreplaceall (text,'{\f1\fnil\fcharset2 Symbol;}','');{Skall alltid tas bort}
text := stringreplaceall ! (text,'{\f2\fswiss\fprq2 System;}}','');{Skall alltid tas bort}
text := stringreplaceall (text,'{\colortbl\red0\green0\blue0;}','');{Skall alltid tas bort}
{I version 2.01 av Delphi finns inte \cf0 med i RTF-rutan. Tog darfor bort
det efter \fs16 och la istallet en egen tvatt av \cf0.}
//temptext := hamtastreng (text,'{\rtf1','\deflang');
//text := stringreplace (text,temptext,''); {Hamta och radera allt fran start till deflang}
text := stringreplaceall (text,'\cf0','');
temptext := hamtastreng (text,'\deflang','\pard');{Plocka fran deflang till pard for att fa }
text := stringreplace (text,temptext,'');{oavsett vilken lang det ar. Norska o svenska ar olika}
{Har skall vi plocka bort fs och flera olika siffror beroende pa vilka alternativ vi godkanner.}
//text := stringreplaceall (text,'\fs16','');{8 punkter}
//text := stringreplaceall (text,'\fs20','');{10 punkter}
{Nu stadar vi istallet bort alla tvasif! friga fontsize.}
while pos ('\fs',text) >0 do
begin
application.processmessages;
start := pos ('\fs',text);
Delete(text,start,5);
end;
text := stringreplaceall (text,'\pard\plain\f0 ','<P>');
text := stringreplaceall (text,'\par \plain\f0\b\ul ','</P><MELLIS>');
text := stringreplaceall (text,'\plain\f0\b\ul ','</P><MELLIS>');
text := stringreplaceall (text,'\plain\f0','</MELLIS>');
text := stringreplaceall (text,'\par }','</P>');
text := stringreplaceall (text,'\par ','</P><P>');
text := stringreplaceall (text,'#]#','}');
text := stringreplaceall (text,'#[#','{');
text := stringreplaceall (text,'\\','\');
result := text;
end;

//This is cut directly from the middle of a fairly long save routine that calls the above function.
//I know I could use streams instead of going through a separate fil! e but I have not had the time to change this

utfilnamn := mditted.exepath+stringreplace(stringreplace(extractfilename(pathname),'.TTT',''),'.ttt','') + 'ut.RTF';
brodtext.lines.savetofile (utfilnamn);
temptext := '';
assignfile(tempF,utfilnamn);
reset (tempF);
try
while not eof(tempF) do
begin
readln (tempF,temptext2);
temptext2 := stringreplaceall (temptext2,'\'+chr(39)+'b6','');
temptext2 := rtf2sgml (temptext2);
if temptext2 <>'' then temptext := temptext+temptext2;
application.processmessages;
end;
finally
closefile (tempF);
end;
deletefile (utfilnamn);
! temptext := stringreplaceall (temptext,'</MELLIS> ','</MELLIS>');
temptext := stringreplaceall (temptext,'</P> ','</P>');
temptext := stringreplaceall (temptext,'</P>'+chr(0),'</P>');
temptext := stringreplaceall (temptext,'</MELLIS></P>','</MELLIS>');
temptext := stringreplaceall (temptext,'<P></P>','');
temptext := stringreplaceall (temptext,'</P><P></MELLIS>','</MELLIS><P>');
temptext := stringreplaceall (temptext,'</MELLIS>','<#MELLIS><P>');
temptext := stringreplaceall (temptext,'<#MELLIS>','</MELLIS>');
temptext := stringreplaceall (temptext,'<P><P>','<P>');
temptext := stringreplaceall (temptext,'<P> ','<P>');
temptext := stringreplaceall (temptext,'<P&g! t;-','<P>_');
temptext := stringreplaceall (temptext,'<P>_','<CITAT>_');
while pos('<CITAT>_',temptext)>0 do
begin
application.processmessages;
temptext2 := hamtastreng (temptext,'<CITAT>_','</P>');
temptext := stringreplace (temptext,temptext2+'</P>',temptext2+'</CITAT>');
temptext := stringreplace (temptext,'<CITAT>_','<CITAT>-');
end;
writeln (F,'<BRODTEXT>'+temptext+'</BRODTEXT>');

Author: johan@lindgren.pp.se

»»» Прислать свои комментарии

Обсуждается в конференциях   |x|
У нас большой выбор статей   |x|
Способы сохранения и загрузки параметров программного обеспечения. Их преимущества и недостатки. Внедрение средств защиты.
В этой статье речь пойдет о способах сохранения и загрузки параметров программного обеспечения. Из своего личного опыта я могу твердо сказать, что это не так просто, как кажется многим. Как Вы уже успели заметить, крупные программные продукты используют для хранения своих параметров исключительно системный реестр. Напротив, разработчики программного обеспечения, относящие его к Freeware, предпочитают конфигурационные файлы с расширением "INI" (далее "ini-файлы"). Почему же дело обстоит именно так? Мы рассмотрим два этих способа более подробно, а так же поговорим о внедрении определенных средств защиты ini-файлов.
Новинки книжного рынка   |x|
Shareware : профессиональная разработка и продвижение программ
Рассматриваются особенности создания условно-бесплатных программ, приводятся рекомендации по разработке интерфейса и оформлению документации, обсуждаются теоретические и практические вопросы проектирования, рекламы, маркетинга и технической поддержки создаваемого программного продукта. Книга содержит примеры удачной разработки и реализации программ из мировой и российской практики. Множество иллюстраций дает возможность более наглядно представить объем и качество работы, необходимой для создания программ на профессиональном уровне.
Автор: Жарков С.
Другие сайты о DELPHI   |x|
LENIN INC
LENIN INC Home Page. The best Soft, Rusifications and other.

» Оценка сайта: 2
Опрос населения :)
К какой возрастной категории Вы принадлежите ?
»»» меньше 16
»»» от 17 до 20
»»» от 21 до 23
»»» от 24 до 26
»»» от 27 до 30
»»» от 30 до 35
»»» от 35 до 40
»»» от 40 до 44
»»» больше 45
Для души

Хокку дня
Ливень весенний.
Как буйно, как разноцветно
Распускаются зонтики!

Афоризмы
Мы надеемся приблизительно, зато боимся точно (Поль Валери)

Фраза дня
Тише едешь - никому не нужен (услышано от гаишника)

Дурацкие законы (информация предоставлена сайтом kurilka.com)
В городе Крескилл в Нью Джерзи (США) все коты и кошки должны носить три колокольчика, чтобы "птицы всегда знали об их местонахождении".
В городе Кукшефт (США) официально запрещено ругаться нецензурными выражениями.

И на закуску коротенький анекдот
... Доблестный рыцарь Айболит отрезал ноги богатым и пришивал их бедным...

Фотоприколы.
Начните день с хорошего настроения!
http://delphi.mastak.ru/cgi-bin/prikol.pl?id=55


На этом позвольте откланяться и пожелать вам удачного дня.
Искренне ваш, Алексей (delphi@mastak.ru)

Добро пожаловать на сайт -= Мастера DELPHI =- 


http://subscribe.ru/
E-mail: ask@subscribe.ru
Отписаться
Убрать рекламу

В избранное