Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!tank!gft_robert@gsbacd.uchicago.edu From: gft_robert@gsbacd.uchicago.edu Newsgroups: comp.sys.mac.programmer Subject: Script Manager Date Questions Message-ID: <9537@tank.uchicago.edu> Date: 31 May 90 21:29:45 GMT Sender: news@tank.uchicago.edu Organization: University of Chicago Graduate School of Business Lines: 56 I have a couple of questions with regard to manipulation of dates with the Script Manager: 1) When you fill in a LongDateRec to pass to LongDate2Secs, I don't understand what you do with some of the fields. I guess you zero .era out, since it's AD, but what do you do with .pm? Is it 1 for PM, 0 for AM? Doesn't seem to make much difference what I do with it; .hour seems to determine whether it's am or pm. And what about .res1,.res2, and .res3? Do I zero them out, or leave them be? 2) If you just want to use a "default" value for the intlParam parameter in the IULDateString and IULTimeString calls, what do you fill in? The Script Manager guide seems to say that if you put 0 into intlParam, you use international resource 0. So you just pass handle(0) I assume. Seems to work, but is it right? 3) Is there any new routine which one can use in place of GetDateTime? GetDateTime returns a longint, which in THINK Pascal is a signed longint, and thus negative. If there were a routine which returned a LongDateTime, that would be better. Failing that, does the following routine look OK to convert a signed longint to a comp (I use such an iterative process to avoid intermediate overflow values, which seem to pop up if I just do it in one big assignment): function Long2Comp (long: longint): comp; {% converts signed long into comp, taking into account overflow of signed long %} var tempComp: comp; begin if long < 0 then begin tempComp := long; tempComp := tempComp + 2; tempComp := tempComp + maxlongint; tempComp := tempComp + maxlongint; end else tempComp := long; Long2Comp := tempComp; end; {Long2Comp} Any info much appreciated! Thanks, Robert ============================================================================ = gft_robert@gsbacd.uchicago.edu * generic disclaimer: * "It's more fun to = = * all my opinions are * compute" = = * mine * -Kraftwerk = ============================================================================