Auto-suggestion allows for the quick completion of names for convenience or where the programmer is unsure of the exact name. The workbench is constantly analysing what the user is typing. When it thinks it would be useful to make suggestion, a suggestion window automatically appears. You can force the workbench to make a suggestion by using the ALT-DOWN ARROW shortcut.
Suggestions can be used with variables, form entities and functions. In the case of form entities, the context (usually an event handler) can help in building the suggestion.
Once a suggest window has been displayed you can use the down and up arrows to navigate it. Esc will dismiss it and Enter will insert your current selection. Ctrl-Space will insert the first item in the list.
How suggestions work depends to some extent on the context. Here are some example of suggestions being used in typical cases:
Assume we have a variable called numusers or num_users or NumberUsers (we are not quite sure). Entering
numu <ALT-DOWN ARROW>
will produce a list taken from the current programs symbol table including num_users which we click to select and this replaces the text with num_users.
Suppose the user enters
'gb_<ALT-DOWN ARROW>
then the suggestion box will list all functions in the program starting 'gb_. There may be a few but it will be easy to spot 'gb_open in the list and select it. The code will now appear as
'gb_open(
If you have already enter a completely valid record variable. Pressing '.' you will get a list of flds that belong to that record.
DIM rRecord$_Record
rRecord<.>
Will give you a window listing each fld that belongs to Record.
Suggest currently lists members and methods for SOAP and Dynamic objects. This works in exactly the same way as for records.
Suppose we are in an event handler called MyForm.MyButton.Click(). Entering
. <ALT-DOWN ARROW>
Will produce a suggestion list containing all the controls on MyForm. Entering
.myb <ALT-DOWN ARROW>
Will produce a suggestion list of controls starting .myb, including .MyButton. Selecting this one will replace the text with .MyButton. Entering
.MyButton <ALT-DOWN ARROW>
Will not suggest controls as the control is already a control name on the form. Instead possible properties will appear in the suggestion list, and we could select .Text$ from the list. This would change the text in the editor to .MyButton.text$. Entering