Announcement

Collapse
No announcement yet.

4D-CD-00032 ViSi Date Input Validation with Keyboard

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

  • 4D-CD-00032 ViSi Date Input Validation with Keyboard

    This codebase example demonstrates how a keyboard object is used as an input interface for accepting a date string from the user. The program then parses the 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". Otherwise, 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

    Note also that the blinking underscore cursor functionality is made possible through the use of the routines in the include file "blinkCursorRoutines<rev no.>.inc". To know more about this functionality, refer to the codebase example:

    4D-CD-00040 ViSi Keyboard Input Interface with an Underscore Cursor


    Instructions:

    1. Compile the attached ViSi project and upload the program to a uLCD-32PTU (or your target display).

    2. In step 1, Workshop 4 will ask for a uSD card to which the graphics or supporting files will be copied. Mount the uSD card to the PC, copy the files, unmount the uSD card from the PC, and mount it to the display module.

    3. The program should now run on the display module. See the video for more information.

    Note: If unfamiliar with steps 1 and 2, see the application notes.


    Attached Files
    Doff
Working...
X