Forum > FPC development

Argument can`t be assigned to

<< < (2/2)

typo:
In fact I can compile your code with no error messages, but with these hints:


--- Code: ---type Pbyte = ^Byte;
     Pword = ^Word;
     Pdword = ^LongWord; // Hint: Local type "Pdword" is not used

FUNCTION GetMem( addr: LongWord ) : Byte;
var
  ptr : Pbyte;
BEGIN
  addr :=$B800;
  ptr := PByte(addr);  // <<<<< Hint: Conversion between ordinals and pointers is not portable
  GetMem := ptr^;
END;

PROCEDURE SetMem( addr: LongWord; value: Byte );
var
  ptr: Pbyte;
BEGIN
  addr :=$B800;
  ptr := Pbyte(addr);  // <<<<< Hint: Conversion between ordinals and pointers is not portable
  ptr^ := value;
END;

FUNCTION GetMemW( addr: LongWord ) : Word;
var
  ptr : Pword;
BEGIN
  addr :=$B800;
  ptr := Pword(addr); // <<<<< Hint: Conversion between ordinals and pointers is not portable
  GetMemW := ptr^;
END;

PROCEDURE SetMemW( addr: LongWord; value: Word );
var
  ptr: Pword;
BEGIN
  addr :=$B800;
  ptr := Pword(addr);  // <<<<< Hint: Conversion between ordinals and pointers is not portable
  ptr^ := value;
END;     

--- End code ---

marcov:

--- Quote from: nitinjain on May 15, 2014, 04:11:02 pm ---Yes, I agreed and i have fixed those basic errors and after that I got this error "Argument can`t be assigned to" on both places (at MEM and MEMW starting point)

--- End quote ---

See point (2).   memw is never going to work on something else than dos.
 
The whole "screen is at $B800" concept is a DOSism.

Navigation

[0] Message Index

[*] Previous page

Go to full version