IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Prism
Search Prism Group:

Advanced
-Collapse +Expand Prism To/From
To/FromCODEGuides
-Collapse +Expand Prism Study Test
PRESTWOODCERTIFIED
-Collapse +Expand Prism Store
PRESTWOODSTORE

Prestwood eMagazine

November Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingDelphi PrismLanguage Det...   Print This     
  From the June 2015 Issue of Prestwood eMag
 
Prism Language Details:
Delphi Prism Pointers
 
Posted 15 years ago on 3/14/2009
Prism Code Snippet:
 A flashcard from our Prism Flashcards Library
 A code snippet from our Prism Code Snippets Page

KB101962

General Info: Pointers / References

A pointer is a variable type that allows you to refer indirectly to another object. Instead of holding data, a pointer holds the address to data -- the address of another variable or object. You can change the address value a pointer points to thus changing the variable or object the pointer is pointing to.

A reference is a type of pointer that cannot change and it must always point to a valid storage (no nulls).

Delphi Prism Pointers

Although pointer data types in Prism coding are less important than in other languages such as C++, Prism does support developer defined pointers. Use the ^ operator to declare a pointer data type. Use the @ operator to return the current address of a variable.

In .Net managed coding the use of pointers is not safe because the garbage collector may move memory around. To safely use pointers, use the unsafe keyword. However, avoid unsafe code if possible.

More Info

Definition:  Pointers / References

Comments

1 Comments.
Share a thought or comment...
Comment 1 of 2

I profoundly like your dedicated abilities as the post you distributed has some incredible data which is very valuable for me.

Posted 18 months ago

Comment 2 of 2

Hy there i can see your post and i must say

In Delphi Prism, you have the concept of references and objects, which are closely related to pointers:

  1. References: In Delphi Prism, references behave somewhat like pointers. When you work with objects or complex data types, you‘re essentially working with references to those objects in memory. Changes made to the reference will reflect in the actual object.

  2. Garbage Collection: Delphi Prism, being part of the .NET framework, utilizes garbage collection to manage memory. This means that you don‘t have to manually allocate and deallocate memory for objects like you would with traditional pointers in languages like C or C++.

  3. Nullable Types: Delphi Prism supports nullable value types. This is a concept that allows a value type to also have a null value, similar to how pointers can point to null in other languages.

Thanks and regards

Robert Vaughn

Posted 15 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1123A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101962 Counter
13437
Since 3/14/2009
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]