Lỗi variable tlbi is not found trên foxpro

This article briefly describes some of the changes found in Visual FoxPro 3.0 and how to use the new features.

MORE INFORMATION

_SCREEN and activeControl Property

In previous versions of FoxPro, you may have used the FoxPro system variable _CUROBJ to refer to the object that currently had the focus. Although the _CUROBJ variable has been retained for backward compatibility, Microsoft recommends that you now refer to an object or control on a form by using the _SCREEN reference and activeControl property. To return the name of the control that has the focus use this code:

_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.name

      
To 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..setfocus

      
-or-

thisform.activecontrol.name
      
0

-or- [if the form is part of a formset]

thisform.activecontrol.name
      
1 NOTE: is the name of the control you wish to become active.

/N Parameter on the RUN Command

The RUN command is available on the Windows platform only. The RUN command in FoxPro for Windows has a /N parameter that allows you to launch a Windows-based application. In fact, FoxPro for Windows introduced the /N option for executing windows-based applications from FoxPro. This functionality is retained in Visual FoxPro. The following command launches Word for Windows, and opens the readme document.

thisform.activecontrol.name
      
2

The Microsoft Windows Control Panel contains many utilities that you can use in your applications. You can also call these utilities using the RUN command:

thisform.activecontrol.name
      
3

You 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.

thisform.activecontrol.name
      
4

Drives and Directories

Several FoxPro functions can be used to obtain information about drives and directories. Compare the returned values after issuing the command SET DEFAULT TO C:\VFP.

Drive:

thisform.activecontrol.name
      
5

Directories:

thisform.activecontrol.name
      
6

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.

thisform.activecontrol.name
      
7

USE Command

You can run the USE IN 0 command to open a table or .dbf file in the first available work area. This command does not select that work area in which it opened the table or .dbf file. You must use the SELECT command to do this. You can issue the command USE IN to close a table or .dbf file without selecting its work area.

A new SHARED clause for the USE command allows you to open a table or .dbf file for shared use without using the SET EXCLUSIVE command. For more information about the USE command, refer to the USE topic in the Help file.

Cross-Tab Output to Spreadsheets

Genxtab has been replaced by the Fpxtab program and is called from the code created by the Query Wizard. After running the Query Wizard select the Cross-Tab Wizard from the first screen, and follow the instructions to create a table that can then be exported or copied to spreadsheets.

Custom Messages

You can display custom messages in the FoxPro status bar. To do this, type the following in the Command window:

thisform.activecontrol.name
      
8 Where 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.

Preprocessor Directives

Do not use _WINDOWS, _DOS, _MAC, or _UNIX with preprocessor directives [that is,

IF...

ENDIF]. These are designed to be runtime variables. For example the following will NOT work:

thisform.activecontrol.name
      
9

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:

thisformset.thisform.activecontrol.name
      
0

Preprocessor Substitution in Text Strings

In FoxPro 2.6,

define prevented preprocessor substitution in text strings. This has been remedied in Visual FoxPro. The following code will work as expected returning the text 'test' from the function call. In FoxPro 2.x this would have resulted in a 'NOSUB not found error' message. This is because of the way the '[]' characters were evaluated.

thisformset.thisform.activecontrol.name
      
1

Development Tools

The Foxtools.fll file, which is located in your FoxPro for Windows root directory, contains a variety of functions you can use to enhance your applications. Many of these functions provide access to API routines and Microsoft Windows functions. You can view these by using the DISPLAY STATUS command [after you use SET LIBRARY TO foxtools]. Use of the window API routines is also supported through the use of the DECLARE statement.

Chủ Đề