This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Lists and strings and classes


Lists and strings and classes

Postby PointOfLight » Dec 5, 2004 @ 7:11pm

I have a class that contains a list as one of it's private members. I'd like to have a function, say class.RetrieveElement(index$), that retrieves an item from this list and returns that element to the user. Or, worst case scenario, I would pass the variable to store the element of the list in as the second variable. So my syntax would either be:

x$ = class.RetrieveElement(1);

or:

class.RetrieveElement(1, &x$);

Now the element will be a string, and I can't seem to get the value out of the class. No matter what I do, x$ always ends up being the address of the element, not the value of the element. Please help!
Eric Pankoke
Programmer
Point Of Light Software
http://www.polsoftware.com/
PointOfLight
pm Member
 
Posts: 525
Joined: Nov 2, 2003 @ 8:39pm


Postby kornalius » Dec 6, 2004 @ 3:55pm

Regards,
Kornalius
President
ArianeSoft Inc.
http://www.arianesoft.ca
User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby PointOfLight » Dec 6, 2004 @ 4:00pm

Eric Pankoke
Programmer
Point Of Light Software
http://www.polsoftware.com/
PointOfLight
pm Member
 
Posts: 525
Joined: Nov 2, 2003 @ 8:39pm


Postby PointOfLight » Dec 6, 2004 @ 4:23pm

Just to verify, I first tried a return(@data$);. This gave me the "address misaligned" error. Then I left out the @ in the return statement and tried ShowMessage(@val$);, where val$ is the variable assigned to the return of the function. There was no error, but the value displayed was still the address, not the actual value of the string.
Eric Pankoke
Programmer
Point Of Light Software
http://www.polsoftware.com/
PointOfLight
pm Member
 
Posts: 525
Joined: Nov 2, 2003 @ 8:39pm


Postby kornalius » Dec 6, 2004 @ 5:57pm

Regards,
Kornalius
President
ArianeSoft Inc.
http://www.arianesoft.ca
User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby PointOfLight » Dec 6, 2004 @ 6:27pm

Eric Pankoke
Programmer
Point Of Light Software
http://www.polsoftware.com/
PointOfLight
pm Member
 
Posts: 525
Joined: Nov 2, 2003 @ 8:39pm


Postby kornalius » Dec 6, 2004 @ 6:39pm

No problem, we could have discovered something buggy along the way! ;)
Regards,
Kornalius
President
ArianeSoft Inc.
http://www.arianesoft.ca
User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Return to Pocket Programming Language (PPL)


Sort


Forum Description

Discuss this new development tool.

Moderator:

kornalius

Forum permissions

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 post attachments in this forum

cron