Examples of %GCE

Example:

	GTM>DO ^%GCE
	Global Change Every occurrence
	Global ^a:^b
	^a ^b
	Current total of 2 globals.
	Global ^ <RETURN>
	Old String: hello
	New String: good-bye
	Show changed nodes <Yes>?: <RETURN>
	Output Device: <terminal>: <RETURN>
	^a
	No changes made in total 1 nodes.
	^b
	^b(10)
	Was : hello Adam
	Now : good-bye Adam
	1 changes made in total 25 nodes.
	Global ^ <RETURN>
	GTM>
	

This example searches a range of globals and its nodes for the old string value entered. GT.M searches each global and displays the changes and number of nodes changed and checked.

Example:

	GTM>set ^b(12)=12
	GTM>set ^b(122)=122
	GTM>set ^b(30)=656
	GTM>set ^b(45)=344
	GTM>set ^b(1212)=012212
	GTM>DO ^%GCE
	Global Change Every occurrence
	Global ^b
	Current total of 1 global.
	Global ^ <RETURN> 
	Old String: 12
	New String: 35
	Show changed nodes <Yes>?: <RETURN>
	Output Device: <terminal>: <RETURN> 
	^b(12)
	Was : 12
	Now : 35
	^b(122)
	Was : 122
	Now : 352
	^b(1212)
	Was : 12212
	Now : 35235
	5 changes made in total 5 nodes
	Global ^ <RETURN> 
	GTM>DO ^%G
	Output device: <terminal>: <RETURN>
	List ^b
	^b(12)=35
	^b(30)=656
	^b(45)=344
	^b(122)=352
	^b(1212)=35235		
	

This example shows that executing %GCE replaces all occurrences of "12" in the data stored in the global ^b with "35" and displays the affected nodes before and after the change. Then the %G demonstrates that "12" as data was changed, while "12" in the subscripts remained untouched.