CHSWAP ====== To get out of a tight spot I wrote this function to swap around two S*BASIC channels: ERT CHSWAP(#chn1, #chn2) Both #chn1 and #chn2 must be existing, open channels. The # is obligatory. "Anything" sent to chn1 will now end up in chn2 and vice versa. Examples all assume the standard three window S*BASIC consoles. 100 PRINT#2; CHSWAP(#1, #2): REMark Prints 0 in S*BASIC's rightmost window 110 PRINT "This is a test" : REMark Ends up in leftmost window (#2) 120 LIST: : REMark Goes to channel #1 130 CIRCLE 50, 50, 50 : REMark Circle in #2 140 PRINT CHSWAP(#1, #2) : REMark Back to normal : Heres another: 100 ch = FOP_OVER("ram1_test_txt") 110 PRINT#2; CHSWAP(#1, #ch) 120 PRINT "This is a test" 130 LIST#1 140 PRINT#2; CHSWAP(#1, #ch) 150 CLOSE : This too works fine: The text and listing end up in the file. However, .. 130 CIRCLE 50, 50, 50 .. would, of course, not work in this case. Luckily, youll only get smacked with a Bad Parameter error. There may be pitfalls; I havent tested this extensively. On your head be it! Programm status =============== V0.02, pjw, 2024 Feb 06 Conditions of use and DISCLAIMER as per Knoware.no
Generated by QuickHTM, 2024 Feb 06