home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
database
/
p4w_all.zip
/
TI1309.ASC
< prev
next >
Wrap
Text File
|
1993-05-04
|
4KB
|
133 lines
PRODUCT : Paradox for Windows NUMBER : 1309
VERSION : 1.0
OS : WIN
DATE : May 4, 1993 PAGE : 1/2
TITLE : Scan Loop to Convert an Entire Field to Upper or
Lower Case
This document demonstrates a script that uses SCAN to change a
field named "FLDNAME" to upper case. If you wish to change your
field to lower case, substitute the word "lower" for "upper" in
the script below. 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 and
; enclose it in quotes.
tc.edit()
scan tc:
tc."FLDNAME" = upper(tc."FLDNAME") ; Change FLDNAME to
; your field name
; and enclose it
; in quotes.
; Change upper() to
; lower() to convert
; field to lower
; case.
endScan
tc.close()
tv.open("TBLNAME") ; View the table.
tv.bringToTop()
endmethod
PRODUCT : Paradox for Windows NUMBER : 1309
VERSION : 1.0
OS : WIN
DATE : May 4, 1993 PAGE : 2/2
TITLE : Scan Loop to Convert an Entire Field to Upper or
Lower Case
NOTE: The semicolon ";" indicates that a comment follows. The
comment will not be processed when when you play the
script.
Check the Syntax
After you have typed in the script on the previous page, 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 first 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.
Suggested Reading:
scan ObjectPAL Reference Guide, Chapter 3
TCursor ObjectPAL Developer's Guide, Chapter 10
upper() ObjectPAL Reference Guide, Chapter 4
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.