Split to Array on Repeat Skips Every Other Line??

Sivakatirswami katir at hindu.org
Mon May 16 02:07:42 EDT 2005


OK, well I solved the problem by taking the split out of the loop to a 
function, now it works. But I still think this is a bug.

on mouseUp
    repeat for each line x in gLogData
       put returnLogEntry(x) & cr after tLog
    end repeat
   put tLog into fld "logViewer"
end mouseup
function returnLogEntry x
   split x with "|" and tab
   return (x["Project"] & tab &  (x["hours"] 
+round(x["hour-fraction"],2)) & tab & x["Fund_Category"])
end returnLogEntry

Now I get all six lines as expected:

Online-Donations	5.41	Public Services
Publishers-Desk-Interface	1.25	Public Services
Digital-Dharma-List	6.5	Public Services
Web-Editor-Upgrade	2.17	Public Services
Publishers-Desk-Interface	6.75	Funded Projects
Online-Donations	1.08	Public Services

skts


On May 15, 2005, at 8:00 PM, Sivakatirswami wrote:

> Incoming data stored in a global and then try to split this on a 
> loop...
> every other line on output is empty.
>
> global gSomeData # which has six lines  of data
>
> repeat for each line x in gSomeData
>    split x with "|" and tab
>    put x["Project"] & tab &  (x["hours"] +round(x["hour-fraction"],2)) 
> & tab & x["Fund_Category"] & cr after tLog
> end repeat
>
> put tLog
>
> returns:
>
> Online-Donations	5.41	Public Services
> 	0	
> Digital-Dharma-List	6.5	Public Services
> 	0	
> Publishers-Desk-Interface	6.75	Funded Projects
> 	0	
>
> Every other line is skipped!
>
> ???
>
>  I *can* re-do this using an itemdel algorithm and skip the split to 
> array,
> but using these little arrays is so much more efficient (if it worked 
> of course)
>
> Sivakatirswami
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list