Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difference in Date Save between VPP 7 & FPD
Message
From
27/09/2006 07:02:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01157275
Message ID:
01157436
Views:
18
>Hi Chaps
>
>I've written a prog to work in FPD, to read in an XLS/CSV file and create a table (from a given copy struct).
>
>For ease of use I've been testing it in VFP and everything's hunky-dory. BUT the resultant table is not knowable from FPD26. So I've rebuilt the FPD proj and created a new EXE for it.
>
>When I run this, a date field that yields, say, 11/04/2006 in VFP, ends up with XX/XX/1920.
>
>I've got century on, date british
>
>
>Select IntermTable
>Locate
>Skip				&& 26/09/06 just to skip XLS/CSV header, col headings rec
>Scan Rest
>  Scatter MEMVAR
>  Select DestFB1
>  Append Blank
>  Replace Operator    with tnOperator, ;	
>  	 Journey	    with VAL( m.B), ;	
>  	 Route	    with PADL( ALLTRIM( m.C), 4, "0"), ;
>  	 Date	    with CTOD( m.E), ;
>  	 Class	    with PADL( ALLTRIM( m.D), 4, "0"), ;
>  	 TickTime    with ALLTRIM( m.F), ;
>  	 Number	    with VAL( m.G), ;
>  	 Fare	    with VAL( m.H), ;
>  	 Value	    with VAL( m.I), ;
>  	 OStage	    with PADL( ALLTRIM( m.J), 4, "0"), ;
>  	 DStage	    with PADL( ALLTRIM( m.K), 4, "0"), ;
>  	 Driver	    with VAL( m.L), ;
>  	 Bus	    with VAL( m.M), ;
>  	 Duty	    with VAL( m.N)
>EndScan
>
>
>
>IntermTable is that into which the XLS is initially imported.
>
>The s/s/ date is in the form: XX-XX-2006
>I've just realised that I haven't Set Mark to "-" - would that make any difference?
>
>Obviously, somewhere the s/w is treating the date as short (as with Cent off) but I can't figure out how/why.
>
>Any ideas?
>
>'ppreciate it
>
>Terry

Terry,
I can't explain why VFP would return correct date vs FPD. You're doing a replace ( ctod(m.e) ). That makes me suspect field e width is 8 and not 10 which would explain it returning as 1920. Hard case:) FPD just works right for me.
PS: "-" wouldn't make a difference. And why don't you get it as date into intermtable in the first place?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform