Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Delphi by gera ( 15 years ago )
unit SDIMAIN;
       {$H+}
interface

uses Windows, Classes, Graphics, Forms, Controls, Menus,
  Dialogs, StdCtrls, Buttons, ExtCtrls, ComCtrls, ImgList, StdActns,
  ActnList, ToolWin, Messages, SysUtils, Variants, Mask;

type
  rec=record
    classname:unicodestring;
    childcol:integer;
    strprotcompcol:integer;
  end;
  TRec=^rec;

  TSDIAppForm = class(TForm)
    OpenDialog: TOpenDialog;
    Button1: TButton;
    Memo1: TMemo;
    Memo2: TMemo;
    procedure Button1Click(Sender: TObject);    
  end;

procedure Convert(memo:tmemo;filepath:Unicodestring);

var
  SDIAppForm: TSDIAppForm;

implementation

uses about;

{$R *.dfm}

procedure Convert(memo:tmemo;filepath:Unicodestring);
var
  streamintro:tfilestream;
  ch:char;
  stroka:unicodestring;
  konec:boolean;
  RecordList:tlist;
begin
  konec:=false;
  streamintro:=tfilestream.create(filepath,fmopenread);
  while not konec do
    begin
       streamintro.Read(ch,sizeof(ch));
       if ch=#13#26 then
         konec:=true
       else
        begin
          stroka:=stroka+ch;
         showmessage('ebis'' konem, bleat'''+stroka);
        end;
        
              
    end;
   streamintro.Free;                               
   {
   var
      inputStream:TFileStream;
      endOfFile:boolean;
      symbol:char;
      str:AnsiString;
   begin
        inputStream:=TFileStream.Create(filePath, fmOpenRead);
        endOfFile:=false;
        str:='';
        while (not endOfFile) do begin
              inputStream.Read(symbol, SizeOf(symbol));
              str := str + symbol;
              if symbol <> #13 then ShowMessage(symbol) надо еще одну вещь сюда добавть
               else ShowMessage('huipizda');
              if symbol = #26 then endOfFile:=true;
        end;
        inputStream.Free;
   end;
}
       memo.lines.add(stroka);
end;


procedure TSDIAppForm.Button1Click(Sender: TObject);

begin
  Opendialog.Filter:='Text files (*.txt)|*.txt|All files (*.*)|*.*';
  if OpenDialog.Execute
    then begin
      Memo1.Lines.LoadFromFile&#40;Opendialog.FileName&#41;;
      Convert(memo2,Opendialog.FileName);
 //     memo2.lines.Add(charr);
    end;
end;


end.

 

Revise this Paste

Children: 29559
Your Name: Code Language: