Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!dartvax!eleazar.dartmouth.edu!jkc From: jkc@eleazar.dartmouth.edu (Kevin Calhoun) Newsgroups: comp.sys.mac.programmer Subject: String2Date (Script Manager 2.0) Message-ID: <12668@dartvax.Dartmouth.EDU> Date: 15 Mar 89 14:16:22 GMT Sender: news@dartvax.Dartmouth.EDU Reply-To: jkc@eleazar.dartmouth.edu (Kevin Calhoun) Organization: Dartmouth College, Hanover, NH Lines: 32 Does the String2Date routine documented in the Inside Macintosh Interim Chapter Draft of the Script Manager 2.0, dated February, 1989, really work under System 6.0.3? I'm using the following code and getting mixed results. The handle h is locked when I call String2Date -- err := InitDateCache(@myDateCache); if err = noErr then string2dateResult := String2Date(h^, GetHandleSize(h)-1, @myDateCache, lengthUsed, dateTime); If the text in h is "September 1, 1987", this works well, but if it's "September 10, 1987", I get a privilege violation (of all things) with the pc pointing to a STOP instruction (of all things) in the itl4 resource. Whenever I use this format for the date, as long as the day of the month is less than 10, all's well, but otherwise I'm in trouble. If I use the short date format, as in "9/1/87", it never works. I'm trying to write a HyperCard XFCN that will convert dates properly even when they fall outside of the magic range of 1/1/1904 to whenever it is that I can't remember now and can't calculate in my head on the fly. I suspect that HyperCard doesn't yet rely on the new Script Manager routines because they don't work. Can anyone confirm my suspicion? --Kevin Calhoun Courseware Development Dartmouth College "Is is buggy in here or is it just me?"