English
Forum

Letzer this month's

 
- Page 1 -



ByteAttack
want gladly always out find, which day in the month the latest is.
To umständlich the code, or goes straight yet? goes it Perhaps plainer?
CompileMarkSeparation
Proc Letzter

    declare Wahl!,Tag$,last$
    Parameters Monat%,Jahr%
    Wahl! = dt("setDate", Jahr%, Monat%, 28)
    Tag$=dt("DateTimeStr","dd", Wahl!)

    WhileNot Tag$="01"

        last$=dt("DateTimeStr","dd", Wahl!)
        Wahl!=dt("getDate", 0, Wahl! + 1)
        Tag$=dt("DateTimeStr","dd", Wahl!)

    EndWhile

    print "Letzter des Monats "+ Str$(Monat%)+"."+Str$(Jahr%)+" ist der:"+last$+"."

EndProc

Letzter 02,2012' Letzter dieses Monats
waitmouse
 
10/11/12  
 



« this Posting watts as Solution marked. »


RGH
or so without Loop and krytische Formeln:
CompileMarkSeparation
Proc Letzter

    declare Wahl!, last$ , M%, J%
    Parameters Monat%,Jahr%
    M% = Monat% + 1
    J% = Jahr%

    If M% = 13

        M% = 1
        J% = J% + 1

    EndIf

    Wahl! = dt("setDate", J%, M%, 1) - 1
    last$=dt("DateTimeStr","dd", Wahl!)
    print "Letzter des Monats "+ Str$(Monat%)+"."+Str$(Jahr%)+" ist der: +last$+"."

EndProc

Letzter 02,2012' Letzter dieses Monats
waitmouse

Greeting Roland
 
XProfan X2
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
10/11/12  
 



look time:  [...]  &  [...]  .
 
10/11/12  
 




Andreas
Miethe


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
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
10/11/12  
 




RGH
or so without Loop and krytische Formeln:
CompileMarkSeparation
Proc Letzter

    declare Wahl!, last$ , M%, J%
    Parameters Monat%,Jahr%
    M% = Monat% + 1
    J% = Jahr%

    If M% = 13

        M% = 1
        J% = J% + 1

    EndIf

    Wahl! = dt("setDate", J%, M%, 1) - 1
    last$=dt("DateTimeStr","dd", Wahl!)
    print "Letzter des Monats "+ Str$(Monat%)+"."+Str$(Jahr%)+" ist der: +last$+"."

EndProc

Letzter 02,2012' Letzter dieses Monats
waitmouse

Greeting Roland
 
XProfan X2
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
10/11/12  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.519 Views

Themeninformationen



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