home *** CD-ROM | disk | FTP | other *** search
-
-
- STATIC counter := 0, screens := {}
-
- *****************************************************************
- FUNCTION SCRNPUSH (top, left, bottom, right)
- *****************************************************************
-
- * Push a screen onto screen stack
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- * Initialize parameters not passed
- top = IF(top = NIL, 0, top)
- left = IF(left = NIL, 0, left)
- bottom = IF(bottom = NIL, MAXROW(), bottom)
- right = IF(right = NIL, MAXCOL(), right)
-
- * Increment screen counter and screen array
- counter++
- ASIZE(screens, counter)
-
- * Push screen onto stack
- screens[counter] = SCRNSAVE(top, left, bottom, right)
-
- RETURN counter
-
-
- *****************************************************************
- FUNCTION SCRNPOP
- *****************************************************************
-
- * Restore a screen from screen stack
-
- IF counter > 0
-
- * Restore the screen
- SCRNREST(screens[counter])
-
- * Decrement screen counter and screens array
- ASIZE(screens, --counter)
-
- ENDIF
-
- RETURN counter
-
- *****************************************************************
- FUNCTION SCRNLOAD (filename)
- *****************************************************************
-
- * Loads a set of screens from a disk file
-
- LOCAL = temp_array := {}
-
- * If extension is not passed, default to .ARR
- filename = IF(AT('.', filename) = 0, filename + '.ARR', filename)
-
- IF filename != NIL .AND. FILE(filename)
-
- * If file exists load temporary array
- ARRESTORE(temp_array, filename)
-
- * Resize screens array
- ASIZE(screens, LEN(screens) + LEN(temp_array))
-
- * Add temporary array to screens array
- ACOPY(temp_array, screens, 1, LEN(temp_array), counter + 1)
-
- * Set screen counter and return its value
- counter := LEN(screens)
- RETURN counter
-
- ELSE
- * Return -1 as error indicator
- RETURN -1
- ENDIF
-
- *****************************************************************
- FUNCTION SCRNWRIT (filename)
- *****************************************************************
-
- * Writes current set of screens to a disk file
-
- * If extension is not passed, default to .ARR
- filename = IF(AT('.', filename) = 0, filename + '.ARR', filename)
-
- * Save screens array to disk
- IF filename != NIL .AND. ARSAVE(screens, filename)
- * Successful save
- RETURN LEN(screens)
- ELSE
- * Unsuccessful save, return -1 as error indicator
- RETURN -1
- ENDIF
-
-
- *****************************************************************
- FUNCTION SCRNCLR (no_clear)
- *****************************************************************
-
- * Clears screen stack or returns its size in bytes
-
- LOCAL size := 0, cntr := 0
-
- IF no_clear = NIL
- * Reset the screen count and screen stack array and return
- counter := 0 ; screens := {}
- RETURN 0
- ELSE
- * Otherwise, return size of screen stack
- FOR cntr = 1 TO counter
- size = size + LEN(screens[counter])
- NEXT
- RETURN size
- ENDIF
-
-