home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / ACCEPT.ZIP / PROMPT.BAS < prev   
Encoding:
BASIC Source File  |  1987-08-02  |  857 b   |  23 lines

  1. '   PROMPT.BAS
  2. '       This subprogram displays a prompt (P$) together with a
  3. '       previous response, if any (R$).  IF the response length,
  4. '       nc% exceeds the length of the previous response (R$), then
  5. '       the difference is made up with trailing character sc%'s.
  6. '       The prompt starts in row r% and column c%.  The starting
  7. '       location of the response is returned in r% and c%.
  8. '       Ptype is the attribute to be used for the prompt.
  9. '       Rtype is the attribute to be used for the response.
  10.  
  11.     SUB prompt(r%, c%, P$, R$, nc%, Ptype%, Rtype%, sc%) STATIC
  12.  
  13.         WHILE LEN(R$) < nc%
  14.             R$ = R$ + CHR$(sc%)
  15.         WEND
  16.  
  17.         CALL P(P$, r%, c%, Ptype%)
  18.         c% = c% + LEN(P$) 'adjust the column to point to start of data
  19.         IF c% > 80 THEN r% = r% + 1: c% = c% - 80
  20.         CALL P(R$, r%, c%, Rtype%)
  21.  
  22.     END SUB
  23.