- Open the attribute table of your river layer.

|
- Click on the Options button for the table and then select Add a new field.

|
- Define field properties. In this example a Field called River_ID of type Long integer with a precision of 16 is defined.

A new field is created with all values set to zero.
|
- Right click on the heading of the new field and select calculate values.

|
- You may get a warning message about calculating outside an edit session, simply select YES to continue.
|
- Tick the Advance check box to enable VBA scripting.
|
- You can either type in the following code or download the calculator expression file here. If you download this text file you need to load the code into the calculator by clicking on the LOAD. . . button.

|