How to get 'Start in' directory path

Hi,

My attachment files polling to the ‘Target directory’ as a normal practice. But i wanted to poll into ‘Start in’ directory path. Hence i would need to locate/find the ‘Start in’ directory path. Your suggestions would be much appropriated in advance. Thanks

You can get the current directory at anytime using LONGPATH() or PATH()
So call either of those before you change directories to get the start in path.

On a semi related subject:
You can call COMMAND(‘0’) to get the path of the program that’s running.
( note: that’s a zero )

Help[ Command ]
“…
A flag of ‘0’ returns the minimum path the operating system used to find the command.
…”

Thanks Mark. COMMAND(‘0’) returns Path of the Target folder with file.exe . I am looking for Start in:
Still exploring…

image

Mark did say this. Use LONGPATH() as soon as your program starts and the current path will be the “Start In” path.

Sorry, i was looking for ‘Start in’ path for ‘Data set’ where the ‘Target’ dir path is different from ‘Start in’ dir path. Thanks

Hi,

I’m not sure to understand what you are looking for, but it looks like you’re trying to read the data from the shortcut (right click on the program icon placed on the desktop, then click on properties)

These shortcuts are .lnk files, I’m not sure we can open them easily and read their content…
the program does not know nothing about the shortcut, it is the shorcut which knows where the program is located and where (in which directory) it should start.

From another point, we can tell our Clarion programs where the data is located using the SYSTEM{Prop:DataPath} property.

From the help file

PROP:DataPath

A read/write SYSTEM property that can be used to set the default directory for data files.

All files with unqualified file names (e.g., those files with no NAME attribute or a NAME with only a relative path) will be looked for in the directory specified by SYSTEM{PROP:DataPath}.

SYSTEM{PROP:DataPath} defaults to the directory the application starts in. This will save developers from having to do startup code like the following:

GETINI(datadirectory)
file1name = datadirectory & ‘file1’
file2name = datadirectory & ‘file2’
file3name = datadirectory & ‘file3’

Is this what you’re after …
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcurrentdirectory