/*
@Node Header
@Next Macro

Code:       gendispx.rexx
Author:     Russell Leighton
Revision:   16 Feb 1994

Comments:

Generate a line of x displacements between two existing nodes.  This script
will   only   work   on  regions  of  nodes  that  were  generated  by  the
'genregion.rexx' script.  The variable 'inodes' must be set to the original
value  that was used to generate the region.  The value of the displacement
may be set with the variable 'disp'.

@EndNode
@Node Macro
*/

options results

address ami2d

if ~show('l', "rexxmathlib.library") then do
    check = addlib('rexxmathlib.library',0,-30,0)
end

'info(node)'
f1 = result
parse var f1 nd i1a x1a y1a
if i1a = 0 then exit
'info(node)'
f2 = result
parse var f2 nd i1b x1b y1b
if i1b = 0 then exit
if i1a > i1b then do
    parse var f2 nd i1a x1a y1a
    parse var f1 nd i1b x1b y1b
end

in = i1b - i1a

'get inodes'
ni = result
if in > ni then inc = ni
else inc = 1
'get disp'
disp = result

do i=0 to in by inc
    n = i1a + i
    'dispx('n','disp')'
end
exit
