For Programmers: Free Programming Magazines  


Home > Archive > Clarion > May 2006 > Date incrementing code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Date incrementing code
Roger Dilling

2006-05-23, 6:55 pm

I have a C5 order entry app that I wish to increment the order date by
one day if the order is entered after noon. I have tried a variety of
code embeds without success. I have gcal global templates installed
in the app. Below is just on of several code snipits I have tried
without success.

If Loc:Time > 1200
Ord:OrdDate = gsBUSINESSPLUS(Loc:OperDate,1,1)
Else
ORD:OrdDate = Loc:OperDate
End ! If

Loc:Time is defined as the computer time based on a 2400 clock
sandinzz@yahoo.com

2006-05-24, 3:55 am

Hi, Roger.

All variables in your *.DCT or variables that keep date or time must be
of LONG type.
12:00 has to be string '12:00' which must be converted/deformated to
number.

!
! In Window Manager -> Init
!

Loc:Time = CLOCK()
Loc:OperDate = TODAY()

!
! In OK button
!

IF LOC:TIME > DEFORMAT('12:00',@T1)
ORD:ORDERDATE = TODAY() + 1
ELSE
ORD:ORDERDATE = TODAY()
END

Best wishes from Zoran

Roger Dilling

2006-05-24, 7:55 am

Thanks,
That worked. I was taking the format the wrong way
Roger

On 24 May 2006 00:29:53 -0700, sandinzz@yahoo.com wrote:

>Hi, Roger.
>
>All variables in your *.DCT or variables that keep date or time must be
>of LONG type.
>12:00 has to be string '12:00' which must be converted/deformated to
>number.
>
>!
>! In Window Manager -> Init
>!
>
> Loc:Time = CLOCK()
> Loc:OperDate = TODAY()
>
>!
>! In OK button
>!
>
> IF LOC:TIME > DEFORMAT('12:00',@T1)
> ORD:ORDERDATE = TODAY() + 1
> ELSE
> ORD:ORDERDATE = TODAY()
> END
>
>Best wishes from Zoran


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com