Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.