Re: Quick C# conversion question...

[email protected]
Newsgroups gmane.comp.lang.delphi.jedi
Message-ID <[email protected]>
> Hi all,
>    I have been playing around with the Delphi.NET preview compiler as I 
> haven't bothered this list about a conversion question for a while ( 
> i've been bothering others and I thought they needed a rest : ), so can 
> someone please tell me what this converts to...
> 
> CustomVertex.PositionNormal[] verts = 
> (CustomVertex.PositionNormal[])vb.Lock(0,0);
> 
> I tried converting this as
> verts : array of CustomVertex.PositionNormal;
> verts := CustomVertex.PositionNormal( vb.Lock( 0, LockFlags( 0 ) ) );

Logcally the typecast should be an array too then. So that would be

type myarray = array of custom...

var verts : myarray;

verts:=myarray (vb.lock...);

> or
> verts := vb.Lock( 0, LockFlags( 0 ) );
> 
> But to no avail. How does one do an array typecast? Is this possible 
> Pascal/Delphi?

You mean pascal# and Delphi# ? :-)

In normal Delphi you can only typecast arrays that have the exact same size
or using pointers (the parraytype(@symbol)^[x] trick), but that is exactly
the kind of things that I don't expect Delphi# to grok. 

Or there are things possible with dynamic arrays that I don't know about ( I
  don't use them normally
since most of my code is currently shared between two FPC versions, one at
D2 level, one at D6 level)



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.