Welcome to the CSIG, a Special Interest Group of the ACGNJ, and let me again welcome everyone back from their Summer activities. The meeting this month will be a continuation of last months text program. The goal is now to convert it into a Windows program.
The majority of my programs start with an idea or algorithm. Often the algorithm has to be tested and debugged. Because of this it is often best to create a CONSOLE APPLICATION in order to test an idea. Once the idea is proven, it can be converted to a WINDOWS APP.
Here's the problem: I have a 5000 line Web Site that is written in Microsoft Frontpage 2003 that MS has abandoned. Their latest web software is Expression Web 4. They do not have any means to convert a FP website to an EW website. Their recommendation is to rewrite the code manually! While this is possible, it is extremely time consuming. Let's use C++ to help with the conversion. An HTML file is a simple TEXT file. C++ is great at handling text. I have created a simple console application that does a partial conversion of Frontpage to Expression Web by handling syntax variations. For example: all Page tokens are changed from uppercase to lower case; all height=xxx tokens are erased; etc.
The beginning subject for this month is a general review and random access program where anyone can introduce a subject or ask a question about programming.
This is an exciting time for the C Language programming since Microsoft now has 4 different language compilers: C++, C++ Express, C-Sharp, and C-Sharp Express. These are all capable of creating Windows (tm) programs and some are free !
Microsoft is now advertising it's newest versions designated Visual Studio 2010.
Version 2008 is also still available for download. Some free versions require
registration at Microsoft. Some versions are more deluxe but have demo timeouts.
There are "Express" versions otherwise know as "Free" as well as the commercial versions.
The Express versions are
fully functional. Unless you work in a large program development company, you probably won't need the
broader features of the commercial versions.
Additionally, there are other companies making free and almost free compilers.
Here's a link with many compilers:
http://www.willus.com/ccomp.shtml
(See below for other language and tutorial links.)
The following PDF files contain more detailed information about the C and C++ language as well as an extensive list of web sites showing free programs and tutorials for both Windows (tm) and Linux.
The beginning of the evening (starting at 7:30pm) will be a RANDOM ACCESS discussion. The main presentation will follow.
Our download site has code and programs from most of our meetings. ( Source Code Files )
// PROCESS BUTTON HIT
//
: System::Void ProcessButton_Click(System::Object^ sender, System::EventArgs^ e) {
if (String::IsNullOrEmpty(this->SourceFilename->Text)) return;
if (File::Exists(this->OutputFilename) &&
(System::Windows::Forms::DialogResult::No ==
MessageBox::Show(
"The TXT output file already exists. Overwrite?", "ATTENTION",
MessageBoxButtons::YesNo
)))
return;
// Open output file
sw = gcnew StreamWriter(OutputFilename);
Process(SourceFilename->Text);
// Close output file
sw->Close();
ViewTextfile->Enabled = true;
}
//
// VIEW TEXT FILE BUTTON HIT
//
private: System::Void ViewTextfile_Click(System::Object^ sender, System::EventArgs^ e) {
if ( (!String::IsNullOrEmpty(this->OutputFilename)) &&
File::Exists(this->OutputFilename))
System::Diagnostics::Process::Start(OutputFilename);
ViewTextfile->Enabled = false;
ProcessButton->Enabled = false;
}
//
// PROCESS ROUTINE
//
private: int Process(String ^ inputFilename)
{
StatusLine->Text = "Processing " + inputFilename;
if (! File::Exists(inputFilename))
{
StatusLine->Text = String::Format(
"{0} does not exist.", Path::GetFullPath(inputFilename));
return 1;
}
StreamReader ^sr = File::OpenText(inputFilename);
String ^input = sr->ReadToEnd();
sr->Close();
//
// Begin search and replace
//
sw->WriteLine("<!-- *********************************************************************** -->");
sw->WriteLine("<!-- Processed through CLEANUP1 (FP-2003) Ver. 1.07 by B.Arnold -->");
sw->WriteLine("<!-- <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" -->");
sw->WriteLine("<!-- Add into HEAD section the following: -->");
sw->WriteLine("<!-- <style type=\"text/css\"> span.cu {text-decoration: underline} </style> -->");
sw->WriteLine("<!-- *********************************************************************** -->");
input = input->Replace( "<A ", "<a ");
input = input->Replace( "</A>", "</a>");
input = input->Replace( "<B>", "<b>");
input = input->Replace( "</B>", "</b>");
input = input->Replace( "<BR>", "<br>");
input = input->Replace( "<br>", "<br />"); // required for XHTML
input = input->Replace( "<P>", "<p>");
input = input->Replace( "<P ", "<p ");
input = input->Replace( "</P>", "</p>");
input = input->Replace( "<U>", "<u>");
input = input->Replace( "</U>", "</u>");
input = input->Replace( "<H", "<h");
input = input->Replace( "</H", "</h");
input = input->Replace( "<TD ", "<td ");
input = input->Replace( "<TR>", "<tr>");
input = input->Replace( "</TD>", "</td>");
input = input->Replace( "</TR>", "</tr>");
input = input->Replace( "<DIV ", "<div ");