SynEdit Completion Proposal done Dynamically, Plus TWebBrowser Example
This example by: Carrz-Fox-Fire Promotions Will show you how to create a Tabbed Text Editor using TSynEdit TPageControl, TMainMenu, TStatusBar, TCompletionProposal, TSynHTMLSyn, TSynPasSyn with the TSynCompletionProposal and the TSynEdit, all made a Runtime. Also an Example of how to make your own IE Web Browser. That shows you how to load a page, how to open a link with TComboBox, and show the status of the page being downloaded just like in Internet Explorer. Allot of very useful information has been added to this tutorial to make up for not submitting anything within the last little while. As I like to be able to help as many people as I can when I can. We have just added to our server, A Delphi Secruity Source Page. Where you can learn more about this tutorial source, Plus other projects that we have and are working on. Please visit us for more information on our tutorials here at Planet and for other Source Code, and Components. | http://www.carrz-fox-fire.com/Delphi/Delphi_Fire_Security/Main.asp | To go to our new Delphi Fire delphi@carrz-fox-fire.com
Yapay Zeka Özeti: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
<?php
function format($code) {
$reserved = Array("Public", "Private", "Sub", "Dim", "As", "Integer", "End", "Me", "String", "Long", "Function", "Declare", "Lib", "ByVal", "With", "If", "Then", "Else", "Option", "Explicit", "Type", "Const", "Open", "Close", "Print", "Write", "As", "For", "Next", "To");
$numr = count($reserved);
$code = str_replace('(', ' ( ', $code);
$code = str_replace(')', ' ) ', $code);
$code = str_replace('.', ' . ', $code);
$code = str_replace("'", " ' ", $code);
$code = str_replace('"', ' " ', $code);
$code = str_replace(",", " , ", $code);
$lines = explode("\n", $code);
$numl = count($lines);
//for each line
for ($i = 0; $i < $numl; $i++) {
$lines[$i] = str_replace("\r", '', $lines[$i]);
$words = explode(' ', $lines[$i]);
$numw = count($words);
$line = '';
//for each word
for ($j = 0; $j < $numw; $j++) {
$b = 0;
//if it's a comment '
if($words[$j] == "'") {
$line = substr($line, 0, strlen($line) -1) . '<font color="#008800">' . "'";
for ($m = $j + 1; $m < $numw; $m++) {
$line = $line . $words[$m] . ' ';
}
$line = $line . "</font>";
break;
}
//if it's a quote "
if ($words[$j] == '"') {
$line = substr($line, 0, strlen($line) -1) . $words[$j];
if ($skip == 1) {
$skip = 0;
} else {
$skip = 1;
}
} else {
if ($skip == 0) { //if we're not skipping
//for each reserved word
for ($k = 0; $k < $numr; $k++) {
if (strtolower(trim($words[$j])) == strtolower($reserved[$k])) {
$b = 1;
$line = $line . '<font color="#000088">' . $words[$j] . '</font> ';
break;
}
}
//if it's not in a comment
if ($b != 1) {
$line = $line . $words[$j];
if(trim($words[$j]) != '"') {
if(trim($words[$j]) != "'") {
$line = $line . ' ';
}
}
}
} else {
if (trim($words[$j]) == '"') {
$line = trim($line) . '"';
} else {
$line = $line . $words[$j] . ' ';
}
}
}
}
$fcode = $fcode . $line . "\n";
}
$fcode = str_replace(" ( ", "(", $fcode);
$fcode = str_replace(" ) ", ")", $fcode);
$fcode = str_replace(" . ", ".", $fcode);
$fcode = str_replace(" ' ", "'", $fcode);
$fcode = str_replace(" , ", ",", $fcode);
return '<pre style="background:#F4F4F4;">' . trim($fcode, "\n") . '</pre>';
}
?>
Upload
Upload