English
C ++ Forum

Wrong Result with Date Calculations!

 

Stefan
M.
Caillet
Hello Sebastian,
I knows, you have little Time, but can You you nevertheless time standing, Why this code to Umsetzung to C++ one Wrong Result supply?
The code ought to The number the KalenderWoche the 27.11.2008 zurückliefern - what 48 is.
Klappt under XProfan11 perfect. Profan2CPP (Profan2Cpp - Trial 2.0a-pre5) lieferk no Error Message Exe becomes created and is executable. however supply These one completely Wrong Result zurück; tappt im dunkeln says namely the 27.11.2008 lie in the week 52!
The function The The Wochennummer supply means "DoY"
likewise supply The Funkton "MoW$" One Wrong Result : it supply for week 52 (JAHR 2008) as monday whom 24.12.2008 back -> should but the 22.12.2008 his.
As I said: under XPROFAN 11 go The Berechnungen correctly implemented.
have The Datums-Test_p2cpp.prf as attachment angefügt.

The informations of Profan2CPP:
New proposition --->
input: E:StefanJOSYs-AdressbuchDATUMS-TEST_p2cpp.prf
spending: E:StefanJOSYs-AdressbuchDATUMS-TEST_p2cpp_cpp

bind Include-Files one... ok.
read Header-Files... ok.
Überprüfe Syntax... ok.
Erstelle directories... ok.
supplant Header-Definitionen... ok.
Übersetze... ok.
Erstelle PrfMain.cpp... ok.
copy Header... ok.
copy Bibliotheken... ok.
Generiere Makefile... ok.

proposition successful Translated!
[861 Lines in 451 ms]
memory-balance:
====================================

allocated : 5120 KByte (99772)
freed : 5120 KByte (99772)
------------------------------------
difference : 0 byte (0)

Spitzenwert : 45488 byte
====================================

AUSGABE of MAKE.BAT:
"Cev-C++Bing++.exe" -c PrfMain.cpp -o .objPrfMain.o -I"Cev-C++\include" -I"Cev-C++\includeg++" -L"Cev-C++\lib" -B"Cev-C++\bin" -fexceptions -s -mwindows -w -O2 -fvtable-thunks -fno-elide-constructors
"Cev-C++Bing++.exe" -c DATUMS-TEST_p2cpp.cpp -o .objDATUMS-TEST_p2cpp.o -I"Cev-C++\include" -I"Cev-C++\includeg++" -L"Cev-C++\lib" -B"Cev-C++\bin" -fexceptions -s -mwindows -w -O2 -fvtable-thunks -fno-elide-constructors
"Cev-C++Bing++.exe" -o "DATUMS-TEST_p2cpp.exe" ".objPrfMain.o" ".objDATUMS-TEST_p2cpp.o" ".esesource.o" ".libplibbase.lib" ".libplibstr.lib" ".libplibwin.lib" ".libplibtxt.lib" -luuid "Cev-C++\liblibglu32.a" "Cev-C++\liblibopengl32.a" "Cev-C++\liblibole32.a" "Cev-C++\liblibolepro32.a" "Cev-C++\liblibodbc32.a" "Cev-C++\liblibwsock32.a" "Cev-C++\liblibcomctl32.a" "Cev-C++\liblibwinmm.a" -I"Cev-C++\include" -I"Cev-C++\includeg++" -L"Cev-C++\lib" -B"Cev-C++\bin" -fexceptions -s -mwindows -w -O2 -fvtable-thunks -fno-elide-constructors
Finished.

thanks for your trouble.
greeting Stefan

22 kB
Kurzbeschreibung: supply as C++ incorrect Results - Rechnet under XProfan11 correctly
Hochgeladen:11/27/08
Downloadcounter146
Download
 
Ich habe grosses Glück, weil ich Mitmenschen helfen darf.
Entwicklungsumgebung:
XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit
PC: P4/3GHz , 2GB RAM , 1700GB HD
Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD
11/27/08  
 




Stefan
M.
Caillet
Hello Sebastian,
I could now the trouble something enger eingrenzen!
The Proc "WoY" calls unteranderem The Proc "DoW" (Day of Week) in following shape as function on:
CompileMarkSeparation
DoW neujahr$   neujahr$ = 01.01.2008
wtgnj%=if(%(0)=0,7,%(0)) )) Neuj.: So. wird WoTagnr. 7e>

here supply %(0) always 0 back, instead of the Return-Wertes
let I me in Proc "DoW" whom Return-worth a row to "RETURN rc%" spend, is it correctly.

If I the appeal however in following shape ausführe, is correct the Return-worth:
CompileMarkSeparation
Declare FN%
FN% = DoW(neujahr$)
wtgnj%=if(FN%=0,7,FN%) )) Neuj.: So. wird WoTagnr. 7re>

clear can I now The suitable Funktionsaufrufe anpassen; you're any in a INC include, The I abeR not sebst written have, is something with difficulty, if I for C++ Translation first any fremmden INCs to such Call search must.
If you it hinbekommst, that the Return-worth correctly zurückgegeben becomes, Ersparst You me ne crowd Arbaeit.
Ah Yes, yet something, I have of course The CD with the Full Version of Profan2CPP not yet receive, however has me JDS already The serial number by MAIL delivered!
thanks
love Regards
Stefan
 
Ich habe grosses Glück, weil ich Mitmenschen helfen darf.
Entwicklungsumgebung:
XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit
PC: P4/3GHz , 2GB RAM , 1700GB HD
Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD
11/27/08  
 




Sebastian
König
Hello Stefan,

Stefan M. Caillet
Hello Sebastian,
I could now the trouble something enger eingrenzen!
[...]


thanks for detailed Description. i'll me naturally therefore concern, find but most likely first on the WE or beginning next week enough Time for. it power in the doing a Difference, whether a procedure with or without clinging (i.e. as function) called becomes - too in XProfan self, but probably have I one detail thereby not correctly. in Profan2Cpp umgesetzt.

Stefan M. Caillet
Ah Yes, yet something, I have of course The CD with the Full Version of Profan2CPP not yet receive, however has me JDS already The serial number by MAIL delivered!


Ah super - if you me The number by PM or Mail zukommen can, sufficient me the as Proof your Full Version.

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
11/27/08  
 




Sebastian
König
Hello Stefan,

i think, I could the trouble to fix. there one mittelschwerer invasion on the management the Parameter-Stacks necessary was, must the whole yet in detail tested go. Perhaps have You for Yes another couple others Codes I can you In any drop gladly a new Version to that testing send.

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
12/01/08  
 




Stefan
M.
Caillet
Hello Sebastian,
thanks you Herzlichst for your trouble,
will be you today noon (with us in the switzerland is it now 04:17) The serial number Per PM Send. be now To tired, circa yet clear enough To think, so I the correctly hinbekomme.
I hope now finally tired enough To his, so I time something sleep can - is namely already 54 hours since, since I letztesmal gesxhlafen have. These verfl... insomnia!
greeting Stefan
 
Ich habe grosses Glück, weil ich Mitmenschen helfen darf.
Entwicklungsumgebung:
XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit
PC: P4/3GHz , 2GB RAM , 1700GB HD
Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD
12/01/08  
 




Sebastian
König
Oha, then wish I you plenty success at fall asleep and good silence! having me already gewundert, here circa these Time a response To get...
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
12/01/08  
 




Stefan
M.
Caillet
Hello Sebastian,
and again is ne night? for me past, thanks the good Opportunities, has at least times for 8 hours worked. usually sleep I, if I can, between 5:30 od 6:30 To ca. 9.00 od 9:30 - so I do not before geweckt will be od. wake. If I on 4 hours sleep come, be I already happy, often are it 2 - 3 hours. the as Statement why you circa these Time response on dien Posting receive had.
so, i'll you yet The PM with the serial number Send.
greeting Stefan
 
Ich habe grosses Glück, weil ich Mitmenschen helfen darf.
Entwicklungsumgebung:
XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit
PC: P4/3GHz , 2GB RAM , 1700GB HD
Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD
12/01/08  
 




Sebastian
König
Hello Stefan,

have The PM receive - thanks! I make same time a new Version ready and mail tappt im dunkeln you by Email.

sleep do I here in Hong Kong in the momentum too plenty less than in Germany, in the average 5 To 6 hours per night (ok, is from your visibility well already plenty). Interessanterweise be I so but ausgeschlafen - must well on the climate here lying...

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
12/02/08  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.102 Views

Untitledvor 0 min.
T Rümker05/19/14
Ernst05/13/14
J. Strahl07/14/12
KJ04/01/12
More...

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