CHIDX ===== Get the channel ID of one of an external job's console channels Usage ===== chid = CHIDX([#]channel_no%, jobID) where chid is either the desired channel ID (not channel number!) or an error code, usually Not Found channel_no% is some notional channel number, probably in order of creation jobID is the job ID of the target job being queried. Note: Only console channels are scanned for. A channel to any other type of device returns a Not Found. Note: This command assumes that job#0's channel#0 is a console channel. Note: Job#0's channel #0 cannot be reached by this routine! Assume that it always has the channel ID $00000000! Why this command? ================= Whats the point of this command? What can it be used for? Well, you might wish to make a utility that lists information about (console) channels. A simplistic demo here: 100 CLS 140 PRINT "System's channels:" 150 PRINT TO 6; '$00000000' 170 : 172 jid = 0 175 REPeat main 180 FOR ch = 0 TO 15 190 chx = CHIDX(ch, jid) 200 IF chx = -7: EXIT ch 210 PRINT TO 6; '$'; HEX$(chx, 32) 220 END FOR ch 230 PRINT 240 : 250 jid = NXJOB(jid, 0) 260 IF jid = 0: EXIT main 270 PRINT "Job"! JOB$(jid);"'s channels:" 280 PAUSE 290 END REPeat main 300 : The reason I wrote this command was to use one job to print to another job's window. This may be useful to, for example, run asynchronous tasks, like a clock or timer in the same display as the main act. See PRTSTR% for an example of that. Note: This may not be very "clean" in the Qdos sense. It is possible to do some bad shit with this command, so take care! Also take a look at the JobWin toolkit. The command PTRCHID is another way of getting an external job's channel IDs - by using the pointer. Program Status ============== V0.01, pjw, 2025 Oct 03, Includes code (NxChn) © 1988 Tony Tebby, QJUMP, lifted from the SMSQ/E sources, fiddled by me. Conditions of use and DISCLAIMER as per Knoware.no
Generated by QuickHTM, 2025 Oct 05