All of the work in this project is my own!  I have not left copies of my code in public folders on university computers. I have not given any of this project to others. I will not give any portion of this project to others taking this class. I realize that the penalty for turning in work that is not my own can range from an "F" in the class to dismissal from Trinity University. 

                                                                                             Print Name  __________________________

                                                                                              Signature   __________________________
 


 

Visual FoxPro Lab C
 
20 Points
Individual Assignment


Set Netscape Margins [ Left = 1; Right = .2; To p= .6; Bottom = .6; Select Document Title, Location,  Page Number, Page Total Black Text l]


Answer all of the following without using the Mouse/Menu Options!

1] How do you get information about the wait command from the on-line help system? _________________

2] How can you add a logical field, called CHECKEDOUT, to the open video database? Be specific. List all of the steps. _________________________________________________________________________

____________________________________________________________________________________

3] ____________ (T/F) The modify structure command can be used to add new fields the database open in the current work area.

4] ____________ (T/F) The modify structure command can be used to add new fields the database open in the current work area.

5] ____________ (T/F) The modify structure command can be used to delete fields from the database open in the current work area.

6] ____________ (T/F) The modify structure command can be used to change the datatype of fields of the database open in the current work area.

7] ____________ (T/F) The modify structure command can be used to change the size of fields of the database open in the current work area.

8] ____________ (T/F) The FoxPro database system can automatically adjust the database record sizes, types, and fields after modify structure.

9] How can you create a system type window in the top right corner of the screen, that says "Waiting", that will delay processing until you hit any key? ________________________________________________

10] How can you create a system type window in the top right corner of the screen, that says "Waiting Again", that will delay processing until either (1) you hit any key, (b) you depress the mouse, or (3) 15 seconds passes? _____________________________________________________________________________

11] Program files have ___________ extensions.

12] Database files have ___________ extensions.

13] __________ (T/F) Modify Command ListComedy can be used to open a file, called ListComedy.PRG if it exists.

14] __________ (T/F) Modify Command ListComedy will create a file, called ListComedy.PRG if it does not exist.

15] How can you create a program file, called ListHorror.PRG. __________________________________

16] How can you create a program file, called ListName.PRG. ___________________________________

17] How can execute (run) a program file, called ListHorror.PRG. _______________________________

18] How can execute (run) a program file, called ListName.PRG. ________________________________

19] __________ (T/F) A series of commands, that could be entered one at a time from the command window, can be placed in a program file and run by entering one do command in the command window.

20] Write the code for a program file, called ListHorror.PRG, that does the following

(1) clears the screen, (2) displays the name, no, and no_min of all of the horror films with a delay, (3) waits until the user is ready to quit, and (4) re-clears the screen again.

_______________________________________________________

_______________________________________________________

_______________________________________________________

_______________________________________________________

21] Write the code for a program file, called ListName.PRG, that does the following

(1) clears the screen, (2) displays the name, no, rating, and no_min of all of the films with a delay, (3) waits 15 seconds or until the user responds and (4) re-clears the screen again.

_______________________________________________________

_______________________________________________________

_______________________________________________________

_______________________________________________________

22] __________ (T/F) When a window is defined, it immediately appears on the desktop.

23] How can you define a window, called HorrorWin, that takes up almost all of the screen (center it).

____________________________________________________________________________________

24] How can you get HorrorWin to be the current window on the desktop?

____________________________________________________________________________________

25] How can you define a window, called NameWin, that takes up almost all of the screen (center it). Make sure that Name Listing appears in the title bar of the window.

____________________________________________________________________________________

26] How can you get NameWin to be the current window on the desktop?

____________________________________________________________________________________

27] How can you get HorrorWin to go away? _________________________________________________

28] How can you get NameWin to go away? __________________________________________________

29] How can you get all defined open windows to go away? _____________________________________

30] Your objective is to write a module, called TriWin, that will draw the three concentric boxes illustrated to the right of the lines below (labeled Desired Output Image). Start by clearing the display window; the boxes can be created with 13 lines of code.

Either     (a) write the 14 lines of code in the space provided at the left or print the output from TriWin and attach it to the
                back of this lab. Print the program. Using a pen, label this listing with an "F" in the top right corner. Write "See
                attached in the lines below
or
               (b) record the solution below.

Hint : For the easiest solution, use display commands similar to the following:
            ? "                               |----------------------------------------| "
 
<------------- Lines of Code------------------->   <-----------------------------Desired Output Image -------------------->
_______________________________
___________________________ |----------------------------------------|
___________________________ |                                        |
___________________________ |       |------------------------|       |
___________________________ |       |                        |       |
___________________________ |       |       |--------|       |       |
___________________________ |       |       |        |       |       |
___________________________ |       |       |        |       |       |
___________________________ |       |       |        |       |       |
___________________________ |       |       |--------|       |       |
___________________________ |       |                        |       |
___________________________ |       |------------------------|       |
___________________________ |                                        |
___________________________ |----------------------------------------|

31] __________ (T/F) Once a window has been deactivated, it must be defined again before it can be activated again.

32] __________ (T/F) Once a window has been defined, it can be activated and deactivated many times without redefining it.

33] __________ (T/F) Once a window has been released, it must be defined again before it can be activated again.

34] __________ (T/F) Once a window has been defined, it can be activated and released many times without redefining it.

35] __________ (T/F) Once the environment variable called Printer has been set on, a copy of all display and list information will be sent to the printer until this variable has been set off.

36] How does one make a copy of display and list options go to the printer? ___________________________

37] How does one make the status bar at the bottom of the screen go away? ___________________________

38] How does one make the status bar at the bottom of the screen re-appear? __________________________

39] __________ (T/F) Once the environment variable called Bell has been set on, a bell will ring when edit fields are completely filled.

40] __________ (T/F) Once the environment variable called Bell has been set off, a bell will ring when edit fields receive invalid data.

41] __________ (T/F) Once the environment variable called Bell has been set on, a bell will ring when edit fields receive invalid data.

42] What type of invalid data might ring the bell for a date field? ____________________________________

43] What type of invalid data might ring the bell for a logical field? __________________________________

44] How do you display the FoxPro environment information? _____________________________________

45] How do you print the FoxPro environment information? _____________________________________



46] If you are using a lab computer, erase all of the files from the Temp folder of hard drive C. Create a folder, called Client, in folder Temp on hard Drive C.  Start FoxPro. 47] Within folder C:/Temp/Client, create a Database table, called Client.DBF which has the following table structure.
 
 
48] Add the following records to your database exactly as listed below. Include the blank spaces before Minney Mouse and make roger rabbit all lower case.
 

49] Write the line of code that could be entered in the command window to display all of the information about all of the Texas Clients. (Try it and record the solution below) How many clients were displayed?

________________________________________________________________  __________________
 
50] Write the line of code that could be entered in the command window to display all of the information about all of the Clients that live in either Texas or Tennessee. (Try it and record the solution below) How many clients were displayed?

________________________________________________________________  __________________
 
51] Write the line of code that could be entered in the command window to display all of the information about all of the Clients that are 21 (or older)  and live in San Antonio. (Try it and record the solution below) How many clients were displayed?

________________________________________________________________  __________________
 
52] Write the line of code that could be entered in the command window to display all of the information about all of the Clients that are 20 or 21 and live in either Texas or Tennessee. (Try it and record the solution below) How many clients were displayed?

________________________________________________________________  __________________
 
53] Write the line of code that could be entered in the command window to display all of the information about all of the Bald Texas Clients. (Try it and record the solution below) How many clients were displayed?

________________________________________________________________  __________________
 
54] Write a program, called Main.PRG which includes the following code.

Turn Off FoxPro. Double click on My Computer. Double click on Folder Temp. You should see the following:
 
 
Using the mouse, double click on Main.PRG. This will start the main program above. If you have followed the directions carefully, your start program should produce the following browse window within FoxPro.
 
 
Double clicking on any PRG file should launch FoxPro (if it has been properly installed on the computer) and execute all of the lines of code in the PRG file just as if they had been entered one at a time in the command window.  Close the browse window and do the following:

Set Default to C:\Temp          <-- Sets the default directory to the temp folder on the hard drive
Do Main                                 <-- Attempts, unsuccessfully, to execute program Main.PRG within the default directory
                                                           (which is c:\temp). The error will generate the following message:
 

 
Close the error window (OK) and do the following:

Do C:\Temp\Client\Main         <-- Attempts, successfully, to execute program Main.PRG within the directory
                                                          C:\Temp\Client. The program will once more execute just as it did by double
                                                          clicking on the Main.PRG icon above.

When your default directory contains your Main.PRG you can simply do the following:
 
Do Main         <-- Attempts to execute program Main.PRG within the current default directory.

55] Write a program, called DisplayBald, which (1) sets the default drive to C:\Temp\Client, (2) opens the client database table, (3) clears the display window, (4) creates and activates a large window called OutputWin [ title = Display Of The Bald Folk!], (5) displays your name in the center of line 1, (6) displays line 2 as a blank line, (7) displays the the name and phone of all bald people, (8) creates a wait window which says "Hit Any Key To Continue" and maintains it until either the user hits a key or waits 10 seconds, (9) deactivates the OutputWin,  and  (10) exits foxpro. Test the program!

56] Modify Command Main. Make the following changes and save. Modify Command DisplayBald replace set default with the following two lines.
 
* Set Default to C:\Temp\Client
Set Default to A:\Client

The Main program should now consider the default directory to be A:\Client.  The DisplayBald  program should now consider the default directory to be A:\Client.

57] Quit FoxPro. Make at least two  back-up copies of this folder on other disks!   Copy directory C:\Temp\Client (including contents) to two separate floppy disks. Delete the C:\Temp\Client from the computer. Make sure that your backup copies look ok!
 

Windows 95/NT  Tutorial
 


58] Turn Off FoxPro. Place a one of your two Client floppy disks in drive A (top-right).  Double click on My Computer. Double click on Floppy drive A. You should see the following:
 
 
Using the mouse, double click on Main.PRG. This will start the main program above; it should execute from your floppy disk. Try It! Exit FoxPro when done.

Using the mouse, double click on DisplayBald.PRG. This will start your DisplayBald program above; it should execute from your floppy disk. Try It! Do not exit FoxPro. Your solution should look something like the following:
 

 
59] Write the FoxPro code to efficiently write a copy of the Client database layout to a file called Struct.TXT. Do It!

____________________________________________________________________________________
60] Write the FoxPro code to efficiently write a copy of the Client environmental information to a file called Status.TXT. Do It!

____________________________________________________________________________________
61] Write the FoxPro code to efficiently write a copy of all information about all of the Clients to a file called Clients.TXT. Do It!

____________________________________________________________________________________
 
62] Exit FoxPro and start/launch Microsoft Word. Set the margins [L = 1", T = .5", B = .5", R = .5"]

63] Load file Struct.TXT  into Word.  Set font for all to courier or new courier; select a size that is readable and that will fit well on the screen. Print a copy. Using a pen, label this listing with an "A" in the top right corner.

64] Load file Status.TXT  into Word.  Set font for all to courier or new courier; select a size that is readable and that will fit well on the screen. Print a copy. Using a pen, label this listing with an "B" in the top right corner.

65] Load file Clients.TXT  into Word.  Set font for all to courier or new courier; select a size that is readable and that will fit well on the screen. Print a copy. Using a pen, label this listing with an "C" in the top right corner.

66] Load file Main.PRG  into Word.  Set font for all to courier or new courier; select a size that is readable and that will fit well on the screen. Print a copy. Using a pen, label this listing with an "D" in the top right corner.

67] Load file DisplayBald.PRG  into Word.  Set font for all to courier or new courier; select a size that is readable and that will fit well on the screen. Print a copy. Using a pen, label this listing with an "E" in the top right corner.
 
 
 


68] Those Labs labeled "Individual Assignment" are to be done separately by each individual. Using a pen,  each individual is to print print his/her name at the top of this document in the space provided and sign it.  Those Labs labeled "Team Assignment" may be done as a team or individually. Using a pen,  each individual on the team is to print print his/her name at the top of this document in the space provided and sign it. Submit only one copy of team assignments!

FoxPro Tutorial C

Include the following in your wire-band binder:

A] A divider

B] Copy of this assignment sheet. Print name and sign!
 
C] Listings A, B, C, D, & E

D] Listing F from TriWin [if you did not write the code on the assignment sheet]
 
E] One copy of the Disk containing the working Client folder.