Purpose : The Shell function runs a specified .EXE , .COM , .BAT OR .PIF program.
Syntax :
Shell ( program-name$ [ , mode% ] )
A% = Shell ( " WINWORD.EXE " )
B% = Shell ( " C : \ WORD \ WINWORD.EXE " , 3 )
The Shell function loads an executable file into the windows environment and returns the task ID number that Windows assigns to each tunning program.
the first example loads and runs the program file WINWORD.EXE . it assumes that the file is in the default directory or in a directory specified by the path statement. because the mode is not specified , it uses the default mode of 2 ( minimized with focus )
Shell function constants of then mode% parameter
consant : value : Description
vbHide : 0 : Hides window with focus
vbNormalFocus : 1 : give window focus and restores ti to its original size and position.
vbMinimizedFocus : 2 : Minimizes and gives window focus
vbMaximizedFocus : 3 : Mazimizes and gives window focus
vbNormalNoFocus : 4 : Restores window to its original size and position with-out focus
vbMinimizedNoFocus : 6 : Minimizes window without focus.
Showing posts with label Operating Environment. Show all posts
Showing posts with label Operating Environment. Show all posts
Wednesday, November 3, 2010
Visual Basic Operating Environment Function : Environ, Environ$
Purpose : The Environ and Environ$ function return setting from the operating system's environment table.
Syntax :
Environ ( { entry_name$ | entry-position% } )
Environ$ ( { entry_name$ | entry-position% } )
A$ Environ ( " path " )
A$ Environ ( 1 )
DOS maintains a table of values called environment variables. values in the environment table typically store information abut such things as the current drive and path, the location of the command processor, or special settings needed y various programs.
The Environ and Environ$ functions allow the program to read the current setting of the operating system's environment table . Entries in the environment table are set by using the DOS command syntax SET ENTRY_NAME = ENTRY_VALUE. see a DOS reference manual for more information on the SET command. Environ allows you to specify either the name or position of the entry to be retrieved.
Syntax :
Environ ( { entry_name$ | entry-position% } )
Environ$ ( { entry_name$ | entry-position% } )
A$ Environ ( " path " )
A$ Environ ( 1 )
DOS maintains a table of values called environment variables. values in the environment table typically store information abut such things as the current drive and path, the location of the command processor, or special settings needed y various programs.
The Environ and Environ$ functions allow the program to read the current setting of the operating system's environment table . Entries in the environment table are set by using the DOS command syntax SET ENTRY_NAME = ENTRY_VALUE. see a DOS reference manual for more information on the SET command. Environ allows you to specify either the name or position of the entry to be retrieved.
Labels:
Environ,
Environ$,
Function,
Operating Environment,
Visual Basic
Visual Basic Operating Environment Function : Command
Purpose : The Command and command$ function return a variant or string that contains any Command-line Parameters used when Visual Basic or the Visual Basic environment Program was started.
Syntax :
Command
Command$
Command
Command$
Params$ = Command$
in this example stores command-line parameters for the current program into the string Params$. these functions return any test that followed the CMD parameter on the command line. the string returned by the visual basic environment can be modified by choosing properties from the project menu. When used with a Visual Basic program , Command$ returns any text that followed the executable filename on the command line.
Labels:
Command,
Command$,
Function,
Operating Environment,
Visual Basic
Monday, November 1, 2010
Visual Basic Operating Environment Statement : Beep
Purpose : The Beep statement causes the computer's speaker to produce a short tone.
Syntax :
Beep
Beep
If ErrorNumber% > 0 Then Beep
The example beeps the speaker if the variable ErrorNumber is set. The Beep statement causes the computer to send a short tone to the speaker. you can control neither the tone not the duration; however, issuing several beep command consecutively can create the effect of a longer beep.
The example beeps the speaker if the variable ErrorNumber is set. The Beep statement causes the computer to send a short tone to the speaker. you can control neither the tone not the duration; however, issuing several beep command consecutively can create the effect of a longer beep.
Labels:
Beep,
Operating Environment,
Statement,
Visual Basic
Visual Basic Operating Environment Statement : AppActivate
Purpose : The AppActivate statement activates a running Windows program and gives it the Current focus. It does not change the window State property (minimized or maximized) Of the program.
Syntax :
AppActivate ProgramTitle$ [, wait]
AppActivate ProgramTitle$ [, wait]
AppActivate “ paintbrush - ( Untitled ) “
AppActivate “ paintbrush-( untitled )” , True
AppActivate “ paintbrush-( untitled )” , True
The first example gives the paintbrush application the focus, assuming that it is already running and has no file loaded.
The second example works the same as the first example , except that it waits until the calling application has the focus.
The second example works the same as the first example , except that it waits until the calling application has the focus.
Labels:
AppActivate,
Operating Environment,
Statement,
Visual Basic
Subscribe to:
Posts (Atom)