Visual Basic and Visual FoxPro functions to change the case of text

VBA

UCase(), LCase(), StrConv()

VFP

Upper(), Lower(), Proper()

Common Syntax Notes

The straightforward case-conversion routines work in the same way in both languages. In Visual FoxPro the Proper() function returns the string with the first letter of each word capitalised. In VBA the StrConv() function with a parameter of 3 does the same.

Note that neither of these last two functions are as useful as they might seem. You cannot use them to tidy up the poor capitalisation of a list of names because they blindly capitalise the first letter of each word. For example:

?Proper("MCCARTNEY")

will give you "Mccartney" and you'll get similarly unhelpful results from "DICAPRIO" and "IBM".

Finding characters  |  Text functions  |  Changing characters

More tips from Alvechurch Data

More tips from Alvechurch Data

FoxPro DefaultExt function

Using DefaultExt() to correct file extensions in a FoxPro program.

Read More

FoxPro ForceExt function

Using ForceExt() to correct file extensions in a FoxPro program.

Read More

FoxPro JustExt function

Using JustExt() to get the extension from a file name.

Read More