# the slope _has_ changed a default distance is supplied
#
# the first use of @... to specify an absolute location
-# acts only to fix the zero point of the absolute position scale
-# and does not actually specify the location of the current point
+# acts only to fix the zero point of the absolute position scale;
+# the (relative to start) location of the current point must already be known
use strict qw(vars refs);
# $cp[]{H} height
# $cp[]{L} absolute dist
# $cp[]{S} slope
-
our $absoffset;
+
our $numre= '(?:\\d{1,6}(?:\\.\\d*)?|\\.\\d+)';
our $progname= $0;
arg_item(S, $1 * 0.01);
} elsif (m/^\@([-+]?$numre)$/o) {
if (defined $absoffset) {
- arg_item(L, $1 + $absoffset);
- } else {
- $absoffset= -$1;
- }
+ arg_item(L, $1 + $absoffset);
+ } else {
+ if (!@cp) {
+ $absoffset= -$1;
+ } elsif (defined $cp[$#cp]{L}) {
+ $absoffset= $cp[$#cp]{L} - $1;
+ } else {
+ arg_error("point \#$#cp location still unknown at \`$_'");
+ }
+ }
} elsif (m/^\+($numre)$/o) {
complete_current_point("new point started because of +...");
arg_item(L, $cp[$#cp]{L} + $1);