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|
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|