A very basic object pascal question to you all....
An [in/out] paramerter requires a PByte. I want to pass a string in that
parameter. What are my options?
NIRAV KAKU
MyProc(@MyStringVar[1])
May need a cast: MyProc(PByte(@MyStringVar[1])).
WL
Var
pB: PByte;
pB := @someString[1];
Now pass pB. This will work *unless* the called function writes to the
address you pass it. If it does that it must know the size of the string
memory (Length(somestring)+1, including the #0 terminator) and guard
against writing beyond the end of buffer.
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
//move data into array of byte
Move(Pointer(TheString)^, TheArray, Length)
//pass the array
MyProc(@TheArray)
NIRAV KAKU
NIRAV KAKU wrote:
> Hello there,
>
> A very basic object pascal question to you all....
>
> An [in/out] paramerter requires a PByte. I want to pass a string in that
> parameter. What are my options?
>
> NIRAV KAKU