ciavaglia
10th July 2014, 21:32
I'm getting no where with Baan support so I'm asking if anyone has had this issue. My experience leads my to believe it's an issue in Baan's Porting Set.

I need to convert strings into dates. I understand that there is many ways to do this. I'm not looking for other solutions. I'm looking to use the standard inputstr.to.date() function as described in the Baan Programming Manual.

My strings can come in 3 formats(mmddyy, m-d-yy, m-d-yyyy).
Below is my program and parts of the datecurr file.

4GL script:
declaration:
long date.val

choice.cont.process:
on.choice:
date.val = inputstr.to.date("010114", "%D015,2") |This returns 735234
date.val = inputstr.to.date("1-1-14", "%D045,2") |This returns -1
date.val = inputstr.to.date("1-1-2014", "%D099,2") |This returns -1
choice.again()

datecurr:
D|0151|MDY|%02m%02d%02y|
D|0152|MDY|%02m%02d%02y|
D|0153|MDY|%02m%02d%02y|
D|0154|MDY|%02m%02d%02y|
D|0451|MDY|%m-%d-%02y|
D|0452|MDY|%m-%d-%02y|
D|0453|MDY|%m.%d.%02y|
D|0454|MDY|%m/%d/%02y|
D|0991|MDY|%m-%d-%04Y|
D|0992|MDY|%m-%d-%04Y|
D|0993|MDY|%m.%d.%04Y|
D|0994|MDY|%m/%d/%04Y|

mark_h
10th July 2014, 23:57
I get same results on my system. I even tried the %D() format and a couple of others. Some return 0 most -1.

günther
11th July 2014, 12:00
Hi.

First of all, have a look at your file $BSE/lib/datecurr, which should contain an entry "D|0452|..." with the expected format.

If not:
1. Make a copy of that file(!)
2. Use the Option "Convert to Runtime" (and re-login) in ttadv4180m000 to create the file.
3. log off and on again.

Regards
Günther

ciavaglia
11th July 2014, 14:41
Gunther

Please note a included a copy of the entries from my datacurr file in the original post.