Code: Select all
Debug #PB_Button_Toggle ; return 4099 not 4096
Debug #PB_ComboBox_Editable ; return 66 not 64
Code: Select all
Debug #PB_Button_Toggle ; return 4099 not 4096
Debug #PB_ComboBox_Editable ; return 66 not 64
Why should they have only one set bit? Probably these constants are itself combinations of multiple OS specific constants.mestnyi wrote: Mon Nov 04, 2024 9:20 pm Aren't these bit constants?Code: Select all
Debug #PB_Button_Toggle ; return 4099 not 4096 Debug #PB_ComboBox_Editable ; return 66 not 64
Code: Select all
;/
;| FileSize() results as constants
;\
#PB_FileSize_Empty = 0
#PB_FileSize_Missing = -1
#PB_FileSize_Directory = -2
Something like this would be absolutely amazing, for the first three years of me using PB I had to go check what the return value was for missing file vs directory every time I wanted to use this functionAxolotl wrote: Tue Nov 05, 2024 3:32 pm Yes, I would support that.
BTW: I use this for a (very) long time now!? Just a cautious suggestion.Code: Select all
;/ ;| FileSize() results as constants ;\ #PB_FileSize_Empty = 0 #PB_FileSize_Missing = -1 #PB_FileSize_Directory = -2
I agree with you, but I'm working on a GUI to replace the standard one for all three axes, and it was almost ready until my hard drive burned down, I had to rewrite it again, so I'm directly connected with both hands.Fred wrote: Tue Nov 05, 2024 10:41 am BarryG is right, you should never rely on the constant value as it can change anytime between releases.
You can use Macros:Quin wrote: Tue Nov 05, 2024 4:52 pm Something like this would be absolutely amazing, for the first three years of me using PB I had to go check what the return value was for missing file vs directory every time I wanted to use this function![]()
Code: Select all
Macro ExistFile (_entry_)
Bool(FileSize(_entry_) > -1)
EndMacro
Macro ExistDirectory (_entry_)
Bool(FileSize(_entry_) = -2)
EndMacro
Or using the proposed constants:Little John wrote: Wed Nov 06, 2024 6:53 amYou can use Macros:Quin wrote: Tue Nov 05, 2024 4:52 pm Something like this would be absolutely amazing, for the first three years of me using PB I had to go check what the return value was for missing file vs directory every time I wanted to use this function![]()
Code: Select all
Macro ExistFile (_entry_) Bool(FileSize(_entry_) > -1) EndMacro Macro ExistDirectory (_entry_) Bool(FileSize(_entry_) = -2) EndMacro
Code: Select all
Macro ExistFile (_entry_)
Bool(FileSize(_entry_) >= #PB_FileSize_Empty)
EndMacro
Macro ExistDirectory (_entry_)
Bool(FileSize(_entry_) = #PB_FileSize_Directory)
EndMacro