Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying large quantity of data

Status
Not open for further replies.

LotusE

Programmer
Nov 22, 2002
25
BE
I know that there is a way to copy a large quantity of data to the 'memory' of the computer, so you can then easily paste it in for example, Microsoft Excel, instead of using automation with 'for endfor' loops, but I cannot remember how it worked and I don't seem to find anything on this form.

Can anyone help me?

Thanks in advance!

Cheers

LotusE
 
Automating copy-paste? Maybe you should provide a concrete example of what you want to do.

If your question is one of automation, post to forum1251.

Brian
 
no, it's not automating copy paste. I can't remember the function in foxpro to copy data from an array (or table?) to the memory of the computer.

Cheers

LotusE
 
I think I've got it, it's the Datatoclip() method

Thanks

Cheers

LotusE
 
That method is pretty handy.

Brian

Code:
CREATE TABLE MyTable (Fld1 c(3), Fld2 n(5), Fld3 d)

FOR lnX = 1 TO 10
	APPEND BLANK 
		IF MOD(lnX ,3)#0
		 REPLACE Fld1 WITH CHR(64+lnX)
		 REPLACE Fld2 WITH lnX
		 REPLACE Fld3 WITH DATE()+lnX
		ENDIF
ENDFOR
 
LOCATE
_vfp.DataToClip([MyTable],RECCOUNT(),3)

loexcel=CREATEOBJECT('excel.application')
loexcel.Visible=.t.
loexcel.Workbooks.Add()
loexcel.range("b4").select
loexcel.ActiveWorkbook.ActiveSheet.Paste()
[\code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top