$O: Notational Find in code

Doug Kuyvenhoven omnisdev at vencor.ca
Sat May 17 10:41:01 EDT 2008

Hi Caroline:

I've written various forms of 'Find & Replace' over the years for  
various reasons. It's relatively simple to do with notation.

1. Build a list of all the classes in a library

	Do $libs.LibName.$classes.$makelist($ref().$name,$ref) Return  

2. Loop through the classes making a list of all the methods in each  

	For ClassesList.$line to ClassesList.$linecount

		Do ClassesList.C2().$methods.$makelist($ref().$name,$ref) Returns  

		; Loop through the methods looking for the key words you are after.

		For MethodsList.$line to MethodsList.$linecount

			Set reference rMethod as MethodsList.C2

			Calculate Text as rMethod.$methodtext
			If pos('OK message',Text)

				; Modify the methods text

				; Assign the modified text back to the method
				Calculate rMethod.$methodtext as Text			

			End if

		End for

	End for

Hope that helps.

Doug Kuyvenhoven
Vencor Software - www.vencor.ca

On 17-May-08, at 9:09 AM, Dr Caroline Wilkins wrote:

> Dear Listers,
> Does anyone know what code would be living behind the "Find All"  
> button on the IDE "Find & Replace" window?
> I want to be able to search a large library for user interaction  
> things like OK and Yes/No messages and edit them notationally as  
> part of a multilanguage adaptation of an existing large application.
> I saw in the archives that Nick Chadwick had created a Find &  
> Replace library, but the email address on the mail is bouncing, so  
> presumably long out of date. If anyone can put me in touch with him,  
> that would be great.
> Best Regards
> Caroline
> Dr. Caroline Wilkins
> iB2B Ltd
> http://www.artificia.co.uk
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com

More information about the omnisdev-en mailing list