IonicWind Software

Announcements => User Offerings => Topic started by: Andy on December 19, 2015, 04:59:06 AM

Title: Pointers - How to use them
Post by: Andy on December 19, 2015, 04:59:06 AM
Big thanks to Larry Mc for guiding me step by step on how to use pointers.

So I thought I would create some examples on how to use them (from a beginners point of view).

Here are eight examples on how to use INT's, STRINGS and ISTRINGS with pointers, I hope they will be of some use to you if you have never used pointers before or was just unsure.

Best wishes, as always,

Andy.
:)

Title: Re: Pointers - How to use them
Post by: aurelCB on December 19, 2015, 09:16:21 AM
good Andy
but if beginner need to understand what is pointer variable type
then i think that must start with such a simple program..
Using user guide is great help .

DEF p as POINTER 'Create a pointer called ''.
INT i=7
'reference pointer
p = i 'Tell p it is pointing to an integer i

'Get the values and print them...
openconsole
'de-reference pointer
print #p
do:until inkey$ <> ""
closeconsole
Title: Re: Pointers - How to use them
Post by: Andy on December 19, 2015, 11:52:13 PM
Thanks for that,

Yes I agree with what you say, the reason for the post is that in the case of pointers the help file was not telling me (that I could find) how to write code (using pointers) with strings, istrings, UDT's and arrays (examples A3 to A7).

I also had to work out how you can increase a pointer size (example A8) without losing data.

So once you have read the help file, you can look at my examples to help you move on with poiters.

Just thought they cover all the basic questions I was asking myself, and likely someone else new to pointers would probably ask.

Thanks,
Andy.
:)
Title: Re: Pointers - How to use them
Post by: aurelCB on December 20, 2015, 12:46:29 AM
hi Andy yes i agree that some things are not explained very well in user guide
also you may look in topic here on forum where i and LarryMc talk about using pointer
and linked list in ABasic.