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

New feature: Array of objects


New feature: Array of objects

Postby kornalius » Oct 14, 2005 @ 4:38pm

Last edited by kornalius on Oct 14, 2005 @ 7:35pm, edited 1 time in total.
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 mmtbb » Oct 14, 2005 @ 6:06pm

mmtbb
pm Member
 
Posts: 277
Joined: Mar 18, 2004 @ 6:56am


Postby mmtbb » Oct 29, 2005 @ 12:10am

Normally when you access a property of an object it is like this:

Object.property$ = "hello";

however, in the above examples, an array is like this:

Object$[i$].Property$ = 23; //notice all the '$' signs. Shouldn't it be:

Object[i$].property$;

Perhaps you specifically wanted it this way, in which case that is fine, it is just nice to have the format the same for consistancy in the syntax.
mmtbb
pm Member
 
Posts: 277
Joined: Mar 18, 2004 @ 6:56am


Postby kornalius » Oct 29, 2005 @ 4:23pm

Yep it's this way. obj$[i$].property$

PPL get the offset of the variable obj$ at position i$, then get the property$ variable value. It's not conventional but is with PPL anyway! :wink:
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 mmtbb » Oct 29, 2005 @ 5:53pm

thanks
mmtbb
pm Member
 
Posts: 277
Joined: Mar 18, 2004 @ 6:56am


Postby mmtbb » Oct 30, 2005 @ 5:01am

when you free the object array, can you do:

freeobject(ObjectArray$);

or do you have to free each array element?:

freeobject(ObjectArray$[i$]);
mmtbb
pm Member
 
Posts: 277
Joined: Mar 18, 2004 @ 6:56am


Postby kornalius » Oct 31, 2005 @ 2:22am

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