Code To HTML Converter-Beispiele
[ Übersicht | Beispiele | Download | Feedback ]
Letzte Aktualisierung:

Code To Html Converter - Formatierungsbeispiele
[C und C++]
/* A short piece of c++ code to demonstrate 
   the output of CodeToHtml */

# include <iostream.h>
# include "syio.h"
# define  G_STOP 0xFFA60C

int Syio::dump (voidconst
{
  if (bufchars)
  {
    char * tmp = new char[bufchars + 2];
    int idx = bufidx - bufchars;
    int i;

    if (idx < 0)
    idx += bufsize;
    for (i = 0; i < bufchars; )
    {
      if (idx >= bufsize)
        idx = 0;
      tmp[i++] = bufaddr[idx++];
    }
    if (i)
    {
      if (tmp[i-1] != '\n')   // Terminate with NL
        tmp[i++] = '\n';
      tmp[i] = 0;
      cout << "---\n" << tmp << "---\n";
    }
    delete tmp;
  }
  return bufchars;
}

[Pascal/Delphi]
{--------------------------------------------------------------------------
    #3 Data engine
 --------------------------------------------------------------------------}

function TvwReader.getInteger:longint;
begin
  if blockended then raise exception.create('reading error 2');
  case currtype of
   ktString :result := strtoint(readstring);
   ktInteger:result := readinteger;
   ktFloat  :result := trunc(readFloat);
   ktBoolean:result := longint(readBoolean);
   else {ktfont   :}raise exception.create('conversion error');
  end;
  blockended := true;
end;

{----------------------------------------------------------}
procedure TxyDataCheck.Button5Click(Sender: TObject);
begin
 with seriescombobox do
  if itemindex = -1 then
   messagedlg('There is no series selected', mterror, [mbok], 0)
 else
  if messagedlg('Delete series '
        + fgraph[longint(items.objects[itemindex])].seriesname
          + ' permanently, are you sure?',
              mtconfirmation, [mbyes, mbno],0) = mrYes then
    begin
    fgraph[longint(items.objects[itemindex])].free;
    BuildSeriesComboBox(-1);
    if seriescombobox.items.count > 0 then
      seriescombobox.itemindex := 0;
    seriesComboboxChange(Self)
    end;
end;
{----------------------------------------------------------}

[Visual Basic]
' Just small piece of Visual Basic Code
' without any sense :)

Option Explicit
Const mnErrDeviceUnavailable = 68

Type MYVERSION
  lMajorVersion As Long
  lMinorVersion As Long
  lExtraInfo As Long
End Type

Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SystemInfo)

Private Sub Command1_Click ()
  Text1.Text = "Hello World!"
End Sub

Function SystemDirectory() As String
Dim WinPath As String
    WinPath = String(145, Chr(0))
    SystemDirectory = Left(WinPath, GetSystemDirectory(WinPath, 145))
End Function




© 2000-2001 by S. Kreutzmann Valid HTML 4.0!