home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ob140os2.zip / STRDEMO.B < prev    next >
Text File  |  1997-09-12  |  440b  |  15 lines

  1. * This shows the use of strings
  2.  
  3.  DIM A$ AS STRING*10
  4.  
  5.  HEXOUT=INTEL' 0xxh format
  6.  A$="1234567890"
  7.  PRINT LEFT$(A$,3)' should print '123'
  8.  PRINT RIGHT$(A$,3)' should print '890'
  9.  PRINT MID$(A$,3,3)' should print '345'
  10.  PRINT TAIL$(A$,3)' should print '34567890'
  11.  PRINT SUBSTR("345",A$)' should print '3'
  12.  PRINT SUBSTR("345",A$,4)' should print '0'
  13.  PRINT HEX$(ASC(A$))' should print '031h'
  14.  PRINT CHR$(041h)' should print 'A'
  15.