[Oberon] identity of two VARs

shark at gulfnet.sd64.bc.ca shark at gulfnet.sd64.bc.ca
Wed Sep 14 17:48:38 CEST 2005


Here is a simple problem which I've never had to solve until now.

PROCEDURE Identical*(VAR source, target: ARRAY OF CHAR):integer;
(* Return 0, 1, 2 or 3 according to identity of location and 
   identity of content strings. *)
VAR 
	identicallocation, identicalcontent: INTEGER;
BEGIN
	IF ?? THEN (* source and target are the same array *)
		identicallocation := 1 ELSE identicallocation := 0 
	END;
	IF source = target THEN (* the strings in source and target match. *)
		identicalcontent := 1 ELSE identicalcontent := 0 
	END;
	RETURN((2*identicalcontent)+identicallocation)
END Identical;

More briefly,
PROCEDURE Identical*(VAR source, target: ARRAY OF CHAR):integer;
BEGIN
	RETURN((2*(source=target))+??)
END Identical;.

What should I put in place of ?? to have this work?

Thanks,        ... Peter E.


Desktops.OpenDoc  http://carnot.pathology.ubc.ca/




More information about the Oberon mailing list