目前分類:Lazarus/Free Pascal (9)

瀏覽方式: 標題列表 簡短摘要

Project -> Project Option -> Compiler Options -> Paths,或是按Shift-Ctrl-F11

在Other unit files(-Fu)中將以下路徑補上

bagatelles 發表在 痞客邦 留言(0) 人氣()

CodeTyphon 5.3使用了FPC 3.1.1,RTL終於用了UTF-8,但有些電腦一直無法編譯出Win32/Win64 IDE,研究發現應該是PATH的問題,修改以下部分

 

bagatelles 發表在 痞客邦 留言(0) 人氣()

procedure BenchmarkFileStream(AFile: string);
  var
    I, Position, PackageCount: cardinal;
    FS: TFileStream;
    Buffer: byte;
    T0: double;
  begin
    T0 := Now;
    Buffer := 0;
    try
      FS := TFileStream.Create(AFile, fmOpenRead);
      PackageCount := FS.Size div 188;

      if PackageCount > 0 then
        for I := 0 to PackageCount - 1 do
        begin
          try
            FS.Position := I * 188;
            FS.ReadBuffer(Buffer, 1);            
          except
            on E: Exception do
              WriteLn('Exception: ' + E.Message);
          end;
        end
    finally
      FS.Free;
    end;
    WriteLn('FileStream Time: ' + IntToStr(MilliSecondsBetween(T0, Now)));
  end;

  procedure BenchmarkBufferIO(AFile: string);
  var
    I, Position, PackageCount: cardinal;
    Buffer: byte;
    T0: double;
    MyFile: file;
    NumberRead: word;
  begin
    T0 := Now;
    Buffer := 0;
    try
      AssignFile(MyFile, AFile);
      Reset(MyFile, 1);
      PackageCount := FileSize(MyFile) div 188;

      if PackageCount > 0 then
        for I := 0 to PackageCount - 1 do
        begin
          try
            Seek(MyFile, I * 188);
            BlockRead(MyFile, Buffer, SizeOf(Buffer), NumberRead);            
          except
            on E: Exception do
              WriteLn('Exception: ' + E.Message);
          end;
        end
    finally
      Close(MyFile);
    end;
    WriteLn('BufferIO Time: ' + IntToStr(MilliSecondsBetween(T0, Now)));
  end;

  procedure BenchmarkFileHandle(AFile: string);
  var
    FileHandle: integer;
    I, PackageCount: cardinal;
    Buffer: byte;
    T0: double;
    MyFile: file;
  begin
    T0 := Now;
    Buffer := 0;
    try
      AssignFile(MyFile, AFile);
      Reset(MyFile, 1);
      PackageCount := FileSize(MyFile) div 188;
      Close(MyFile);

      FileHandle := FileOpen(AFile, fmOpenRead);
      Filemode := fmOpenRead;

      if PackAgeCount > 0 then
        for I := 0 to PackageCount - 1 do
        begin
          try
            FileSeek(FileHandle, I * 188, 0);
            FileRead(FileHandle, Buffer, SizeOf(Buffer));            
          except
            on E: Exception do
              WriteLn('Exception: ' + E.Message);
          end;
        end
    finally
      FileClose(FileHandle);
    end;
    WriteLn('FileHandle Time: ' + IntToStr(MilliSecondsBetween(T0, Now)));
  end;

bagatelles 發表在 痞客邦 留言(0) 人氣()

Markup Online syntax highlighter:支援Delphi, Pascal與大多數語言,可以輸出HTML,但少了行號。可以使用許多style。

bagatelles 發表在 痞客邦 留言(0) 人氣()

2013/06/17更新

新版的Code Typhon 4.3是可以在Windows XP SP3上執行,也不用將cygwin之類的目錄改名就可以build small/big IDE。開發applicaton似乎比4.2正常一點,4.2運作時會出現很多奇怪的錯誤,就連點button都會,看到有問題就懶得用,新版再看看。

bagatelles 發表在 痞客邦 留言(0) 人氣()

將Indy 10.5.8安裝到Lazarus 1.0.8,或之前的版本常會出現錯誤,按以下步驟來應該都可以成功。

1.  將Indy 10.5.8的原始程式複製到Lazarus的安裝目錄下,目錄任意名稱。

bagatelles 發表在 痞客邦 留言(0) 人氣()

mklink是Vista後來的Windows有提供的指令,在Windows 7上面的說明是這樣:

建立符號連結。

bagatelles 發表在 痞客邦 留言(0) 人氣()

2013/04/20測試:

 

bagatelles 發表在 痞客邦 留言(0) 人氣()

Lazarus 1.0 64bit 在Windows 7 64bit上會跟avast antivirus防毒打架,以前的版本是沒這個問題,九月升級以後就跑出來了,會出現一對的存取錯誤,只要一執行或關閉程式都會這樣。在Windows XP 32bit上安裝Lazarus 32bit跟防毒沒出現問題,目前還不知道怎樣解決?

bagatelles 發表在 痞客邦 留言(0) 人氣()