QUESTIONS:
1. Enumerations have to be declared before using their variable in a structure? Can you not set their values after?
2. This was very helpful, esp. in the use of PushListPosition and PopListPosition. I will be searching many lists in my routines and im sure i'll be using those a lot.
3 ...
Search found 10 matches
- Sat Oct 04, 2025 3:46 pm
- Forum: Coding Questions
- Topic: Problems with list in a procedure - need help
- Replies: 12
- Views: 275
- Thu Oct 02, 2025 3:59 pm
- Forum: Coding Questions
- Topic: Problems with list in a procedure - need help
- Replies: 12
- Views: 275
Re: Problems with list in a procedure - need help
Dang you guys are more than helpful!
Im gonna look over all this code and learn as much as i can. PureBasic is not my first language so im having a hard time with even simple things.
Thanx guys!
Im gonna look over all this code and learn as much as i can. PureBasic is not my first language so im having a hard time with even simple things.
Thanx guys!
- Thu Oct 02, 2025 8:35 am
- Forum: Coding Questions
- Topic: Problems with list in a procedure - need help
- Replies: 12
- Views: 275
Re: Problems with list in a procedure - need help
Im not understanding the question or the need for global declaration. Im using the same syntax as in the help manual.
Newlist creates the list construct, and im using a Structure as its elements.
....
Ok i went back to the manual and it does say (in the NewList page, nowhere else, and "global ...
Newlist creates the list construct, and im using a Structure as its elements.
....
Ok i went back to the manual and it does say (in the NewList page, nowhere else, and "global ...
- Thu Oct 02, 2025 4:46 am
- Forum: Coding Questions
- Topic: Problems with list in a procedure - need help
- Replies: 12
- Views: 275
Problems with list in a procedure - need help
The following code will be some of the first lines in a program before the main routine begins. I am setting up my lists, enumerations, and called procedures. I ran a syntax check to make sure that im doing this right:
; Compartments for the SNB:
structure SNbits
SNID.q
SNbitflags.a
SNptr.q ...
; Compartments for the SNB:
structure SNbits
SNID.q
SNbitflags.a
SNptr.q ...
- Tue Sep 30, 2025 10:15 am
- Forum: Coding Questions
- Topic: Multi-use structure element - pointers or unions?
- Replies: 3
- Views: 176
Re: Multi-use structure element - pointers or unions?
I did think about using Maps, but they cant be sorted, and i need to sort my list of numbers often. (Altho i could use maps for the secondary lists, since the initial list will have the reference to an element in the map.)
But i still didnt get my answer of when structure unions are helpful.
But i still didnt get my answer of when structure unions are helpful.
- Tue Sep 30, 2025 2:06 am
- Forum: Coding Questions
- Topic: Multi-use structure element - pointers or unions?
- Replies: 3
- Views: 176
Multi-use structure element - pointers or unions?
Im creating multiple lists that reference particular entries by ID. In other words, each list entry will have an initial index of so many bytes that is called by other lists, to help separate the data but keep it linked. Imagine multiple lists whose first number in each line is the same, indicating ...
- Sun Sep 28, 2025 3:47 pm
- Forum: Coding Questions
- Topic: Enumerations within structures?
- Replies: 4
- Views: 294
Re: Enumerations within structures?
Ok thanks for all your advice.
The reason i wanted to use a structure as my list element is so i can quickly access a bit by variable name. But as i already knew, there arent one-bit variable sizes, the smallest is one byte.
So think i'll incorporate @mk-soft's code and just store the list ...
The reason i wanted to use a structure as my list element is so i can quickly access a bit by variable name. But as i already knew, there arent one-bit variable sizes, the smallest is one byte.
So think i'll incorporate @mk-soft's code and just store the list ...
- Sun Sep 28, 2025 11:19 am
- Forum: Coding Questions
- Topic: Enumerations within structures?
- Replies: 4
- Views: 294
Enumerations within structures?
I am attempting to set up a list whose elements are in the format of a Structure, but the Structure elements are simply a sequence of bits (for ultrafast bitflag checking), and there are 32 bits. So in other words, the list is composed of a series of 32-bit elements, meaning they are ultimately just ...
- Sat Jan 25, 2025 3:01 pm
- Forum: Coding Questions
- Topic: Whats the best way to check mouseclick locations in window
- Replies: 4
- Views: 1150
Re: Whats the best way to check mouseclick locations in window
OK I'll first try a loop to test for the mouseclick within rects.
I can probly optimize it by deductive testing, such as "is mouseX greater than firstrowX?" and winnow it down that way.
Thanks for your suggestions guys
I can probly optimize it by deductive testing, such as "is mouseX greater than firstrowX?" and winnow it down that way.
Thanks for your suggestions guys
- Sat Jan 25, 2025 12:09 am
- Forum: Coding Questions
- Topic: Whats the best way to check mouseclick locations in window
- Replies: 4
- Views: 1150
Whats the best way to check mouseclick locations in window
I'm developing a new game in PB which uses a table of card slots, so that when you have selected a card to place, you can then click on a card slot to move that card there. I'm simply using image placement on an image window. No 2D or 3D commands.
The problem is there are 100 possible rectangles ...
The problem is there are 100 possible rectangles ...