cloneform
cloneform
DATABASE
,
FORM
,
PROPERTY
,
VALUE

The cloneform statement copies all of the objects in a form (optionally, with modifications) into the active form.

Parameters

This statement has four parameters:

database – The database containing the form you want to clone. You can use `""` for the current database. (Note: The specified database must be open.)

form – The form you want to clone.

property – the object property (color, font, etc.) to modify. See Modifiable Object Properties for descriptions of the different properties that can be modified. Standard properties can be specified in either upper or lower case, but native properties are case sensitive.

value – The new value for this property.

Description

This statement copies all of the objects from a specified form into the current form. Here is a simple example that makes a copy of the current form.

    let formName = info("formname")
    makenewform formName+" Clone"
    openform formName+" Clone"
    cloneform "",formName

The objects can be modified as they are copied, for example their position can be shifted. This next example assumes that there is an object in the current form called SwapArea. It starts by deleting any objects inside the swap area, then copies the objects in the form Fresh into this area. The position of the objects is adjusted as the objects are copied so that the objects will be positioned relative to the top left corner of the SwapArea objct. In other words, the procedure replaces whatever objects are currently inside SwapArea with the objects in the Fresh form.

    local swapRectangle
    swapRectangle = rectangleinset(objectinfo("rectangle","SwapArea"), 1)
    // delete any objects inside SwapArea
    selectobjects unionrectangle(objectinfo("rectangle"),swapRectangle)=swapRectangle
    deleteselectedobjects
    // copy the objects in the form "Fresh" into the swap area
    cloneform "","Fresh","rectangle",
        rectangleoffset(objectinfo("rectangle"),rtop(playRectangle),rleft(playRectangle))

Note: You can specify multiple property/value pairs in a single cloneform statement, like this:

    cloneform database,form,property1,value1,property2,value2,property3,value3

or with a dictionary, like this:

    cloneform database,form,initializedictionary(property1,value1, ... propertyN,valueN)

The advantage of using a dictionary is that you can prepare it in advance in a variable, and then use it over and over again (possibly adjusting it with the changedictionaryvalues( function).

There are literally hundreds of different object properties that can be modified with the cloneform statement. To learn more, see Modifiable Object Properties.

See Also

- activeobjectaction -- allows a procedure to communicate with the object on the current form that is currently being edited (if any).
- changeobject -- modifies the properties of one object in a form.
- changeobjects -- modifies the properties of one or more objects in a form.
- cloneobjects -- duplicates objects in a form (with modifications).
- closeactiveobject -- closes any object whose text is currently being edited.
- datamode -- switches a form from graphics mode into data mode.
- deleteselectedobjects -- deletes selected objects from a form.
- draggraybox -- facilitates dragging something around in a form window.
- dragtext -- starts drag-and-drop of text.
- formcleanview -- cleans up extraneous NSView objects in the current form.
- formxy -- programmatically scrolls a form to a new position.
- graphicsmode -- switches a form into graphics mode.
- info("activeobject") -- returns the name of the currently active text editor or word processor object (if any).
- info("activesuperobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("click") -- returns the location of the last mouse click in screen relative coordinates.
- info("clickedobjectid") -- returns the object ID of the clicked object.
- info("focusobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("focusobjectid") -- returns the object ID of the currently active text editor or word processor object, if any.
- info("scrollpoint") -- returns the distance the current form is scrolled horizontally and vertically.
- magicformwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- magicwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- magnification -- changes the magnification of a form.
- Modifiable Object Properties -- describes the properties of graphic objects that can be modified by a program (dimensions, color, font, title, etc.).
- newformobject -- creates a new graphic object in a form.
- object -- selects an object (based on the object name).
- objectaction -- allows a procedure to communicate with an object on the current form.
- objectid -- selects one graphic object in the current form based on an ID number.
- objectinfo( -- returns information about a graphic object: its location, size, color, font, etc.
- objectinfoarray( -- builds a text array of form object properties
- objectnumber -- identifies one graphic object from a set of selected graphic objects in the current form.
- openasyncprogresswindow -- opens a floating progress window for asynchronous operations (urltask(, timers).
- progressalert -- displays a progress alert if an operation is going to take a long time.
- progressbar -- updates a progress bar on the current form.
- selectallobjects -- selects all the graphic objects in the current form.
- selectnoobjects -- unselects all the graphic objects in the current form.
- selectobjects -- uses a formula to select one or more objects in the current form.
- startgraphicschange -- adds undo support to a procedure.
- textlisttableoptions -- sets up text list table options
- xytoxy( -- converts a point or rectangle from one co-ordinate system to another.

History

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