Article ID: 113812
Article Last Modified on 6/29/2004
SET DEFAULT TO C:\<FoxPro directory>\TUTORIAL
USE SALESMAN
DISPLAY STRUCTURE
Note that the database contains a character field called CITY.
CREATE MENU CHGPAD\<"+alltrim(city)+"
MODIFY COMMAND CHGPAD.MPR
Look for the following DEFINE PAD statement in the code:
DEFINE PAD CityPad OF _MSYSMENU PROMPT "\<"+alltrim(city)+"" ;
COLOR SCHEME 3
Note that the item entered in the Prompt box during menu design
(\<"+alltrim(city)+") was inserted in the menu code. The two quotation
marks you typed in were needed to close off the two quotation marks
automatically inserted by the Menu Builder. This results in the
concatenation of CITY as a field, not as the word "CITY".
SET DEFAULT TO C:\<FoxPro directory>\TUTORIAL
USE SALESMAN
GO TOP && Go to 1st record
DO CHGPAD.MPR && Display CHGPAD menu with 1st record's city
WAIT WINDOW "The menu pad shows the first record's city...press ;
the SPACEBAR"
SKIP && Go to 2nd record; redefine pad for its city
DEFINE PAD CityPad OF _MSYSMENU PROMPT "\<"+alltrim(city)+"" ;
COLOR SCHEME 3
WAIT WINDOW "The menu pad shows the next record's city...press ;
the SPACEBAR"
SET SYSMENU TO DEFAULT && Restore system menu
DO CHGPAD
SET DEFAULT TO C:\VFP\SAMPLES\DATA
USE EMPLOYEE
DISPLAY STRUCTURE
Note that the database contains a character field called CITY.
CREATE MENU CHGPAD\<"+alltrim(city)+"
MODIFY COMMAND CHGPAD.MPR
Look for the following DEFINE PAD statement in the code:
DEFINE PAD CityPad OF _MSYSMENU PROMPT "\<"+alltrim(city)+"" ;
COLOR SCHEME 3
Note that the item entered in the Prompt box during menu design
(\<"+alltrim(city)+") was inserted in the menu code. The two quotation
marks you typed in were needed to close off the two quotation marks
automatically inserted by the Menu Builder. This results in the
concatenation of CITY as a field, not as the word "CITY".
SET DEFAULT TO C:\VFP\SAMPLES\DATA
USE EMPLOYEE
GO TOP && Go to 1st record
DO CHGPAD.MPR && Display CHGPAD menu with 1st record's city
WAIT WINDOW "The menu pad shows the first record's city...press ;
the SPACEBAR"
SKIP && Go to 2nd record; redefine pad for its city
DEFINE PAD CityPad OF _MSYSMENU PROMPT "\<"+alltrim(city)+"" ;
COLOR SCHEME 3
WAIT WINDOW "The menu pad shows the next record's city...press ;
the SPACEBAR"
SET SYSMENU TO DEFAULT && Restore system menu
DO CHGPADKeywords: kbhowto kbcode kbbuilder KB113812