PC SOFT

WINDEV的在线文档

  • Numeric controls (except for the currency controls)
  • Currency controls
  • Currency + Euro Controls
  • Date controls
  • Time Controls
  • DateTime controls
  • Duration controls
  • Text controls in the report editor
  • Text controls in the window editor
  • Progress Bar controls
  • Type of input mask
  • Regular expressions in the input masks
  • Limits
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

..输入掩码 is used to:
  • find out the input mask.
  • modify the input mask (among the available masks for the type).
..输入掩码 applies to the all the controls used to enter or display a text:
  • an edit control.
  • a group of edit controls.
  • an editable combo box.
  • a table column,
  • 17版本和更高版本
    WinDev a table column displayed by a combo box.
    17新版本
    WinDev a table column displayed by a combo box.
    WinDev a table column displayed by a combo box.
  • a table cell,
  • a progress bar,
  • 15版本和更高版本
    a formatted static control.
    15新版本
    a formatted static control.
    a formatted static control.
..输入掩码 also applies to the Calculated controls or to the Item controls found in the reports.

Note: The input mask of a control is defined in the window or report editor, in the "General" tab of the control description.

See Input mask for more details.

例子
// Modify the mask of "EDT_CustomerName"
EDT_CustomerName..输入掩码=掩码.大写

// Modify the mask of the 1st table row for the COL_Price column
TABLE_Table1.COL_Price1】..输入掩码="9999,99"
// The mask is taken into account by the displayed value
信息TABLE_Table1.COL_Price1】..显示值)

WinDev用户代码(MCU)
// Accepts digits from 0 to 7 (octal)
MyExpression字符串型"[0-7]"
EDT_Edit1..输入掩码="regexp:"+MyExpression

// Mask for a progress bar
PROGBAR_ProgBar1..输入掩码="Performed at 999,99%"

// Allows the input of a single digit included between 1 and 6
EDT_CONTROL..输入掩码="regexp:[1-6]{0,1}"

// Allow the input of digits and dot character only,
// up to 10 characters
EDT_CONTROL..输入掩码="regexp:[0-9.]{0,10}"

// Input mask for a French registration number
EDT_REGNUM..输入掩码=...
"regexp:[A-Z]{0,2}[ \-]?[0-9]{0,3}[ \-]?[A-Z]{0,2}"

// Input mask with no size limit,
// accepting numbers as well as lowercase and uppercase letters
EDT_CONTROL..输入掩码="regexp:[0-9a-zA-Z]*"

语法

Finding out the input mask of a control 隐藏详细信息

<Result> = <Control Name>..输入掩码
<Result>: Constant or character string
Input mask of the specified control. The input mask depends on the type of control. See notes for more details.
<Control Name>: Character string (with or without quotes)
Name of the control to use.

Modifying the input mask of a control 隐藏详细信息

<Control Name>..输入掩码 = <New Input Mask>
<Control Name>: Character string (with or without quotes)
Name of the control to use.
<New Input Mask>: Constant or character string
New input mask for the specified control. The input mask depends on the type of control. See notes for more details.

WinDev In the window editor, a regular expression can be used to create the mask for the edit controls and the combo boxes: to do so, use the "regexp:" string before the regular expression. See notes for more details.

注意

Numeric controls (except for the currency controls)

1. Preset input masks

掩码.文件大小Numeric mask for the file size and disk size.
17版本和更高版本
掩码.系统数字
17新版本
掩码.系统数字
掩码.系统数字
Numeric mask used by the system. Corresponds to the mask selected in the system regional settings ("Regional options" in the control panel).

Example:

EDT_Edit1..输入掩码=掩码.文件大小
EDT_Edit15681234

The change of unit (from KB to MB for example) is performed for each multiple of 1024. Therefore, the mask may display 1003 KB.

2. Custom input masks

The input masks are defined via the following characters: "9", ".", ",", "+" and "-", "$" and space characters. For example: "99.999,99".

In display mode, the decimal and thousand separators as well as the symbol defined for the language are taken into account.

In programming (regardless of the language):

  • " " (space) is replaced by the thousand separator
  • "," (comma) is replaced by the decimal separator
  • "$" is replaced by the currency symbol (write "$$" to avoid this substitution)

3. Specific custom input masks

  • Using the % symbol:
    Caution: Up to version 90028, the value assigned to the control by programming was displayed as it was, followed by the % character.
    From version 90033, the valued assigned to the control by programming is multiplied by 100 and the "%" character is displayed. To restore the operating mode of the earlier versions, write "%%" to display the % character without multiplying the value by 100.
    Example:
    • Assigning the control by programming:
      EDT_Edit1..输入掩码="999,9%"
      EDT_Edit10.562

      EDT_Edit1..输入掩码="999,9%%"
      EDT_Edit10.562
    • Input in the control by the user:
      • Mask 99.99%, value entered: 19.6, value displayed: 19,6%, valued handled by programming: 0,196.
      • Mask 99.99%%, value entered: 19.6, value displayed: 19,6%, valued handled by programming: 19.6.
  • Using brackets: displaying the negative numbers.
    Example:
    EDT_Edit1..输入掩码="(999 999)"
    EDT_Edit1=-1234// Displays (1 234)
    EDT_Edit11234
  • Using the - sign at the end of string: displaying negative numbers (ability to write "--" to display the - sign at the end of string).
    Example:
    EDT_Edit1..输入掩码="999 999 -"
    EDT_Edit1=-1234// Displays 1 234-
  • Multiple input mask: input mask used to define the format of positive numbers, the format of negative numbers, the value if 0 is used, the value if NULL is used. The following syntax is used:
    <Format of Positive Numbers>;<Format of Negative Numbers>;<Value if 0>;<Value if NULL>

    Example:
    EDT_Edit1..输入掩码="999 999;-999 999;0;<NULL>"
    EDT_Edit1=-1234// Displays - 1 234

    Note: You have the ability to specify a color by using [<Color>] beside the requested mask. <Color> can correspond to:
    • one of the following constants: Red, Green, Blue, Black, White, Yellow, Orange
    • an hexadecimal value in "#BBGGRR" format.
      Example:
      EDT_Edit1..输入掩码="999 999;-999 999[Red];0;<NULL>"
      EDT_Edit1=-1234// Displays - 1 234 in red

      EDT_Edit1..输入掩码="999 999;-999 999[ #FF0000];0;<NULL>"
      EDT_Edit1=-1234// Displays - 1 234 in blue

      Note: The color specified in the input mask has priority over ..颜色. It is ignored if the control is grayed.

Notes:

  • If you want the number to be filled with zeros on the left, use the "0" character on the left of the mask. For example: "099.999,99".
  • If you want the decimal part of the number to be filled with zeros, use the character "9" on the right of the decimal point. For example, when using the "9999,99000" mask, the number 12 is displayed as "12,00" and not as "12,00000".
    However, the number "12,368" is displayed properly: its value is preserved, without being truncated or rounded.
  • To force the signs, use the "+" character on the left. For example: "+9999".
  • 18版本和更高版本
    WinDev You also have the ability to specify hexadecimal input masks (between 0xF and 0xFFFFFFFFFFFFFFFFF).
    18新版本
    WinDev You also have the ability to specify hexadecimal input masks (between 0xF and 0xFFFFFFFFFFFFFFFFF).
    WinDev You also have the ability to specify hexadecimal input masks (between 0xF and 0xFFFFFFFFFFFFFFFFF).

Currency controls

The input masks have the same type as the numeric masks. The difference is found in the precision: the currencies have 17 significant digits for the integer part and up to 6 digits for the decimal part.

For example: "99 999 999 999 999 999,999999".

17版本和更高版本
Note: A preset mask can also be used for the Currency controls:

17版本和更高版本
掩码.系统货币
17新版本
掩码.系统货币
掩码.系统货币
Currency mask used by the system. Corresponds to the mask selected in the system regional settings ("Regional options" in the control panel).
17新版本
Note: A preset mask can also be used for the Currency controls:

17版本和更高版本
掩码.系统货币
17新版本
掩码.系统货币
掩码.系统货币
Currency mask used by the system. Corresponds to the mask selected in the system regional settings ("Regional options" in the control panel).
Note: A preset mask can also be used for the Currency controls:

17版本和更高版本
掩码.系统货币
17新版本
掩码.系统货币
掩码.系统货币
Currency mask used by the system. Corresponds to the mask selected in the system regional settings ("Regional options" in the control panel).

Currency + Euro Controls

The input masks have the same type as the currency masks. The dollar character ("$") can be added into the mask to display the current currency.

For example: "999,99 $" will display "250,25 F" if the current currency is the French Franc.

Date controls

The input masks for the Date controls are:
  • "JJ/MM/AAAA"
  • "DD/MM/YY"
  • 16版本和更高版本
    "DDD DD"
    16新版本
    "DDD DD"
    "DDD DD"
  • "MM/DD/YYYY"
  • "MM/DD/YY"
  • "YYYY/MM/DD"
  • "YY/MM/DD"
  • "DD/MM/YYYY HH:MM:SS"
  • "MM/DD/YYYY HH:mm:SS"
  • "DD/MM/YYYY HH:mm:SS:CCC"
  • "MM/DD/YYYY HH:mm:SS:CCC"
  • "DDDD DD MMMM YYYY"
  • 16版本和更高版本
    "Dddd DD Mmmm YYYY"
    16新版本
    "Dddd DD Mmmm YYYY"
    "Dddd DD Mmmm YYYY"
  • 16版本和更高版本
    "Dddd DD Mmm YYYY"
    16新版本
    "Dddd DD Mmm YYYY"
    "Dddd DD Mmm YYYY"
  • DD (corresponding to the day of the week in digits, for example: 12)
  • "DDDD" (corresponding day of the week, "Thursday" for example). The case used depends on the linguistic options of the project.
  • 16版本和更高版本
    "Dddd" (corresponding to the day of the week with the first letter in uppercase, for example: Monday)
    16新版本
    "Dddd" (corresponding to the day of the week with the first letter in uppercase, for example: Monday)
    "Dddd" (corresponding to the day of the week with the first letter in uppercase, for example: Monday)
  • 16版本和更高版本
    "dddd" (corresponding to the day of the week with the first letter in lowercase, for example: monday)
    16新版本
    "dddd" (corresponding to the day of the week with the first letter in lowercase, for example: monday)
    "dddd" (corresponding to the day of the week with the first letter in lowercase, for example: monday)
  • "DDD" (abbreviation for the day of the week, "Thu" for example). The case used depends on the linguistic options of the project.
  • 16版本和更高版本
    "Ddd" (abbreviation for the day of the week with the first letter in uppercase, for example: Mon)
    16新版本
    "Ddd" (abbreviation for the day of the week with the first letter in uppercase, for example: Mon)
    "Ddd" (abbreviation for the day of the week with the first letter in uppercase, for example: Mon)
  • 16版本和更高版本
    "ddd" (abbreviation for the day of the week with the first letter in lowercase, for example: mon)
    16新版本
    "ddd" (abbreviation for the day of the week with the first letter in lowercase, for example: mon)
    "ddd" (abbreviation for the day of the week with the first letter in lowercase, for example: mon)
  • MM (month in digits, for example: 12)
  • "MMMM" (month spelled out, "January" for example). The case used depends on the linguistic options of the project.
  • 16版本和更高版本
    "Mmmm" (month spelled out with the first letter in uppercase, for example: January)
    16新版本
    "Mmmm" (month spelled out with the first letter in uppercase, for example: January)
    "Mmmm" (month spelled out with the first letter in uppercase, for example: January)
  • 16版本和更高版本
    "mmmm" (month spelled out with the first letter in lowercase, for example: january)
    16新版本
    "mmmm" (month spelled out with the first letter in lowercase, for example: january)
    "mmmm" (month spelled out with the first letter in lowercase, for example: january)
  • "MMM" (abbreviation of the month, "Jan" for example). The case used depends on the linguistic options of the project.
  • 16版本和更高版本
    "Mmm" (abbreviation of the month with the first letter in uppercase, for example: Jan)
    16新版本
    "Mmm" (abbreviation of the month with the first letter in uppercase, for example: Jan)
    "Mmm" (abbreviation of the month with the first letter in uppercase, for example: Jan)
  • 16版本和更高版本
    "mmm" (abbreviation of the month with the first letter in lowercase, for example: jan)
    16新版本
    "mmm" (abbreviation of the month with the first letter in lowercase, for example: jan)
    "mmm" (abbreviation of the month with the first letter in lowercase, for example: jan)
  • "YYYY" (year on four digits, "2001" for example)
  • "YY" (last two digits of the year, "01" for example)
  • the date defined by the project.
    The date defined by the project depends on the date format selected in the parameters of the project language ("Project .. Project description", "Language" tab, linguistic options about the date).The date defined by the project depends on the date format selected in the parameters of the project language:
    • on the "项目" pane, in the "项目" group, click "描述".
    • display the "Languages" tab then the linguistic options regarding the date.
These masks can be combined. For example: "Ddd DD Mmmm YYYY at HH:mm" will return a result in the following format: "Thu 01 February 1979 at 21:35".

Time Controls

The input masks for the time controls are:
  • "HH:MM"
  • "HH h MM"
  • "HH:MM:SS"
  • "HH:MM:SS AM": Used to manage the time in AM/PM format.
  • "HH:MM:SS:CC"
  • The preset mask corresponds to the system time. The system time depends on the mask selected in the regional system setings ("Regional options" in the control panel).
    17版本和更高版本
    掩码.系统时间
    17新版本
    掩码.系统时间
    掩码.系统时间
    Mask used by the system for the time.

DateTime controls

To specify a DateTime input mask, you must:
  1. Switch the type of the control (or table column) to Date ("Details" tab in the description window of the control or column).
  2. Modify the input mask of this control or column ("Details" tab of the description window of the control or column, or ..输入掩码).

Duration controls

The following elements can be used to define a custom mask (case sensitive). To present the custom masks, let's take a duration equal to 0 day 04 hours 15 minutes 03 seconds and 412 thousandths of a second:
  • +1: only the most significant unit will be displayed (the number of hours in our example).
  • +2: only the two most significant units will be displayed (the number of hours and the number of minutes in our example).
    Specify '+3' or '+4' to display the three or four most significant units.
  • D: the number of days will be displayed if this number is greater than 0 (the number of days will not be displayed in our example).
  • H: the number of hours will be displayed if this number (or if the number of days) is greater than 0. If this number contains a single digit, this digit will be displayed (the number of hours will be '4' in our example).
  • HH: the number of hours will be displayed if this number (or if the number of days) is greater than 0. If this number contains a single digit, this digit will be preceded by '0' (the number of hours will be '04' in our example).
  • M: the number of minutes will be displayed if this number (or the number of days, or the number of hours) is greater than 0. If this number contains a single digit, this digit will be displayed (the number of minutes will be '15' in our example).
  • MM: the number of minutes will be displayed if this number (or the number of days, or the number of hours) is greater than 0. If this number contains a single digit, this digit will be preceded by '0' (the number of minutes will be '15' in our example).
  • S: the number of seconds will be displayed if this number (or if the number of days, or the number of hours, or the number of minutes) is greater than 0. If this number contains a single digit, this digit will be displayed (the number of seconds will be '3' in our example).
  • SS: the number of seconds will be displayed if this number (or if the number of days, or the number of hours, or the number of minutes) is greater than 0. If this number contains a single digit, this digit will be preceded by '0' (the number of seconds will be '03' in our example).
  • CC: the number of hundredths of a second will be displayed (the number of hundredths of a second will be '41' in our example).
  • CCC: the number of thousandths of a second will be displayed (the number of thousandths of a second will be '412' in our example).
Note: If the separator corresponds to the ":" character, the letter corresponding to the most significant unit will be added ('h' for hour, 'm' for minute, 's' for second, 'cs' for hundredths of a second and 'ms' for thousands of a second).

WinDev

Text controls in the report editor

The masks defined in the report editor are as follows ("General" tab of control description):

掩码.大写All in uppercase characters.
掩码.小写All in lowercase characters.
掩码.第一个字符大写First letter in uppercase character.

WinDev用户代码(MCU)

Text controls in the window editor

  • The preset masks
    These masks are defined in the window editor ("General" tab of control description).
    掩码.字母加字母加数字Letter, then letters + digits.
    掩码.大写字母加大写字母加数字Uppercase letter, then uppercase letters + digits.
    掩码.IPv6地址IP addresses in IPV6 format such as: aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh:iiii:jjjj
    掩码.IP地址IP address in IPV4 format (for example: 192.168.2.3).
    掩码.MAC地址MAC address in the following format: "aa:bb:cc:dd:ee:ff".
    掩码.字母Letters.
    掩码.大写字母Letters in uppercase characters.
    掩码.字母加数字Letters + digits.
    掩码.大写字母加数字Letters in uppercase characters + digits.
    掩码.无No input mask.
    掩码.邮编French zip code (including the overseas departments): number on 5 digits.
    掩码.德国邮编German zip code.
    掩码.澳大利亚邮编Australian zip code.
    掩码.奥地利邮编Austrian zip code.
    掩码.比利时邮编Belgium zip code.
    掩码.巴西邮编Brazilian zip code.
    掩码.加拿大邮编Canadian zip code.
    掩码.西班牙邮编Spanish zip code.
    掩码.希腊邮编Greek zip code.
    掩码.意大利邮编Italian zip code.
    掩码.荷兰邮编Dutch zip code.
    掩码.葡萄牙邮编Portuguese zip code.
    掩码.新加坡邮编Singaporean zip code.
    掩码.瑞士邮编Swiss zip code.
    掩码.英国邮编British zip code.
    掩码.美国邮编American zip code.
    掩码.电子邮件Email address.
    掩码.多个电子邮件Emails addresses separated by the ";" character.
    掩码.RFC2822电子邮件Email address checking the syntax defined in the RFC2822 and checking the top level domain when exiting from a control.
    掩码.多个RFC2822电子邮件Emails addresses separated by the ";" character. These emails addresses check the syntax defined in RFC2822 and the top level domain in control output.
    掩码.文件而无目录File name (without its directories).
    掩码.澳大利亚身份证号Australian social security number (Tax File Number - TFN).
    掩码.比利时身份证号Belgium social security number (National number).
    掩码.巴西身份证号Brazilian social security number (Cadastro de Pessoas fisicas).
    掩码.加拿大身份证号Canadian social security number (Social insurance number).
    掩码.西班牙身份证号Spanish social security number (Numero de identificacion de Extranjeros).
    掩码.希腊身份证号Greek social security number (Identity card).
    掩码.意大利身份证号Italian social security number (Codice fiscale).
    掩码.荷兰身份证号Dutch social security number (Sofinummer).
    掩码.新加坡身份证号Singaporean social security number (National Registration Identity Card).
    掩码.英国身份证号British social security number (National Insurance Number).
    掩码.美国身份证号American social security number (Social Security Number).
    掩码.INSEEINSEE Number.
    掩码.INSEEkeyINSEE number + key.
    掩码.ISBN10ISBN number on 10 digits.
    掩码.ISBN13ISBN number on 13 digits.
    掩码.大写All in uppercase characters.
    掩码.小写All in lowercase characters.
    掩码.罗马数字Roman numeral (for example: MCMLXXIV).
    掩码.文件名称和路径File name and path.
    掩码.数字Digits.
    掩码.AmericanExpress卡号Number of credit card for American Express on 15 digits.
    掩码.MasterCard卡号Number of credit card for MasterCard on 16 digits.
    maskCardNumberVISANumber of credit card for Visa on 16 digits.
    掩码.银行账号Bank account number according to the IBAN standard: two letters (country code) + two digits (control key) + 11 to 30 digits/letters.
    掩码.数字加符号Digits, '+', ' ', '.', '-', ','
    掩码.姓Letters + Digits + Space + Quote + Dash.
    掩码.大写姓Uppercase Letters + Digits + Space + Quote + Dash.
    掩码.第一个字符大写First letter in uppercase character.
    掩码.银行账户证明RIB number of an account.
    掩码.SIRENSIREN number of a company: number of 9 digits made of eight digits + a control code (on one digit) calculated according to the Luhn algorithm.
    掩码.SIRETSIRET number of a company: SIREN number followed by 4 digits + a control code (on one digit) calculated according to the Luhn algorithm.
    掩码.电话Phone number
    20版本和更高版本
    掩码.比利时电话
    20新版本
    掩码.比利时电话
    掩码.比利时电话
    Phone number in Belgium format (with management of dialing codes, national and international numbers).

    20版本和更高版本
    掩码.加拿大电话
    20新版本
    掩码.加拿大电话
    掩码.加拿大电话
    Phone number in Canadian format (XXX CCC-CCCC or +1 XXX CCC-CCCC, where XXX is the regional code and CCC-CCCC the local number).

    掩码.法国电话Phone number in French format (10 digits, grouped by 2). For example: "04 67 69 40 23" or "36 99".
    20版本和更高版本
    掩码.瑞士电话
    20新版本
    掩码.瑞士电话
    掩码.瑞士电话
    Phone number in Swiss format (0CC CCC CC CC or +41 CC CCC CC CC).

  • The custom masks
    These custom masks are described with the following characters:
    • "9": Single digit
    • "C": Digit or space character
    • "L" (letter L in uppercase): Uppercase letter
    • "l" (letter L in lowercase): Lowercase letter
    • "A": Uppercase alphanumeric character
    • "a": Lowercase alphanumeric character
    • "?": Any character
Any other character is reproduced as it is. Therefore, the masks are never wrong.

Note: A numeric mask can be described in a text control. The value retrieved will be a numeric character string and not a numeric value.
For example: For a French registration number: CCCC LL 9A.

WinDev用户代码(MCU)

Progress Bar controls

In a Progress Bar control, the input mask is used to define the formatting of the text displayed in the progress bar. The mask used by default is "999,9 %". You have the ability to use the custom masks available for a Text control.

Type of input mask

Caution: A mask can be replaced by a mask of the same type. For example, the input mask of a DATE control cannot be replaced by the input mask of a TIME control.

Assigning an incorrect input mask will trigger an error message.

WinDev用户代码(MCU)

Regular expressions in the input masks

The regular expressions used in this property must not be the ones used in 检查正则表达式.

In the input masks, the regular expressions are used to prevent from typing some characters or a sequence of characters.

In 检查正则表达式, the regular expressions are used to check whether a string complies with a format.

Example: Checking whether the T1 string contains a letter and a digit:
  • with 检查正则表达式: the regular expression is [A-Za-z][0-9]
  • with ..输入掩码: the regular expression is [A-Za-z]{0,1}[0-9]{0,1}

Limits

WinDev In a report, ..输入掩码 can only be used on:
  • a calculated control,
  • an Item control.

WinDev In a window, ..输入掩码 only applies to the:
  • edit controls,
  • table columns,
  • 17版本和更高版本
    WinDev table columns displayed by a combo box.
    17新版本
    WinDev table columns displayed by a combo box.
    WinDev table columns displayed by a combo box.
  • editable combo boxes,
  • groups of edit controls,
  • table cells.