Free pascal Rendszer unit hibák
2011-02-03T11:28:01+01:00
2011-02-03T11:28:02+01:00
2022-06-29T09:10:24+02:00
  • ***** BOCS véltetlenül a társalgóba ment lécike rakd át a tudástárba, elnézést ****


    {$D-,N+,E-}

    { Ati }
    { Rendszer 1998..2008-06-14 }

    unit
    rendszer;

    interface

    uses
    crt, dos;

    type
    ttalal = record
    szam : byte;
    x : array[1..255] of byte;
    end;
    tbytetomb = array[1..65535] of byte;
    tkarhalmaz = set of char;
    TVga320x200 = array[0..63999] of byte;
    TVga320x200Mut = ^TVga320x200;

    var
    lastbil : char;
    funcbil : boolean;
    Vga : TVga320x200 absolute $A000:00;
    VgaMut : Array[1..2] Of TVga320x200Mut;

    function GetIdo : Single;
    function trim(s : string) : string;
    procedure tabkar(var s : string);
    function valaszt(s : String; k : string; var bo, jo : string) : boolean;
    function stsi(s : string; var hiba : integer) : single;
    function longstr(long : longint) : string;
    function stlo(s : string) : longint;
    function sist(x : single) : string;
    function lost(l : longint) : string;
    function kerkar(const s : string; mit : char; var talal : ttalal) : byte;
    function poschar(kars : tkarhalmaz; const s : string; kx : byte) : byte;
    function rndminmax(min, max : integer) : integer;
    function varakoz : char;
    procedure varcikl(c : longint);
    procedure VgaIni;
    procedure VgaEnd;
    procedure Vga2MasolVga;
    Procedure Vga2Torol;
    Procedure GotoXY2(X, Y : Single);
    Procedure HaltError(s : string);

    implementation

    function GetIdo : Single;
    Var
    h, m, s, s100 : word;
    Begin
    GetTime(h, m, s, s100);
    GetIdo := h * 3600 + m * 60 + s + s100 / 100;
    End;

    Procedure HaltError(s : string);
    begin
    ClrScr;
    writeln(s);
    halt(1);
    end;

    procedure varcikl(c : longint);
    var
    aktc : longint;
    begin
    for aktc := 1 to c do begin
    end;
    end;

    function varakoz : char;
    begin
    lastbil := readkey;
    if lastbil = #0 then begin
    funcbil := true;
    lastbil := readkey;
    end else begin
    funcbil := false;
    end;
    varakoz := lastbil;
    end;

    function sist(x : single) : string;
    var
    s : string;
    begin
    str(x:1:7, s);
    sist := s;
    end;

    function stsi(s : string; var hiba : integer) : single;
    var
    v : single;
    begin
    val(s, v, hiba);
    stsi := v;
    end;

    function lost(l : longint) : string;
    var
    s : string;
    begin
    str(l, s);
    lost := s;
    end;

    function stlo(s : string) : longint;
    var
    v : longint;
    h : integer;
    begin
    val(s, v, h);
    stlo := v;
    end;

    function valaszt(s : String; k : string; var bo, jo : string) : boolean;
    var
    x : integer;
    begin
    x := pos(k, s);
    valaszt := false;
    if x <> 0 then begin
    bo := trim(copy(s, 1, x-1));
    jo := trim(copy(s, x+1, 255));
    valaszt := true;
    end;
    end;

    function trim(s : string) : string;
    var
    s2 : string;
    begin
    s2 := s;
    repeat
    if s2[length(s2)] = ' ' then begin
    delete(s2, length(s2), 1);
    if s2 = '' then break;
    end;
    until s2[length(s2)] <> ' ';
    repeat
    if s2[1] = ' ' then begin
    delete(s2, 1, 1);
    if s2 = '' then break;
    end;
    until s2[1] <> ' ';
    trim := s2;
    end;

    procedure tabkar(var s : string);
    var
    x : integer;
    begin
    for x := 1 to length(s) do begin
    if s[x] = #9 then s[x] := #32;
    end;
    end;

    function kerkar(const s : string; mit : char; var talal : ttalal) : byte;
    var
    x : byte;
    begin
    talal.szam := 0;
    for x := 1 to length(s) do begin
    if s[x] = mit then begin
    talal.szam := talal.szam + 1;
    talal.x[talal.szam] := x;
    end;
    end;
    kerkar := talal.szam;
    end;

    function poschar(kars : tkarhalmaz; const s : string; kx : byte) : byte;
    var
    x : byte;
    begin
    for x := kx to length(s) do begin
    if s[x] in kars then begin
    poschar := x;
    exit;
    end;
    end;
    poschar := 0;
    end;

    function rndminmax(min, max : integer) : integer;
    begin
    if (min < 0) and (max < 0) then begin
    rndminmax := -rndminmax(-min, -max);
    end else begin
    rndminmax := random(max - min + 1) + min;
    end;
    end;

    function longstr(long : longint) : string;
    var
    s : string;
    begin
    str(long, s);
    longstr := s;
    end;

    procedure VgaIni;
    Begin
    VGAMut[1] := @Vga;
    GetMem(VgaMut[2], 64000);
    Asm
    Mov AX, $13;
    Int $10;
    End;
    End;

    procedure VgaEnd;
    Begin
    FreeMem(VgaMut[2], 64000);
    Asm
    Mov AX, 3;
    Int $10;
    End;
    End;

    procedure Vga2MasolVga;
    Begin
    Move(Vgamut[1]^, VgaMut[2]^, 64000);
    End;

    Procedure Vga2Torol;
    Begin
    FillChar(VgaMut[2]^, 64000, 0);
    End;

    Procedure GotoXY2(X, Y : Single);
    Begin
    GotoXY(Round(X), Round(Y));
    End;

    begin
    end.

    Hibák írom ->
    209,14 Incompatible types got far pointer expected "TVGA320Mut"
    212,7 Unknown indetifier "AX"
    221,9 Invalid reference syntax
    221,9 No size specified and unable to determine the size of the operands
    Mutasd a teljes hozzászólást!
Ez a téma lezárásra került a moderátor által. A lezárás oka: [Error] rendszer.pas(1): Undeclared identifier: 'l�cike'.
abcd