You are here: Function Reference > Alphabetical Listing > S > SetSectionPos

SetSectionPos

SetImagePos

SetImagePos has been replaced with SetSectionPos. SetImagePos and SetSectionPos have same functionality; the only change is to the function name. The existing SetImagePos scripts will continue to function and will not require any modification.

Use this procedure/function to reposition a section on a page.

Syntax

SetSectionPos (PrefixName, Section, Form, Group)

Parameter

Description

PrefixName

A prefix name to be associated with the coordinates returned by the procedure.

Section

Enter the name of a section in the form set. The default is the current section.

Form

Enter the name of a form in the form set that contains the section. The default is the current form.

Group

Enter the name of the form group that contains the form and section you specified. The default is the current group.

This procedure repositions a section at the coordinates you specify in the PrefixName parameter: prefix name.top, prefix name.left.

Note The section remains the same size.

This procedure retrieves these variables and sets the section’s top coordinate to prefix name.top and its left coordinate to prefix name.left. This procedure returns a bad variable error message if the prefix name.top or prefix name.left variables are not defined as DAL internal variables.

Example

For this example, assume the current section is Image25, the form is Input_form, and the form group is Package1. The coordinates are:

 

Image25

For internal variables

Image50

Top

25

125

95

Left

50

150

90

Note The the Bottom-Right coordinate is automatically calculated from the new Top-Left coordinate by adding the section height and width, which are not changed by this DAL function.

Procedure

Result

Explanation

SetSectionPos ("MyImage")

New coordinates for the current section, Image25, will be:

Myimage.top = 125

Myimage.left = 150

Myimage.bottom = 200

Myimage.right = 200

Sets the coordinates for the current section to the internal DAL variables: Myimage.top, Myimage.left, Myimage.bottom, and Myimage.right.

SetSectionPos ("MyImage", "Image50")

New coordinates for the section, Image50, will be:

Myimage.top = 125

Myimage.left = 150

Myimage.bottom = 200

Myimage.right = 200

Sets the coordinates for the section, Image50, to the internal DAL variables: Myimage.top, Myimage.left, Myimage.bottom, and Myimage.right.

SetSectionPos ( "m", "MVF\2", "XYZ")

The section is reposition to:

m.top = top

m.left = left

m.bottom = coordinate

m.right = right

The second occurrence of the section MVF on the form XYZ is repositioned using the DAL target variables.

IF (SectionRect ("MyRect", "MyImage"))
     MyRect.Top += 2400;
     SetSectionPos("MyRect","MyImage");
END;

This script takes the coordinates of the section named MyImage and sets them to the variables MyRect.Top, MyRect.Left, MyRect.Bottom, and MyRect.Right. Next, it increases MyRect.Top by 2400 FAP units then moves MyImage one inch (2400 FAP units) lower on the page.

See also