home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / hypercar / 4676 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.5 KB  |  43 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!nwnexus!tbenedic
  3. From: Tom Benedict <tbenedic@halcyon.com>
  4. Subject: Re: ItemDelimiter property in HC 2.1
  5. Message-ID: <oNTiwB1w165w@halcyon.com>
  6. Originator: bbs@halcyon.com
  7. Sender: sso@nwnexus.WA.COM (System Security Officer)
  8. Organization: The 23:00 News and Mail Service
  9. References: <1992Dec28.140110.16639@vax5.cit.cornell.edu>
  10. Date: Tue, 29 Dec 1992 01:50:59 GMT
  11. Lines: 30
  12.  
  13. vry@vax5.cit.cornell.edu writes:
  14.  
  15. > Does anyone out there know about the ItemDelimiter property in HC 2.1?
  16. > Someone told me it existed, but I haven't been able to find any documentation
  17. > on it, and it sounds like something I could really use. If you know about it
  18. > then please e-mail me at vry@cornella.cit.cornell.edu. Thanks.
  19. > Victor Chavarria
  20.  
  21. You can use the itemDelimiter property in HyperCard 2.1 to specify, for 
  22. the duration of the handler, the character that HyperCard should 
  23. recognize as delimiting the 'item' chunk.
  24. this means that you can parse a short file name out of the long path name 
  25. "My Disk:HyperCard 2.1:My Stacks:theStackName" with the following 
  26. function:
  27. function shortFileName str
  28.   set itemDelimiter to ":"
  29.   get last item of str
  30.   set itemDelimiter to comma
  31.   return it
  32. end shortFileName
  33.  
  34. Note that even though the itemDelimiter is reset to comma on idle, I 
  35. explicitly set it back to comma within the function because the handler 
  36. which calls shortFileName may do some item manipulation that expects 
  37. comma delmited chunks.
  38.  
  39. the itemDelimiter property is very useful.
  40.  
  41. Tom Benedict
  42.