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

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1308
  9.   VERSION  :  1.0
  10.        OS  :  WIN
  11.      DATE  :  May 4, 1993                              PAGE  :  1/2
  12.  
  13.     TITLE  :  Scan Loop to Convert a Text Field to Initial Capitals
  14.  
  15.  
  16.  
  17.  
  18.   This document demonstrates a script that uses SCAN to change a
  19.   field named "FLDNAME" to initial capitals.  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.   Before making global changes to your table, it is a good idea to
  24.   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.
  39.      tc.edit()
  40.  
  41.      scan tc:
  42.         tc."FLDNAME" = format("cl,cc", tc."FLDNAME")
  43.                                           ; Change FLDNAME to your
  44.                                           ;   field name.
  45.      endScan
  46.  
  47.      tc.endedit()
  48.      tc.close()
  49.      tv.open("TBLNAME")                   ; View the table.
  50.      tv.bringToTop()
  51.      endmethod
  52.  
  53.   NOTE: The semicolon ";" indicates that a comment follows.  The
  54.         comment will not be processed when when you play the
  55.         script.
  56.    
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1308
  75.   VERSION  :  1.0
  76.        OS  :  WIN
  77.      DATE  :  May 4, 1993                              PAGE  :  2/2
  78.  
  79.     TITLE  :  Scan Loop to Convert a Text Field to Initial Capitals
  80.  
  81.  
  82.  
  83.  
  84.   Check the Syntax
  85.  
  86.   After you have typed in the script shown above, choose Language |
  87.   Check Syntax.  The compiler examines the code and identifies if
  88.   there are syntax errors in the method.  It displays a message in
  89.   the status line of the open Editor window, such as "No syntax
  90.   errors" or a description of the syntax error.  If there is a
  91.   syntax error, Paradox positions the cursor at the point of the
  92.   error.  Before you can run the script, you will need to correct
  93.   your code and choose Language | Check Syntax again until there
  94.   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.   A complete description of SCAN can be found in Chapter 3 of the
  106.   ObjectPAL Reference Guide.
  107.  
  108.  
  109.   DISCLAIMER: You have the right to use this technical information
  110.   subject to the terms of the No-Nonsense License Statement that
  111.   you received with the Borland product to which this information
  112.   pertains.
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.