Author |
Topic: Lists in BB4W (Read 651 times) |
|
dje4816
New Member
member is offline


Posts: 11
|
 |
Lists in BB4W
« Thread started on: Nov 15th, 2013, 3:49pm » |
|
Several languages offer a List function. This is essentially an array which can be grown or shrunk on the fly without destroying its contents. Typically a structure would be used, one field holding data with a couple of other fields employed as pointers to the preceding and succeeding element in the list. A new element (structure) can be added anytime, and an existing structure can be deleted anytime without affecting the rest of the List.
I can't find a way to make BB4W structures generate new structures without providing a structure name on the fly, so I'm stuck. I want the List feature in a program I'm working on.
I'm sure someone has already solved this problem, so please give me some pointers (no pun intended!)
Dave.
|
|
Logged
|
|
|
|
dje4816
New Member
member is offline


Posts: 11
|
 |
Re: Lists in BB4W
« Reply #2 on: Nov 16th, 2013, 08:36am » |
|
Thanks, Richard, I knew you'd come up with something!
Dave.
|
|
Logged
|
|
|
|
dje4816
New Member
member is offline


Posts: 11
|
 |
Re: Lists in BB4W
« Reply #3 on: Nov 16th, 2013, 09:45am » |
|
I tried to use the code linked at http://rosettacode.org/wiki/Doubly-linked_list/Traversal#BBC_BASIC.
In the code in the link the following lines appear:
a.pNext% = b{} a.iData% = 123 b.pPrev% = a{} b.iData% = 789 c.iData% = 456
When I copy and paste them in to BB4W, they appear like this: andpNext% = b{} andiData% = 123 bgetpPrev% = a{} bgetiData% = 789 colouriData% = 456
As you can see, BB4W changes the code after copying it in. So I tried typing it in directly into BB4W, with exactly the same effect.
What's going on here? Do those changes mean anything? Either way, the code doesn't run.
Any help and an explanation appreciated!
Dave.
|
|
Logged
|
|
|
|
Malvern
Guest
|
 |
Re: Lists in BB4W
« Reply #4 on: Nov 16th, 2013, 12:32pm » |
|
Go to the IDE Options menu, select Customize and then uncheck the Accept Keyword Abbreviations option.
The effect you are getting is because you have lower case keywords selected and the IDE thinks you are trying to use abbreviated keywords.
|
|
Logged
|
|
|
|
dje4816
New Member
member is offline


Posts: 11
|
 |
Re: Lists in BB4W
« Reply #5 on: Nov 16th, 2013, 12:40pm » |
|
Thanks, Malvern, it's working fine now.
Dave.
|
|
Logged
|
|
|
|
|