Re: Len of path limit for FileSize() [Resolved]
Posted: Tue Jan 02, 2024 9:09 pm
Thanks a lot i'm impressed 
Have a very good year

Have a very good year

http://www.purebasic.com
https://www.purebasic.fr/english/
A toutes fins utile, if needed,Kwai chang caine wrote: How do you know the combination of constants, when you have the value ?
Find out which binary flags are in the number.Kwai chang caine wrote: Tue Jan 02, 2024 8:42 pm How do you know the combination of constants, when you have the value ?
Code: Select all
Procedure GetFlgBin(flg_bin)
Protected i, x ;, length
; length = Len(Bin(flg_bin))
For i = 0 To 64 ; length
If flg_bin >> i & 1
; x = Pow(2, i)
x = 1 << i
If x
Debug x
EndIf
EndIf
Next
EndProcedure
; GetFlgBin(9223372036854775807)
GetFlgBin(20)
⠀⠀⠀⠀⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀compiler wrote:4
16
4
16
Kwai chang caine wrote: Mon Jan 08, 2024 5:52 pm But why there return always two time the result ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Code: Select all
Procedure GetFlgBin(flg_bin)
Protected i
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
#BinLength = 31
CompilerElse
#BinLength = 63
CompilerEndIf
For i = 0 To #BinLength
If flg_bin >> i & 1
Debug 1 << i
EndIf
Next
EndProcedure
GetFlgBin(21)
Code: Select all
Procedure GetFlgBin(flg_bin.q)
Protected i
For i = 0 To 63
If flg_bin >> i & 1
Debug 1 << i
EndIf
Next
EndProcedure
GetFlgBin(21)
Code: Select all
Procedure GetFlgBin(flg_bin.q)
Protected i, x.q
For i = 0 To 63
If flg_bin >> i & 1
x = 1 << i
Debug x
EndIf
Next
EndProcedure
GetFlgBin(21)
Debug "---"
GetFlgBin(9223372036854775807)
Debug Bin(9223372036854775807)
It is an english forum, I racole (recall) to you.