home *** CD-ROM | disk | FTP | other *** search
- ======= AREXX CMDS ======
-
- Edit Rexx output buffer 35
- <altCtl-1:
- equateLoc(buf35,sPage,sFile)
- editBuf(buf35) >
-
- Edit Rexx input buffer 36
- <altCtl-2:
- equateLoc(buf36,sPage,sFile)
- editBuf(buf36) >
-
- Send output buffer 35 to Rexx
- <altCtl-3:
- equateNum(n98,0) .. 0 flag means send msg, not reply
- rexxOut(buf35,all,0,n98,n99) .. 0 ActionResult means default to RXCOMM
- runKey(virtual-s) >
-
- Fetch Rexx input into buffer 36
- <altCtl-4:
- if (rexxIn(buf36,sFile,n97,n98,n99)) if (eqNum(n98,0)) { .. if Msg
- equateLoc(buf36,sPage,sFile)
- editBuf(buf36)
- }
- runKey(virtual-r) >
-
- Send hilite region to Rexx.
- <altCtl-5:
- equateNum(n98,0) .. 0 means msg, not reply
- rexxOut(curFile,hilite,0,n98,n99) .. 0 means default to Action = RXCOMM
- runKey(virtual-s) >
-
- Fetch Rexx input at cursor
- <altCtl-6:
- rexxIn(curFile,atCursor,n97,n98,n99)
- runKey(virtual-r) >
-
- Send an OK reply to Rexx (NOTE: Amiga-ESC abort sends Failed reply.)
- <altCtl-7:
- equateNum(n98,1) .. 1 means reply, not msg
- rexxOut(" ",all,0,n98,n99) .. 0 is OKAY result
- runKey(virtual-s) >
-
- Send an OK reply to Rexx along with text in hilite region
- <altCtl-8:
- equateNum(n98,1)
- rexxOut(curFile,hilite,0,n98,n99) ..text NOT sent, if not RXFB_RESULT msg
- runKey(virtual-s) >
-
- Toggle flag to handle Rexx traffic automatically during idle periods.
- <altCtl-9: .. set idletime back to old value
- if (getFlag(curFile,userGlobalB)) equateNum(idleTime,n36)
- else { .. idleTime not 0, toggle to auto-traffic handling
- equateNum(n36,idleTime) .. store idleTime in n36
- equateNum(idleTime,0) .. set idleTime to 0
- }
- flipFlag(curFile,userGlobalB) .. toggle flag
- swapKey(idle,virtual-t) .. swap in/out the auto-traffic idle cmd
- >
-
- Make an x.rexx program with commands to send to Uedit.
- <altCtl-0:
- if (not newFile) return
- clearRgn(curFile,all)
- insertRgn(curFile,atCursor,
- "/* ARexx->Uedit cmd program */
- address 'URexx' 'c:'
- ",all)
- movecursor(curFile,sChar)
- movecursor(curFile,sChar)
- equateLoc(curFile,sPage,sFile)
- setFileName(curFile,"x.rexx")
- updateDisplay
- while (nothing) {
- putMsg("Give desired inputs. Amiga-ESC when done. F2 to save.")
- getKeyVal(macroNum,inputChar)
- toWord(curFile,macroNum)
- insertChar(curFile,"+")
- toWord(curFile,inputChar)
- insertChar(curFile," ")
- updateDisplay
- fileSize(curFile,n54) .. force pack, avoid mem-abort
- }
- >
-
- Swapped to idle for auto handling of Rexx msgs
- <virtual-t:
- if (rexxIn(buf36,eFile,n97,n98,n99)) { .. if fetched something
- .. runKey(virtual-r) .. show flags - slower if use this line
- if (eqNum(n98,0)) { .. if recvd a Msg, not a Reply
- moveCursor(buf36,sFile)
- copyChar(buf36,n53)
- moveCursor(buf36,eChar)
- copyChar(buf36,n54)
- moveCursor(buf36,eChar)
- if (eqNum(n54,":")) { .. look for "c:" or "f:"
- if (eqNum(n53,"F")) goto label(10)
- if (eqNum(n53,"f")) {
- label(10) .. load in a FILENAME
- moveCursor(buf36,sFile)
- clearChar(buf36)
- clearChar(buf36)
- if (loadFile(buf36)) goto label(50) .. OKAY Reply
- goto label(40) .. ERROR reply
- }
- if (eqNum(n53,"C")) goto label(20)
- if (eqNum(n53,"c")) { .. CMDs to execute
- equateNum(n54,0) .. use as toggle flag
- goto label(25)
- label(20)
- moveCursor(buf36,eWord)
- label(25)
- while (nothing) {
- if (is(buf36,digit)) goto label(30)
- if (is(buf36,eFile)) goto label(50) .. send OK reply
- moveCursor(buf36,eChar)
- }
- label(30)
- incNum(n54)
- if (not and(n54,n54,1)) { .. must be second #
- toNumber(inputChar,buf36)
- if (inUse(macroNum)) runKey(macroNum)
- else if (gtNum(inputChar,0)) typeChar(inputChar)
- } else toNumber(macroNum,buf36)
- goto label(20) .. get next number
- }
- }
- ..
- .. there was no "c:" or "f:" prefix, so must be inserting text.
- .. NOTE: For greater protection and control, you might want to
- .. require an "i:" prefix for text to be inserted.
- ..
- if (insertRgn(curFile,atCursor,buf36,all)) goto label(50)
- label(40)
- equateNum(n96,10) .. send ERROR reply
- goto label(60)
- label(50)
- equateNum(n96,0) .. send OKAY reply
- label(60)
- freeBuf(buf36)
- rexxOut(" ",all,n96,1,n99) .. send REPLY code in n96
- }
- }
- >
-
- Show numbers for a received Arexx msg or reply
- <virtual-r:
- if (not eqNum(n99,0)) runKey(virtual-m) .. rexxIn() failed
- else { .. rexxIn() succeeded
- if (eqNum(n98,0)) { .. MSG: show action & modifiers
- and(n96,n97,0X0F000000) .. get ACTION code
- and(n95,n97,0X000F0000) .. get MODIFIER
- if(gtNum(n95,0)) div(n95,n95,0x10000)
- freeBuf(buf54)
- insertRgn(buf54,atCursor,"Msg fetched: Action = ",all)
- toWord(buf54,n96)
- insertRgn(buf54,atCursor," Modifier = ",all)
- toWord(buf54,n95)
- ..insertRgn(buf54,atCursor," -- press return",all)
- putMsg(buf54)
- } else { .. REPLY:
- if (eqNum(n97,0)) putMsg("Reply fetched. Result OKAY")
- else {
- freeBuf(buf54)
- insertRgn(buf54,atCursor,
- "Reply received: Result = ERROR ",all)
- toWord(buf54,n97)
- ..insertRgn(buf54,atCursor," -- press return",all)
- putMsg(buf54)
- }
- }
- }
- ..getkey(n50)
- >
-
- Show numbers for a sent ARexx msg or reply
- <virtual-s:
-
- if (not eqNum(n99,0)) runKey(virtual-m) .. rexxOut() failed
- else {
- if (eqNum(n98,0)) putMsg("Msg sent")
- else putMsg("Reply sent")
- }
- >
-
- Show returncode error msgs
- <virtual-m:
- switch(n99) {
- case(-1) { putMsg("ARexx not up") }
- case(-2) { putMsg("No memory or no text") }
- case(-3) { putMsg("Msg/reply > 65535 bytes") }
- case(-4) { putMsg("Nothing to fetch or reply to") }
- case(-5) { putMsg("Fetch reply before sending this msg/reply") }
- }
- returnFalse .. so virtual-r/-s above will return False
- >
-
-