home *** CD-ROM | disk | FTP | other *** search
- 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
- From: leilas@ems.cdc.com (Leila Schneberger)
- Newsgroups: comp.databases
- Subject: Re:Paradox-Setting all fields to same value
- Message-ID: <30180@nntp_server.ems.cdc.com>
- Date: 9 Nov 92 16:39:38 GMT
- Sender: sys@ems.ems.cdc.com
- Reply-To: leilas@ems.cdc.com
- Organization: Empros Systems International, a division of Ceridian
- Lines: 75
- Nntp-Posting-Host: eve.ems.cdc.com
-
- Thanks to all who replied! I was surprised by the number of ways that
- Paradox is able to do this.
- In article <30076@nntp_server.ems.cdc.com>, leilas@ems.cdc.com (Leila Schneberger) writes:
- |> For each record in a table, I want to set all ocurrences of a field
- |> to some value (YearlyDues = "NotPaid"). How do I do this in Paradox?
- |>
-
- In QBE (Ask) in field 'YearlyDues', type:
-
- CHANGETO NotPaid
-
- Press F2.
-
- ps This is clearly covered in the User Guide under 'Ask'.
- --------------------------------
-
- Script - editor -write (or new in 4.0) - Whatevername
-
- edit "Name_of_the_table"
- scan
- [yearlydues]="Notpaid"
- endscan
- do_it!
-
- Then press F10 ang G (as Go)
-
- -------------------------------
-
- hi, you could do something like:
-
- aTable = "mytable"
-
- ?? "Enter Init Value: "
- ACCEPT "A12" TO Value ; get the value to init with
- ; must match type in table
-
- EDIT aTable
- MOVETO[ myfield ] ; move to the field to act upon
- [myfield] = Value ; put into first record in table
-
- FOR i FROM 1 TO NRECORDS(atable) - 1
- DOWN ; move to next rec
- DITTO
- ENDFOR
- ; from PAL guide pg 276
-
-
- - ps you could make this into a reusable procedure.
- also, see PAL User's Guide, pg276 v3.5
-
- save it as a script, and run it on the table,
- or you could simply record the keystrokes of moving down
- to the next record, then typing ditto. STop record
- and play the resulting script using repeatplay choice,
- play it the number of records in the table..
-
- -----------------------------
-
- Use any TEXT editor, create a file called "change.sc".
-
- FILE CONTENTS:
-
- edit "tablename" <-- replace with your table (quotes are necessary)
- scan
- [YearlyDues] = "NotPaid"
- endscan
- do_it!
-
- END OF FILE
-
- In Paradox, use menu commands <Scripts> <Play>, then enter "change"
-
- ----------------------------
-
- That's it!
-