PcToday = '' & Button to set the date to TODAY() PcYear = '' & Button for changing the year PcMonth = '' & Button for changing the month * Initialize Button Values for use in Valid PcDate = ALLTRIM(CMONTH(pdDate)) + ' ' +
Foxpro 2.6 dbconnect update#
* Update the date displayed at the top of the screen
![foxpro 2.6 dbconnect foxpro 2.6 dbconnect](https://www.dbsofts.com/articles/images/vfp_source.png)
* Set the default value here if it is not WAIT WINDOW "Parameter is the wrong type" TIMEOUT 5 WAIT WINDOW "Wrong number of parameters sent" TIMEOUT 5 * In this implementation of the code, a date parameter All parameters must be in #SECTION 1 in the setup code. Any parameters and private variables used in the screen are also set up here.
![foxpro 2.6 dbconnect foxpro 2.6 dbconnect](https://www.mssqltips.com/tipImages/1470_4_SQL.jpg)
This is where the 3-D effects are set up. In each of the invisible buttons, the When clause calls UpdateDate() and the valid calls ValPress().įigure 2 shows the calendar screen at design time. Another six by seven array (paButton) maps each invisible button on top of the output objects. The are set to refresh, so the month can be changed.ĭate selection is done using invisible buttons. An array (taDate) dimensioned as six rows and seven columns for the days of any month in the year. The dates are displayed using an output field with a field format of "Z 99". The calendar screen is named SCDATE in the layout dialog, and is referenced in the cleanup code. The file can be built into the application or be in the path.
![foxpro 2.6 dbconnect foxpro 2.6 dbconnect](https://images-na.ssl-images-amazon.com/images/I/41x1oEUqgqL._SY291_BO1,204,203,200_QL40_ML2_.jpg)
The file 3DBOX.PRG must be added to any project that calls this screen. (I keep my copy in the FPW26 directory.) To make it all work, add the following line to your CONFIG.FPW file:
Foxpro 2.6 dbconnect driver#
GENSCRENX.PRG needs to be on the FoxPro path, as does the 3-D driver and 3D.prg. (See Ken Levy's article "Screen Builder" in the September 1993 issue and Cal Evans' article "The X Files" in the October 1995 issue for more information on GENSCRNX.). Three public domain, third-party programs are used in this screen to achieve the desired look: Ken Levy's GENDSCRNX and 3-D driver and Bill Anderson's 3DBOX.prg.
Foxpro 2.6 dbconnect code#
There are functions in the cleanup code that update and display the dates, generate days in the correct positions for the month and year, and set the cursor to the correct day in the month. The and invisible buttons are mapped to arrays using row and column positions, making it easy to reference any particular object. This screen (figure 1) has six rows and seven columns of with invisible buttons mapped on top. Also, I have used GENSCRNX with a 3-D driver to give the screen a more pleasing appearance. I don't see any problems creating the same screen in VFP in fact, many features can be added, making the screen even better than in FoxPro 2.6. I still do a lot of FoxPro 2.6 development, so this screen has been constructed in FoxPro 2.6. (In FoxPro's Calendar/Diary screen, you can exit the screen with a CTRL-W or CTRL-F4 and the last selection is put into the variable _DIARYDATE.) I created a calendar program in FoxPro that has the features of the Office 97 calendar, and more. Unlike the calendar in FoxPro, however, the calendar in Office 97 closes upon date selection. Dates in Office 97 have a combo box button that brings up a calendar, much like the calendar built into FoxPro. I've just begun using Office 97 and noticed that the dates work differently than what I have been used to in FoxPro. Create a Better Calendar for FoxPro 2.6 Create a Better Calendar for FoxPro 2.6 Build a pop-up calendar like the one in Office 97.