1 SUB SMG_SCROLL(LONG Start_row,LONG Start_col,LONG Height, & LONG Width,BYTE Direction,LONG Lines_to_scroll,BYTE Vir_disp_num) !---------------------------------------------------------------& ! & ! SMG_SCROLL & ! & ! Creation Date: 3-July-1985 & ! Author: Ken Messer & ! Purpose: Scroll a virtual display & ! & ! Modification history & ! & ! Date Description of change(s) & ! & !---------------------------------------------------------------& ! & ! Copyright (c) 1985 - Ken Messer, Allied Electronics, Inc., & ! 401 E. 8th St., Ft. Worth, TX 76102 & ! & ! This software may be copied and distributed freely to anyone & ! for non-commerical use provided that this copyright notice is & ! included. & !---------------------------------------------------------------& OPTION TYPE = INTEGER, SIZE = INTEGER LONG %include "SMG$LIBRARY:SMG.DFN" DECLARE BYTE CONSTANT True = -1, & False = 0 DECLARE LONG Scroll_direction, & RS EXTERNAL LONG FUNCTION SMG$Scroll_display_area EXTERNAL LONG CONSTANT SMG$M_Up, & SMG$M_Down, & SMG$M_Left, & SMG$M_Right, & SS$_Normal EXTERNAL STRING FUNCTION Get_Error_Message(LONG) !---------------------------------------------------------------& ! & ! M a i n P r o g r a m L o g i c & ! & !---------------------------------------------------------------& ! Set the scroll direction SELECT Direction CASE 0 Scroll_direction = SMG$M_Up CASE 1 Scroll_direction = SMG$M_Down CASE 2 Scroll_direction = SMG$M_Left CASE 3 Scroll_direction = SMG$M_Right CASE ELSE Scroll_direction = SMG$M_Up END SELECT ! Don't allow negative values Height = 0 IF Height < 0 Width = 0 IF Width < 0 Lines_to_scroll = 1 IF Lines_to_scroll <= 0 ! Scroll in the desired direction SELECT True CASE Height > 0 and Width > 0 RS = SMG$Scroll_display_area(Display_id(Vir_disp_num), & Start_row,Start_col,Height,Width,Scroll_direction, & Lines_to_scroll) CASE Height > 0 and Width = 0 RS = SMG$Scroll_display_area(Display_id(Vir_disp_num), & Start_row,Start_col,Height,,Scroll_direction, & Lines_to_scroll) CASE Height = 0 and Width > 0 RS = SMG$Scroll_display_area(Display_id(Vir_disp_num), & Start_row,Start_col,,Width,Scroll_direction, & Lines_to_scroll) CASE Height = 0 and Width = 0 RS = SMG$Scroll_display_area(Display_id(Vir_disp_num), & Start_row,Start_col,,,Scroll_direction,Lines_to_scroll) END SELECT IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF 32767 SUBEXIT END SUB