Re: Delphi.NET



On Tue, 26 Jun 2007 08:00:25 GMT, "Daniel Hobson"
<djhob1972@xxxxxxxxxxxx> wrote:

Hi All,

I was wondering if anybody is out there who uses Delphi.NET. We seem to be
having a few problems in knowning
about the new requirements of DotNET. The main one that has us really
stumped is how do you
convert from one data type to another different data type?

For example:-

Type
TTestRec = record
t1: array [1..32] of char;
t2: array [1..28] of char;
end;

MyBuffer : TidBytes;
MyActType : TTestRec;

I read in the information via TCP/IP into MyBuffer (Have no choice in the
matter)

The question is now .. how can I say that MyBuffer is type TTestRec ????


TidBytes is an array of bytes.
Your TTestRec houses two arrays of chars.

If you want to transfer the array of bytes into an array of char,
you'll have to convert the ordinal byte values into their chr
equivalents.

You can either do this by writing your own simple function, or use the
built-in BytesToString function found in idGlobal.
.



Relevant Pages

  • Delphi.NET
    ... about the new requirements of DotNET. ... convert from one data type to another different data type? ... MyActType: TTestRec; ... I read in the information via TCP/IP into MyBuffer ...
    (comp.lang.pascal.delphi.misc)
  • Delphi.NET
    ... about the new requirements of DotNET. ... convert from one data type to another different data type? ... MyActType: TTestRec; ... I read in the information via TCP/IP into MyBuffer (Have no choice in the ...
    (alt.comp.lang.borland-delphi)
  • Re: Delphi.NET
    ... convert from one data type to another different data type? ... MyActType: TTestRec; ... I read in the information via TCP/IP into MyBuffer (Have no choice in the ... Since you cannot use a fixed length array in the TCP/IP routine, ...
    (comp.lang.pascal.delphi.misc)
  • Re: how does your language... make a map?
    ... Again, storing the map ... push(array,element) just appends the element to the array. ... Int is the standard integer type, which leaves MapCell (a data type) ... data MapCell(Terrain terrain, Occupant occupant); ...
    (rec.games.roguelike.development)
  • Re: Dim, var, & why?
    ... I think you misunderstood ... Calling a VB Array an "Object" is obviously incorrect in the context of VB. ... In VB they are a Data Type. ... and all types in dotNet derive from object. ...
    (microsoft.public.vb.general.discussion)