I have an appserver routine, that accepts a dataset with info about a procedure to execute, with parameters and stuff...
But now, I deviced some extra functions that it would be nice to have on this processor... the thing is I run out of parameters on the receiving procedure. I'm just missing two dates parameters...
The solution I came is to stuff two dates in one char parameter:
ttBot.CharParam20 = string(date1) + "," + string(date2).
and on the called procedure, unstuff the two dates...
But I just wondered....
Being this program in ISO8859 page, and DMY... the date will be stuffed like "30/10/16,31/12/16", what would happend sometime in future, when some customer on different date format tries to use that app...
What would be the safest way to send two date params to a program using one char variable?
(I´m in no position to expand the interfase of the called procedure)
using ABL to standard .p on appserver 11.3
Have a look at the ISO-DATE function.
Have a look at the ISO-DATE function.
Just have to look the easiest way to turn them back...
Thanks!
I was wondering if that needed to be an int64, but dates still fit nicely in the 16 bit year address space [:)]
def var idate as integer no-undo initial 13689326. message date( idate ) skip date( idate + 1 ) view-as alert-box.
You do realize that doing this kind of thing is pretty much guaranteed to bite you later? Do what it takes to change the interface.
In version 9 I needed to store a date-time in an integer field, so I used:
v-datetime = int(today - 01/01/2005) * 1440 + (time / 60). This is <= 8 digits well into the 22nd century.
These days I use ADD-INTERVAL(DATETIME (01/01/2005),v-datetime,'minutes') to get it back.
I'd agree, only I use a comma delimited list to pass parameters all the time. As long as the program is designed to accept 1 or more entries in the parameter.
Better than what I've seen in the past, i.e.:
def shared variable emp-ids extent 100.
do i - 1 to 100:
if emp-ids[i] <> "" then do:
[...]
end.
end.