Purebasic returns always a Quad as Color Value. That is a decision Fred made!
But you don't have to use a Quad. If you want, you can use a Long.
I always use Long for Color values.
If you know how a x86/x64 returns values you can see it makes no difference.
on 32Bit x86 the two Registers EAX ...
Search found 327 matches
- Wed Oct 29, 2025 12:01 pm
- Forum: Coding Questions
- Topic: $FF0000FF <> RGBA(255, 0, 0, 255) .... why?
- Replies: 11
- Views: 93
- Wed Oct 29, 2025 11:38 am
- Forum: Coding Questions
- Topic: $FF0000FF <> RGBA(255, 0, 0, 255) .... why?
- Replies: 11
- Views: 93
Re: $FF0000FF <> RGBA(255, 0, 0, 255) .... why?
Q= $FF0000FF ; 4278190335
col= RGBA(255, 0, 0, 255) ; -16776961
Debug Q
Debug col
Q is set directly as quad value -> it's positive
col is converted inside RGBA form a Long to a Quad! That's a difference!
Because PureBasic do not support unsinged long, the long is negative and this negative ...
- Sat Oct 11, 2025 11:10 pm
- Forum: Tricks 'n' Tips
- Topic: Multi-threaded Separable Box Blur
- Replies: 2
- Views: 358
Re: Multi-threaded Separable Box Blur
blure code from wilbert
viewtopic.php?p=543311&hilit=color+adju ... rt#p543311
and here the link to the HueShift discussion with the amazing speed
viewtopic.php?p=607158#p607158
viewtopic.php?p=543311&hilit=color+adju ... rt#p543311
and here the link to the HueShift discussion with the amazing speed
viewtopic.php?p=607158#p607158
- Sat Oct 11, 2025 11:08 pm
- Forum: Tricks 'n' Tips
- Topic: Multi-threaded Separable Box Blur
- Replies: 2
- Views: 358
Re: Multi-threaded Separable Box Blur
Blur is a Matrix operation. The maximum speed you will get with XMM Code.
On modern x64 CPU's this will be extremly fast because of Auto parallelisation, if you use multiple registers.
I guess a 4k Picture needs only ms to process in a single task. Wilbert is the specaialist for such things.
There ...
On modern x64 CPU's this will be extremly fast because of Auto parallelisation, if you use multiple registers.
I guess a 4k Picture needs only ms to process in a single task. Wilbert is the specaialist for such things.
There ...
- Fri Sep 05, 2025 4:22 pm
- Forum: Coding Questions
- Topic: [Solved] #PB_ANY or Gadget creation limitations
- Replies: 5
- Views: 676
Re: [Solved] #PB_ANY or Gadget creation limitations
maybe you explain what is your goal.
Your code looks complicated and it is not the best for debugging.
I'm sure there are more clear solutions for your problem.
Your code looks complicated and it is not the best for debugging.
I'm sure there are more clear solutions for your problem.
- Tue Sep 02, 2025 7:16 pm
- Forum: Coding Questions
- Topic: Temporary Double
- Replies: 12
- Views: 1034
Re: Temporary Double
(In case, please forgive my dumbness :D) What "to statements"? Here your examples always give 0.0 :(
Top
; this 2 lines in the Macro return different values - but should be the same
Macro IIFn(_Expression_, _TruePart_, _FalsePart_)
Bool(Not _Expression_) * _FalsePart_ + Bool(_Expression ...
Top
; this 2 lines in the Macro return different values - but should be the same
Macro IIFn(_Expression_, _TruePart_, _FalsePart_)
Bool(Not _Expression_) * _FalsePart_ + Bool(_Expression ...
- Tue Sep 02, 2025 5:36 pm
- Forum: Bugs - Windows
- Topic: [Done] Bug with Bool operation in PB6.21 ASM and C-Backend
- Replies: 2
- Views: 1135
[Done] Bug with Bool operation in PB6.21 ASM and C-Backend
EnableExplicit
Macro IIFn(_Expression_, _TruePart_, _FalsePart_)
; Bool(Not _Expression_) * _FalsePart_ + Bool(_Expression_) * _TruePart_
Bool(_Expression_) * _TruePart_ + Bool(Not _Expression_) * _FalsePart_
EndMacro
Debug IIFn(1=0, 11.1, 10) ; should be 10, gives 0.0!
Define res.d ...
- Tue Sep 02, 2025 5:12 pm
- Forum: Coding Questions
- Topic: Temporary Double
- Replies: 12
- Views: 1034
Re: Temporary Double
Macro IIFn(_Expression_, _TruePart_, _FalsePart_)
Bool(_Expression_)*_TruePart_ + Bool(Not(_Expression_))*_FalsePart_
EndMacro
Debug IIFn(1=0, 11.1, 10) ; should be 10, gives 0.0!
seems to be a PB-Bug!
If I change the to statements it works
EnableExplicit
Macro IIFn(_Expression_, _TruePart ...
Bool(_Expression_)*_TruePart_ + Bool(Not(_Expression_))*_FalsePart_
EndMacro
Debug IIFn(1=0, 11.1, 10) ; should be 10, gives 0.0!
seems to be a PB-Bug!
If I change the to statements it works
EnableExplicit
Macro IIFn(_Expression_, _TruePart ...
- Mon Sep 01, 2025 8:11 pm
- Forum: Coding Questions
- Topic: Temporary Double
- Replies: 12
- Views: 1034
Re: Temporary Double
here a collection of different IIF Macros
; IIF : similar to the VB IIf Function
; use it : IIf(varReturn, A>1000, "large", "small")
Macro IIF(varReturn, _Expression_, valTrue, valFalse)
If Bool(_Expression_)
varReturn = valTrue
Else
varReturn = valFalse
EndIf
EndMacro
;IIFe ...
; IIF : similar to the VB IIf Function
; use it : IIf(varReturn, A>1000, "large", "small")
Macro IIF(varReturn, _Expression_, valTrue, valFalse)
If Bool(_Expression_)
varReturn = valTrue
Else
varReturn = valFalse
EndIf
EndMacro
;IIFe ...
- Wed Aug 27, 2025 5:44 pm
- Forum: Coding Questions
- Topic: [SOLVED] FindString() with CRLF in the search?
- Replies: 12
- Views: 883
Re: FindString() with CRLF in the search?
The problem seems to be the String you read from the file.k but, I still get zero when I reduce down to search.s = #CRLF$
(again, I am using PB6.20)
Code: Select all
search.s = #CRLF$ + "Word"
txt.s = "blablablablabla" + #CRLF$ + "Word"
p = FindString(txt, search)
Debug p
- Wed Aug 27, 2025 8:58 am
- Forum: The PureBasic Editor
- Topic: [SOLVED] Very slow editor - independent of settings
- Replies: 107
- Views: 52451
Re: [SOLVED] Very slow editor - independent of settings
The Ryzen processor somehow limits the load on the processor. I remember that on Intel, an incorrect loop could load the processor to 100%, so I always had a processor sensor in the tray. While experimenting with the CLCL program, I noticed that the processor was only loaded by 8%. This was strange ...
- Fri Aug 22, 2025 5:12 pm
- Forum: Tricks 'n' Tips
- Topic: Simple toggle trick
- Replies: 19
- Views: 2045
Re: Simple toggle trick
Hi Randy, your code is a good example for don't do that!
Never try to toggle ON/OFF with the binary not! Always use Bool Not.
This is a big differernce.
The binary Not toggles all bits.
The bool Not toggles between #False and #True.
I modified your code to show the Problem.
If I set first t ...
Never try to toggle ON/OFF with the binary not! Always use Bool Not.
This is a big differernce.
The binary Not toggles all bits.
The bool Not toggles between #False and #True.
I modified your code to show the Problem.
If I set first t ...
- Tue Aug 19, 2025 6:11 pm
- Forum: The PureBasic Editor
- Topic: A complete code browser for PureBasic [Windows]
- Replies: 81
- Views: 47548
Re: A complete code browser for PureBasic [Windows]
I downloaded source of V 1.01, Compiling with PB6.21!
There are some issues with the SourceProject File.
Once selected it is nearly not possible to change. I have to Quit first, then it change but not analyze.
Try to analize the PB-IDE Sourcecode. From https://github.com/fantaisie-software ...
There are some issues with the SourceProject File.
Once selected it is nearly not possible to change. I have to Quit first, then it change but not analyze.
Try to analize the PB-IDE Sourcecode. From https://github.com/fantaisie-software ...
- Thu Aug 14, 2025 12:57 pm
- Forum: Coding Questions
- Topic: Best approach to create a syntax reader for a code converter?
- Replies: 15
- Views: 1381
Re: Best approach to create a syntax reader for a code converter?
Try to convert VB6 or Fortran to PureBasic with AI!Huh? There's AI for that!
This will change your mind!
- Thu Aug 14, 2025 12:36 pm
- Forum: Tricks 'n' Tips
- Topic: Advanced Stirng parsing techniques
- Replies: 0
- Views: 945
Advanced Stirng parsing techniques
here I show some advanced String parsing techniques with univeral CharPointer and the use of my Purebasic Extention Module PX.
- Skip Spaces and Tabs
- Find end of an Expression or Word and get the length
- Check next character
Please download the additional PX module here
https://github.com ...
- Skip Spaces and Tabs
- Find end of an Expression or Word and get the length
- Check next character
Please download the additional PX module here
https://github.com ...