Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!chuq From: chuq@Apple.COM (Chuq Von Rospach) Newsgroups: comp.sys.mac Subject: 4D 2.0 question Message-ID: <35206@apple.Apple.COM> Date: 3 Oct 89 00:04:46 GMT Organization: Life is just a Fantasy novel played for keeps Lines: 24 Here's a question for the folks who are using 4D. I've got a file with a unique key. I'm going to be generating that key in a procedure, and I want to check for the previous existence of that key programmatically. What is the most efficient way of doing that? I can see two approaches: do a SEARCH based on that key. If "number of records in selection" > 0, it's already there. try to SAVE RECORD the thing. If it fails (the field is marked unique) then it exists. In both cases, I want to loop and generate the key again until I do get it right. Any suggestions on the cleanest way to do this? -- Chuq Von Rospach <+> Editor,OtherRealms <+> Member SFWA/ASFA chuq@apple.com <+> CI$: 73317,635 <+> [This is myself speaking] Future home of the San Jose Photons! I was a Kings fan before it was politically correct. NHL to San Jose!