en:docs:fapi:doschdir

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:docs:fapi:doschdir [2018/09/02 03:51] prokusheven:docs:fapi:doschdir [2020/12/07 01:52] prokushev
Line 10: Line 10:
 ==Parameters== ==Parameters==
  
-  *DirName (PSZ) - input : Address of the ASCIIZ directory path name. +  *DirName ([[PSZ]]) - input : Address of the ASCIIZ directory path name. 
-  *Reserved (ULONG) - input : Reserved and must be set to zero.+  *Reserved ([[ULONG]]) - input : Reserved and must be set to zero.
  
 ==Return Code== ==Return Code==
  
-  rc (USHORT) - return+rc ([[USHORT]]) - return
  
 Return code descriptions are: Return code descriptions are:
Line 40: Line 40:
 ==Example Code== ==Example Code==
 ===C Binding=== ===C Binding===
 +<code c>
 +#define INCL_DOSFILEMGR
  
-  #define INCL_DOSFILEMGR +USHORT  rc = DosChDir(DirName, Reserved);
-   +
-  USHORT  rc = DosChDir(DirName, Reserved); +
-   +
-  PSZ              DirName;       /* Directory path name * +
-  ULONG            0;             /* Reserved (must be zero) */ +
-   +
-  USHORT           rc;            /* return code */+
  
 +PSZ              DirName;       /* Directory path name */
 +ULONG            0;             /* Reserved (must be zero) */
 +
 +USHORT           rc;            /* return code */
 +</code>
 This example changes directories to \os2\system.  This example changes directories to \os2\system. 
 +<code c>
 +#define INCL_DOSFILEMGR
  
-  #define INCL_DOSFILEMGR +#define PATH "\\os2\\system" 
-   +#define RESERVED 0L
-  #define PATH "\\os2\\system" +
-  #define RESERVED 0L +
-   +
-  USHORT rc; +
-   +
-     rc = DosChDir(PATH, RESERVED);+
  
 +USHORT rc;
 +
 +rc = DosChDir(PATH, RESERVED);
 +
 +</code>
 ===MASM Binding=== ===MASM Binding===
- +<code asm> 
-  EXTRN  DosChDir:FAR +EXTRN  DosChDir:FAR 
-  INCL_DOSFILEMGR     EQU 1+INCL_DOSFILEMGR     EQU 1
      
-  PUSH@  ASCIIZ  DirName       ;Directory path name string +PUSH@  ASCIIZ  DirName       ;Directory path name string 
-  PUSH   DWORD               ;Reserved (must be zero) +PUSH   DWORD               ;Reserved (must be zero) 
-  CALL   DosChDir+CALL   DosChDir 
 +</code>
  
 Returns WORD Returns WORD