Page 1 of 1

accepting (or prompting) a date

Posted: July 18th, 2022, 7:28 am
by AriSilva
Hi folks,
I need to filter some questionaires, skipping (skip case) the ones with a field date below a certain date I would enter during execution time, like an accept, or a prompt,
The field type "date" exists in a form, but not in batch mode.
Best
Ari

Re: accepting (or prompting) a date

Posted: July 18th, 2022, 9:55 am
by Gregory Martin
Can you just use prompt and give the user a format to enter the date. Something like:
numeric date;

while not datevalid(date) do
    string
text_date = prompt("Enter a date in the format: YYYY-MM-DD");
    date = tonumber(replace(text_date, "-", ""));
enddo;

Re: accepting (or prompting) a date

Posted: July 19th, 2022, 5:05 pm
by AriSilva
Sure, that's what I´m doing now.
I was just thinking about using some kind of a calendar date format, as in the form.
Best
Ari