lakeshoresurfer wrote:
> Hi all !
>
> I am trying to find a way to display the previous business date.
>
> Currently I have this :
>
> Clip.setpaste(formatdate("MM",date)++"/"++formatdate("dd",date)
> ++"/"++formatdate("yyyy",date))
Here's a date calculator that is used to type weekday's for a month, it
was made by Alex Peters. It's not ready to use for what you want, but it
would be another chunk of code for your reference to help you build
something.
; Function Description:
; For retrieving the weekdays in a month after a selected date
; and using those dates in a repeating command. Modify the
; FormatDate() section if you want the date in another format.
; Existing date format is mm/dd/yy ie. 01/31/04
;
; Version:
; 1.0 05/05/2004
;
; Author:
; Alex Peters
;
; Modified By:
; David Troesch <[EMAIL PROTECTED]>
@weekend
Local FillerDate = Date.Get
;This is what will be typed before the date
Local BeforeKeys = ""
;This is what will be typed after the date
Local AfterKeys = "{enter}"
;Begin Code
If(FillerDate) Do
Local FillerMonth = Select(FillerDate, 5, 6)
For(Local Output; Select(FillerDate, 5, 6) == FillerMonth; FillerDate =
Date.AddDays(FillerDate, 1))
If(Date.Weekday(FillerDate) And Date.Weekday(FillerDate) != 6)
Output = Output ++ BeforeKeys ++ FormatDate("MM/dd/yy",
FillerDate)
++ AfterKeys
EndFor
Do("*Keys", "{slow}" ++ Output)
EndIf
Quit
@sundaymonday
Local FillerDate = Date.Get
;This is what will be typed before the date
Local BeforeKeys = ""
;This is what will be typed after the date
Local AfterKeys = "{enter}"
;Begin Code
If(FillerDate) Do
Local FillerMonth = Select(FillerDate, 6, 7)
For(Local Output; Select(FillerDate, 6, 7) == FillerMonth; FillerDate =
Date.AddDays(FillerDate, 1))
If(Date.Weekday(FillerDate) And Date.Weekday(FillerDate) != 7)
Output = Output ++ BeforeKeys ++ FormatDate("MM/dd/yy",
FillerDate)
++ AfterKeys
EndFor
Do("*Keys", "{slow}" ++ Output)
EndIf
Quit
HTH
David Troesch | Atlanta, GA | ICQ# 2333123
"Success is not a doorway, it's a staircase."
Funstuff: WANTED: Meaningful overnight relationship