How to copy columns between child tables HELP ME pleaseeee

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Alberto Aviles

How to copy columns between child tables HELP ME pleaseeee

Post by Alberto Aviles » 08 Jun 2007, 17:54

 Posted by:  Alberto Aviles 

HI..

some one have a sample code to copy columns between child tables, in runtime
??

tnaks

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: How to copy columns between child tables HELP ME pleaseeee

Post by Jeff Luther » 08 Jun 2007, 19:15

 Posted by:  Jeff Luther 

Don't have one, but you could write a test using the SAL functions SalTblCopyRows()
and SalTblPasteRows(). See TD's Help for details on these functions.

And if you really only want to copy a single column's worth of data to another
column in another TW, then a loop (between start & end rows) and the function
SalTblSetContext() are what you should use for your test application. Something
like:

Code: Select all

Set nCurrRow = nSomeStartRow	! could be 0, could be another row ! nEndRow = last row you want to copy
While nCurrRow <= nEndRow
     Call SalTblSetContext( hWndFromTbl, nCurrRow )
     Call SalTblSetContext( hWndToTbl, nCurrRow )
     Set hWndToTbl.colTO = hWndFromTbl.colFROM
     Set nCurrRow = nCurrRow + 1
or similiar would likely be at the core of your code.

Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/gupta/

Alberto Aviles

Re: How to copy columns between child tables HELP ME pleaseeee

Post by Alberto Aviles » 08 Jun 2007, 21:26

 Posted by:  Alberto Aviles 

hi ng...
some one can help ??

i cant set the source info into the destination cell...
! Set hWinTablaDestino.hWinColumnaDestino = sDato
! Handle Semi-qualified reference not allowed because sNombreColumna is not
a child window or variable of a form, dialog, or table.

or how get the cell handle to use
salsetwindowtext()

You do not have the required permissions to view the files attached to this post.

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: How to copy columns between child tables HELP ME pleaseeee

Post by Jeff Luther » 08 Jun 2007, 22:39

 Posted by:  Jeff Luther 

Well... hWinColumnaDestino is a null/0 window handle! so your call to
SalSetWindowText( hWinColumnaDestino, sDato ) will never work. You need
to have a valid window handle for your Destino/destination column. Here's
how to do it:

Code: Select all

Variables
	Number: nColID

Code: Select all

Set nColID = SalTblCreateColumn( hWinTablaDestino, ... ) ! you have this as "Call..."
! now convert the ID to its window handle for the SalSetWindowText() calls
Set hWinColumnaDestino = SalTblGetColumnWindow ( hWinTablaDestino, nColID, COL_GetID )
(A good way to debug is to set your breakpoint, single step and test the values of
your variables. On the SalSetWindowText(...) call hWinColumnaDestino = 0.)

Another good thing to do is *always* save your tests and samples in text/APT mode,
not binary mode, when you upload here.

Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/gupta/

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests