From nordjan@dutchpu.tudelft.nlMon Jan 22 13:57:55 1996 Date: Fri, 5 Jan 96 09:22:46 +0100 From: Nord-Jan Vermeer Reply to: N.Vermeer@ct.tudelft.nl To: aurora-editor@sfu.ca Subject: Window difference macro First of all happy New Year and best wishes. A while ago I read a request to submit some useful macro's. Here is mine, unfortunately unfinished yet, but I could use some help too. The objective is to transfer the last functionality reason to use Norton Editor once in a while: Search Window Difference, to a macro in Aurora. Here's how I think it should work: first there is a check if there are only two windows open (this should be edit windows not file manager windows), next the windows are tiled horizontally and from the current cursor position in each window, a comparison is made character by character (this is very slow and should, of course, be done line by line), this loop is stopped once a difference is encountered. I have run into a number of problems (without trying very hard): - how to count only EDIT windows - how to compare line by line (and skip empty line, specially when starting with one!) Hoping to hear from you soon, Nord /* ------------------------------------------------------------------ */ /* Macro: WINDIF.AML */ /* Written by: Nord-Jan Vermeer */ /* */ /* Description: This macro is used to find the diferences in two */ /* windows and stops at the successive differences */ /* */ /* Usage: Place this macro in the MACRO subdirectory, compile, */ /* and run from the macro picklist . */ /* ------------------------------------------------------------------ */ include bootpath "define.aml" var wincount buffer = getcurswin wincount = 0 while buffer do wincount = wincount + 1 buffer = getprevwin buffer end if wincount < 2 then msgbox "There is only 1 window open: nothing to compare." elseif wincount > 2 then msgbox "There are " + wincount + " windows open: too much to compare." else tile 'h' getprevwin repeat string1 = getchar if string1 <> "" then right else down col 1 end prevwindow string2= getchar if string2 <> "" then right else down col 1 end nextwindow until string1 <> string2 left prevwindow left nextwindow end +--------------------------- end of message ------------------------+ | | | | Nord-Jan Vermeer | Email: n.vermeer@ct.tudelft.nl | | Institute for Wind Energy | | | Faculty of Civil Engineering | Phone: +31 15 2785166 | | Delft University of Technology | | | Stevinweg 1 | Fax: +31 15 2785347 | | 2628 CN Delft | | | The Netherlands | Room 6.63 | +---------------------------------+---------------------------------+