Just bought 'The Waite Group's GW_BASIC Primer Plus' from Amazon and have started working my way through the book. The first issue I have is with DATE$, it returns the date in the U.S. Format (mm-dd-yyy), but I would rather have the date in the European Format (dd-mm-yyyy).
I may be getting ahead of myself, but I have written a subroutine to convert DATE$ to the European Format in the form '14 Apr 2020' so there is no confusion between the U.S. And European Format. As this is my first program I would be grateful if anyone cares to comment on whether I have done this correctly or is there a more efficient way of doing this.
100GOSUB1000110PRINTD$120END130'140'1000'Convert DATE$ to an unambiguous format returned in D$1010OPTION BASE11020DIMM$(12)1030DATA"Jan","Feb","Mar","Apr","May","Jun"1040DATA"Jul","Aug","Sep","Oct","Nov","Dec"1050FORI=1TO121060READM$(I)1070NEXTI1080'1090D$=DATE$1100DAY$=MID$(D$,4,2)1110MONTH=VAL(LEFT$(D$,2))1120YEAR$=RIGHT$(D$,4)1130'1140' Swap position of D$=DAY$ and M$(MONTH) for US date format.1150D$=DAY$+" "+M$(MONTH)+" "+YEAR$1160RETURN
Just bought 'The Waite Group's GW_BASIC Primer Plus' from Amazon and have started working my way through the book. The first issue I have is with DATE$, it returns the date in the U.S. Format (mm-dd-yyy), but I would rather have the date in the European Format (dd-mm-yyyy).
I may be getting ahead of myself, but I have written a subroutine to convert DATE$ to the European Format in the form '14 Apr 2020' so there is no confusion between the U.S. And European Format. As this is my first program I would be grateful if anyone cares to comment on whether I have done this correctly or is there a more efficient way of doing this.
Stuart
Last edit: Tuxtoo 2020-04-14
It runs good
Good job
The dtae format was used for filing be for computer's
It is now the standard in the USA
Dave
Last edit: Smithdoor 2020-04-14