{"id":25232,"date":"2020-11-05T17:07:56","date_gmt":"2020-11-05T10:07:56","guid":{"rendered":"https:\/\/tom.ji42.com\/?p=25232"},"modified":"2020-11-05T17:07:56","modified_gmt":"2020-11-05T10:07:56","slug":"format-property","status":"publish","type":"post","link":"https:\/\/tom.tomwork.net\/?p=25232","title":{"rendered":"Format Property"},"content":{"rendered":"<div id=\"header\">\n<table id=\"topTable\" width=\"100%\">\n<tbody>\n<tr id=\"headerTableRow1\">\n<td align=\"left\"><span id=\"runningHeaderText\">Visual FoxPro 9.0 Language Reference<\/span><\/td>\n<\/tr>\n<tr id=\"headerTableRow2\">\n<td align=\"left\"><span id=\"nsrTitle\">Format Property<\/span><\/td>\n<\/tr>\n<tr id=\"headerTableRow3\">\n<td><a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/e1c96289-3368-4546-84ce-8b1bd6163e43.htm#seeAlsoToggle\">See Also\u00a0<\/a>\u0412<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table id=\"bottomTable\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td><span tabindex=\"0\"><img decoding=\"async\" id=\"toggleAllImage\" class=\"toggleAll\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/collall.gif\" \/><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div id=\"mainSection\">\n<div id=\"mainBody\">\n<div id=\"allHistory\" class=\"saveHistory\"><\/div>\n<p>Specifies the input and output formatting of a control&#8217;s\u00a0<b>Value<\/b>\u00a0property. Available at design time and run time.<\/p>\n<div id=\"syntaxSection\" class=\"section\">\n<div id=\"syntaxCodeBlocks\" class=\"code\">\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<th align=\"left\"><\/th>\n<\/tr>\n<tr>\n<td>\n<pre><i>Control.<\/i>Format[ = <i>cFunction<\/i>]<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h1 class=\"heading\"><span tabindex=\"0\"><!--more--><img decoding=\"async\" id=\"returnValueToggle\" class=\"toggle\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/collapse.gif\" name=\"toggleSwitch\" \/>Return Value<\/span><\/h1>\n<div id=\"returnValueSection\" class=\"section\">\n<dl>\n<dt><i>cFunction<\/i><\/dt>\n<\/dl>\n<dl>\n<dd>Specifies the character constraints for data entry and formatting for display. The following table lists the valid\u00a0<i>cFunction<\/i>\u00a0values for the appropriate controls.<\/p>\n<h3 class=\"subHeading\"><\/h3>\n<table>\n<tbody>\n<tr>\n<th><i>cFunction<\/i><\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td><b>EditBox<\/b>\u00a0control<\/td>\n<\/tr>\n<tr>\n<td>K<\/td>\n<td>Selects all the text when the control gets focus.<\/td>\n<\/tr>\n<tr>\n<td><b>Spinner<\/b>\u00a0control<\/td>\n<\/tr>\n<tr>\n<td>$<\/td>\n<td>Displays the currency symbol.<\/td>\n<\/tr>\n<tr>\n<td>^<\/td>\n<td>Displays numeric data using scientific notation.<\/td>\n<\/tr>\n<tr>\n<td>K<\/td>\n<td>Selects all the text when the control gets the focus.<\/td>\n<\/tr>\n<tr>\n<td>L<\/td>\n<td>Displays leading zeros instead of spaces in the text box.<\/td>\n<\/tr>\n<tr>\n<td>R<\/td>\n<td>Displays the format mask for the text box that is specified in the\u00a0<b>InputMask<\/b>\u00a0property.<\/p>\n<p>The mask formats data for easier entry and clearer display (for example, if the mask is 99-999, the number 12345 is displayed as 12-345), but is not stored as part of the data. Use only with character or numeric data.<\/td>\n<\/tr>\n<tr>\n<td><b>TextBox<\/b>\u00a0control and\u00a0<b>Column<\/b>\u00a0object<\/td>\n<\/tr>\n<tr>\n<td>!<\/td>\n<td>Converts alphabetic characters to uppercase. Use with data of\u00a0<b>Character<\/b>\u00a0type only.<\/td>\n<\/tr>\n<tr>\n<td>$<\/td>\n<td>Displays the currency symbol. The\u00a0<b>ControlSource<\/b>\u00a0property must specify a numeric source for the text box.<\/td>\n<\/tr>\n<tr>\n<td>^<\/td>\n<td>Displays numeric data using scientific notation. The\u00a0<b>ControlSource<\/b>\u00a0property must specify a numeric source for the text box.<\/td>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>Allows alphabetic characters only with no spaces or punctuation marks.<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td>Uses the current\u00a0<b>SET DATE<\/b>\u00a0format.<\/td>\n<\/tr>\n<tr>\n<td>E<\/td>\n<td>Edits\u00a0<b>Date<\/b>\u00a0values as British dates.<\/td>\n<\/tr>\n<tr>\n<td>F<\/td>\n<td>Prevents\u00a0<b>Varchar<\/b>\u00a0values from being padded with trailing spaces in text boxes or\u00a0<b>Varbinary<\/b>\u00a0values from being padded with trailing zeroes (0s).<\/p>\n<div class=\"alert\">\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<th align=\"left\"><img decoding=\"async\" class=\"note\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/note.gif\" \/>Note:<\/th>\n<\/tr>\n<tr>\n<td>For text boxes bound to data with\u00a0<b>Varchar<\/b>\u00a0type, the\u00a0<b>MaxLength<\/b>\u00a0property must be set to a nonzero value to permit input for the desired number of characters.&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"alert\">\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<th align=\"left\"><img decoding=\"async\" class=\"note\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/note.gif\" \/>Note:<\/th>\n<\/tr>\n<tr>\n<td>When you drag a field with\u00a0<b>Varchar<\/b>\u00a0type to a form, the created text box&#8217;s\u00a0<b>Format<\/b>\u00a0property is set to &#8220;F&#8221;, and the\u00a0<b>MaxLength<\/b>\u00a0property is set to the maximum length for the\u00a0<b>Varchar<\/b>\u00a0field. When you drag a\u00a0<b>Grid<\/b>\u00a0control to a form and create\u00a0<b>TextBox<\/b>\u00a0controls for columns with\u00a0<b>Varchar<\/b>\u00a0type, the\u00a0<b>Format<\/b>\u00a0property is set to &#8220;F&#8221;, and the\u00a0<b>MaxLength<\/b>\u00a0property is set to the maximum length for the\u00a0<b>Varchar<\/b>\u00a0field.&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"alert\">\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<th align=\"left\"><img decoding=\"async\" class=\"note\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/note.gif\" \/>Note:<\/th>\n<\/tr>\n<tr>\n<td>When you drag a field with\u00a0<b>Varbinary<\/b>\u00a0type to a form or when you drag a\u00a0<b>Grid<\/b>\u00a0control to a form and create\u00a0<b>TextBox<\/b>\u00a0controls for columns with\u00a0<b>Varbinary<\/b>\u00a0type, the following occur:&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<\/div>\n<ul>\n<li><b>Format<\/b>\u00a0property is set to &#8220;F&#8221;.<\/li>\n<li><b>MaxLength<\/b>\u00a0property is set to the maximum length multiplied by 2 for the\u00a0<b>Varchar<\/b>\u00a0field.<\/li>\n<li><b>InputMask<\/b>\u00a0property is filled with &#8220;H&#8221; up to the value of the\u00a0<b>MaxLength<\/b>\u00a0property.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>K<\/td>\n<td>Selects all the text when the control gets the focus.<\/td>\n<\/tr>\n<tr>\n<td>L<\/td>\n<td>Displays leading zeros instead of spaces in the text box. The\u00a0<b>ControlSource<\/b>\u00a0property must specify a numeric source for the text box.<\/td>\n<\/tr>\n<tr>\n<td>M<\/td>\n<td>Included for backward compatibility.<\/td>\n<\/tr>\n<tr>\n<td>R<\/td>\n<td>Displays the format mask for the text box that is specified in the\u00a0<b>InputMask<\/b>\u00a0property.<\/p>\n<p>The mask formats data for easier entry and clearer display. For example, if the mask is 99-999, the number 12345 is displayed as 12-345 but is not stored as part of the data. Use only with\u00a0<b>Character<\/b>\u00a0or\u00a0<b>Numeric<\/b>\u00a0data.<\/td>\n<\/tr>\n<tr>\n<td>T<\/td>\n<td>Trims leading and trailing blanks from the input field.<\/td>\n<\/tr>\n<tr>\n<td>YS<\/td>\n<td>Displays\u00a0<b>Date<\/b>\u00a0values in a short date format determined by the Windows Control Panel short date setting.<\/td>\n<\/tr>\n<tr>\n<td>YL<\/td>\n<td>Displays\u00a0<b>Date<\/b>\u00a0values in a long date format determined by the Windows Control Panel long date setting.<\/td>\n<\/tr>\n<tr>\n<td><b>EditBox<\/b>\u00a0control,\u00a0<b>TextBox<\/b>\u00a0control,\u00a0<b>Column<\/b>\u00a0object, and\u00a0<b>Spinner<\/b>\u00a0control<\/td>\n<\/tr>\n<tr>\n<td>Z<\/td>\n<td>Displays the value as blank if it is 0, except when the control has focus.<\/p>\n<p>Dates are also supported in these controls. The \/ \/ date delimiters are not displayed unless the control has focus.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/dd>\n<\/dl>\n<\/div>\n<h1 class=\"heading\"><span tabindex=\"0\"><img decoding=\"async\" id=\"remarksToggle\" class=\"toggle\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/collapse.gif\" name=\"toggleSwitch\" \/>Remarks<\/span><\/h1>\n<div id=\"remarksSection\" class=\"section\">\n<p>Applies To:\u00a0<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/362c5c7d-2dd9-4c2c-8028-af188f9fe3d8.htm\">Column Object<\/a>\u00a0|\u00a0<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/10b56cf0-55bf-4242-88f2-481e6a013d16.htm\">ComboBox Control<\/a>\u00a0|\u00a0<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/9d4545f7-74fe-4bd3-ba0f-bf9fba4d2129.htm\">EditBox Control<\/a>\u00a0|\u00a0<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/f0867563-6b6a-45a9-8fd7-d0199b5d50f5.htm\">Spinner Control<\/a>\u00a0|\u00a0<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/26bd8887-3888-41e6-a578-30b11a9eb2b4.htm\">TextBox Control (Visual FoxPro)<\/a><\/p>\n<p>The\u00a0<b>Format<\/b>\u00a0property specifies a behavior for the entire input field. You can mix several\u00a0<b>Format<\/b>\u00a0codes, but they always affect everything in the input field. This property contrasts to the\u00a0<b>InputMask<\/b>\u00a0property in which each entry in the input mask corresponds to an entry in the input field.<\/p>\n<p>The\u00a0<b>Format<\/b>\u00a0property mimics the behavior of the\u00a0<b>FUNCTION<\/b>\u00a0clause in the\u00a0<b>@\u0412\u00a0&#8230;\u0412\u00a0GET<\/b>\u00a0and\u00a0<b>@\u0412\u00a0&#8230;\u0412\u00a0EDIT<\/b>\u00a0commands.<\/p>\n<\/div>\n<h1 class=\"heading\"><span tabindex=\"0\"><img decoding=\"async\" id=\"seeAlsoToggle\" class=\"toggle\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/collapse.gif\" name=\"toggleSwitch\" \/>See Also<\/span><\/h1>\n<div id=\"seeAlsoSection\" class=\"section\">\n<h4 class=\"subHeading\">Reference<\/h4>\n<p><a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/45d3d91e-ee26-4ad1-95d6-4ebbc2791827.htm\">Value Property<\/a><\/p>\n<h4 class=\"subHeading\">Other Resources<\/h4>\n<p><a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/d39a41d2-b1b1-4223-a120-6e8cc41a30c9.htm\">DynamicInputMask Property<\/a><br \/>\n<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/1547a42a-e88f-4549-a82c-231a921ec689.htm\">InputMask Property<\/a><br \/>\n<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/ee3cb1dc-11b6-434d-8d4d-7a91daa5097a.htm\">Properties (Visual FoxPro)<\/a><br \/>\n<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/6dcddc3f-9944-4ad8-be2f-003610af616a.htm\">Language Reference (Visual FoxPro)<\/a><\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual FoxPro 9.0 Language Reference Format Property See Also\u00a0\u0412 Specifies the input and output formatting of a control&#8217;s\u00a0Value\u00a0property. Available at design time and run time. Control.Format[ = cFunction]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13],"tags":[],"class_list":["post-25232","post","type-post","status-publish","format-standard","hentry","category-13"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6cOVM-6yY","_links":{"self":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/25232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25232"}],"version-history":[{"count":2,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/25232\/revisions"}],"predecessor-version":[{"id":25234,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/25232\/revisions\/25234"}],"wp:attachment":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}