Cursors and Forms

In the article "Faking Cursors" the CURSOR utility was introduced. CURSOR may in turn be used to construct a forms application that supports scrolling through a selection set, much as the FORMS atool in Host ARCEDIT.


&r EFORMS [CURSOR/GLOBAL] {item...item}

invokes a FORMS-style dialog box with which a user may edit individual entries in a selection set or apply edits to the entire set.


arguments

[CURSOR/GLOBAL] - the CURSOR option enables browsing and editing individual entries in a selection set; the GLOBAL option applies values to the entire set.

{item...item} - one or more items which will be displayed in the update form. If no items are specified, all the items for the selected feature will be listed.


Before running EFORMS with the CURSOR option, a cursor named FORMS must be declared, and the join environment (if any) set:

   &r cursor declare forms
   &r cursor forms relate veg.landform muntnumb ordered
   &r eforms cursor type type_txt #parent
   &r cursor forms remove restoresel
The reason for this is that EFORMS has no way to query the current join environment. If EFORMS is used as part of a larger application, it would be up to that application to store the JOIN environment and supply it as above.

The maximum number of items which may be specified is 9. The sum of the item names, when delimited by spaces and commas, must not exceed 80 characters.

Item definitions are stored beginning at SML variable 501, and item values begin at 601. Thus the maximum number of items supported by the EFORMS dialog box is 100. The code may be altered to change this number, though care should be taken not to collide with the cursor stacks.


To download the install pack, click HERE. Unzip in a temporary directory and execute FORMS.BAT.


Using EFORMS at the Command Prompt

The following SMLs (included in the install pack) may be used to support and execute EFORMS from the command prompt; the JOIN environment is stored in SML variable 71:

JOIN.SML

&extract -1 -1 1
&goto false &if &eq %-1 OFF
   &sv 71 "%-1 %-2 %-3"
   &goto end
&label false
   &sv 71 OFF
&label end
JOIN %71
&return
CFORMS.SML

&r cursor declare forms
&goto false &if &eq %71 OFF
   &r cursor forms relate %71
&label false
&r eforms cursor %-1 %-2 %-3 %-4 %-5 %-6 %-7 %-8 %-9
&r cursor forms remove restoresel
&return
GFORMS.SML

&r eforms global %-1 %-2 %-3 %-4 %-5 %-6 %-7 %-8 %-9
&return
In this case, "&r JOIN OFF" should be performed at the beginning of a session to set variable 71 to OFF. This may also be done in the ARCEDITW startup script -- see "Customizing PC ARC/INFO 3.5.X" for further information.


EXAMPLE ONE: Editing Labels in VEG

In ARCEDITW, a few labels are selected in VEG:

Figure 1

The following dialog joins the labels to VEG.LANDFORM and brings up the EFORMS CURSOR dialog box:

&r join veg.landform muntnumb ordered
&r cforms
Figure 2

Pressing the ">>" button brings up the next record. Note the activation of the "<<" button to return to the previous record.

Figure 3


Return to ArcTips page