Help for Pointers in Delphi 8 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help for Pointers in Delphi 8

hi all,
I m using Delphi 8. I have done some work in Delphi 6.
There are Pointer DataTypes (PInteger, PSmallInt, PByteArray etc.) in Delphi 6. Are there any DataTypes like these in Delphi 8.
Actually i m getting Error when i declare a varialble of type 'PSmallInt' or 'PInteger'.
I declared an 'unsafe' procedure, which allows me to declare poiter variables with '^', but giving me Error-'Undeclared Identifier' on 'PSmallInt' or 'PInteger'.

Thanks in advance.

Comments

  • zibadianzibadian Posts: 6,349Member
    : hi all,
    : I m using Delphi 8. I have done some work in Delphi 6.
    : There are Pointer DataTypes (PInteger, PSmallInt, PByteArray etc.) in Delphi 6. Are there any DataTypes like these in Delphi 8.
    : Actually i m getting Error when i declare a varialble of type 'PSmallInt' or 'PInteger'.
    : I declared an 'unsafe' procedure, which allows me to declare poiter variables with '^', but giving me Error-'Undeclared Identifier' on 'PSmallInt' or 'PInteger'.
    :
    : Thanks in advance.
    :
    You can always create your own pointer-types using the type declaration:
    [code]
    type
    PInteger = ^integer;
    [/code]
  • kruti kansarakruti kansara Posts: 19Member
    : : hi all,
    : : I m using Delphi 8. I have done some work in Delphi 6.
    : : There are Pointer DataTypes (PInteger, PSmallInt, PByteArray etc.) in Delphi 6. Are there any DataTypes like these in Delphi 8.
    : : Actually i m getting Error when i declare a varialble of type 'PSmallInt' or 'PInteger'.
    : : I declared an 'unsafe' procedure, which allows me to declare poiter variables with '^', but giving me Error-'Undeclared Identifier' on 'PSmallInt' or 'PInteger'.
    : :
    : : Thanks in advance.
    : :
    : You can always create your own pointer-types using the type declaration:
    : [code]

    : type
    : PInteger = ^integer;
    : [/code]
    :

    hi,
    thnx 4 ur ans.
    it works 4 PInteger and PSmallInt. But could you please tell me what about PByteArray?
    I have wrote a procedure like,
    {$UNSAFECODE ON}

    procedure MyProc(); unsafe;
    var
    myint : PInteger;
    mypntr : PSmallInt;
    line : PByteArray;
    begin
    //
    end;

    It is giving me an error on 'PByteArray'.

  • KoppisKoppis Posts: 68Member
    : : : hi all,
    : : : I m using Delphi 8. I have done some work in Delphi 6.
    : : : There are Pointer DataTypes (PInteger, PSmallInt, PByteArray etc.) in Delphi 6. Are there any DataTypes like these in Delphi 8.
    : : : Actually i m getting Error when i declare a varialble of type 'PSmallInt' or 'PInteger'.
    : : : I declared an 'unsafe' procedure, which allows me to declare poiter variables with '^', but giving me Error-'Undeclared Identifier' on 'PSmallInt' or 'PInteger'.
    : : :
    : : : Thanks in advance.
    : : :
    : : You can always create your own pointer-types using the type declaration:
    : : [code]
    :
    : : type
    : : PInteger = ^integer;
    : : [/code]
    : :
    :
    : hi,
    : thnx 4 ur ans.
    : it works 4 PInteger and PSmallInt. But could you please tell me what about PByteArray?
    : I have wrote a procedure like,
    : {$UNSAFECODE ON}
    :
    : procedure MyProc(); unsafe;
    : var
    : myint : PInteger;
    : mypntr : PSmallInt;
    : line : PByteArray;
    : begin
    : //
    : end;
    :
    : It is giving me an error on 'PByteArray'.
    :
    :

    I don't have Delphi 8 so I don't know if ByteArray is defined on some unit already. But you should always be able to define it yourself:[code]
    TByteArray: Array[0..2] of Byte;
    PByteArray: ^TByteArray;[/code]
  • zibadianzibadian Posts: 6,349Member
    : : : : hi all,
    : : : : I m using Delphi 8. I have done some work in Delphi 6.
    : : : : There are Pointer DataTypes (PInteger, PSmallInt, PByteArray etc.) in Delphi 6. Are there any DataTypes like these in Delphi 8.
    : : : : Actually i m getting Error when i declare a varialble of type 'PSmallInt' or 'PInteger'.
    : : : : I declared an 'unsafe' procedure, which allows me to declare poiter variables with '^', but giving me Error-'Undeclared Identifier' on 'PSmallInt' or 'PInteger'.
    : : : :
    : : : : Thanks in advance.
    : : : :
    : : : You can always create your own pointer-types using the type declaration:
    : : : [code]
    : :
    : : : type
    : : : PInteger = ^integer;
    : : : [/code]
    : : :
    : :
    : : hi,
    : : thnx 4 ur ans.
    : : it works 4 PInteger and PSmallInt. But could you please tell me what about PByteArray?
    : : I have wrote a procedure like,
    : : {$UNSAFECODE ON}
    : :
    : : procedure MyProc(); unsafe;
    : : var
    : : myint : PInteger;
    : : mypntr : PSmallInt;
    : : line : PByteArray;
    : : begin
    : : //
    : : end;
    : :
    : : It is giving me an error on 'PByteArray'.
    : :
    : :
    :
    : I don't have Delphi 8 so I don't know if ByteArray is defined on some unit already. But you should always be able to define it yourself:[code]
    : TByteArray: Array[0..2] of Byte;
    : PByteArray: ^TByteArray;[/code]
    :
    The D5 limit of the TByteArray is 32767. You can also look in the help files, to see in which unit those types are defined.
  • kruti kansarakruti kansara Posts: 19Member
    : : : : : hi all,
    : : : : : I m using Delphi 8. I have done some work in Delphi 6.
    : : : : : There are Pointer DataTypes (PInteger, PSmallInt, PByteArray etc.) in Delphi 6. Are there any DataTypes like these in Delphi 8.
    : : : : : Actually i m getting Error when i declare a varialble of type 'PSmallInt' or 'PInteger'.
    : : : : : I declared an 'unsafe' procedure, which allows me to declare poiter variables with '^', but giving me Error-'Undeclared Identifier' on 'PSmallInt' or 'PInteger'.
    : : : : :
    : : : : : Thanks in advance.
    : : : : :
    : : : : You can always create your own pointer-types using the type declaration:
    : : : : [code]
    : : :
    : : : : type
    : : : : PInteger = ^integer;
    : : : : [/code]
    : : : :
    : : :
    : : : hi,
    : : : thnx 4 ur ans.
    : : : it works 4 PInteger and PSmallInt. But could you please tell me what about PByteArray?
    : : : I have wrote a procedure like,
    : : : {$UNSAFECODE ON}
    : : :
    : : : procedure MyProc(); unsafe;
    : : : var
    : : : myint : PInteger;
    : : : mypntr : PSmallInt;
    : : : line : PByteArray;
    : : : begin
    : : : //
    : : : end;
    : : :
    : : : It is giving me an error on 'PByteArray'.
    : : :
    : : :
    : :
    : : I don't have Delphi 8 so I don't know if ByteArray is defined on some unit already. But you should always be able to define it yourself:[code]
    : : TByteArray: Array[0..2] of Byte;
    : : PByteArray: ^TByteArray;[/code]
    : :
    : The D5 limit of the TByteArray is 32767. You can also look in the help files, to see in which unit those types are defined.
    :

    Thanx all,
    4 all ur helps.
Sign In or Register to comment.