Page 1 of 1

Posted: Sat Mar 16, 2002 10:21 am
by BackupUser
Restored from previous forum. Originally posted by PB.

I've never used structures before, but I think my vis2pure app would benefit by
using them. Currently, vis2pure has individual arrays for all gadget properties,
for example: gn$(x) for gadget name, gv(x) for gadget visible, etc. However, as
I'm adding more and more properties for each gadget, I think that perhaps using
structures would be a better and more efficient approach. Am I right?

Basically, I guess I'm asking: Is using structures a better way to go instead of
using individual arrays? Do they save memory, etc?


PB - Registered PureBasic Coder

Posted: Sat Mar 16, 2002 2:42 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

Structure are faster and more modular than using tons of Arrays. It doesn't save memory, but the structure solution is definitely cleaner, go for it ! You can combinate the structure with the linkedlist and you will get an expandable, low memory solution. If you need more info of how to use them, just tell us.

Fred - AlphaSND

Posted: Sun Mar 17, 2002 8:52 pm
by BackupUser
Restored from previous forum. Originally posted by tranquil.

Fangbeast, please dont replay to postings if you are drunken. (Is this what you mean with pain at late night?)

:-)))

Mike

Tranquilizer/ Secretly!
Registred PureBasic User

Posted: Mon Mar 18, 2002 2:47 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
You cannot reference an element in a structure directly like a(15) (get element 15 from array 'a', you have to loop through all items to get to the one you want.
Hi Fang, I just tried a structure and I was able to get element 5 out of 10
elements without reading elements 1-4 first... so I don't understand what
you mean by the above?


PB - Registered PureBasic Coder

Posted: Mon Mar 18, 2002 3:44 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
Hi Fang, I just tried a structure and I was able to get element 5 out of 10
elements without reading elements 1-4 first... so I don't understand what
you mean by the above?
I think than Fang talked about LinkedList. With linkedList, to get the 15th elem, you have to do a loop on the 15th first..

Fred - AlphaSND

Posted: Tue Mar 19, 2002 8:51 am
by BackupUser
Restored from previous forum. Originally posted by Stan.

I should not have gotten out of bed this year.

Fangles
I toyed a bit with the same idea, but my girlfriend insisted on being
with me ... Too much for an old guy like me

Learning and Love are what life is all about ... [ PB. registered user ]