Page 1 of 1

Posted: Sat Jan 04, 2003 9:34 pm
by BackupUser
Restored from previous forum. Originally posted by tinman.

Hi,

Not wanting to start another huge thread, but is there any way I can get the address of the string pointer, not the string.

So imagine you have a$="foo". @a$ will give you the address of the f character. Is there any way to get the address where the a$ pointer is located?

My main interest in this is with arrays, since

@array$(0) gives you a pointer to the first string in the array, and not the start of the array.

Thanks.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)

Posted: Sun Jan 05, 2003 7:57 am
by BackupUser
Restored from previous forum. Originally posted by horst.

Look at this:

Code: Select all

string.s = "Hello"
location_of_string = @string
location_of_pointer = @location_of_string

Debug string
Debug Str(location_of_string)
Debug Str(location_of_pointer)

Debug PeekS(PeekL(location_of_pointer))

Horst

Posted: Sun Jan 05, 2003 8:01 am
by BackupUser
Restored from previous forum. Originally posted by horst.

No, that was wrong, because it makes a new pointer
(location_of_string), and does not show the original pointer



Horst

Posted: Sun Jan 05, 2003 3:58 pm
by BackupUser
Restored from previous forum. Originally posted by Tomio.

It seems to be the same as in C:

Dim a$(2)
a$(0)="0line"
a$(1)="1line"

Debug a$() ;address of array
Debug @a$() ;..the same
Debug a$(0) ;string
Debug @a$(0) ;address of start of string

Is it this what you mean?

../tomio

Posted: Sun Jan 05, 2003 4:09 pm
by BackupUser
Restored from previous forum. Originally posted by tinman.
Originally posted by Tomio

Is it this what you mean?
Yes, perfect. Thanks.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)