-
If the Customers table is open, what does this command do:
? [company]
Foxpro has three delimiters for text. The single and double quotes
are familiar but square brackets are equally effective and very useful
if you have to work with a string which include the other two types of
quote such as
lcWhere = [Where Name = "O'Leary"].
-
What happens if you hold the Shift key down then click on File in
the main menu?
For a bonus mark - which other standard Microsoft applications have
this feature?
And for a second bonus - which other Fox menu changes when you hold
down Shift?
-
What date is given by
Gomonth({^2000-01-31}, 1)?
Foxpro has always been very good with dates; it knows that February 31st
is not a valid date and knows that 2000 was a Leap Year. The
Gomonth
function makes the sensible assumption that the last day of February
is one month after the last day of January.
-
What does the command 3+8
do if you are on the first record of the Customer table?
Go is a shorthand for the
Goto
command but neither are actually needed. If you type a number in a
program or in the Command Window then Foxpro will move to that record
in the current table.
Please do not use this feature in a program.
-
If x is 'X ' and y is 'Y ' then what is the result of
x - y?
The familiar + operator concatenates two strings. The - operator also
concatenates two strings but it removes the trailing spaces from the
first string and puts them on the end of the concatenated string.
-
What happens if you redefine a field type from Numeric to Float?
The Float and Numeric types are identical. The two definitions have been
kept in the language for backwards compatibility.
-
Can you enter duplicate values in a field with a Unique index?
The Unique index type allows duplicate entries but will only display or
process one of them. It's badly named and has been dropped from the
language in VFP 9.
-
What does ?_screen->backcolor do?
Foxpro has always used the '->' characters as an alternative to the
period between table name and field name. When object orientated
features were added in version 3 the Fox team followed convention and
used a period between names of objects and properties. The compiler
appears to treat '->' as being equivalent to a period so
_screen->backcolor
is effectively the same as
_screen.backcolor.
-
Can you use a #DEFINE on a Foxpro keyword?
The effect of a #DEFINE directive is
similar to a search-and-replace through the code before it is compiled
so something like #DEFINE PACK ZAP will
find every occurence of the four characters 'PACK' in a program or
method and replace them with the three characters 'ZAP'.
Please don't do this. Anybody trying to debug this will see that the
source code still says "PACK" and will have to work out why the PACK
command appears to be deleting all records.
-
What is the result of Proper('MCKAY')?
Help says that the Proper function
Returns from a character expression a string capitalized as
appropriate for proper names.
.
This is not quite true. All that the function does is to change the
first character of the string to upper case and change all the rest
to lower case. Not a particularly useful function.