• <Helps for GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
        • Compress Function
        • Decompress Function
        • Diagnostics Function
        • Encode Function
        • ErrMsg Function
        • ExecSystem Function (Desktop)
        • ExecSystem Function (Mobile)
        • ExecPFF Function
        • GetProperty Function
        • GetLabel Function
        • GetLanguage Function
        • GetSymbol Function
        • GetValueLabel Function
        • Hash Function
        • HtmlDialog Function
        • InValueSet Function
        • Invoke Function
        • IsChecked Function
        • LoadSetting Function
        • LogText Function
        • MaxValue Function
        • MinValue Function
        • Paradata Function
        • PathConcat Function
        • PathName Function
        • Report Function (Deprecated)
        • SaveSetting Function
        • SetLanguage Function
        • SetProperty Function
        • SetReportData Function (Deprecated)
        • SetValueSet Function
        • SetValueSet Function With Arrays
        • SetValueSets Function
        • Special Function
        • SqlQuery Function
        • Stop Function
        • SysParm Function
        • Tr Function
        • Trace Function
        • UUID Function
        • View Function
        • Warning Function
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
      • Export Attributes
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for CSWeb>

PathName Function

Format
s = pathname(path_type ‖ dictionary_name ‖ file_handler);
Description
The following path_type arguments return the folder name associated with a special directory on your device:
path_typeDescription
ApplicationThe folder where the application file (.ent or .bch) is located.
CSProThe folder where the CSPro executable files are located.
DownloadsThe operating system's directory for storing downloaded files.
HtmlThe folder where CSPro's HTML files are located.
InputFileThe folder where the main data file (associated with the primary dictionary) is located.
TempThe operating system's temporary directory.
There are some options specific to Windows:
path_typeDescription
DesktopThe current user's Desktop folder.
DocumentsThe current user's Documents folder.
ProgramFiles32The folder containing installed 32-bit applications.
ProgramFiles64The folder containing installed 64-bit applications. If the computer has only a 32-bit processor, this returns the same value as ProgramFiles32.
WindowsThe folder contains the Windows operating system.
There are some options specific to mobile devices:
path_typeDescription
CSEntryThe folder from which CSPro applications are run.
CSEntryExternalOn devices with removable storage (e.g., an SD card), the folder on removable storage to which CSPro applications can write.
If supplying a dictionary_name, the function returns the folder name of the dictionary file (.dcf) itself, not of the data file associated with the dictionary. On mobile devices, the function returns the folder name of the .pen file because dictionary files (.dcf) are not used directly when running .pen applications.
If providing a file_handler (declared in a file statement), the function returns the folder name containing the text file associated with the file handler.
Return Value
The function returns a string containing the fully qualified folder name.
Example
setfile(log_file, pathname(Desktop) + "Census Daily Report.txt", create);
See also: Path Namespace, FileName Function