English
Source / code snippets

date Letzer month day

 
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
 
10/12/12  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.334 Views

Untitledvor 0 min.
ecki02/10/23
p.specht11/21/21
R.Schneider11/20/21
Uwe Lang11/20/21
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie