Category : BASIC Source Code
Archive   : QBNW-20.ZIP
Filename : GET_Q_ID.SUB

 
Output of file : GET_Q_ID.SUB contained in archive : QBNW-20.ZIP
'--------------------------------------------------------------------------'
' '
' Assign the varible Object.Name$ a name, and this routine '
' will return that object's ID and its' type. Works on queues '
' as well as other objects. '
' '
'--------------------------------------------------------------------------'
sub Queue.ID(Object.Name$, QUEUE.TYPE%, Status%, QID$, Q.ID.HEX$) static
defint a-z
redim inary%(7),outary%(7)
'
if Object.name$ = "" then
status = -1
exit sub
end if
'
for a = 1 to len(Object.Name$)
b = asc(mid$(Object.Name$, a, 1))
if b > 96 and b < 123 then b = b - 32
mid$(Object.Name$, a, 1) = chr$(b)
next
'
on$ = object.name$
if QUEUE.TYPE% = 0 then QUEUE.TYPE% = 768
'
Request$ = " " + chr$(&h35) + Mki$(QUEUE.TYPE%) + chr$(len(ON$)) + ON$
mid$(Request$,1,2) = mki$(len(Request$))
Reply$ = space$(60)
'
inary%(0) = &HE300
inary%(5) = SADD(Request$)
inary%(6) = SADD(Reply$)
'
call int86(&H21,varptr(inary%(0)),varptr(outary%(0)))
'
ax = outary%(0)
status% = (AX and &hff)
QID$ = mid$(reply$,3,4)
Object.Type = cvi(mid$(reply$, 7, 2))
Object.name$ = mid$(reply$, 9, 48)
'
id.a = asc(mid$(reply$, 3, 1))
id.b = asc(mid$(reply$, 4, 1))
id.c = asc(mid$(reply$, 5, 1))
id.d = asc(mid$(reply$, 6, 1))
'
a$ = hex$(id.a):if id.a < &h0F then a$ = "0" + a$
b$ = hex$(id.b):if id.b < &h0F then b$ = "0" + b$
c$ = hex$(id.c):if id.c < &h0F then c$ = "0" + c$
d$ = hex$(id.d):if id.d < &h0F then d$ = "0" + d$
Q.ID.HEX$ = a$ + b$ + c$ + d$
end sub


  3 Responses to “Category : BASIC Source Code
Archive   : QBNW-20.ZIP
Filename : GET_Q_ID.SUB

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/