DevGet

100 REMark Given real device name, return usage
110 REMark Given usage, return real device name
120 REMark If neither found, return nothing
130 REMark SMSQ/E 3+
140 REMark V0.06, December 18th 2018 (check length)
150 REMark No PEEK(!! ), No Hex, combined Real and Use
160 :
170 DEFine FuNction DevGet$(dev$)
180 LOCal gdl, l%, p
190 p = PEEK_L(VER$(-2) + 72)
200 REPeat gdl
210 :
220  IF PeekStrg$(p + 42) == dev$ THEN
230   RETurn PeekStrg$(p + 36)
240  ELSE
250   IF PeekStrg$(p + 36) == dev$ THEN
260    RETurn PeekStrg$(p + 42)
270   END IF
280  END IF
290 :
300  p = PEEK_L(p): IF p = 0: EXIT gdl
310 END REPeat gdl
320 RETurn '': REMark Or  RETurn dev$
330 END DEFine DevGet$
340 :
350 DEFine FuNction PeekStrg$(ad)
360 l% = PEEK_W(ad)
370 SELect ON l%: = 1 TO 4: RETurn PEEK$(ad + 2, l%)
380 RETurn ''
390 END DEFine PeekStrg$
400 :
410 :
  
Generated with sb2htm on 2019 Mar 12
©pjwitte March 2oi9