![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
My problem sounds easy: I want to copy data from one to another file without a keyfield or any other link. I thought a script "Copy" like this would do it: Open file ("a") goto field (a::atext) copy (a::atext) goto field (b::btext) paste(select;b::btext) This script is located in file "b" In file "a" is a perform script "Copy" Perform script ("Copy" from file:"b") The script does not copy the contents of field atext into btext. It copies data which were accidentally in the memory from a former copy/paste action. What is wrong with the script? I use FM8. What could be a easy solution ? Hermann |
#3
| |||
| |||
|
|
My problem sounds easy: I want to copy data from one to another file without a keyfield or any other link. I thought a script "Copy" like this would do it: Open file ("a") goto field (a::atext) copy (a::atext) goto field (b::btext) paste(select;b::btext) This script is located in file "b" In file "a" is a perform script "Copy" Perform script ("Copy" from file:"b") The script does not copy the contents of field atext into btext. It copies data which were accidentally in the memory from a former copy/paste action. What is wrong with the script? I use FM8. What could be a easy solution ? |
#4
| |||||
| |||||
|
|
In article <1h7bw8s.1xaneimc4u0lcN%h.siemandel (AT) nefkom (DOT) net>, h.siemandel (AT) nefkom (DOT) net (Hermann Siemandel) wrote: My problem sounds easy: I want to copy data from one to another file without a keyfield or any other link. I thought a script "Copy" like this would do it: Open file ("a") goto field (a::atext) copy (a::atext) goto field (b::btext) paste(select;b::btext) The main problem is that your Copy command needs to select the field content first - just like you would manually select text before copying it. Ok tried it but didn`t work either |
|
You also don't even need the Go To Field commands at all since the Copy and Paste commands will do that anyway. This means your script command should be: Open ["a"] Copy [Select; a::atext] Paste [Select; b::btext] (Im' not sure why the Open command is there, it may not be needed either.) A second possible problem is that for the Copy and Paste script commands to work, the fields both need to be on the current layout. |
|
Instead of Copy / Paste you could simply use the Set Field command, meaning your script becomes even simpler. eg. Open ["a"] Set Field [b::btext, a::atext] Works only if a link exists |
|
This has the bonus of not needing to have the fields on the current layout and the fields will not become selected so the process is invisible to the user. It also doesn't require running a script in file / table "b" (as long as the "a::" and "b::" mean you've actually got a relationship link between "a" and "b"). It could also depends on what you're trying to do, but there may be a better way to transfer the data. You could go to the target file / table and use the Import command to copy the data from the original file / table, but the original file / table would need to have only the records you want to copy in it's Found Set. This method also creates new records in the target field / table rather than changing existing records. |
|
Another way is to temporarily store the data in Global fields and then got to file "b" and create the new record and use Set Field to copy the data over from the Global Fields. Thx for your detailed information on this subject. Helpful Harry Hopefully helping harassed humans happily handle handiwork hardships ;o) |
#5
| |||
| |||
|
|
My problem sounds easy: I want to copy data from one to another file without a keyfield or any other link. I thought a script "Copy" like this would do it: Open file ("a") goto field (a::atext) copy (a::atext) goto field (b::btext) paste(select;b::btext) This script is located in file "b" In file "a" is a perform script "Copy" Perform script ("Copy" from file:"b") The script does not copy the contents of field atext into btext. It copies data which were accidentally in the memory from a former copy/paste action. What is wrong with the script? I use FM8. What could be a easy solution ? Hermann |
#6
| |||
| |||
|
|
Open ["a"] Set Field [b::btext, a::atext] Works only if a link exists |
#7
| |||
| |||
|
|
My problem sounds easy: I want to copy data from one to another file without a keyfield or any other link. I thought a script "Copy" like this would do it: Open file ("a") goto field (a::atext) copy (a::atext) goto field (b::btext) paste(select;b::btext) This script is located in file "b" In file "a" is a perform script "Copy" Perform script ("Copy" from file:"b") The script does not copy the contents of field atext into btext. It copies data which were accidentally in the memory from a former copy/paste action. What is wrong with the script? I use FM8. What could be a easy solution ? Hermann |
#8
| |||
| |||
|
|
In article <1h7bw8s.1xaneimc4u0lcN%h.siemandel (AT) nefkom (DOT) net>, h.siemandel (AT) nefkom (DOT) net (Hermann Siemandel) wrote: My problem sounds easy: I want to copy data from one to another file without a keyfield or any other link. I thought a script "Copy" like this would do it: Open file ("a") goto field (a::atext) copy (a::atext) goto field (b::btext) paste(select;b::btext) This script is located in file "b" Use File >> Import Records >> from file This is very powerful and flexible, can be scripted for repetitive use, can be set to either add records or update records based on a match field you specify, etc. It can work among data tables within one file, or between files. You can import all or a few fields. It has nothing to do with relationships. Everything is handled within the Import process. You are right. I discovered it to be a powerful command and i solved my |
![]() |
| Thread Tools | |
| Display Modes | |
| |