|
Technical answers from the trenches |
|
Script Tutorial: Converting Field Values to Mixed Case
| ||||
Posted: 5 October 2000 |
||||
  |
Applies to: All versions |
|||
  |
Audience: Beginner |
|||
Question: I've heard that I can use a script to convert field values to mixed case. What are scripts and how do I do this?In many software packages, you can automate various actions using macros. Paradox lets you automate tasks through its ObjectPAL programming language. In general, you attach code to events associated with specific objects and user activities. For example, button objects have a pushButton() event that is triggered when the user clicks the button. To perform some action when your users click the button, you need to add code the button's pushButton() event. Scripts are somewhat similar to macros, though they cannot be recorded in Paradox for Windows or Linux. They are basically standalone "containers" for ObjectPAL code that is executed outside of a form. The following steps you through the process of creating a Paradox 9 script to convert field values to mixed case.
var
tc tCursor
endVar
errorTrapOnWarnings( Yes )
try
tc.open( "contacts" ) ; use your table name...
tc.edit()
scan tc :
message( tc.recNo() )
; replace "First Name" as needed
tc."First Name" =
format( "cc", lower( tc."First Name" ) )
endScan
tc.close()
onFail
errorShow( "Can't Convert",
"Use [>>] for details..." )
endTry
beep()
Message( "Done..." )
This code does the following:
Scripts can be used for a wide range of purposes; we generally use them for utilities and starting Paradox applications. For more information, see the Paradox ObjectPAL tutorial under the Help menu |
|||
|
||||||||
|
Copyright © 2000-2004, techtricks.com; All Rights Reserved. Acknowledgements, Disclaimers, Terms and Conditions. |
||||||||
|
Article last updated on 31 May 2003
|
||
|
|
||
|
[- End -]
|