remove empty lines in DG

JJS jjs at krutt.org
Tue Dec 11 13:20:07 EST 2018


Thanks Bob, will come in handy when needed.

I use PHP as middleware, as others have to use it too and need access to 
the DB. If i would use RevDB then they would not be granted access. And 
the webspace provider is not allowing LC server on it's shared hosting.

So the data is coming in as delimited data, encrypted that is.

For now this works, as at the moment i can't figure out which lines in 
the DB are causing this as these lines do not seem to have an id, and i 
do not see an id with empty data in the db:

*repeat*foreachlinetLine invarResults

*if* item1oftLine isempty*then*

*delete*linetLine ofvarResults

*next* *repeat*

*end* *if*

So for me it is still a bit strange where its coming from.

*
*

Op 10-12-2018 om 23:01 schreef Bob Sneidar via use-livecode:
> 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
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list