'*************************findedge() function************************ ' ' purpose: looks in sobeldata array in the direction designated ' until it finds an edge (or the edge of the image) ' ' input: SobelData array ' ' output: returns integer value of pixel location desginating the ' the first edge found in the specified direction ' '******************************************************************** Function findedge(startw As Integer, starth As Integer, goright As Boolean) As Integer Dim direction As Integer Const found As Boolean = True Dim edge As Boolean Dim x As Integer Dim y As Integer edge = False x = startw y = starth If goright = True Then direction = 1 If goright = False Then direction = -1 'use SobelData...it has what is being displayed While (edge <> found) And x < picWIDTH And x >= 0 If SobelData(x, y) = 0 Then edge = True Else x = x + direction End If Wend findedge = x End Function