{"id":292,"date":"2004-08-15T13:18:46","date_gmt":"2004-08-15T05:18:46","guid":{"rendered":"http:\/\/foxpro.ntsl119.com\/scr\/?p=292"},"modified":"2007-11-02T13:36:45","modified_gmt":"2007-11-02T05:36:45","slug":"peculiar","status":"publish","type":"post","link":"https:\/\/foxpro.ntsl119.com\/scr\/archives\/292","title":{"rendered":"Peculiar&#8230;"},"content":{"rendered":"<p>Peculiar things happen once in a while in a programming language IDE and the VisualFoxpro&#8217;s IDE is not an exception.<\/p>\n<p>Take this for an example:<\/p>\n<pre><font size=\"2\" face=\"Tahoma, Verdana, sans-serif\">close databases<br \/>\r\nclose all<br \/>\r\n<br \/>\r\n<\/font><font color=\"#0000FF\">select<\/font> 0<br \/>\r\n<font color=\"#0000FF\">use<\/font> FILEAREA <font color=\"#0000FF\">shared<\/font><br \/>\r\n     <font color=\"#0000FF\">if !file<\/font>('FILEAREA.cdx') <br \/>\r\n          <font color=\"#0000FF\">index on<\/font> NUMTOSTR(AREAIDNO, 5) <font color=\"#0000FF\">tag<\/font> CAREIDNO <br \/>\r\n          <font color=\"#0000FF\">index on upper<\/font>(<font color=\"#0000FF\">alltrim<\/font>(AREA)) <font color=\"#0000FF\">tag<\/font> CAREAREA<br \/>\r\n     <font color=\"#0000FF\">endif<\/font><br \/>\r\n<br \/>\r\n<font color=\"#006633\">Note: UDF NUMTOSTR(5, 3) returns '005' <br \/>\r\nNote: UDF is 'User Defined Function' (OK... you know that already)<\/font><\/pre>\n<p>\nSo what is wrong with the above snippet?<\/p>\n<p>Nothing really. In fact I&#8217;m using it on a different application and it&#8217;s fine. But tonight I&#8217;m getting the &#8216;File must be opened exclusively.&#8217; error message. So I tried transferring it from the .PRG file to the frm.Init, removed the NUMTOSTR line temporarily, executed close all commands inside the command window, closed VisualFoxpro a couple of times and the error is still there.<\/p>\n<p>No other application is using the database and I&#8217;m not even connected t0 the internet. (Just in case you&#8217;re entertaining that wild idea that someone in cyberspace is playing with my databases tonight)<\/p>\n<p>So I thought &#8216;FILEAREA&#8217; was an ultra-secret Foxpro reserved word and renamed the database to AREA. <\/p>\n<p>Still, the problem exists.<\/p>\n<p>Another reboot, fired up VisualFoxpro, executed the program and it ran sans the error message this time.<\/p>\n<p>Weird.<\/p>\n<p>So I tried recoding the things I made, re-used the NUMTSTR function, renamed the database back to FILEAREA and placed the code back to the DatabaseInitialization.prg. <\/p>\n<p>Problem&#8217;s lost&#8230; I can&#8217;t even recreate it.<\/p>\n<p>This is one of those weird stuff I encounter once in a while. You can&#8217;t even share it to someone whose skills are better than yours since it just disappeared out of nowhere. As a programmer this is quite puzzling. Programmers always have this inner desire to know the why and how of things. Why such thing exists. Why it exists that way.<\/p>\n<p>When you can&#8217;t recreate the problem, you can&#8217;t prove that the problem isolation procedures you just did were the solution&#8230; that you used the right chant and growl frequencies.<\/p>\n<p>You can&#8217;t even prove that such problem exists.<\/p>\n<p>Really weird. You just end up storing it somewhere behind some portal deep within your brain&#8230; <\/p>\n<p>&#8230; or you end up blogging about it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Peculiar things happen once in a while in a programming language IDE and the VisualFoxpro&#8217;s IDE is not an exception. Take this for an example: close databases close all select 0 use FILEAREA shared if !file(&#8216;FILEAREA.cdx&#8217;) index on NUMTOSTR(AREAIDNO, 5) tag CAREIDNO index on upper(alltrim(AREA)) tag CAREAREA endif Note: UDF NUMTOSTR(5, 3) returns &#8216;005&#8217; Note: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-visual-foxpro","category-workblog"],"_links":{"self":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":0,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"wp:attachment":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}