remove empty lines in DG

Bob Sneidar bobsneidar at iotecdigital.com
Mon Dec 10 17:01:39 EST 2018


You would be better off gettign the data as a cursor then looping through the cursor data to produce a dg compatible array, then setting the dgData. dgText is ok if all you have to work with is delimited text data, but if you can get an array, then you should use dgData. 

Fortunately for you, I have a cursorToArray function already written:-)

function cursorToArray pCursorID
   put revDatabaseColumnCount(pCursorID) into tColumnCount
   put revDatabaseColumnNames(pCursorID) into tColumnNames
   
   repeat forever
      add 1 to tRecordCount
      repeat with i = 1 to tColumnCount
         put revDatabaseColumnNumbered(pCursorID, i) into aCursorArray [tRecordCount] [item i of tColumnNames]
      end repeat
      
      revMoveToNextRecord pCursorID
      if not the result then exit repeat
   end repeat
   
   return aCursorArray
end cursorToArray



> On Dec 10, 2018, at 09:11 , JJS via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I could delete the empty lines by dispatching delete to the DG.
> 
> But this was not a solution to the cause.
> 
> Now it seems it happens when fetching from the DB. Now as everything is encrypted, i can't see which line in the DB is empty.
> 
> So have to check if i can find the exact lines causing it, which is really strange. Because when they finally arrive in the DG they have no no corresponding to the db.
> 
> So it looks like it is no fault somewhere in LC.
> 
> At least i can find empty line in the fetched results and delete them, causing the data nicely to appear at the top in the DG.
> 
> Thanks!
> 
> Jerry





More information about the use-livecode mailing list