You are here: AxTools > CodeSMART 2007 for VB6 > Documentation > User's Guide > AutoText > Using Custom Parameters with AutoText
While browsing this page, why not start downloading the evaluation setup kit (direct download, no questions asked).

Using Custom Parameters with AutoText

The code of an auto-text item can be enriched with standard parameters that are replaced at insertion time with specific values automatically determined by CodeSMART. However, there may be times when the need to provide other variable values than the ones already represented by the standard parameters appears.

For example, when the inserted code contains a variable piece of code that appears repeatedly. Let's consider the following code piece:

MyRecordset.Seek "=", ValueToSeekFor
If Not MyRecordset.NoMatch Then
    '
End If
Instead of typing 'MyRecordset' each time, you could define a custom parameter (e.g. RsName) and include it in the auto-text item code using the Custom Parameters popup:

To create a custom parameter:

  1. Click Edit Custom Parameters in the Parameters menu of the AutoText Manager to display the Edit Custom Parameters dialog box.
  2. Click on the Add New button or click on the first empty cell of the Name column in the Custom Parameters grid.
  3. Type a meaningful name for the custom parameter. This is the name that will be listed in the Enter Parameter Values dialog box.
  4. You can provide a default value for the custom parameter in the corresponding grid cell.
  5. Optionally, you can type a short description for the current custom parameter. This text will be displayed in the Enter Parameter Values dialog's descriptive area (below the grid that lists the parameters and their values).
  6. From now on, each time you will type the alias 'rssk' into a Visual Basic code window a dialog box will be displayed allowing you to specify the appropriate value for the RsName custom parameter.
    Here it is how the Enter Parameter Values dialog box will appear in our example:

 Notes

  • The same custom parameter can be used in multiple auto-text items.
  • If a custom parameter name is modified then you will have to manually change every instance of the parameter's previous name in all the items where it was present.
  • Deleting a custom parameter does not actually remove it from any item code where it was present.
See also
AutoText Overview
The AutoText Manager
Using Standard Parameters with AutoText

Back To Top

Copyright © 2008 AxTools - CodeSMART 2007 for VB6 - AutoText