Parallel Programming #4

Blitz3D Forums/Blitz3D Beginners Area/Parallel Programming #4

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Like I said, I was getting into more advanced stuff (all at once) but you seem to have handled everything well. You might read the documentation on (custom) types.

Basically, since Blitz only has a few built-in types (int%, string$, float#), it also allows you to create your own. (They're analogous to structs in C.) Custom types are like bllueprints for containers for a set of related variables. Once you define the type, you can create as many instances as you like, and they automatically get stored in an internal linked-list. Anyway, I'm confident you'll understand them after reading the documentation on them a few times. The only point I need to make right now is that the type definition, e.g.:
Type name_of_custom_type
    Field field1%
    Field field2$
    Field field3#
    Field field4%
End Type
...must be defined outside of a function/loop/etc, in other words, at the "root" scope. So just copy and paste that part of your program (and also the part where a New Portval is created -- you only need one -- you shouldn't have it inside the Repeat loop) at the top or bottom.

Everything else looks like it should work.

By the <code> stuff, I was letting you know that if you wanted to post your program code to the forum in
    this kind of formatting
...that you could do it by putting it between these two formatting codes:
<code>
(insert blitz code here)
</code>
-- but replace the < with [ and the > with ].

Also, if you scroll down to the bottom of the message, you can post a reply directly to that thread, and it will go to the top of the queue -- so you don't have to create a new topic each time.