﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Релиб / Программирование / Delphi  / Translate DELPHI to Basic  Help me plz!!!!!!!! / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Релиб</description><link>http://www.relib.com/forums/</link><webMaster>robot@relib.com</webMaster><lastBuildDate>Sun, 23 Nov 2008 00:29:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Translate DELPHI to Basic  Help me plz!!!!!!!!</title><link>http://www.relib.com/forums/Topic715091-8-1.aspx</link><description>StringReplace(S, S1, S2) - замена в строке S строки S1 на строку S2. Похоже в VB на Mid, но эта функция не &amp;quot;раздвигает строку&amp;quot;.&lt;BR&gt;&lt;BR&gt;&amp;gt;while pos ('\fs',text) &amp;amp;gt;0 do&lt;BR&gt;&amp;gt;begin&lt;BR&gt;&amp;gt;application.processmessages;&lt;BR&gt;&amp;gt;start := pos ('\fs',text);&lt;BR&gt;&amp;gt;Delete(text,start,5);&lt;BR&gt;&amp;gt;end;&lt;BR&gt;&lt;BR&gt;Цикл Do While с параметром Mid,&lt;BR&gt;application.processmessages=DoEvents,&lt;BR&gt;Delete заменяем на Mid(text, start, 5)&lt;BR&gt;&lt;BR&gt;Ну а остальное думаю ясно (файлы там и остальное).</description><pubDate>Mon, 09 Jul 2001 12:30:00 GMT</pubDate><dc:creator>zans</dc:creator></item><item><title>Translate DELPHI to Basic  Help me plz!!!!!!!!</title><link>http://www.relib.com/forums/Topic715091-8-1.aspx</link><description>function rtf2sgml (text : string) : string;&lt;BR&gt;{Funktion for att konvertera en RTF-rad till SGML-text.}&lt;BR&gt;var&lt;BR&gt;temptext : string;&lt;BR&gt;start : integer;&lt;BR&gt;begin&lt;BR&gt;text := stringreplaceall (text,'&amp;amp;amp;','##amp;');&lt;BR&gt;text := stringreplaceall (text,'##amp','&amp;amp;amp;amp');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'e5','&amp;amp;amp;aring;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'c5','&amp;amp;amp;Aring;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'e4','&amp;amp;amp;auml;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'c4','&amp;amp;amp;Auml;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'f6','&amp;amp;amp;ouml;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'d6','&amp;amp;amp;Ouml;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'e9','&amp;amp;amp;eacute;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'c9','&amp;amp;amp;Eacute;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'e1','&amp;amp;amp;aacute;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'c1','&amp;amp;amp;Aacute;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'e0','&amp;amp;amp;agrave;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'c0','&amp;amp;amp;Agrave;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'f2','&amp;amp;amp;ograve;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'d2','&amp;amp;amp;Ograve;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'fc','&amp;amp;amp;uuml;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'dc','&amp;amp;amp;Uuml;');&lt;BR&gt;text := stringreplaceall (text,'\'+chr(39)+'a3','&amp;amp;amp;#163;');&lt;BR&gt;text := stringreplaceall (text,'\}','#]#');&lt;BR&gt;text := stringreplaceall (text,'\{','#[#');&lt;BR&gt;text := stringreplaceall (text,'{\rtf1\ansi\deff0\deftab720','');{Skall alltid tas bort}&lt;BR&gt;text := stringreplaceall (text,'{\fonttbl',''); {Skall alltid tas bort}&lt;BR&gt;text := stringreplaceall (text,'{\f0\fnil MS Sans Serif;}','');{Skall alltid tas bort}&lt;BR&gt;text := stringreplaceall (text,'{\f1\fnil\fcharset2 Symbol;}','');{Skall alltid tas bort}&lt;BR&gt;text := stringreplaceall (text,'{\f2\fswiss\fprq2 System;}}','');{Skall alltid tas bort}&lt;BR&gt;text := stringreplaceall (text,'{\colortbl\red0\green0\blue0;}','');{Skall alltid tas&lt;BR&gt;bort}&lt;BR&gt;{I version 2.01 av Delphi finns inte \cf0 med i RTF-rutan. Tog darfor bort&lt;BR&gt;det efter \fs16 och la istallet en egen tvatt av \cf0.}&lt;BR&gt;//temptext := hamtastreng (text,'{\rtf1','\deflang');&lt;BR&gt;//text := stringreplace (text,temptext,''); {Hamta och radera allt fran start till&lt;BR&gt;deflang}&lt;BR&gt;text := stringreplaceall (text,'\cf0','');&lt;BR&gt;temptext := hamtastreng (text,'\deflang','\pard');{Plocka fran deflang till pard for att&lt;BR&gt;fa }&lt;BR&gt;text := stringreplace (text,temptext,'');{oavsett vilken lang det ar. Norska o svenska ar&lt;BR&gt;olika}&lt;BR&gt;{Har skall vi plocka bort fs och flera olika siffror beroende pa vilka alternativ vi&lt;BR&gt;godkanner.}&lt;BR&gt;//text := stringreplaceall (text,'\fs16','');{8 punkter}&lt;BR&gt;//text := stringreplaceall (text,'\fs20','');{10 punkter}&lt;BR&gt;{Nu stadar vi istallet bort alla tvasiffriga fontsize.}&lt;BR&gt;while pos ('\fs',text) &amp;amp;gt;0 do&lt;BR&gt;begin&lt;BR&gt;application.processmessages;&lt;BR&gt;start := pos ('\fs',text);&lt;BR&gt;Delete(text,start,5);&lt;BR&gt;end;&lt;BR&gt;text := stringreplaceall (text,'\pard\plain\f0 ','&amp;amp;lt;P&amp;amp;gt;');&lt;BR&gt;text := stringreplaceall (text,'\par \plain\f0\b\ul ','&amp;amp;lt;/P&amp;amp;gt;&amp;amp;lt;MELLIS&amp;amp;gt;');&lt;BR&gt;text := stringreplaceall (text,'\plain\f0\b\ul ','&amp;amp;lt;/P&amp;amp;gt;&amp;amp;lt;MELLIS&amp;amp;gt;');&lt;BR&gt;text := stringreplaceall (text,'\plain\f0','&amp;amp;lt;/MELLIS&amp;amp;gt;');&lt;BR&gt;text := stringreplaceall (text,'\par }','&amp;amp;lt;/P&amp;amp;gt;');&lt;BR&gt;text := stringreplaceall (text,'\par ','&amp;amp;lt;/P&amp;amp;gt;&amp;amp;lt;P&amp;amp;gt;');&lt;BR&gt;text := stringreplaceall (text,'#]#','}');&lt;BR&gt;text := stringreplaceall (text,'#[#','{');&lt;BR&gt;text := stringreplaceall (text,'\\','\');&lt;BR&gt;result := text;&lt;BR&gt;end;&lt;BR&gt;&lt;BR&gt;//This is cut directly from the middle of a fairly long save routine that calls the above&lt;BR&gt;function.&lt;BR&gt;//I know I could use streams instead of going through a separate file but I have not had&lt;BR&gt;the time to change this&lt;BR&gt;&lt;BR&gt;utfilnamn :=&lt;BR&gt;mditted.exepath+stringreplace(stringreplace(extractfilename(pathname),'.TTT',''),'.ttt','')&lt;BR&gt;+ 'ut.RTF';&lt;BR&gt;brodtext.lines.savetofile (utfilnamn);&lt;BR&gt;temptext := '';&lt;BR&gt;assignfile(tempF,utfilnamn);&lt;BR&gt;reset (tempF);&lt;BR&gt;try&lt;BR&gt;while not eof(tempF) do&lt;BR&gt;begin&lt;BR&gt;readln (tempF,temptext2);&lt;BR&gt;temptext2 := stringreplaceall (temptext2,'\'+chr(39)+'b6','');&lt;BR&gt;temptext2 := rtf2sgml (temptext2);&lt;BR&gt;if temptext2 &amp;amp;lt;&amp;amp;gt;'' then temptext := temptext+temptext2;&lt;BR&gt;application.processmessages;&lt;BR&gt;end;&lt;BR&gt;finally&lt;BR&gt;closefile (tempF);&lt;BR&gt;end;&lt;BR&gt;deletefile (utfilnamn);&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;/MELLIS&amp;amp;gt; ','&amp;amp;lt;/MELLIS&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;/P&amp;amp;gt; ','&amp;amp;lt;/P&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;/P&amp;amp;gt;'+chr(0),'&amp;amp;lt;/P&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;/MELLIS&amp;amp;gt;&amp;amp;lt;/P&amp;amp;gt;','&amp;amp;lt;/MELLIS&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;P&amp;amp;gt;&amp;amp;lt;/P&amp;amp;gt;','');&lt;BR&gt;temptext := stringreplaceall&lt;BR&gt;(temptext,'&amp;amp;lt;/P&amp;amp;gt;&amp;amp;lt;P&amp;amp;gt;&amp;amp;lt;/MELLIS&amp;amp;gt;','&amp;amp;lt;/MELLIS&amp;amp;gt;&amp;amp;lt;P&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;/MELLIS&amp;amp;gt;','&amp;amp;lt;#MELLIS&amp;amp;gt;&amp;amp;lt;P&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;#MELLIS&amp;amp;gt;','&amp;amp;lt;/MELLIS&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;P&amp;amp;gt;&amp;amp;lt;P&amp;amp;gt;','&amp;amp;lt;P&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;P&amp;amp;gt; ','&amp;amp;lt;P&amp;amp;gt;');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;P&amp;amp;gt;-','&amp;amp;lt;P&amp;amp;gt;_');&lt;BR&gt;temptext := stringreplaceall (temptext,'&amp;amp;lt;P&amp;amp;gt;_','&amp;amp;lt;CITAT&amp;amp;gt;_');&lt;BR&gt;while pos('&amp;amp;lt;CITAT&amp;amp;gt;_',temptext)&amp;amp;gt;0 do&lt;BR&gt;begin&lt;BR&gt;application.processmessages;&lt;BR&gt;temptext2 := hamtastreng (temptext,'&amp;amp;lt;CITAT&amp;amp;gt;_','&amp;amp;lt;/P&amp;amp;gt;');&lt;BR&gt;temptext := stringreplace (temptext,temptext2+'&amp;amp;lt;/P&amp;amp;gt;',temptext2+'&amp;amp;lt;/CITAT&amp;amp;gt;');&lt;BR&gt;temptext := stringreplace (temptext,'&amp;amp;lt;CITAT&amp;amp;gt;_','&amp;amp;lt;CITAT&amp;amp;gt;-');&lt;BR&gt;end;&lt;BR&gt;writeln (F,'&amp;amp;lt;BRODTEXT&amp;amp;gt;'+temptext+'&amp;amp;lt;/BRODTEXT&amp;amp;gt;');</description><pubDate>Wed, 04 Jul 2001 10:08:00 GMT</pubDate><dc:creator>messer</dc:creator></item></channel></rss>