home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / hypercar / 2914 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.6 KB  |  53 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!usc!sol.ctr.columbia.edu!ucselx!babb
  3. From: babb@ucselx.sdsu.edu (babb j)
  4. Subject: find function
  5. Message-ID: <1992Jul29.214621.6634@ucselx.sdsu.edu>
  6. Organization: San Diego State University Computing Services
  7. X-Newsreader: Tin 1.1 PL4
  8. Date: Wed, 29 Jul 1992 21:46:21 GMT
  9. Lines: 42
  10.  
  11. I'm modifying a script for a stack that stores info from students in a comma 
  12. delimited file. I want to filter any comma's out of the field before the
  13. field's info is written to the file. I scripted:
  14.  
  15. on returnInField
  16.   find chars ","
  17.   if result is empty then
  18.     answer "Sorry, no comma's allowed" with "Darn!" 
  19.   end if 
  20. end returnInField 
  21.  
  22. 1) If there's a comma in the field, the whole field is selected, not just
  23. the comma. I'd like to just delete a selected comma at that point. BUT... 
  24.  
  25. 2) If there is NO comma, Hypercard goes to an Audio card!!! This card  
  26. isn't even the next card, it's #14 and the field & handler are on card 
  27. #9. Card IDs aren't close either. I checked out the mesg watcher and saw... 
  28.  
  29. openField
  30.   keyDown
  31.   returnInField
  32.     find
  33.       closeCard
  34.         put
  35.       closeBackground
  36.       openBackground
  37.       openCard            
  38.         SndList
  39.     .
  40.     .
  41.     .
  42. I can't figure out why the find routine is closing the card and opening
  43. another (seemingly) unrelated one when there's no comma!!??!!
  44. Any ideas?  
  45. Jeff.
  46. babb@ucselx.sdsu.edu
  47.  
  48. -- 
  49. Jeff Babb - Programmer/Technical Support - San Diego State University
  50. Language Acquisition Resource Center (L.A.R.C.) (619)594-4475 
  51. babb@ucsvax.sdsu.edu  
  52. .."now go away or I shall taunt you a second time" M.P.& T.H.G. 
  53.