importprocedure
importprocedure
ARCHIVE
,
OPTION
,
VALUE

The importprocedure statement imports a procedure into a database.

Parameters

This statement has three parameters:

archive – is a binary archive containing the procedure to import. This archive must have been originally created with the exportprocedure( function.

option – one or more options that modify the import. See below for descriptions of each option. The option can be specified in either upper or lower case.

value – is the option value (see below).

Description

This statement imports a procedure into a database. The procedure must have been previously saved with the exportprocedure( function. This example copies the procedure Display Message from the current database into the Checkbook database.

    local transferData
    transferData=exportprocedure("Display Message")
    opendatabase "Checkbook"
    importprocedure transferData

If the Checkbook database already contained a Display Message procedure, it will be updated. If it did not contain a Display Message procedure, it will be added.

Note: In addition to the archive parameter, you can also specify one or more option/value pairs that modify the import operation, like this:

    importprocedure procedureArchive,option1,value1,option2,value2,option3,value3

#### NAME

This option specifies the name of the imported procedure. This example makes a copy of the Do Something procedure.

    local transferData,procedureName
    procedureName = "Do Something"
    transferData=exportprocedure(procedureName)
    importprocedure transferData,"Name",procedureName+" Copy"

If there is no name option, the original name the procedure had when the exportprocedure( function was used will be used.

#### DATABASE

This option allows you to specify the database the procedure will be imported into. You can import the procedure into any open database. If this option is omitted, the procedure will be imported into the current database.

    importprocedure transferData,"Database",targetDB

#### INSERTBEFORE

This option allows you to specify the location of the imported procedure. The imported procedure will be imported in front of the specified procedure. This example makes a copy of the Calculate Total and inserts the copy above the Calculate Total procedure, renaming it Calculate SubTotal.

    local transferData,procedureName
    procedureName = "Calculate Total"
    transferData=exportprocedure(procedureName)
    importprocedure transferData,"Name","Calculate SubTotal","InsertBefore","Calculate Total"

If there is no insertbefore option, the imported procedure will be added at the end of the current list of procedures (unless it already exists, in which case it will be updated).

#### UPDATE

If the procedure to be imported already exists, the importprocedure statement updates the existing procedure rather than adding a duplicate. If the update option is false, the statement will NOT update the existing procedure (instead an error message will be generated.). This example copies the procedure Display Message from the current database into the Checkbook database, however, if the Display Message procedure already exists in the Checkbook database, the program will stop with an error.

    local transferData
    transferData=exportprocedure("Display Message")
    opendatabase "Checkbook"
    importprocedure transferData,"update","false"

#### CREATE

If the procedure to be imported does not already exist, the importprocedure statement will create it. However, if the create option is false, the statement will NOT create a new procedure in the database (instead an error message will be generated.). This example copies the procedure Display Message from the current database into the Checkbook database, however, if the Display Message procedure does not already exist in the Checkbook database, the program will stop with an error. (If it does exist, it will be updated.)

    local transferData
    transferData=exportprocedure("Display Message")
    opendatabase "Checkbook"
    importprocedure transferData,"create","false"

See Also

- activeobjectaction -- allows a procedure to communicate with the object on the current form that is currently being edited (if any).
- automaticprocedurename( -- returns an available procedure name.
- changeobject -- modifies the properties of one object in a form.
- changeobjects -- modifies the properties of one or more objects in a form.
- changetimer -- modifies a repeating task that will be performed periodically when Panorama is not otherwise busy.
- cloneform -- copies all of the objects in a form (optionally, with modifications) into the active form.
- cloneobjects -- duplicates objects in a form (with modifications).
- closeactiveobject -- closes any object whose text is currently being edited.
- closedatabaseactiveobjects -- stops all text editing associated with the current database.
- downloadpartialdatabase -- downloads specified components of the current database from the server. The current database must be shared.
- exportallprocedures -- saves all the procedures in an editable text format.
- exportprocedure( -- exports a procedure and the procedure's meta data as a binary object that can be imported with the importprocedure statement.
- formxy -- programmatically scrolls a form to a new position.
- getmaxwindow -- retrieves the position and size of the of the largest possible window on the main screen.
- getprocedureoption( -- returns information about a procedure.
- getproceduretext -- gets the contents (source) of a procedure and places it in a variable.
- getproceduretext( -- gets the contents (source code) of a procedure.
- getwindow -- retrieves the position and size of the current window.
- Implicitly Triggered Procedures -- Procedures that are triggered automatically when the user performs some normal Panorama action are said to be "implicitly triggered."
- importdatabase -- imports data from another database into the current database.
- importdictprocedures -- converts source code exported by the ExportAllProcedures statement into a dictionary.
- importjson -- imports a JSON array into the current database.
- importjsonline -- imports a JSON record into the current record.
- importline -- imports a line of text into the current record.
- importrawdata -- imports raw binary data into an existing database.
- importtext -- imports text into an existing database.
- info("proceduredatabase") -- returns the name of the database that contains the currently running procedure.
- info("procedurename") -- returns the name of the currently running procedure.
- join -- joins data from another database into the current database.
- joinonerecord -- joins matching data from another database into the current record.
- loadallprocedures -- loads all the procedures from a dictionary into the current database. If a procedure doesn't exist it will be created.
- makenewform -- creates a new form in the current database.
- makenewprocedure -- creates a new procedure in the current database.
- Mark Menu -- allows you to set bookmarks in source code to help navigate to specific spots in a long program.
- newdatabase -- creates a new database.
- newformobject -- creates a new graphic object in a form.
- objectaction -- allows a procedure to communicate with an object on the current form.
- partialdatabaseupdate -- updates one or more components of an existing database.
- printonemultiple -- prints a form over and over again without advancing from record to record. Instead of advancing from record to record, a variable is incremented each time the form is printed. This statement is designed for printing calendars or thumbnails.
- printtopdf -- prints the current database to a PDF file.
- printusingform -- allows the current database to be printed using a different form than the one currently being displayed.
- procedureexists( -- checks to see whether a procedure exists or not.
- procedureinsertfieldname -- inserts a field name into a procedure, adding chevrons if necessary.
- procedureinsertformname -- inserts a form name into a procedure, adding quotes.
- procedureinsertprocedurename -- inserts a procedure name into a procedure, adding quotes if necessary.
- proceduresearch -- searches for text in a procedure.
- proceduresearchexact -- searches for text in a procedure.
- proceduresearchnext -- searches for text in a procedure, starting from the current location.
- proceduresearchnextexact -- searches for text in a procedure, starting from the current location.
- Program Menu -- assists with running and debugging code, and with developing custom dialogs.
- Programming -- basics of programming with Panorama X.
- recompile -- recompiles all procedures in a database.
- saveallprocedures -- saves all the procedures in the specified database into a dictionary.
- saveoneprocedure -- saves a specific procedure in the specified database into a dictionary.
- saveopenprocedures -- saves all the open procedures in the specified database into a dictionary.
- savepartialdatabase -- saves specified components of the current database, leaving other components out.
- serverupdate -- temporarily disables record locking and server updates when using a shared database.
- setprocedureoptions -- modifies one or more properties of a procedure (source code, Action menu options, etc.).
- setproceduretext -- changes the text of the currently open procedure.
- setwindow -- specifies the dimensions (size and location) of the next window that is opened (with openform, opensheet, openprocedure etc.).
- Source Menu -- used to assist in editing program code.
- startbonjour -- starts monitoring the local network for available hosts.
- starttimer -- sets up and starts a repeating task that will be performed periodically when Panorama is not otherwise busy.
- stopbonjour -- cancels monitoring of the local network for available hosts.
- windowbox -- specifies the dimensions (size and location) of the next window that is opened (with openform, opensheet, openprocedure etc.).

History

Version | Status | Notes
10.0 | New | New in this version.