Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
With the forum function, this:
[code:1:e464a30e7f]fmDate:=Input("Start ddmmyy (0=first trade)",0,311299,0);
fmDay:=If(fmDate=0,ValueWhen(1,Cum(1)=1,DayOfMonth()),Int(fmDate/10000+.5));
fmMonth:=If(fmDate=0,ValueWhen(1,Cum(1)=1,Month()),Int((fmDate-fmDay*10000)/100+.5));
fmYear:=If(fmDate=0,ValueWhen(1,Cum(1)=1,Year()),Int(fmDate-Int(fmDate/100+.5)*100+.5));
fmYear:=If(fmYear<100,If(fmYear<40,fmYear+2000,fmYear+1900),fmYear);
toDate:=Input("End ddmmyy (0=last trade)",0,311299,0);
toDay:=If(toDate=0,LastValue(DayOfMonth()),Int(toDate/10000+.5));
toMonth:=If(toDate=0,LastValue(Month()),Int((toDate-toDay*10000)/100+.5));
toYear:=If(toDate=0,LastValue(Year()),Int(toDate-Int(toDate/100+.5)*100+.5));
toYear:=If(toYear<100,If(toYear<40,toYear+2000,toYear+1900),toYear);
betweenDates:=((DayOfMonth()>=fmDay AND Month()=fmMonth AND Year()=fmYear) OR (Month()>fmMonth AND Year()=fmYear) OR Year()>fmYear) AND ((DayOfMonth()<=toDay AND Month()=toMonth AND Year()=toYear) OR (Month()<toMonth AND Year()=toYear) OR Year()<toYear);[/code:1:e464a30e7f]
can be written as :
[code:1:e464a30e7f]fmDate:=Input("Start yyyymmdd (0=last trade)",0,20201231,20060101);
toDate:=Input("End yyyymmdd (0=last trade)",0,20201231,0);
ExtFml("ForumDll.DateRange", fmDate, toDate);[/code:1:e464a30e7f]
Simple. No?
wabbit :D
|