home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / database / 1776 < prev    next >
Encoding:
Text File  |  1993-01-22  |  1.4 KB  |  52 lines

  1. Newsgroups: comp.sys.mac.databases
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!decwrl!csus.edu!netcom.com!jeffp
  3. From: jeffp@netcom.com (Jeff)
  4. Subject: 4D Field Incrementing
  5. Message-ID: <1993Jan22.081803.9058@netcom.com>
  6. Organization: BeHereNow
  7. Distribution: usa
  8. Date: Fri, 22 Jan 1993 08:18:03 GMT
  9. Lines: 41
  10.  
  11.  
  12. I want to increment ad integer in an Input Layout starting @ 1000.
  13. I created a "dummy" file with one record that has the value of 1000.
  14. Then I added a script to the individual fields that have the same name
  15. in a different file, as in the dummy file. 
  16.  
  17. So I want to assign a the number to the field once, but I don't want it
  18. to update as the value in the Dummy field increments for Adding Records
  19. later on...
  20.  
  21. If I have a [Clients]ClientNumber field, and a [Dummy]ClientNumber place
  22. holder field, can I assign the value and increment it like this?:
  23.  
  24. $RecNum:=Record number
  25. If ($RecNum=-3)
  26.   vClientNum:=([Dummy];[Dummy]ClientNum)+1
  27.   ([Dummy];[Dummy]ClientNum):=vClientNum
  28.   [Clients]Client_Num:=vClientNum
  29. End If
  30.  
  31. I think something like this in the [Clients]ClientNumber field would
  32. work, but I tried it and it doesn't work...
  33.  
  34. Or is this better for some reason?:
  35.  
  36. If ([Clients]Client Number=0) 
  37.   [Clients]Client Number:=[Dummy]Client Number
  38.   SAVE RECORD([Clients])
  39.   [Dummy]Client Number:=([Dummy]Client Number + 1)
  40.   Save Record([Dummy])
  41. End if 
  42.  
  43. If you see obvious syntax errors, feel free to point them out (other
  44. than field names).
  45.  
  46. Thanks,
  47.  
  48. Jeff-
  49.  
  50.  
  51.  
  52.