<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 21, 2022 at 8:43 AM Laurence Finston <<a href="mailto:Laurence.Finston@gmx.de">Laurence.Finston@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For a particular application, I'm calling MP from within a program via a pipe and I want to read the output and use it for setting variables in my application.  The intention is to use "point x of <path>" to take a path of length n and convert it into an equivalent path of length n*m where m is some whole number > 1 (within reason).<br>
<br>
The problem is the way the lines in the output of "show" are broken:  The lines are fairly short (max. 80 characters, including the newline) and the x- and y-coordinates of the points can be broken across two lines, which makes parsing unnecessarily difficult.</blockquote><div><br></div><div>yes, it is a "feature". We have to deal with it.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It would also be nice to limit the number of decimal places for the coordinates, by rounding or even by truncating.<br>
<br></blockquote><div><br></div><div>not with "double" but with "decimal" and "binary" we have numberprecision:</div><div>if numbersystem="decimal":</div><div> numberprecision:=6;<br>fi<br>if numbersystem="binary":<br> numberprecision:=6;<br>fi<br></div><div> </div><div>decimal and binary are slower than double, btw.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
As a workaround, I've written a macro to write the data I need to a file (see attachment), but it would be nicer if "show" could be used instead.<br><br></blockquote><div><br></div><div>I think this is the right way, not a workaround: write your data to a file , post-process the file with, for example, perl.</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">luigi<br></div></div>