home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / bye3 / bye339.lbr / GETNAME.BAS < prev    next >
BASIC Source File  |  1985-12-02  |  1KB  |  36 lines

  1. 1000 REM
  2. 1010 REM Example program using BDOS/BDOSHL calls
  3. 1020 REM -- don't try to be smart and pass numbers directly, it won't work
  4. 1030 REM    you must put them in INTEGER variables and then pass them.
  5. 1040 REM
  6. 1050 REM        pst 6/29/85
  7. 1060 REM
  8. 1070 REM Note: to make this program run:
  9. 1080 REM    A>BASCOM =GETNAME<return>        (compile program)
  10. 1090 REM    A>L80 GETNAME,BDOS,GETNAME/N/E        (link in BDOS code)
  11. 1100 REM
  12. 1110 REM
  13. 1120 DEFINT A-Z  ' all integers used here
  14. 1130 REM
  15. 1140 REM First check to see if BYE is running
  16. 1150 REM
  17. 1160 CMD = 32: DAT = 241: RES = 0
  18. 1170 CALL BDOS(CMD, DAT, RES)
  19. 1180 IF RES<>77 THEN PRINT "Bye337 or newer must be running.":STOP
  20. 1190 REM
  21. 1200 REM Print name of current user (assuming BBS poked LC buffer with name)
  22. 1210 REM
  23. 1220 CMD = 80    ' get lastcaller buffer
  24. 1230 DAT = 0     ' no data need be passed
  25. 1240 RES = 0     ' will be modified by result of BDOS call
  26. 1250 REM
  27. 1260 CALL BDOSHL(CMD, DAT, RES)
  28. 1270 REM
  29. 1280 WHILE PEEK(RES)<>0
  30. 1290   NAME$= NAME$ + CHR$(PEEK(RES))
  31. 1300   RES  = RES   + 1
  32. 1310 WEND
  33. 1320 PRINT "Name: ";NAME$
  34. 1330 END
  35.  PEEK(RES)<>0
  36. 1290   NAME$= NAME$ + C