// // AUTOSCROLL.VDM Christian Ziemski 07.10.2004 // 08.10.2004 // // // Key-Usage: // ---------- // Page Up Scroll up page per page // Page Down Scroll down page per page // Home Goto BeginOfFile and scroll down // End Goto EndOfFile and scroll up // Cursor Up Scroll up line per line // Cursor Down Scroll down line per line // Cursor left Decrease speed (use alternating with other keys to work!) // Cursor Up Increase speed (use alternating with other keys to work!) // // Backspace or ESC Stop the macro // // #100=0 #104=1 #105=1 #106=0 Key_Purge repeat (ALL) { #103=Previous_Key(0) if (#103 != #100) { #106=#103 #100=#103 } else { Sleep(#104) } Key_Purge if (#106 == 'E'+'S'*256) { break } if (#106 == 'B'+'S'*256) { break } if (#106 == 'L'+'B'*256) { BoF #105=1 } if (#106 == 'L'+'E'*256) { EoF #105=-1 } if (#106 == 'P'+'U'*256) { #105=-Win_Lines #104=10 } if (#106 == 'P'+'D'*256) { #105=Win_Lines #104=10 } if (#106 == 'C'+'U'*256) { #105=-1 } // Goto_Line(Cur_Line - Win_Vert + 3) if (#106 == 'C'+'D'*256) { #105=1 } // Goto_Line(Cur_Line + Win_Vert - 3) if (#106 == 'C'+'R'*256) { #104=Max(0, #104-=1) } if (#106 == 'C'+'L'*256) { #104=Min(#104+=1, 255) } if (#105 > 0) { #106='C'+'D'*256 } if (#105 < 0) { #106='C'+'U'*256 } if (#105 > 1) { #106='P'+'D'*256 } if (#105 < -1) { #106='P'+'U'*256 } Line(#105, NOERR) Update Statline_Message(" ") if ((#105 > 0) && At_EoF) { Statline_Message("End of file reached!") } if ((#105 < 0) && At_BoF) { Statline_Message("Begin of file reached!") } }