table format in Rev 2

Jan Schenkel janschenkel at yahoo.com
Tue Apr 15 02:00:00 EDT 2003


--- Yves COPPE <yvescoppe at skynet.be> wrote:
> Hello,
> 
> I do not manage to solve my problem of synchronizing
> the number of 
> lines in the 3 flds of my table so that the scroll
> of the other flds 
> adds blank lines on those other fls when I hit
> returns at the end of 
> one fld.
> 
> 
> When I scroll the thumb of fld "3" down to the
> bottom and that the 
> number of lines of the other flds is not the same,
> it produces a non 
> alignement of the lines
> 
> So I'm in the problems...
> 
> HELP !!
> 
> Thank you
> -- 
> Greetings.
> 
> Yves COPPE


Hi Yves,

Even though you can always add the missing returns at
scroll time, in the SynchroniseScrolls handler, it
would be better to fix this problem on returnInField,
as this also allows you to set default data in the
cells of the new line (such as 0,00 for the numeric
column) -- so add this to the group script:

on returnInField
  put word 2 of the selectedLine of the target into \
      tCurrentLine
  put the number of lines of the target into tNumLines
  if tCurrentLine = tNumLines then
    -- add an extra line in all columns
    put return after fld 1 of me
    put return after fld 2 of me
    -- suppose the third column is numeric
    put return & "0,00" after fld 3 of me
  end if
  -- and move the vertical blinker to the next line
  select before line tCurrentLine + 1 of the target
  -- scrolling is handled automatically thanks to
  -- the 'rawKeyDown' handler that I sent earlier
end returnInField

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com



More information about the Use-livecode mailing list