Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>run/!</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
RUN/!


Syntax:     RUN/! <DOS command>/(<expC>)

Purpose:    To execute a DOS command or program from within a compiled
            application.

Argument:   <DOS command> is any executable program including
            resident DOS commands and COMMAND.COM.

Usage:      When you RUN a DOS program, Clipper executes another copy of
            COMMAND.COM passing the DOS command to run at the same
            time.  This has two implications.  First, you must have
            enough memory for COMMAND.COM (27K for DOS 3.2) and the
            program you wish to execute.  Second, COMMAND.COM must be
            available on the path specified by COMSPEC (the default is
            the root directory of the disk where you boot DOS).  If
            COMMAND.COM is not located on this disk or the disk is
            changed, SET COMSPEC to the new location prior to running
            the Clipper application.  Note that SET DEFAULT and SET PATH
            have no effect on RUN.

            Memory resident programs: You should not RUN memory
            resident programs from within Clipper since you may lose
            memory when the application terminates.

            DOS Access: One of the options you may want to give your
            users is direct access to DOS.  You can do this with the
            command:

               RUN COMMAND

            If you use this technique, you may also want to change the
            DOS prompt in order to give instructions on how to return to
            the application program.  To set this up, create a batch
            file to set the DOS access prompt, load the application
            program, and restore the DOS prompt after the application
            program terminates as follows:

               echo off
               prompt Dir: $p$_Type EXIT to return.$_$g
               <your application program>
               prompt $p$g

            Then instruct the user to execute the batch file in place of
            the application .EXE file.

Library:    CLIPPER.LIB


----------------------------------- Example --------------------------------

   The following example demonstrates how you can use RUN in combination
   with MEMOREAD() and MEMOWRIT() to create a user-defined function that
   calls your editor with the current memo field:

   * Main.prg
   success = EditorMemo("NE +", "Notes")


   FUNCTION EditorMemo
   PARAMETERS editor, memofld

   IF MEMOWRIT("Clipedit.tmp", &memofld.)
      RUN (editor + " Clipedit.tmp")
      REPLACE &memofld. WITH MEMOREAD("Clipedit.tmp")
      RETURN 0
   ELSE
      RETURN -1
   ENDIF

   EditorMemo() returns -1 if there is an error and zero if it is
   successful.


See Also: INDEX PACK SET INDEX SET UNIQUE USE

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson