speedcopy
START
,
END
,
FROM

The speedcopy statement copies multiple adjacent fields from a record in one database to a record in another.


Parameters

This statement has three parameters:

start – is the first field to be replaced in the current database. The field name must be surrounded with quotes, for example: "City", not City.

end – is the last field to be replaced in the current database. This field must be to the right of the start field in the data sheet. The field name must be surrounded with quotes, for example: "Zip", not Zip.

from – is the field in the second database that corresponds to the start field in the current database. The field name must be surrounded with quotes, for example: "City", not City.


Description

This statement is designed to be used in combination with a lookup( function. First you lookup, then you copy. The speedcopy will copy additional data from the record that was located by the lookup( function. The speedcopy statement is much easier to write than multiple lookups.

For this example, assume that you have two databases, one named Customer and another named Organizer. Both have fields name Address, City, State and Zip. The example below will quickly look up a customer from the Customer database and copy their address into the Organizer database (which is the currently active database).

Address=lookup( "Customers",Company,Company,Address,"",0)
if Address <> ""
    speedcopy "City","State","Zip"
endif 

Here is the same procedure but written without using the speedcopy statement.

Address=lookup("Customers",Company,Company,Address,"",0)
City=lookup("Customers",Company,Company,City,"",0)
State=lookup("Customers",Company,Company,State,"",0)
Zip=lookup("Customers",Company,Company,Zip,"",0)

Note: Starting with Panorama X, there is another way to do this using the lookupmoredata( function.

Address=lookup("Customers",Company,Company,Address,"",0)
City=lookupmoredata(City,"")
State=lookupmoredata(State,"")
Zip=lookupmoredata(Zip,"")

Unlike using speedcopy, the lookupmoredata( technique doesn’t require that the fields be in the same order in the two databases. If they are in the same order, it’s probably simpler to use speedcopy.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but works differently internally so that it no longer has the possibility of corrupting the data if the database fields don't match up exactly.