home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / database / 7717 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  2.3 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!umn.edu!noc.msc.net!uc.msc.edu!shamash!ems!ems.cdc.com!leilas
  2. From: leilas@ems.cdc.com (Leila Schneberger)
  3. Newsgroups: comp.databases
  4. Subject: Re:Paradox-Setting all fields to same value
  5. Message-ID: <30180@nntp_server.ems.cdc.com>
  6. Date: 9 Nov 92 16:39:38 GMT
  7. Sender: sys@ems.ems.cdc.com
  8. Reply-To: leilas@ems.cdc.com
  9. Organization: Empros Systems International, a division of Ceridian
  10. Lines: 75
  11. Nntp-Posting-Host: eve.ems.cdc.com
  12.  
  13. Thanks to all who replied! I was surprised by the number of ways that
  14. Paradox is able to do this.
  15. In article <30076@nntp_server.ems.cdc.com>, leilas@ems.cdc.com (Leila Schneberger) writes:
  16. |> For each record in a table, I want to set all ocurrences of a field
  17. |> to some value (YearlyDues = "NotPaid"). How do I do this in Paradox?
  18. |> 
  19.  
  20. In QBE (Ask) in field 'YearlyDues', type:
  21.  
  22.     CHANGETO NotPaid
  23.  
  24. Press F2.
  25.  
  26. ps  This is clearly covered in the User Guide under 'Ask'.
  27. --------------------------------
  28.  
  29. Script - editor -write (or new in 4.0) - Whatevername
  30.  
  31. edit "Name_of_the_table"
  32. scan
  33.     [yearlydues]="Notpaid"
  34. endscan
  35. do_it!
  36.  
  37. Then press F10 ang G (as Go)
  38.  
  39. -------------------------------
  40.  
  41.     hi, you could do something like:
  42.  
  43.     aTable = "mytable"
  44.  
  45.     ?? "Enter Init Value: "
  46.     ACCEPT  "A12" TO Value        ; get the value to init with
  47.                       ; must match type in table
  48.  
  49.     EDIT aTable
  50.     MOVETO[ myfield ]    ; move to the field to act upon
  51.     [myfield] = Value    ; put into first record in table
  52.  
  53.     FOR i FROM 1 TO NRECORDS(atable) - 1
  54.         DOWN            ; move to next rec
  55.         DITTO
  56.     ENDFOR
  57.     ; from PAL guide pg 276
  58.  
  59.             
  60.     - ps you could make this into a reusable procedure.
  61.          also, see PAL User's Guide, pg276 v3.5
  62.         
  63.     save it as a script, and run it on the table, 
  64.     or you could simply record the keystrokes of moving down
  65.     to the next record, then typing ditto.  STop record
  66.     and play the resulting script using repeatplay choice,
  67.     play it the number of records in the table..
  68.  
  69. -----------------------------
  70.  
  71. Use any TEXT editor, create a file called "change.sc".
  72.  
  73. FILE CONTENTS:
  74.  
  75. edit "tablename"    <-- replace with your table (quotes are necessary)
  76. scan
  77.   [YearlyDues] = "NotPaid"
  78. endscan
  79. do_it!
  80.  
  81. END OF FILE
  82.  
  83. In Paradox, use menu commands <Scripts> <Play>, then enter "change"
  84.  
  85. ----------------------------
  86.  
  87.  That's it!
  88.