Len of path limit for FileSize() [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Len of path limit for FileSize() [Resolved]

Post by Kwai chang caine »

Thanks a lot i'm impressed :shock:
Have a very good year 8)
ImageThe happiness is a road...
Not a destination
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Len of path limit for FileSize() [Resolved]

Post by boddhi »

Hi KCC,
Kwai chang caine wrote: How do you know the combination of constants, when you have the value ?
A toutes fins utile, if needed,

A link to a tool (which can be used either on its own or as a custom PB tool) listing all the constants integrated into PB.

Image

This was an adaptation of code originally created by Gnozal. Fully fonctional under W10 x64. Not tested under others OS.
I can no longer find the original souce. :(
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
AZJIO
Addict
Addict
Posts: 2155
Joined: Sun May 14, 2017 1:48 am

Re: Len of path limit for FileSize() [Resolved]

Post by AZJIO »

Kwai chang caine wrote: Tue Jan 02, 2024 8:42 pm How do you know the combination of constants, when you have the value ?
Find out which binary flags are in the number.

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)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Len of path limit for FileSize() [Resolved]

Post by Kwai chang caine »

Hello BODDHI
Thanks for this tool of the great GNOZAL who we miss :|
I have put it in the root folder of my 5.73 x86 and that works 8)
After ...it is not really sample to use for me, but it's can be usefull when even :wink:

Hello AZJIO
Thanks a lot for this hieroglyphal
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢰⣾⣝⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⢀⣽⠿⠙⢳⡝⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⣀⣿⣾⢃⣤⡄⠨⢦⡙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠏⠀⠀⠀⣜⣿⡟⣻⣿⡍⢀⠀⠉⡍⢠⡙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⣼⣿⣿⣟⣿⣿⣷⣿⣤⣄⡄⠀⠈⠢⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⡟⢿⣿⣿⣾⣧⡄⠤⠀⠀⠉⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⢀⣾⣿⣿⡟⣟⣌⣿⣇⣱⣶⣿⣿⣿⡿⠻⠀⠄⢀⠠⡄⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⡜⣠⡌⢀⣤⠀⠉⢈⡉⢩⣧⣼⣿⣿⡿⠂⠶⠀⠀⠑⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⣤⣥⣼⠾⠃⠮⠀⠉⠈⠿⣟⣻⢿⣿⢋⣄⠛⠗⢘⠃⠁⢂⠐⠈⠃⠀⠉⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠛⠛⡿⠿⠛⠻⠿⠿⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠀⢀⣼⡿⠿⠟⠦⠀⠀⢈⡀⢤⡿⠾⣟⣻⣶⣶⣶⣚⡀⠀⣤⣤⣛⡁⡌⠀⠀⠀⠀⠈⠻⠿⠟⠛⠿⠿⠿⠿⠿⠿⠿⣿⣿⣿⣿
⠾⠉⠁⠈⠉⠛⠿⠿⠟⠀⠀⠀⢀⡴⠆⠀⠀⠀⠀⡌⢧⠽⡶⠆⠁⢀⡒⠛⢳⣿⣷⢦⣭⢿⣿⣯⣷⣯⣳⣿⣿⣿⣭⣿⣉⣲⡀⠀⠦⠈⠷⠌⠓⢒⣛⠓⠛⢷⣷⠔⠂⠈⠹⠷⠀
⣤⣄⣀⣘⣓⣒⣂⣀⣀⣋⡁⠐⠋⢀⡀⠀⠀⠀⠞⢁⣐⠆⣁⣀⣭⣤⡤⣴⣿⣋⣉⣈⣉⣀⣀⡀⠀⢉⣀⡈⠉⣋⣁⣀⣠⣀⣤⣤⣄⣀⣀⣉⣀⣀⣁⣀⣤⣤⣤⡤⣤⠤⠶⣤⡀
⣿⡻⡿⠏⠛⣦⢯⣽⣭⣽⣿⣿⣿⣿⣿⣶⣶⣤⣦⣿⣿⣽⣿⣧⣦⣬⣥⣼⣿⣿⣿⣯⣯⣭⣟⣁⣐⣛⡛⠓⠉⣉⡛⠫⠿⢿⡶⠤⣶⠾⢿⣿⣿⣿⡛⠿⢿⡿⣿⠇⠀⢤⣤⢖⡃
⢿⣿⣿⣿⣿⣛⣻⣿⣿⣿⣿⣿⣿⡿⢿⣿⡋⡋⠸⡿⠛⠛⠿⣿⠙⠛⢛⣩⠉⠛⠻⠉⠉⢹⠖⠻⠿⢿⣻⠙⢛⣛⠋⣙⣻⣭⣥⣦⣤⣤⣦⣤⣄⣴⣬⣫⣀⣁⣀⢀⡊⠠⣮⣿⣿
⣸⣿⣿⣷⣿⣿⣿⣯⣭⣿⣿⣿⣍⡶⣶⣴⣾⠿⠛⣆⣀⢾⡓⠄⠰⢶⣤⣦⣝⣿⣶⣶⣿⣦⣀⢽⡆⠘⠭⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠋⠒⠛⠛⠛⠛⠓⠛⠛⠛⠛⠒⠚⠛⠛⠛⠛⠛⠛⠛⠛⠋⠙⠓⠛⠛⠛⠛⠛⠛⠛⠛⠓⠛⠛⠛⠛⠚⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛
source :shock:

But why there return always two time the result :wink:
compiler wrote:4
16
4
16
⠀⠀⠀⠀⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
ImageThe happiness is a road...
Not a destination
AZJIO
Addict
Addict
Posts: 2155
Joined: Sun May 14, 2017 1:48 am

Re: Len of path limit for FileSize() [Resolved]

Post by AZJIO »

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)
Or flg_bin.q

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)
Mesa
Enthusiast
Enthusiast
Posts: 433
Joined: Fri Feb 24, 2012 10:19 am

Re: Len of path limit for FileSize() [Resolved]

Post by Mesa »

To be compatible with x86, we need another quad like that:

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)
M.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Len of path limit for FileSize() [Resolved]

Post by Kwai chang caine »

Thank you very much AZJIO and MESA for your precious usefull codes that I will keep preciously 8)
ImageThe happiness is a road...
Not a destination
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Len of path limit for FileSize() [Resolved]

Post by Denis »

Salut KCC,
Since the subject is interesting, can you create a module and share it? :mrgreen:

I get trouble with long Path and not only with PB. :(
A+
Denis
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Len of path limit for FileSize() [Resolved]

Post by Kwai chang caine »

Hello "Denaille" :mrgreen:
Happy to talk to you since this long time :wink:

I have not understand, you want a module of what ? :shock:
ImageThe happiness is a road...
Not a destination
Olli
Addict
Addict
Posts: 1219
Joined: Wed May 27, 2020 12:26 pm

Re: Len of path limit for FileSize() [Resolved]

Post by Olli »

Kwai chang caine wrote: Fri Jan 12, 2024 8:51 pm Hello "Denaille"
It is an english forum, I racole (recall) to you.

Also "denaille" is not an english word. I must so tell to everybody who are fed up to the french expressions, to the french vocabulary, to the french grammar, and, over everything, to the mistakes the frenches as I, make in every english sentence they try to write, I must so tell to them who are fed up to that, that "Denaille" is also a word who does not exist in french. It is a phonetic and familiar expression, you would have to write as this :

<< Hello Deny >>

Good new year to you too, Denis. Good new year to you Kcc, and good new year to everybody who share peacefully their logical knowledge.
Post Reply