Article ID: 141868
Article Last Modified on 12/1/2003
_SCREEN.activeform.activecontrol.name
-or-
thisform.activecontrol.name
-or- (if the form is part of a formset)
thisformset.thisform.activecontrol.name
To return the name of the current control, use this code:
CurControl=_SCREEN.activeform.activecontrol.name or
-or-
CurControl=thisform.activecontrol.name
-or- (if the form is part of a formset)
thisformset.CurControl=thisform.activecontrol.nameTo set the caption of the current control, use this code:
_SCREEN.activeform.activecontrol.caption="my caption"
-or-
thisform.activecontrol.caption="my caption"
-or- (if the form is part of a formset)
thisformset.thisform.activecontrol.caption="my caption"To move the cursor to a control, use this code:
_screen.activeform.<controlname>.setfocus
-or-
thisform.<controlname>.setfocus
-or- (if the form is part of a formset)
thisformset.thisform.<controlname>.setfocusNOTE: <controlname> is the name of the control you wish to become active.
RUN /N <drive><path>WINWORD.EXE README.DOCThe Microsoft Windows Control Panel contains many utilities that you can use in your applications. You can also call these utilities using the RUN command:
RUN /N CONTROL COLOR RUN /N CONTROL PRINTERS RUN /N CONTROL DESKTOPYou can include an optional numeric value immediately after /N to specify how the Windows-based application is opened. Do not include any spaces between /N and the numeric value. The following table lists the numeric value you can include and describes the state of the Windows-based application when opened.
Value Application attributes ------------------------------------------------ 1 Active and normal size 2 Active and minimized 3 Active and maximized 4 Inactive and normal (won't work with Windows 95) 7 Inactive and minimized
SYS(5) returns C:
SET('DEFAULT') returns C:
Directories:
CURDIR()returns \VFP\
SYS(2003) returns \VFP
FULL(SET('DEFA')) returns C:\VFP\
You can also use the ADIR() function to see if a specific directory exists.
The following example returns 0 only if the path name does not exist.
Remember that the path to a network server may not exist if the network
connection is broken.
? ADIR(temparr,'C:\VFP\*.*','D')
returns 0
SET TALK OFF SET MESSAGE TO <expC>Where <expC> is the message. (You can pass a null string to display nothing.) SET MESSAGE TO without a parameter will restore the status bar to its normal functionality.
#define _DOS .t.
#define _WINDOWS .f.
* For code compiled in MS-DOS, the following would not work:
DO CASE
CASE _DOS
? "Running in MS-DOS"
CASE _WINDOWS
? "Running in Windows"
ENDCASE
This code would not work because _DOS would be changed to .T. and _WINDOWS
would be changed to .F. so that the code could never work properly again.
Instead use the following:
#if "Win" $ VERS() #define WINDOWS_CODE .t. #elif "Mac" $ VERS() #define MAC_CODE .t. #elif "Unix" $ VERS() #define UNIX_CODE .t. #else #define DOS_CODE .t. #ENDIF #if WINDOWS_CODE ? "Compiled under WINDOWS" #elif DOS_CODE ? "Compiled under MS-DOS" #ENDIF
#DEFINE nosub 1 DECLARE an_array(3) an_array(nosub)='test' ? afunc[an_array[nosub]] FUNCTION afunc PARAMETER x RETURN x
Keywords: KB141868