|
Post by perfinit on Feb 19, 2020 3:26:59 GMT -5
Does Liberty Basic have a way to breakdown a data element into sections? For instance, if I had a date in the following format: MM/DD/YYYY - is there a way to separate the month, day, and year - and then use those sub-elements in my program?
|
|
|
Post by tsh73 on Feb 19, 2020 3:40:58 GMT -5
Read help on WORD$ basically, WORD$("MM DD YYYY", 2) second word if delimited by spaces WORD$("MM/DD/YYYY", 2, "/") second word if delimited by delimiter supplied as 3rd argument
And of course you can store it and use it (use VAL to convert sting to number if needed)
date$ = "02/19/2020" mm$=WORD$(date$, 1, "/") dd$=WORD$(date$, 2, "/") yyyy$=WORD$(date$, 3, "/")
print mm$, dd$, yyyy$
|
|
|
Post by perfinit on Feb 19, 2020 4:33:01 GMT -5
Got it! Thank you!
|
|