ProgramParameter(), max length
ProgramParameter(), max length
When a command parameter has the length of #MAX_PATH (i.e. 259 bytes plus zero-byte) and is enclosed in quote marks, it will be mutilated. Up to 257 bytes is ok.
Maybe the PB internal buffer that receives the command parameter is not large enough to hold the extra quote marks ???
Maybe the PB internal buffer that receives the command parameter is not large enough to hold the extra quote marks ???
Horst.
maw wrote:Ehh? MAX_PATH is 255 chars + ending zero...
Code: Select all
Debug #MAX_PATHPureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

I just tried, but can't see the limit. Can anyone else confirm ?
and paste this as program parameter:
Code: Select all
openconsole()
a$ = programparameter()
printn(a$)
input()
Code: Select all
";11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111aaaaa"Confirmed under Vista SP1.Fred wrote:I just tried, but can't see the limit. Can anyone else confirm ?
The test works with your 329-char long argument...
No limit.
BTW:
Code: Select all
Debug #MAX_PATH
Last edited by Blue on Thu Jun 12, 2008 4:53 pm, edited 1 time in total.
PB Forums : Proof positive that 2 heads (or more...) are better than one 
I am sorry, I just tested again, and found it is a limitation of the Windows shortcut: The Target cannot be longer than #max_path, including the program path and all parameters. This also applies, when you drag&drop a long file name on a shortcut.Fred wrote:I just tried, but can't see the limit. Can anyone else confirm ?
PB seems to handle it correctly.
Sorry
Horst.



