home *** CD-ROM | disk | FTP | other *** search
- /* REDUCE POINTS - REMOVE CO-LOCATED POINTS */
- /* Copyright 1993 Soft-Logik Publishing Corporation */
- /* May not be distributed without Soft-Logik Publishing Corporation's express written permission */
- /* $VER: 2.0 */
-
- ADDRESS 'TYPESMITH'
- OPTIONS RESULTS
- TRACE OFF
-
- /* Screen to front */
-
- to_front
- delcount=0
-
- /* this is the start of the main program. Restart to here after deleting a point */
-
- Restart:
-
- /* find the number of character paths and store it */
- get_numpaths
- numpaths=RESULT
-
- /* select first path and get coordinates of first point */
- first_path
- get_pointx
- pointx1=RESULT
- get_pointy
- pointy1=RESULT
- get_prev_bcpx
- pbcpx1=RESULT
- get_prev_bcpy
- pbcpy1=RESULT
- get_next_bcpx
- nbcpx1=RESULT
- get_next_bcpy
- nbcpy1=RESULT
-
- /* Loop for number of paths */
- DO i=numpaths TO 1 BY -1
-
- /* find the number of points and store it */
- get_numpoints
- numpoints=RESULT
-
- /* Loop for number of points */
- DO ii=numpoints TO 2 BY -1
-
- next_point
-
- /* get coordinates of point */
- get_pointx
- pointx2=RESULT
- get_pointy
- pointy2=RESULT
- get_prev_bcpx
- pbcpx2=RESULT
- get_prev_bcpy
- pbcpy2=RESULT
- get_next_bcpx
- nbcpx2=RESULT
- get_next_bcpy
- nbcpy2=RESULT
-
- /* compares the coordinates of the current and previous points */
- IF (pointx1=pointx2 & pointy1=pointy2) THEN DO
- /* delete if equal */
- delete
- delcount=delcount+1
- SIGNAL restart
- END
- IF (pointx1~=pointx2 | pointy1~=pointy2) THEN DO
- /* else store the current points in x1,y1 */
- pointx1=pointx2
- pointy1=pointy2
- pbcpx1=pbcpx2
- pbcpy1=pbcpy2
- nbcpx1=nbcpx2
- nbcpy1=nbcpy2
- END
-
- END
-
- /* select the next path */
- next_path
-
- END
-
- display_alert ' 'delcount' co-located points deleted!|Exit'
-
- /* THAT'S ALL FOLKS */
-