Announcement

Collapse
No announcement yet.

4D-CD-00043 Designer or ViSi Parse and Check a Date String

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 4D-CD-00043 Designer or ViSi Parse and Check a Date String




    This codebase example shows one way of parsing a date string to find the month, day, and year information and convert them to their equivalent integer values. The month, date, and year information are then tested if they are valid and if they form a valid date. To accomplish these, the program uses two functions:

    parseDate(var *stringDate, var *globaMonth, var *globalDay, var *globalYear)

    and

    isValidDate(var day, var month, var year)

    The function "parseDate(...)" extracts the month, day, and year information from stringDate and places them to the variables globalMonth, globalDay, and globalYear, respectively. If the function was able to extract the required information, it returns a "1". Otherwise, it returns a "0". This function is defined in the include file "parseDateRoutines.inc".

    The function "isValidDate(...)" checks the variables day, month, and year if they are valid and if they form a valid date. If the date is valid, it returns a "1". Otheriwse, it returns a "0". This function is defined in the include file "dateTimeRoutines.inc".

    If you wish to learn more about the parseDate(...) function, refer to the codebase example:

    4D-CD-00041 Designer or ViSi Routine for Parsing a Date String


    On the other hand, if you wish to learn more about the function "isValidDate(...)", refer to the codebase example:

    4D-CD-00023 Designer or ViSi Time and Date Validation



    Instructions:

    1. In the attached Designer code, modify the input date string on line 24. Compile the project and upload it to a uLCD-32PTU (or your target display).

    2. The program should now run on the display module. See the video for more information.
    Attached Files
    Doff
Working...
X