| |
|
|
| Letzer month date day
Andreas Miethe (11.10.12)
really goes always what CompileMarkSeparation
Proc Letzter
'Schaltjahr ermitteln
Def IsLeapYear(1) If ((((%(1) MOD 4) = 0 & (%(1) MOD 100) <> 0) | ((%(1) MOD 400) = 0)),1,0)
Declare Monate$,Letzter%
Monate$ = "31,28,31,30,31,30,31,31,30,31,30,31"
PARAMETERS Monat%,Jahr%
Decimals 0
If Monat% = 2
Print "Letzter des Monats "+ Str$(Monat%)+"."+Str$(Jahr%)+" ist der: "+str$(Val(substr$(Monate$,Monat%,","))+IsLeapYear(Jahr%)) +"."
Else
Print "Letzter des Monats "+ Str$(Monat%)+"."+Str$(Jahr%)+" ist der: "+substr$(Monate$,Monat%,",") +"."
EndIf
EndProc
Letzter 02,2012' Letzter dieses Monats
waitmouse
or so CompileMarkSeparation
Proc last
PARAMETERS month%,year%
Declare months$
'leap-year detect
Def IsLeapYear(1) If ((((%(1) MOD 4) = 0 & (%(1) MOD 100) <> 0) | ((%(1) MOD 400) = 0)),1,0)
months$ = "31,28,31,30,31,30,31,31,30,31,30,31"
Return If (month% = 2,Str $(Int(Val(substr$(months$,month%,","))+IsLeapYear(year%))),Str $(Int(Val(substr$(months$,month%,",")))))
ENDPROC
Print "Letzter the month's february 2012 is the "+last(02,2012)+"."' last this month's
waitmouse
or so CompileMarkSeparation
Proc last
Def IsLeapYear(1) If ((((%(1) MOD 4) = 0 & (%(1) MOD 100) <> 0) | ((%(1) MOD 400) = 0)),1,0)
Def $months "31,28,31,30,31,30,31,31,30,31,30,31"
Return If (%(1) = 2,Str $(Int(Val(substr$($months,%(1),","))+IsLeapYear(%(2)))),Str $(Int(Val(substr$($months,%(1),",")))))
ENDPROC
Print "Letzter the month's february 2012 is the "+last(02,2012)+"."' last this month's
waitmouse
RGH (11.10.12)
or so without Loop and krytische Formeln: CompileMarkSeparation
Proc last
declare electoral!, last$ , M%, J%
Parameters month%,year%
M% = month% + 1
J% = year%
If M% = 13
M% = 1
J% = J% + 1
EndIf
electoral! = dt("setDate", J%, M%, 1) - 1
last$=dt("DateTimeStr","dd", electoral!)
print "Letzter the month's "+ Str $(month%)+"."+Str $(year%)+" is the: +last$+"."
ENDPROC
last 02,2012' last this month's
waitmouse
Greeting Roland |
|
|
| |
|
|