Grid & Scrolling Field

Jim Ault JimAultWins at yahoo.com
Thu Nov 30 03:52:31 EST 2006


On 11/29/06 11:11 PM, "Scott Kane" <scott at cdroo.com> wrote:

> I've got the code below working nicely for a grid control and the data being
> assigned to it from fields.  All that is except for Scrolling List fields.
> I've tried various combinations, but the scrolling list always ends up using
> the returns in it as the start of a new line in the grid.  Code I'm using
> is:
> 
> on mouseUp
> "NewPotSize" & Tab & fld "NumberOfDivisions" & Return into theRecfld
--not sure what the line above is supposed to do
> "RepottedDate" & Tab & fld "OldPotSize" & Tab & fld "NewPotSize" & Tab & fld
> "NumberOfDivisions" & Return into theRec

>   put fld "RepotList" & Return into tList

>   put fld "RepottedDate" & Tab & fld "OldPotSize" & Tab & fld "NewPotSize" &
> Tab & fld "NumberOfDivisions" & fld "RepotNotes" & Return into theRec
--you are defining theRec a second time, but a different way
>   set the itemDel to tab
--does not seem to be necessary
>    put tList & theRec into fld "RepotList"
--is fld RepotList the 'grid' you are referring to?
>   end mouseUp
> 
> I suspect it's the use of my return character when building the array, but I
> can't seem to be able to work out a better method of inserting a new line
> into the grid.
> 
> Help greatly appreciated...

A bit difficult to see what is going on since the data fields could contain
anything.  Also, your code doesn't seem to make much sense, however it is
late for me after a long day.  Why not try doing it in steps.

get "newpotsize" & tab
get it & fld NumberOfDivisions
get it & cr
put it into theRecFld  -- your code does not make sense here

get "repottedDate" & tab
get it & fld OldPotSize & tab
get it & fld NewPotSize & tab
get it & fld NumberOfDivisions & cr
put it into theRec  -- your code does not make sense here

put fld RepotList & cr into tList

get fld RepottedDate  & Tab
get it & fld "OldPotSize" & Tab
get it & fld "NewPotSize" & Tab
get it & fld RepotNotes & cr
put it into theRec  --you are redefining tRect

 put tList & theRec into fld RepotList

And now I am confused by
>the scrolling list always ends up using
> the returns in it as the start of a new line in the grid.
followed at the end by
> I suspect it's the use of my return character when building the array, but I
> can't seem to be able to work out a better method of inserting a new line
> into the grid.

The way to delimit a new line in a field is by using a return char.  So why
are you surprised that they start a new line in your field?

Jim Ault
Las Vegas





More information about the use-livecode mailing list