home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
database
/
p4w_all.zip
/
TI1308.ASC
< prev
next >
Wrap
Text File
|
1993-05-04
|
3KB
|
133 lines
PRODUCT : Paradox for Windows NUMBER : 1308
VERSION : 1.0
OS : WIN
DATE : May 4, 1993 PAGE : 1/2
TITLE : Scan Loop to Convert a Text Field to Initial Capitals
This document demonstrates a script that uses SCAN to change a
field named "FLDNAME" to initial capitals. You will need to
modify the script and substitute your own table name for TBLNAME
and the field name that you wish to change for FLDNAME.
Before making global changes to your table, it is a good idea to
first make a backup copy.
Creating the Script
Choose File | New | Script. Your script should ultimately
resemble the following:
method run(var eventInfo Event)
Var
tc TCursor
tv Tableview
Endvar
tc.open("TBLNAME") ; Change TBLNAME to your
; table name.
tc.edit()
scan tc:
tc."FLDNAME" = format("cl,cc", tc."FLDNAME")
; Change FLDNAME to your
; field name.
endScan
tc.endedit()
tc.close()
tv.open("TBLNAME") ; View the table.
tv.bringToTop()
endmethod
NOTE: The semicolon ";" indicates that a comment follows. The
comment will not be processed when when you play the
script.
PRODUCT : Paradox for Windows NUMBER : 1308
VERSION : 1.0
OS : WIN
DATE : May 4, 1993 PAGE : 2/2
TITLE : Scan Loop to Convert a Text Field to Initial Capitals
Check the Syntax
After you have typed in the script shown above, choose Language |
Check Syntax. The compiler examines the code and identifies if
there are syntax errors in the method. It displays a message in
the status line of the open Editor window, such as "No syntax
errors" or a description of the syntax error. If there is a
syntax error, Paradox positions the cursor at the point of the
error. Before you can run the script, you will need to correct
your code and choose Language | Check Syntax again until there
are no remaining syntax errors.
When there are no syntax errors:
1. Choose File | Save, type in a filename in the edit box,
then choose OK.
2. To run the script, press [F8]. Your script will play, and
display your table in View mode.
A complete description of SCAN can be found in Chapter 3 of the
ObjectPAL Reference Guide.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.