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  E

15 Points
Individual Assignment
 


The Video.DBF table is open. The default drive is A:\VIDEO. Use it for  the following questions!


 

-------------------------------------- Use the Video.DBF structure above for all questions! --------------------------------------


Answer all of the following without using the Mouse/Menu Options!
Must Be Hand Written - Do Not Type



1] Create a folder, called Video on floppy disk A. Create  the Database Video.DBF from the structure above. Fill this database exactly as illustrated above. Note that "star wars" is lower case. Note that there are three blanks before "Rambo I"

    Video.DBF = _____________________ bytes

2] Set Default To A:\Video  <-- Do
    Use Video  <-- Do
     ? RecNo( )   displays  _____________________

     ? RecCount( )  displays  ___________________

     ? RecSize( )       displays  ___________________
2] How do you open the Video.DBF Table Designer? __________________________________________

3] What is the first tab on the Table Designer? _______________________________________________

4] What is the second tab on the Table Designer? ____________________________________________

5] ______ (T/F) The indexes associated with a database table may be viewed in the Table Designer

6]     Use Video
    Browse Field RecNo = RecNo(), Title, No, Cost, Mystery, Drama, Action, SciFi, Horror, Adult,;
    Romance, Category

    The Video database has no index. In what order are the records displayed with the browse above?

___________________________________________________________________________________

7]]  Do the Browse above. Use the mouse to adjust the fields widths so that your  browse window resembles the illustration above. Start Paint Shop Pro.  Start the screen capture program. Do a screen capture. Crop and print only the browse window.  Using a pen, label this listing with an "A" in the top right corner. See either of the following if necessary.

 Install Paint Shop Pro Tutorial        Screen Capture Tutorial

8] A toggle can be turned on or off. How many FoxPro toggles are illustrated when you display the status

___________________________________________________________________________________

9] How does one send a copy of  the database environment information to a file called Status.TXT? (Don't want output to screen?)

___________________________________________________________________________________

10] How does one display the database environment information?

___________________________________________________________________________________

11] How does one print a copy of  the database environment information? (Don't want output to screen?)

___________________________________________________________________________________

12] What are the three reasons for creating indexes? (1) _____________________________________

(2) ________________________________________ (3) ______________________________________

13]   Index On Title Tag Title <-- Do
     Dir *.*  <-- Do displays  ______________________________________________________________

14] How do you create a simple  Index, called Title, from the Title field. ? ________________________

15] All of the database indexes for table Video.DBF will be stored in file _________________________

16] All of the database indexes for table  Client.DBF will be stored in file _________________________

17] ______ (T/F) My Title index may now be viewed in the Table Designer. This index is in {Ascending /

Descending }____________________________ order.

18] List Title, No <-- Do
      would generate the following output:  Record#  TITLE                                  NO
                                                       _____   _______________________   _______
                                                       _____   _______________________   _______
                                                       _____   _______________________   _______
                                                       _____   _______________________   _______
                                                       _____   _______________________   _______
                                                       _____   _______________________   _______
                                                       _____   _______________________   _______

19]  ______ (T/F) The order of  Display All Title, No is the same as that for List above. (Try It!)

20]  ______ (T/F) The order of  Browse Field RecNo = RecNo(), Title, No is the same as that for List above. (Try It!)

21] Title is an index tag for database Video.DBF. The database is open and Title is the master/primary index.

____ (T/F) Display All  will display all of the records in order by Title field.
22] Title is an index tag for database Video.DBF. The database is open and Title is the master/primary index.

____ (T/F) List  will list all of the records in order by Title field.
23] Title is an index tag for database Video.DBF. The database is open and Title is the master/primary index.

____ (T/F) Report Form  will run the specified report for all of the records in order by Title field.
24] Title is an index tag for database Video.DBF. The database is open and Title is the master/primary index.

____ (T/F) Label Form  will produce the specified label for  all of the records in order by Title field.
 25] Title is an index tag for database Video.DBF. The database is open and Title is the master/primary index.

____ (T/F) Browse  will bring up a browse window in which all of the records in order by Title field.
26. When database table Client.DBF is indexed, all of the indexes will be placed in a file called

___________________________________________________________________________________

27]  What is the extension assigned to each and every index tag file? __________________________

28]  When database table Video.DBF is indexed, all of the indexes will be placed in a file called

___________________________________________________________________________________

28]  ____ (T/F) A character based index is sorted in ASCII order.

29]  ASCII is an acronym for ___________________________________________________________

30]  ? 'A' > 'B' <-- Do displays  __________________________________________________________

31]  ? 'AL' >= 'AB' <-- Do displays  ______________________________________________________

32]  ? "B" > 'a' <-- Do displays  _________________________________________________________

33]  ? 'david' >= 'Daniel' <-- Do displays  __________________________________________________

34]  ____ (T/F) A numeric based index is sorted in ASCII order.

35]  ____ (T/F) A date based index is sorted in ASCII order.

36]  ? ' ' < 'A' <-- Do displays  __________________________________________________________

37]  ____ (T/F) It is impossible to include leading blanks in a character field.

38] In order to display the names of all of the open database tables, one could Display ____________

39] In order to display the names of all of the indexes, one could  Display _______________________

40] In order to display the name of the default directory, one could  Display ______________________

42] In order to display the name of the values currently displayed in the environmental toggles one could

Display _____________________________________________________________________________

43] In order to display the names of each and every field one could 
Display ______________________

44] In order to display the datatype associated with  of each and every field one could

Display _____________________________________________________________________________

45] Title is an index tag for database table  Video.DBF. What two lines of code could to open the database and make Title the master index.

___________________________________________________________________________________

___________________________________________________________________________________

46] Title is an index tag for database table. Video.DBF. What one line of code could to open the database and make Title the master index.

___________________________________________________________________________________

47] Title is an index tag for database  table. Write the code to create an index Tag, called No, based on the No Field. Video.DBF. Do It!
                               ___________________________________________________________________________________

48] Title and No are  index tags for database table. Write the code to create a simple index Tag, called Cost, based on the Cost Field. Video.DBF. Do It!
                                                            ___________________________________________________________________________________

49] Title , No, and Cost  are  index tags for database table. Write the code to create a simple index Tag, called Category, based on the Category Field. Video.DBF. Do It!

                                                                            ___________________________________________________________________________________

50] Title , No,  Cost, and Category  are  index tags for database table. Write the code to make Category the primary/master index.

                                         ___________________________________________________________________________________

51] Title , No,  Cost, and Category  are  index tags for database table. Write the code to make Cost  the primary/master index.

___________________________________________________________________________________

52] Title , No,  Cost, and Category  are  index tags for database table. Write the code to make Title  the primary/master index.

___________________________________________________________________________________


Try the following. Remember, your Title index tag was created with   Index On Title Tag Title

53] Video.DBF's master index is Title. Seek "D" would move the read/write pointer  (7 records above) to #

___________________________________________________________________________________

54] Video.DBF's master index is Title.
Seek "s" would move the read/write pointer  (7 records above) to #

___________________________________________________________________________________

55] Video.DBF's master index is Title.
Seek "S" would move the read/write pointer  (7 records above) to # ________

56] Video.DBF's master index is Title. Seek "t" would move the read/write pointer  (7 records above) to # _________

57] Video.DBF's master index is Title. Seek " " would move the read/write pointer  (7 records above) to # _________

58] Video.DBF's master index is Title. Seek "R" would move the read/write pointer  (7 records above) to # ________

59] Video.DBF's master index is Title. Seek "MU" would move the read/write pointer  (7 records above) to

# _________________________________________________________________________________

60] Video.DBF's master index is Title. Seek "Z" would move the read/write pointer  (7 records above) to #

___________________________________________________________________________________



61]  ____ (T/F) Only the master index is automatically updated when the Edit function is used.

62]  ____ (T/F) All tag indexes are automatically updated when the Edit function is used.

63]  ____ (T/F) Only the master index is automatically updated when the Change function is used.

64]  ____ (T/F) All tag indexes are automatically updated when the Change function is used.

65]  ____ (T/F) Only the master index is automatically updated when the Append function is used.

66]  ____ (T/F) All tag indexes are automatically updated when the Append function is used.

67]  ____ (T/F) Only the master index is automatically updated when the Pack function is used.

68]  ____ (T/F) All tag indexes are automatically updated when the Pack function is used.

69]  ____ (T/F) Only the master index is automatically updated when the Zap function is used.

70]  ____ (T/F) All tag indexes are automatically updated when the Zap function is used.

71]  ____ (T/F) Only the master index is automatically updated when the Delete function is used.

72]  ____ (T/F) All tag indexes are automatically updated when the Delete function is used.

73]  What function is to be called to re-generate the indexes if the .CDX file becomes corrupt?

___________________________________________________________________________________

74] Write the code to create a memory variable, called Name, and assign the value "Tom" to that variable.

_________________________________ Name is a {date/numeric/logical/character} ________________ variable.
75] Write the code to create a memory variable, called N, and assign the value 123 to that variable.

_________________________________ Key is a {date/numeric/logical/character} __________________ variable.
76] Write the code to create a memory variable, called Easter, and assign the value 3/27/98  to that variable.

_________________________________ Easter  is a {date/numeric/logical/character} ________________ variable.
77] Write the code to create a memory variable, called Good, and assign the value .F.  to that variable.

_________________________________ Good  is a {date/numeric/logical/character} ________________ variable.
78] Write the code to create a memory variable, called City, and assign the value "Austin" to that variable.

_________________________________ Key is a {date/numeric/logical/character} _________________ variable.
79] Write the code to create a memory variable, called No, and assign the value 12.3 to that variable.

_________________________________ No is a {date/numeric/logical/character} __________________ variable.

80] @ The default number of potential memory variables available to the programmer is ____________.

This number of memory variables can be increased to as many as _____________________________

81] How do you display a copy of all of the existing local memory variables. _____________________

82] How do you print a copy of all of the existing local memory variables. _______________________

83] How do you write a copy of all of the existing local memory variables to file Memory.TXT without displaying it on

the screen. (no pause) _________________________________________________________________
84] Local memory variable SoughtName contains the name the user wishes to find in the database. How does one

display the contents of SoughtName in the display window? __________________________________


Enter the following commands  on the command line - Record the results in the space provided

Set Default to A:\Video
Use Video
Index On AllTrim(Upper(Title)) Tag Title
Index On Cost Tag Cost
Index On No Tag No
Index On Category Tag Category
Index on Mystery Tag Mystery

Use Video Order Title
Public SoughtTitle, Key, Answer, MixedUp, Valid
SoughtTitle = "Dr. Web"
Key = "DR. WEB"
Answer = "dr. web"
MixedUp = "    dR. weB    "
Valid = .T.
GoTo 6

85]  ? Title    would display   ___________________________________________________________

86]  ? No    would display   _____________________________________________________________

87]  ? Cost    would display   ___________________________________________________________

88]  ? SoughtTitle    would display   ______________________________________________________

89]  ? Key    would display   _____________________________________________________________

90]  ? Upper(Answer)    would display   ____________________________________________________

91]  ? Upper(Title)    would display   _____________________________________________________

92]  ? Lower(Answer)    would display   ____________________________________________________

93]  ? Lower(Title)    would display   _____________________________________________________

94]  ? Proper(Answer)    would display   ____________________________________________________

95]  ? Proper(Title)    would display   ____________________________________________________

96]  ? Key + SoughtTitle    would display   _________________________________________________

97]  ? '*' + MixedUp + '*'    would display   _______________________________________________

98]  ? '*' + RTrim(MixedUp) + '*'    would display   _______________________________________________

99]  ? '*' + LTrim(MixedUp) + '*'    would display   _______________________________________________

100]  ? '*' + AllTrim(MixedUp) + '*'    would display   ____________________________________________

101]  ? '*' + AllTrim(MixedUp) + '*'    would display   ____________________________________________

102]  ? Valid    would display   __________________________________________________________

103]  ? Not Valid    would display   ______________________________________________________

104]  ? SoughtTitle = "Dr. Web"    would display   ___________________________________________

105]  ? SoughtTitle = "DR. WEB"    would display   __________________________________________

106]  ? Upper(SoughtTitle) = "DR. WEB"    would display   __________________________________________

107]  ? AllTrimUpper(MixedUp)) = "DR. WEB"   would display   ________________________________________

108]  ? AllTrimLower(MixedUp)) = "dr. web"   would display   ________________________________________

109]  ? AllTrimProper(MixedUp)) = "Dr. Web"   would display   _______________________________________

110] Video.DBF's master index is No. Seek 11  would move the read/write pointer  (7 records above) to # _________

111] Video.DBF's master index is No. Seek 55  would move the read/write pointer  (7 records above) to # _________

112] Video.DBF's master index is No. Seek 57  would move the read/write pointer  (7 records above) to # _________

113] Video.DBF's master index is No. Seek 111  would move the read/write pointer  (7 records above) to # ________

114]  ? Len(SoughtTitle)   would display   _________________________________________________

115]  ? Len(MixedUp)   would display   _____________________________________________________

116]  ? Len(Title)   would display   _______________________________________________________

117]  ? Len("Tom")   would display   _______________________________________________________

118]  ? Len("")   would display   __________________________________________________________

119]  ? Len(" ")   would display   _________________________________________________________

120] Print the status to a file called Status.TXT

121] Print the structure to a file called Struct.TXT

122] Print the memory to a file called Memory.TXT

123] List all of the information about all of the records to a file called Video.TXT



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

125] 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.

126] Load file Memory.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.

127]  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 "C" in the top right corner.

128]  Load file Video.TXT  into Word.  Set font for all to eight point courier or new courier. Print a copy. Using a pen, label this listing with an "D" in the top right corner.



129] Restart FoxPro and do the following
Set Default to A:\Video
Use Video
Display Status
                                                            The Video.DBF has ______________ indexes.
Copy to NewVideo
Use NewVideo
Display Status
                                                            The NewVideo.DBF has ______________ indexes.

130] Continue using NewVideo. Write the two lines of  code to replace the Title in record #4 to "Star Wars"

_____________________________________    __________________________________________

131] Continue using NewVideo. Write the one line of  code to replace the state field of  the current  record with "TX"

__________________________________________________________________________________

132] Continue using NewVideo. Write the one line of  code to capitalize all of the state fields.

__________________________________________________________________________________

133] Continue using NewVideo. Write the one line of  code to proper  all of the title  fields.

__________________________________________________________________________________

134] Continue using NewVideo. Write the code to increase the cost of every video by 1 (dollar).

__________________________________________________________________________________

135] Add a field, called Rate to NewVideo. Let us assume that there were 10,000 videos in the database. Write the code to fill the Rate field of all Category 1 videos with 1.00.  Write the code to fill the Rate field of all Category 2 videos with 1.50.  Write the code to fill the Rate field of all Category 3 videos with 3.00. Do it!

__________________________________________________________________________________

__________________________________________________________________________________

__________________________________________________________________________________

136] Do the following:

Use NewVideo
Index On Rate Tag Rate
Browse Field RecNo = RecNo(), Title, No, Cost, Mystery, Drama, Action, SciFi, Horror, Adult,;
    Romance, Category, Rate

132] Start Paint Shop Pro.  Start the screen capture program. Do a screen capture of your browse window. Print the
screen capture! Using a pen, label this listing with an "E" in the top right corner. See either of the following if
necessary.

 Install Paint Shop Pro Tutorial        Screen Capture Tutorial

132] The Customer database has a numeric field called Ranking. We would like to have a tag index, called Ranking, that would place the records in decending order by Ranking. Write the code.

__________________________________________________________________________________
<3 Points Of This Lab>

133-150] Assume that the current database table, called Student,  has a field called State and a field called City. We would like to have an index, called Location, that would place the records in order by state - also make sure that the cities are alphabetized within each state. You will have to write a compound index that combines both of the fields. Write the line of code below to create a great index tag called Location.

__________________________________________________________________________________



151] ] 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 E

Turn In The Following
[Stapled, Folded In Half, Number On Outside, In This Order]

1] This assignment sheet. Print name and sign with Ink! All problems solved in pencil or ink - not electronic!

2] Listings A, B, C, D, & E