home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / database / p4w_all.zip / TI1313.ASC < prev    next >
Text File  |  1993-05-04  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1313
  9.   VERSION  :  1.0
  10.        OS  :  WIN
  11.      DATE  :  May 4, 1993                              PAGE  :  1/2
  12.  
  13.     TITLE  :  Script to Remove Leading Blanks From a Field
  14.  
  15.  
  16.  
  17.  
  18.   This document demonstrates a script that uses SCAN to remove any
  19.   leading blanks from an alphanumeric field.  You will need to
  20.   modify the script and substitute your own table name for TBLNAME
  21.   and the field name that you wish to change for FLDNAME.
  22.  
  23.   NOTE: Before making global changes to your table, it is a good
  24.         idea to first make a backup copy.
  25.  
  26.   Creating the Script
  27.  
  28.   Choose File | New | Script.  Your script should ultimately
  29.   resemble the following:
  30.  
  31.      method run(var eventInfo Event)
  32.      var
  33.        tc      TCursor
  34.        tv      TableView
  35.      endVar
  36.  
  37.      tc.open("TBLNAME")                   ; Change TBLNAME to your
  38.                                           ;   table name.  Enclose
  39.                                           ;   it in quotes.
  40.      tc.edit()
  41.  
  42.      scan tc:                             ; Make sure to type
  43.                                           ;   the colon.
  44.        tc."FLDNAME"= tc."FLDNAME".lTrim() ; Removes leading blanks.
  45.                                           ; Enclose field name in
  46.                                           ;   quotes.
  47.      endScan
  48.  
  49.      tc.close()
  50.      tv.open("TBLNAME")
  51.      tv.bringToTop()
  52.      endmethod
  53.  
  54.   NOTE: The semicolon ";" indicates that a comment follows.  The
  55.         comment will not be processed when when you play the
  56.         script.
  57.    
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1313
  75.   VERSION  :  1.0
  76.        OS  :  WIN
  77.      DATE  :  May 4, 1993                              PAGE  :  2/2
  78.  
  79.     TITLE  :  Script to Remove Leading Blanks From a Field
  80.  
  81.  
  82.  
  83.  
  84.   Check the Syntax
  85.  
  86.   After you have typed in the script on the previous page, choose
  87.   Language | Check Syntax.  The compiler examines the code and
  88.   identifies if there are syntax errors in the method.  It displays
  89.   a message in the status line of the open Editor window, such as
  90.   "No syntax errors" or a description of the syntax error.  If
  91.   there is a syntax error, Paradox positions the cursor at the
  92.   point of the first error.  Before you can run the script, you
  93.   will need to correct your code and choose Language | Check Syntax
  94.   again until there are no remaining syntax errors.
  95.  
  96.   When there are no syntax errors:
  97.  
  98.      1.  Choose File | Save, type in a filename in the edit box,
  99.          then choose OK.
  100.  
  101.      2.  To run the script, press [F8].  Your script will play, and
  102.          display your table in View mode.
  103.  
  104.  
  105.   Suggested Reading:
  106.  
  107.   scan              ObjectPAL Reference Guide, Chapter 3
  108.   lTrim             ObjectPAL Reference Guide, Chapter 4
  109.   TCursor           ObjectPAL Developer's Guide, Chapter 10
  110.  
  111.  
  112.   DISCLAIMER: You have the right to use this technical information
  113.   subject to the terms of the No-Nonsense License Statement that
  114.   you received with the Borland product to which this information
  115.   pertains.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.