Declare Var=$txtmsg Type=String
Declare Var=$CurrentSort Type=String
Declare Var=$x Type=Numeric
Declare Var=$xarray Type=Numeric
Declare Var=$count Type=Numeric
Declare Var=$countMax Type=Numeric
Declare Var=$DateCur Type=Date
Declare Var=$DateNxt Type=Date
Declare Var=$DateBegin Type=Date
$xarray=5
$countMax=1
array(1,0) = NumToStr($xarray)
Mfilter where=Found
If $_FilterCount > 0
$CurrentSort = $_OrderBy
SQLSort OrderBy=FoundByMeDate
GoTo Position=TOP
GoSub Name=InitDate
While not($_EOL)
BeginCase
Case $d_FoundByMeDate = $DateCur
Case $d_FoundByMeDate = $DateNxt
$count = $count+1
$DateCur = $d_FoundByMeDate
$DateNxt = $DateCur+1
OtherWise
If $Count>$countMax
$countMax = $count
$txtmsg=FormatNumber("0000", $Count) + " zwischen " + DateFormat($DateBegin) + " und " + DateFormat($DateCur)
If $x=$xarray
$x=0
EndIf
$x = $x + 1
array(1,$x)= $txtmsg
EndIf
GoSub Name=InitDate
EndCase
GoTo Position=Next
EndWhile
SQLSort OrderBy=$CurrentSort
array(1,-2)="D"
$x=1
$txtmsg = ""
while $x <= $xarray
$txtmsg = $txtmsg + array(1,$x) + $_NewLine
$x = $x + 1
EndWhile
MsgOK msg=$txtmsg
EndIf
BeginSub Name=InitDate
$count = 1
$DateBegin=$d_FoundByMeDate
$DateCur=$DateBegin
$DateNxt=$DateCur+1
EndSub