[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

179.0. "Dates incremented by one" by KERNEL::SMITHERSJ (Living on the culinary edge....) Thu Mar 05 1992 17:14

    Quick question programming chappies....

    With ALL-IN-1 2.4, what would be the best way for the customer
    to achieve a date increment system for his hotel reservation
    application?

    The problem he is having when he tries to validate dates in
    increments of one day. ie, check the hotel on this date, the day
    after etc etc.

    I have played around with DATE_CONVERT into a NBS format, splitting
    that into several parts, incrementing the day temp symbol by
    one and then converting back, but that doesn't validate on
    month boundaries.  Its clumsy and I would then need to validate
    that with if month equals 30, do this etc etc

    I then did a GET CAL$SET_DATE:#a.%whole["29/02/92 +1D"] which
    gives me 1st March OK, but I really want to be able to load
    a symbol into that as the date varies.  However, I haven't 
    been able to achive this.

    I searched in the old conferences but haven't found anything apart
    from one note which wasn't relevant. I did look at TM but its not 
    the easiest bit of programming to read.
    
    Any ideas out there?
    
    Thanks
    Julia UK CSC 

      
    
T.RTitleUserPersonal
Name
DateLines
179.1Old conference 2832/2428.1IOSG::TALLETTMit Schuh bish hiThu Mar 05 1992 17:228
    Hi there!
    
    	You could try 2832.* and 2428.1 in the old conference. They find
    	the difference between two dates, but I must confess that they
    	look dauntingly complex.
    
    Regards,
    Paul
179.2CAL SET DATE [parameter]HYTIDE::CREAMERKeep a low profileThu Mar 05 1992 18:1722
    
    Julia,
    
    It sounds like the CALENDAR SET DATE function will do want you want.
    It loads the symbol into OA$TM_DATE.  As an example, the following
    script _should_ increment the date in the symbol #HOTEL_DATE by
    one day (and return OA$TM_DATE to it's original value).
    
    .LABEL START
    	GET #OLD_TM_DATE = OA$TM_DATE
    	CAL SET DATE #HOTEL_DATE
    	CAL SET DATE +1d
    	GET #HOTEL_DATE = OA$TM_DATE
    	CAL SET DATE #OLD_TM_DATE
    .EXIT
    
    Will this work??
    
    Jack 
    
    
    
179.3IOSG::MAURICEIOSG ain't a place to raise a kidThu Mar 05 1992 18:446
    You were nearly there - you just needed a bit of indirection -  e.g.
    
    get #DATE1 = OA$DATE
    GET OA$FUNCTION = 'GET CAL$SET_DATE:#DATE2.%WHOLE["' #DATE1 ' +1D"]'
    
    gets the result in #date2
179.4Even simplerSCOTTC::MARSHALLPearl-white, but slightly shop-soiledFri Mar 06 1992 14:1010
Hi,

It can be done even more simply...

GET #DATE = OA$DATE "+1d"
GET CAL$SET_DATE:#NEWDATE.%WHOLE[#DATE]

Just substitute whatever you need for 'OA$DATE'...

Scott
179.5KERNEL::SMITHERSJLiving on the culinary edge....Fri Mar 06 1992 14:415
    Brilliant.
    
    Thanks to everyone - works a treat.
    
    julia
179.6only works if a day is really a daySQM::DOTYBoth sides nowMon Mar 09 1992 14:5118
RE: .4, .3., .2 

> GET #DATE = OA$DATE "+1d"
  -----------------------^

This only works for English users or other languages where a "day" begins with
the letter "d".  French users would need "d" to be "j" for "jour", and German 
users would need "d" to be "t" for "tag".

The most correct way, and the way TM does it, is to use the symbol 
OA$TM_SETDATE_D.

Gosh, I only left IOSG a few months ago and it seems all I18N knowledge has
already flown out the window!!! :-)


FWIW,
Susie
179.7IOSG::MAURICEIOSG ain't a place to raise a kidMon Mar 09 1992 15:3611
    Hi Susie,
    
    Thanks for the info. You omitted an _ so the symbol is actually
    OA$_TM_SETDATE_D
    
    From a cursory glance at the documentation of CAL$SET_DATE there is no
    mention of this trap for the unwary. Is the documentation wrong? 
    
    Cheers
    
    Stuart
179.8More TM symbols to aid XlationSQM::DOTYBack in the U S of AMon Mar 09 1992 18:4521
Hi Stuart,

Thanks for catching my typo.  Sometimes I get over-enthusiastic when it
comes to I18n topics and my fingers can't keep up with my brain!!!

Yep, it sounds like the documentation might be wrong.  The symbols 
OA$_TM_SETDATE_D and OA$_TM_SETDATE_W were added in V2.4 to save
translators a lot of grief on TM forms when using the GOLD Arrow
keys.

There are also symbols for the words "TODAY", "TOMORROW", "YESTERDAY",
etc.

Obviously, when using the symbols the syntax must be of the order:

    GET OA$FUNCTION = "CAL SET DATE +1" OA$_TM_SETDATE_D


FWIW,
Susie