Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'RUN' and '?'
Message
De
19/08/2001 21:29:13
 
 
À
16/07/2001 09:22:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00530937
Message ID:
00546018
Vues:
16
>>It depends on what process do you run in DOS.
>>Perhaps you may use options like '\pause', or redirect the DOS output to the file and then display the content.
>
>The following sample program replicates my troubles. Note that if you add one more line ("?"), the first line will scroll of the screen.
>
>
>clear
>? "Line 1"
>? "Line 2"
>run del hopefullynonexistentfile.ext
^^^^^^^^ you're running a DOS internal comand; it won't work since there's no 
DEL.COM, DEL.EXE or DEL.BAT to execute; in most versions of the Win32 O/S, you need
the syntax:

RUN command /c del jrandomfile.ext

In addition, if you're smart, you redirect the output of the command processor
to a file and display the file after completion, or you instance a console
Window (see my FAQ entry on writing to a console and using STDIN, STDOUT and
STDERR in the VFP context - a DOS command will run in the context of an active
Windows console owned by the parent thread (much easier to manage if you use
CreateProcess() to manage the creation of the app instance, as would be the
case using API_APPRUN() to launch the application; you can alter a flag in
the call to CreateProcess() to force the child process to inherit the console
context of the parent application) or redirect specific STD I/O device assignments
to an existing stream which the parent app owns a handle to with the
DuplicateHandle privilege on the handle (as is the case for most handles in Win9x or situations in NT/2K where the default security context is used to
create the handle.)

>? "Line 3"
>
>
>Hilmar.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform