Silverfrost Forums

Welcome to our forums

How to Handle Unknon CHARACTER Length

14 Aug 2017 11:35 #20005

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?

14 Aug 2017 11:50 #20006

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

14 Aug 2017 2:55 #20007

Thanks!

Please login to reply.