BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help a newbie

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.components.misc
View previous topic :: View next topic  
Author Message
Nige
Guest





PostPosted: Wed Dec 07, 2005 4:38 am    Post subject: Help a newbie Reply with quote



Looking at some sample code.

I have a line, which calls a function

and the 3rd parameter is @Cells^[0]

whats do the @ and the ^ and the [0] indicate.

thanks
Back to top
Nicholas Sherlock
Guest





PostPosted: Wed Dec 07, 2005 4:55 am    Post subject: Re: Help a newbie Reply with quote



Nige wrote:
Quote:
@Cells^[0]

whats do the @ and the ^ and the [0] indicate.

The whole thing gives you the address of (@) the fist item ([0]) of the
memory that cells uses (^). Read some tutorials on pointers.

Cheers,
Nicholas Sherlock
Back to top
Jamie
Guest





PostPosted: Wed Dec 07, 2005 9:06 am    Post subject: Re: Help a newbie Reply with quote



Nige wrote:
Quote:
Looking at some sample code.

I have a line, which calls a function

and the 3rd parameter is @Cells^[0]

whats do the @ and the ^ and the [0] indicate.

thanks


The @ generates an address of an item.

so lets break this down.

Cells is being treated like a pointer and
thus the use of ^ meaning that you are
fetching data via the pointer which is like
a road map giving directions of where the
start of the data which makes up the object
"CELLS" resides in.
Since it's obvious that Cells must not
be a pointer already to start with, using the
@ infront will generate a pointer address of that
object.
and the use of the [0] is like any other
array from that point on.
it will simply use the Pointer address as the
starting base with the an offset of what
ever in the [?] to calculate the distant to
move from the start of the pointer.



--
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Back to top
Bruce Roberts
Guest





PostPosted: Wed Dec 07, 2005 8:13 pm    Post subject: Re: Help a newbie Reply with quote

"Nige" <nkarnold (AT) blueyonder (DOT) co.uk> wrote in message
news:Ihplf.160032$Es4.143191 (AT) fe2 (DOT) news.blueyonder.co.uk...
Quote:
Looking at some sample code.

I have a line, which calls a function

and the 3rd parameter is @Cells^[0]

whats do the @ and the ^ and the [0] indicate.

The code won't compile. In any case it is nonsensical. @Cells and Cells
mean the same thing as does Cells^ and Cells, presuming Cells is the name
of an array.
Back to top
Riki Wiki Google
Guest





PostPosted: Mon Dec 12, 2005 1:38 am    Post subject: Re: Help a newbie Reply with quote

Hoi Nige + others

When you post in a borland.public... news group you need to post on the
Borland news server to make everybody see it. Further, this news group
b.p.delphi do not officially exist.

Take a look here:
<http://tinyurl.com/8m5nw>
which links to
<http://delphi.wikicities.com/wiki/Delphi_Newsgroups>
Back to top
DrChaos
Guest





PostPosted: Thu Dec 15, 2005 10:09 pm    Post subject: Re: Help a newbie Reply with quote

Nige wrote:
Quote:
Looking at some sample code.

I have a line, which calls a function

and the 3rd parameter is @Cells^[0]

whats do the @ and the ^ and the [0] indicate.

thanks


@ = adress of

^ dereferences a pointer
[x] is the x'th position in a list or array.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.components.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.