Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 2 Jahren, 7 Monaten
Letzter Beitrag:
vor 2 Jahren, 7 Monaten
Beteiligte Autoren:
Randall, Mark Crichton, stefan.kern, abonds, Fabrice Harari, Paulo Oliveira

[WB19] Scatter Gather

Startbeitrag von Randall am 09.07.2015 17:48

Is there an easy way of copying a record from one table to another... like scatter/gather?

Antworten:

Hi Randall

if you are talking about copying a record from one file of the analysis to another one, and if both files have the same structure, then the answer is hcopyrecord

if you are talking about copying a line from a table control to another one, and both have the same columns, then I think I remember that tableName returns a tab delimted string that you can use in tableAdd(secondtable...)

If you are not in one of those two cases, please give us some precisions

Best regards


von Fabrice Harari - am 09.07.2015 18:39
You mean this?

"In computing, vectored I/O, also known as scatter/gather I/O, is a method of input and output by which a single procedure-call sequentially writes data from multiple buffers to a single data stream or reads data from a data stream to multiple buffers. The buffers are given in a vector of buffers."

von abonds - am 10.07.2015 02:06
if it's only to copy one record from one table (file) to another why don't you use:
INSERT INTO FileName [(NameOfItems)] SELECT ...
http://doc.windev.com/en-US/?2034001&name=SQL_statements#NOTE3

von Paulo Oliveira - am 10.07.2015 09:48
He means an old FoxPro Command
https://msdn.microsoft.com/en-us/library/aa978285%28v=vs.71%29.aspx

FileToArray() should do it!

von stefan.kern - am 10.07.2015 20:11
I apologize for not being more specific... I was referring to the old FoxPro commands.
I referred to that because it could be easily entered at the command line. I realize there is a debug interface, but I'm not aware of a similar command line interface to copy and paste (scatter/gather) a record... there's a graphical interface where there's this context menu, and although you can Copy a Row there's no way that I know of to Paste a Row... which would be very helpful.

[attachment 1592 file_context_menu.png]

von Randall - am 14.07.2015 15:10
Scatter / Gather like FoxPro is available in WinDev using "Record" type variable. Here is example used to split and invoice line into two lines.

Create a variable of type "Record"
Scatter to it by = when you are on the record to scatter
Make any field changes required to the variable
Reverse the code to gather =
Now add the gathered record.

// First create variable of record in my table called edcmeters
rRec is record of edcmeters

// Then in button do code...
//1 : &Split
//2 : Do ¬ split
SWITCH Dialog("Split line for this reading?")
CASE 1
rRec = edcmeters // scatter record
rRec.EDCINVOICE = Null // Roll readings 1 an d2
rRec.EDCLREAD1 = EDCTREAD1
rRec.EDCTREAD1 = 0
rRec.EDCLREAD2 = EDCTREAD2
rRec.EDCTREAD2 = 0
edcmeters = rRec // Gather record
HAdd(edcmeters) // Add record

TableDisplay(Table_edcmeters,taStart) // Redisplay the table to show new record
END

Windev is a great replacement for FoxPro.

von Mark Crichton - am 15.07.2015 09:52
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.