forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Handle Unknon CHARACTER Length

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
viroxa



Joined: 28 Jul 2017
Posts: 77

PostPosted: Mon Aug 14, 2017 12:35 pm    Post subject: How to Handle Unknon CHARACTER Length Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1683
Location: Yateley, Hants, UK

PostPosted: Mon Aug 14, 2017 12:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
viroxa



Joined: 28 Jul 2017
Posts: 77

PostPosted: Mon Aug 14, 2017 3:55 pm    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group