Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Long Date Function
#2
Nice! I love stuff like this. Here's what I used to d a lot of back in the 1990's, to save memory space...

Code: (Select All)
dstring$ = "stndrdthththththth"
mstring$ = "January  February March    April    May      June     July     August   SeptemberOctober  November December "

DO
    LINE INPUT "mo-day-year: ", xdate$
    PRINT RTRIM$(MID$(mstring$, (VAL(MID$(xdate$, 1, 2)) - 1) * 9 + 1, 9)); " ";
    PRINT LTRIM$(STR$((VAL(MID$(xdate$, 4)))));
    IF MID$(xdate$, 4, 2) > "10" AND MID$(xdate$, 4, 2) < "21" OR VAL(MID$(xdate$, 5, 1)) = 0 THEN
        PRINT "th, ";
    ELSE
        PRINT MID$(dstring$, VAL(MID$(xdate$, 5, 1)) * 2 - 1, 2); ", ";
    END IF
    PRINT MID$(xdate$, 7, 4)
    PRINT
LOOP

I used what I termed as "Data Strings" to store info. Parse the string and display the results. Saving mem lead to a lot of obfuscated coding but at least it got the program working when space was an issue.

Pete
Reply


Messages In This Thread
Long Date Function - by AtomicSlaughter - 05-21-2022, 09:20 PM
RE: Long Date Function - by Pete - 05-21-2022, 10:18 PM
RE: Long Date Function - by bplus - 05-24-2022, 08:22 PM



Users browsing this thread: 3 Guest(s)