home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
database
/
p4w_all.zip
/
TI1313.ASC
< prev
next >
Wrap
Text File
|
1993-05-04
|
3KB
|
133 lines
PRODUCT : Paradox for Windows NUMBER : 1313
VERSION : 1.0
OS : WIN
DATE : May 4, 1993 PAGE : 1/2
TITLE : Script to Remove Leading Blanks From a Field
This document demonstrates a script that uses SCAN to remove any
leading blanks from an alphanumeric field. 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.
NOTE: 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. Enclose
; it in quotes.
tc.edit()
scan tc: ; Make sure to type
; the colon.
tc."FLDNAME"= tc."FLDNAME".lTrim() ; Removes leading blanks.
; Enclose field name in
; quotes.
endScan
tc.close()
tv.open("TBLNAME")
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 : 1313
VERSION : 1.0
OS : WIN
DATE : May 4, 1993 PAGE : 2/2
TITLE : Script to Remove Leading Blanks From a Field
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
lTrim ObjectPAL Reference Guide, Chapter 4
TCursor ObjectPAL Developer's Guide, Chapter 10
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.