{"id":25920,"date":"2022-02-13T21:05:19","date_gmt":"2022-02-13T14:05:19","guid":{"rendered":"https:\/\/tom.ji42.com\/?p=25920"},"modified":"2022-02-13T21:05:19","modified_gmt":"2022-02-13T14:05:19","slug":"empty-function-vfox","status":"publish","type":"post","link":"https:\/\/tom.tomwork.net\/?p=25920","title":{"rendered":"EMPTY( ) Function &#8211; VFOX"},"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\">EMPTY( ) Function<\/span><\/td>\n<\/tr>\n<tr id=\"headerTableRow3\">\n<td><a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/714bd634-6f29-4024-856b-7b669f0a4350.htm#seeAlsoToggle\">See Also\u00a0<\/a>\u0412\u00a0\u00a0<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/714bd634-6f29-4024-856b-7b669f0a4350.htm#codeExampleToggle\">Example<\/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>Determines whether an expression evaluates to empty.<\/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>EMPTY(<i>eExpression<\/i>)<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><!--more--><\/p>\n<h4 class=\"subHeading\">Parameters<\/h4>\n<dl>\n<dt><i>eExpression<\/i><\/dt>\n<\/dl>\n<dl>\n<dd>Specifies the expression that\u00a0<b>EMPTY(\u0412\u00a0)<\/b>\u00a0evaluates. You can specify an expression with\u00a0<b>Character<\/b>,\u00a0<b>Numeric<\/b>,\u00a0<b>Date<\/b>,\u00a0<b>Varbinary<\/b>,\u00a0<b>Blob<\/b>, or\u00a0<b>Logical<\/b>\u00a0type, or the name of a\u00a0<b>Memo<\/b>\u00a0or\u00a0<b>General<\/b>\u00a0field in an open table.<\/dd>\n<\/dl>\n<\/div>\n<h1 class=\"heading\"><span tabindex=\"0\"><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<p>Logical.\u00a0<b>EMPTY(\u0412\u00a0)<\/b>\u00a0returns True (.T.) if the expression\u00a0<i>eExpression<\/i>\u00a0evaluates to empty; otherwise,\u00a0<b>EMPTY(\u0412\u00a0)<\/b>\u00a0returns False (.F.).<\/p>\n<p>When expression types evaluate to the values in the following table,\u00a0<b>EMPTY(\u0412\u00a0)<\/b>\u00a0returns True (.T.).<\/p>\n<h3 class=\"subHeading\"><\/h3>\n<table>\n<tbody>\n<tr>\n<th>Expression type<\/th>\n<th>Evaluates to<\/th>\n<\/tr>\n<tr>\n<td><b>Blob<\/b><\/td>\n<td>Empty (0h) or contains only zero bytes, for example, 0h00, 0h000000, and so on<\/td>\n<\/tr>\n<tr>\n<td><b>Character<\/b><\/td>\n<td>Empty string, spaces, tabs, carriage returns, linefeeds, or any combination of these<\/td>\n<\/tr>\n<tr>\n<td><b>Currency<\/b><\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td><b>Date<\/b><\/td>\n<td>Empty, for example, CTOD(&#8221;)<\/td>\n<\/tr>\n<tr>\n<td><b>DateTime<\/b><\/td>\n<td>Empty, for example, CTOT(&#8221;)<\/td>\n<\/tr>\n<tr>\n<td><b>Double<\/b><\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td><b>Float<\/b><\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td><b>General<\/b><\/td>\n<td>Empty (no OLE object)<\/td>\n<\/tr>\n<tr>\n<td><b>Integer<\/b><\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td><b>Logical<\/b><\/td>\n<td>False (.F.)<\/td>\n<\/tr>\n<tr>\n<td><b>Memo<\/b><\/td>\n<td>Empty (no contents)<\/td>\n<\/tr>\n<tr>\n<td><b>Numeric<\/b><\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td><b>Varbinary<\/b><\/td>\n<td>Empty (0h) or contains only zero bytes, for example, 0h00, 0h000000, and so on<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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>You cannot use\u00a0<b>EMPTY(\u0412\u00a0)<\/b>\u00a0to determine whether a variable object reference is empty. For example, a variable can contain an object reference for a form. If the form is closed by clicking Close from the form&#8217;s pop-up menu or by issuing\u00a0<b>CLEAR WINDOWS<\/b>, the variable contains the null value.<\/p>\n<p>The following program example demonstrates how to use\u00a0<b>TYPE(\u0412\u00a0)<\/b>\u00a0and\u00a0<b>ISNULL(\u0412\u00a0)<\/b>\u00a0to determine if a variable object reference is valid.<\/p>\n<div class=\"code\">\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<th>\u0412<\/th>\n<th><span class=\"copyCode\" tabindex=\"0\"><img decoding=\"async\" class=\"copyCodeImage\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/copycode.gif\" name=\"ccImage\" align=\"absmiddle\" \/>Copy Code<\/span><\/th>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<pre>goMyForm = CREATEOBJECT('Form')\r\nWAIT WINDOW IIF(TYPE('goMyForm') = 'O' AND !ISNULL(goMyForm), ;\r\n   'goMyForm has valid object reference',;\r\n   'goMyForm does not have valid object reference')<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h1 class=\"heading\"><span tabindex=\"0\"><img decoding=\"async\" id=\"codeExampleToggle\" class=\"toggle\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/collapse.gif\" name=\"toggleSwitch\" \/>Example<\/span><\/h1>\n<div id=\"codeExampleSection\" class=\"section\">\n<p>The following example opens the\u00a0<code>customer<\/code>\u00a0table in the\u00a0<code>testdata<\/code>\u00a0database.\u00a0<b>FOR &#8230; ENDFOR<\/b>\u00a0is used to create a loop in which\u00a0<b>EMPTY(\u0412\u00a0)<\/b>\u00a0s used to determine if\u00a0<b>TAG(\u0412\u00a0)<\/b>\u00a0returns the empty string. The name of each structural index tag is displayed with its candidate status.<\/p>\n<div class=\"code\">\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<th>\u0412<\/th>\n<th><span class=\"copyCode\" tabindex=\"0\"><img decoding=\"async\" class=\"copyCodeImage\" src=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/local\/copycode.gif\" name=\"ccImage\" align=\"absmiddle\" \/>Copy Code<\/span><\/th>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<pre>CLOSE DATABASES\r\nOPEN DATABASE (HOME(2) + 'data\\testdata')\r\nUSE customer     &amp;&amp; Open customer table\r\n\r\nFOR nCount = 1 TO TAGCOUNT( )\r\n   IF !EMPTY(TAG(nCount))  &amp;&amp; Checks for empty string\r\n   ? TAG(nCount)  &amp;&amp; Display tag name\r\n   ? CANDIDATE(nCount)  &amp;&amp; Display candidate status\r\n   ELSE\r\n      EXIT  &amp;&amp; Exit the loop when no more tags are found\r\n   ENDIF\r\nENDFOR<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\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\">Other Resources<\/h4>\n<p><a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/da6b864f-f7c6-43a3-8218-20d56c7a4764.htm\">Functions<\/a><br \/>\n<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/6993649e-01d9-4818-a48c-c77e5e3f3061.htm\">LEN( ) Function<\/a><br \/>\n<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/7e83da43-86c1-4b0d-a00d-ea412382331f.htm\">TYPE(\u0412\u00a0) Function<\/a><br \/>\n<a href=\"http:\/\/www.yaldex.com\/fox_pro_tutorial\/html\/dce94348-85af-42bb-a1c1-7c7c8982861e.htm\">ISNULL(\u0412\u00a0) Function<\/a><\/p>\n<\/div>\n<\/div>\n<div id=\"footer\">Send\u00a0<a href=\"mailto:DevDocs@microsoft.com?subject=Documentation%20Feedback%20(VFP9.0):EMPTY(%20)%20Function\">comments<\/a>\u00a0about this topic to Microsoft. \u0412\u00a9 Microsoft Corporation. All rights reserved.<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual FoxPro 9.0 Language Reference EMPTY( ) Function See Also\u00a0\u0412\u00a0\u00a0Example\u0412 Determines whether an expression evaluates to empty. EMPTY(eExpression)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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},"jetpack_post_was_ever_published":false},"categories":[13],"tags":[],"class_list":["post-25920","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-6K4","_links":{"self":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/25920","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=25920"}],"version-history":[{"count":1,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/25920\/revisions"}],"predecessor-version":[{"id":25921,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/25920\/revisions\/25921"}],"wp:attachment":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}