Announcement

Collapse
No announcement yet.

4D-CD-00044 Designer or ViSi Parse and Check a Time String

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

  • 4D-CD-00044 Designer or ViSi Parse and Check a Time String



    This codebase example shows how to parse a time string to find the hour, minute, and second information and convert them to their equivalent integer values. The hour, minute, and second information are then tested if they are valid. To accomplish these, the program uses two functions:

    parseTime(var *timeString, var *globalHour,var *globalMinute, var *globalSecond)

    and

    isValidTime(var second, var minute, var hour)


    The function "parseTime(...)" extracts the hour, minute, and second information from timeString and places them to the variables globalHour, globalMinute, and globalSecond, 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 "parseTimeRoutines.inc".

    The function "isValidTime(...)" checks the variables second, minute, and hour if they are valid. If the variables are all valid, the function 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 parseTime(...) function, refer to the codebase example:

    4D-CD-00042 Designer or ViSi Routine for Parsing a Time String


    On the other hand, if you wish to learn more about the function "isValidTime(...)", 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 time string on line 22. 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