neigborfunc.qry

  Download

More scripts: Mark By Query

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
###### a function titled "neighbor" is defined here ############
func neighbor(class$,polygon,attr1$,attr2$) {
	Array polygons[1];
	if (class$ == attr1$) {
		numPolygons = GetVectorPolyAdjacentPolyList(Vect,polygons,polygon);
		for i = 1 to numPolygons {
			num =  polygons[i];
			if (Vect.poly[num].CLASS.Class$ == attr2$) return 1;
			}
		}
	return 0;
	}
########### variables for attributes are defined here ###########
attribute1$ = "SrD";
attribute2$ = "SrC"
########### current polygon number #######
polygon = Internal.ElemNum;
###########Class attribute of the current polygon #######
class$ = CLASS.Class;
###### the function titled "neighbor" is called here ############
if (neighbor(class$,polygon,attribute1$,attribute2$) == 1) return 1;
if (neighbor(class$,polygon,attribute2$,attribute1$) == 1) return 1;
return 0;