home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,094 of 9,834   
   Tony McGuire to All   
   Re: Pdox DOS import problem   
   06 Mar 08 09:26:33   
   
   From: png.paradoxcommunity@com   
      
   Paradox doesn't like unmatched single quotes, or quotes within data   
   regardless of whether you tell it that quotes are delimiters.   
      
   I get around it by creating my own import routines.  Fortunately, the   
   data I get is separated with tabs rather than commas.  Commas can also   
   appear as separators, which can make life hard.   
      
   I use tcursors, and read the data with a textstream into an array.   
   Then do a breakapart on the tabs after applying the below.   
   ==================================   
    y is the array element number being processed   
    k is arbitrary; I know it is high enough   
    to ensure all elements are tested, and array elements created.   
       for k from 1 to 50   
         try   
           if match(arRead[y],"..\t\t..",aa,ab) then   
             arRead[y]=aa+"\t \t"+ab   
           else   
             quitloop   
           endif   
         onFail   
           arRead[y].view()   
           return False   
         endTry   
       endfor   
   ==================================   
      
   The above looks for adjoining tabs, which indicate that there is a   
   blank field there.  So I replace double tabs with {tab}{space}{tab},   
   which gives me blank array values rather than missing array elements   
   (a limitation of the breakapart function).   
      
   You should be able to replace the \t with commas; although it may   
   require some work since I believe commas are special instructions to   
   MATCH.   
      
      
      
      
      
      
      
      
      
   --   
   ------------------------------   
    Tony McGuire   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca