Search found 1798 matches
- Fri Apr 19, 2024 2:07 pm
- Forum: Coding Questions
- Topic: Thread Parameters?
- Replies: 13
- Views: 604
Re: Thread Parameters?
@STARGÅTE: Thanks for showing that. I should switch my Delays() to Semaphores() then for my threads? But, can I just use the one semaphore for all my different threads, or does each thread need its own dedicated semaphore? What I mean is, is doing it like this safe? It appears to be. Semaphores gua...
- Fri Apr 19, 2024 7:49 am
- Forum: Coding Questions
- Topic: Thread Parameters?
- Replies: 13
- Views: 604
Re: Thread Parameters?
In both cases the information is passed just as a reference to the thread, and not as a variable or copy. That's why my example has "text$=PeekS(params)" as the first line of the thread: to create a local copy of the params so they're not lost. Sometimes you'll need a small delay after cr...
- Thu Apr 18, 2024 9:27 pm
- Forum: Bugs - Windows
- Topic: [Done] Static array index-less reference
- Replies: 8
- Views: 518
- Thu Apr 18, 2024 6:15 am
- Forum: Coding Questions
- Topic: Thread Parameters?
- Replies: 13
- Views: 604
Re: Thread Parameters?
At this point I would like to give an important note for both proposed solutions. In both cases the information is passed just as a reference to the thread, and not as a variable or copy. This means, the myParams.Parameters (first example) or text$ (second example) have to keep as they are as long a...
- Sun Apr 07, 2024 6:53 pm
- Forum: Coding Questions
- Topic: How to create constants automatically?
- Replies: 12
- Views: 563
Re: How to create constants automatically?
A constant is just a macro with a hashtag. Once defined, it is replace everywhere during the compilation and is not present anymore in the final executable. I think at this point the discussion is closed. When you want to define a constant from another file (during compilation), you can use IncludeF...
- Sun Apr 07, 2024 7:06 am
- Forum: Coding Questions
- Topic: What variable type is "?" for CatchImage?
- Replies: 7
- Views: 338
Re: What variable type is "?" for CatchImage?
The second argument in CatchImage() is just a memory address. The ? operator is used to receive the memory address from a label: *Address = ? Label CatchImageEnhanced(#GLOBAL_IMAGE_POPUP_EDIT,?popup_edit,"Can't load image.") Procedure CatchImageEnhanced(MARCOAGPINTO_gadget, *Buffer, MARCOA...
- Fri Apr 05, 2024 3:49 pm
- Forum: Bugs - Windows
- Topic: [Done] Sound channel not working properly
- Replies: 10
- Views: 362
Re: Sound channel not working properly
The channel is not linked to the sound, it's allocated dynamically (you can define a max number of channels in InitSound()) Ahh, that's a new feature, never saw this. It is also not visible in the online documentation: InitSound() Does this mean, if I use InitSound(16), I have only 16 channels in t...
- Fri Apr 05, 2024 2:04 pm
- Forum: Bugs - Windows
- Topic: [Done] Sound channel not working properly
- Replies: 10
- Views: 362
- Fri Apr 05, 2024 1:45 pm
- Forum: Bugs - Windows
- Topic: [Done] Sound channel not working properly
- Replies: 10
- Views: 362
Re: Sound channel not working properly
The number of the channel is not a global parameter. Each sound number has his own set of channels in which the sound is played. Therefore, Pure Basic functions like PauseSound need the sound number as well as the channel (and not only the channel). If you play #SND_EARTH_CITY, #SND_CONSTRUCTION_LOW...
- Fri Apr 05, 2024 11:21 am
- Forum: Bugs - Windows
- Topic: [Done] LoadImage crashes on faulty BMP-image
- Replies: 10
- Views: 513
Re: LoadImage crashes on faulty BMP-image
But that mean the compiler should check for 1- Bad format 2- Bad image header magic number 3- No image but image extension(Bad guy idea) And maybe more Not the compiler, but the function LoadImage. Yes of course, that's the task of the function not of the user. Otherwise I have to write my own load...
- Fri Apr 05, 2024 5:50 am
- Forum: Bugs - Windows
- Topic: [Done] LoadImage crashes on faulty BMP-image
- Replies: 10
- Views: 513
Re: LoadImage crashes on faulty BMP-image
No. A language function should never crash, because of incompatible input data. (LoadImage, LoadSound, LoadSprite, etc.)
A language function should return 0 is such cases, but not crash.
It is some kind of security risk.
- Wed Apr 03, 2024 6:10 pm
- Forum: Bugs - Windows
- Topic: [Done] PB 6.10 x86 ASM-backend - IMA at DeleteMapElement() with key
- Replies: 4
- Views: 364
[Done] PB 6.10 x86 ASM-backend - IMA at DeleteMapElement() with key
This code generates an IMA during the call of DeleteMapElement(). This problem only occurs with explicit key definition, only in x86, only in the ASM backend, and only with debugger on. Define NewMap Test.i() Define I.i For I = 1 To 100 AddMapElement(Test(),Str(I)) Next Debug MapSize(Test()) For I =...
- Wed Apr 03, 2024 10:08 am
- Forum: Coding Questions
- Topic: Beginner searching for his learning path
- Replies: 16
- Views: 835
Re: Beginner searching for his learning path
The only problem is.. where the start? So that's where you might be able to help me out! I know nothing about programming at the moment. So any fancy terms you throw at me are wizardry right know :D The goal is to be able to build some simple games at some point, pong would be the ultimate first go...
- Tue Apr 02, 2024 8:07 pm
- Forum: Coding Questions
- Topic: What is the usecase for BeginVectorLayer()/EndVectorLayer()
- Replies: 3
- Views: 192
Re: What is the usecase for BeginVectorLayer()/EndVectorLayer()
I use BeginVectorLayer() when I want to draw a set of overlapping figures in a half transparent way.
Without a layer, the individual figures would also blend each other.
Without a layer, the individual figures would also blend each other.
- Mon Apr 01, 2024 4:43 pm
- Forum: Tricks 'n' Tips
- Topic: Revised Chr() & Asc() for UTF-16 surrogate pairs
- Replies: 20
- Views: 5472
Re: Revised Chr() & Asc() for UTF-16 surrogate pairs
I think your last version is the slowest due to several calls to other procedures. When we talk about speed, than we should avoid division of $400: Procedure.s _Chr(Unicode.i) Protected String.s{2} Protected *Long.Long = @String If Unicode < $10000 *Long\l = Unicode Else Unicode - $10000 *Long\l = ...