joeg
New Member
Posts: 22
|
Post by joeg on Jan 24, 2023 20:02:16 GMT -5
Is there a way to force the user to input a date using the format of mm-dd-yyyy in a non-windows program? And then print that entered date in the desired format?
Thank you
Joe
|
|
|
Post by Brandon Parker on Jan 24, 2023 20:50:40 GMT -5
Are you talking about input into the MainWin?
{:0)
Brandon Parker
|
|
joeg
New Member
Posts: 22
|
Post by joeg on Jan 24, 2023 22:09:16 GMT -5
No. Just plain text BASIC code. Imagine if there was a statement such as INPUT USING "##-##-####" to force date input format. I've got some ideas I'm going to test out.
Thank you for the prompt reply!
Joe
|
|
joeg
New Member
Posts: 22
|
Post by joeg on Jan 24, 2023 23:03:15 GMT -5
I decided to accept the month, day and year as separate string inputs, then concatenate the three strings and adding a "-" between the strings for a result of "mm-dd-yyyy" as one string. Then I used the date$ function to convert the string to a numeric value containing the number of days since Jan 1, 1901 (per the Liberty BASIC help document. Then I used the date$ function again to print the date in the desired format - print date$(dateasnum). I still need to apply logic rules to enforce proper input for each string.
Again, I'm a novice in Liberty BASIC that is also blowing off the dust from the brain cells of BASIC back in the early 1980's. As I get the logic worked out in old school BASIC, I move on to creating it in Liberty basic is text and window formats. Yes, I'm having fun as a retired person!
|
|