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.
Search found 323 matches
- Fri Sep 05, 2025 4:22 pm
- Forum: Coding Questions
- Topic: [Solved] #PB_ANY or Gadget creation limitations
- Replies: 5
- Views: 484
- Tue Sep 02, 2025 7:16 pm
- Forum: Coding Questions
- Topic: Temporary Double
- Replies: 12
- Views: 795
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: 531
[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: 795
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: 795
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: 736
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: 44710
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: 1417
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: 41517
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: 12
- Views: 689
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: 587
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 ...
- Thu Aug 14, 2025 9:54 am
- Forum: Coding Questions
- Topic: Best approach to create a syntax reader for a code converter?
- Replies: 12
- Views: 689
Re: Best approach to create a syntax reader for a code converter?
Basically you need to write a compiler, since you don't just parse the syntax, you also need to split it into code sections. I think it's better to use character by character reading for the syntax parser, so you can easily modify the parser behavior during the reading process.
You need to do what ...
You need to do what ...
- Wed Aug 13, 2025 9:44 am
- Forum: Coding Questions
- Topic: Best approach to create a syntax reader for a code converter?
- Replies: 12
- Views: 689
Re: Best approach to create a syntax reader for a code converter?
Here the Link to the Project Oberon Book form Niklaus Wirth, Jürgen Gutknecht of ETH Zuerich.
https://people.inf.ethz.ch/wirth/ProjectOberon1992.pdf
The compiler description with Code start at page 266 (12. The Compiler)
https://people.inf.ethz.ch/wirth/ProjectOberon1992.pdf
The compiler description with Code start at page 266 (12. The Compiler)
- Wed Aug 13, 2025 9:15 am
- Forum: Coding Questions
- Topic: Best approach to create a syntax reader for a code converter?
- Replies: 12
- Views: 689
Re: Best approach to create a syntax reader for a code converter?
My question is: what do you think is the most efficient approach for this kind of parsing?
Regex – fast for simple patterns but can become messy with more complex syntax.
Lexer + Parser – reading character by character, generating tokens, and then interpreting them via syntax analysis.
AST ...
Regex – fast for simple patterns but can become messy with more complex syntax.
Lexer + Parser – reading character by character, generating tokens, and then interpreting them via syntax analysis.
AST ...
- Tue Aug 12, 2025 6:16 pm
- Forum: Tricks 'n' Tips
- Topic: SplitString to list or array with option double-quotes (CSV)
- Replies: 19
- Views: 8208
Re: SplitString to list or array with option double-quotes (CSV)
here is my Version of SplitStringArray and SplitStringList inspired by mk-soft version with DQuote.
I post it here, because I used a different way of implementation.
It supports Multicharacter Separator with DQuote at a very high speed.
I used a few special tricks to get this done.
- Prototype the ...
I post it here, because I used a different way of implementation.
It supports Multicharacter Separator with DQuote at a very high speed.
I used a few special tricks to get this done.
- Prototype the ...