comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Displaying loop-index (was: Re [Q] illegal character ?)

Displaying loop-index (was: Re [Q] illegal character ?)
type: item
description: IDL. Version 3.1.1 (sunos sparc) Hi Two or three years ago I wanted to keep track of the index in a loop, i.e. displaying tha actual index in the loop. Naturally I wanted just one line as output overwrinting that line again and again. I came up with a solution using "\x08" which I had to change to string(8b) about a year ago. The discussion in this group about " [Q] illegal character " gave me -finally :-) - the idea to use string(13b) instead of string(8b). So now I have two routines for the same task (I'll append them at the end - they're just a couple of lines long). I timed them against each other: n_lines n'th line TIME 8b TIME 13b ratio 100 1 0.96499991 0.59800005 1.6137121 1000 1 9.7730000 5.4520000 1.7925532 10000 1 97.016000 55.228000 1.7566452 100 50 0.038999915 0.021000028 1.8571364 1000 50 0.22299993 0.21700001 1.0276494 10000 50 2.3700000 2.1220001 1.1168708 with n_lines: number of loops n'the line: display every n'th loop-index TIME: in seconds ratio: (TIME 8b) / (TIME 13b) As you can see using string(13b) seems to be faster. If anyone of you has ideas to speed them up please inform me. Karlheinz Knipp ____________________________________________________________ __________________ __ ____ __ / // _ \ / / Karlheinz Knipp phone: +49 511 - 762 4922 / // /_/ // / University of Hannover fax: +49 511 - 762 2483 / // ____// / Institute for Photogrammetry / // / / / Nienburger Str.1 /_//_/ /_/ FRG 30167 Hannover e-mail: knipp@ipi.uni-hannover.de vvvvvvvvvvvvvvvvvvvvvvvvv SNIP vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ;+ pro show_line, l, nl, maxl = maxl ; shows line in loop ; ------------------------------------------------------------ ------------------ ; START OF DESCRIPTION ; ; subroutine IPI, U Hannover 08'91, modified 12'91 ; 04'93: changed x08 > string(8b) ; 08'94: modified for less if's ; ; METHOD: print (with reset) line # (or line# - line# mod nl) ; formats : $ NO carr.return ; "\x08" one backspace OLD ; string(8b) NOW ; ; INPUT PARAMETER: l cur…
creator: knipp
date: 1994-08-12T12:01:35-00:00