View previous topic :: View next topic |
Author |
Message |
viroxa
Joined: 28 Jul 2017 Posts: 78
|
Posted: Mon Aug 14, 2017 12:35 pm Post subject: How to Handle Unknon CHARACTER Length |
|
|
Hello, everyone,
I want to assign a filepath to a variable. I don't know the length of the string beforehand, but (LEN=*) is only allowed for dummy arguments or functions.
Therefore my approach now is to use (LEN=100).
Is there another way? |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Mon Aug 14, 2017 12:50 pm Post subject: |
|
|
If I was you I'd use 260. Why?
https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247(v=vs.85).aspx
from which I extract:
Maximum Path Length Limitation
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
Eddie |
|
Back to top |
|
|
viroxa
Joined: 28 Jul 2017 Posts: 78
|
Posted: Mon Aug 14, 2017 3:55 pm Post subject: |
|
|
Thanks! |
|
Back to top |
|
|
|