0 Replies Latest reply on Dec 18, 2009 12:35 PM by max.soft

    Simply Input Formatter and Validation


      Hi all,

      about 20 years ago I used to write:

      @  1, 0 SAY "CustNum" GET Customer->CustNum PICT "@Z99999.99" VALID Customer->CustNum > 0


      One row to have:

      input only numeric value or live blank, for blank show Zero, only two digit. Validating input using a boolean function.


      CA-CLIPPER Language, this is the list of formatters/validating:

      @A    Allows only alphabetic characters.
      @B    Numbers will be left justified
      @C    All positive numbers will be followes by CR.
      @D    All dates will be in the SET DATE format.
      @E    Dates will be in British formal: numbers in European format.
      @K    Allows a suggested value to be seen within the GET
          area but clears It if any noncu sor key is pressed when
          the cursor is in the first Position in the GET area.
      @R    Nontemplate characters will be inserted.
      @S<nSize>    Allows horizontal scrolling of a field or variable that
          is <nSize> characters wide.
      @X    All negative numbers will be followed by DB
      @Z    Displays zero values as blanks.
      @!    Forces uppercase lettering
      @(    Displays negative numbers in parentheses with leading spaces.
      @)    Displays negative numbers in parentheses without leading spaces.


      GET templates/formatting rules:
      A    Only alphabetic characters allowed.
      N    Only alphabetic and numeric characters allowed
      X    Any character allowed.
      L    Only T or F allowed For logical data.
      Y    Only Y or N allowed for logical data.
      9    Only digits, including signs, will be allowed.
      #    Only digits, signs. and spaces will he allowed.
      !    Alphabetic characters are converted to Uppercase.
      $    Dollar will be displayed in place of leading
          spaces for numeric data types.
      *    Asterisk,, will Be displayed in place of leading spaces
          for numeric data types.
      .    Position of decimal point.
      ,    Position of comma.


      Exist a way in flex to write 1 row and obtain the same things?


      I agree to have a more complex validating and formatting methods for 1% of textbox, but I think that you need allow smart methods for the 99% of the text input.

      Study CA-Clipper history to WIN.

      CA-Clipper was one of the first OOP language.

      Visual Basic wins on CA-Clipper only because CA-Visual Objects was complex (advanced and complete but complex).

      CaVisualObject was the first real ObjectOriented programming language for commercial purpose but it was to complex, dont make the same errors.

      Think for two layer: Smart Development; Complex Development;

      For example Clipper allow you to use C++ functions, assembler function and re-write some language component (like RDD, Data Input, and so on), new Class Definition, event listener (advanced TBrowse), Internal Language Parser to execute macro stored in strings, advanced Database Relational.


      Internet applications need a smart programming language for business purpose like was Clipper in '80.


      You can do it!


      Looks at past programming languages to make best future programming languages.


      Thank you