home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmiSoft / Util / Libs / Extralib.lha / Extra / Demos / StringDemo.BAS < prev    next >
Encoding:
BASIC Source File  |  2003-01-02  |  2.0 KB  |  52 lines

  1. ' ___________________________________________________________________________
  2. ' |*************************************************************************|
  3. ' |*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|
  4. ' |*| Set TAB to 4 for best readable file layout.  |*|  Maxon Basic 3.00  |*|
  5. ' |*|______________________________________________|*|____________________|*|
  6. ' |*************************************************************************|
  7. ' |*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|
  8. ' |*|               |*|  $Id: StringDemo.BAS (08.12.02)                   |*|
  9. ' |*| ###### ###### |*|  RhoSigma Source based on NDK 3.1 Includes 40.15  |*|
  10. ' |*| ##  ## ##   # |*| _________________________________________________ |*|
  11. ' |*| ##  ##  ##    |*|                                                   |*|
  12. ' |*| ######   ##   |*|  Demo to show use of GETSTRING$-SUB in »extra.bc« |*|
  13. ' |*| ##      ##    |*|                                                   |*|
  14. ' |*| ##     ##   # |*| ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |*|
  15. ' |*| ##     ###### |*|  Copyright © 1998-2002 RhoSigma, Roland Heyder    |*|
  16. ' |*|               |*|  All Rights Reserved.                             |*|
  17. ' |*|_______________|*|___________________________________________________|*|
  18. ' |*************************************************************************|
  19. ' ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  20.  
  21. '$TO        StringDemoBAS
  22. '$ICONS
  23. '$NOLIBRARY
  24.  
  25. '$INCLUDE    settings.bc
  26. '$INCLUDE    extra.bh
  27.  
  28. DATA "$VER: StringDemoBAS 3.342 (08.12.02)"
  29.  
  30. LIBRARY OPEN "extra",3
  31.  
  32. LINE INPUT "Bitte geben Sie eine Dezimal-Zahl ein: ";z$
  33. z&=VAL(z$)
  34. PRINT
  35.  
  36. b&=Int32ToString&(z&,TRUE%,2)
  37. o&=Int32ToString&(z&,TRUE%,8)
  38. h&=Int32ToString&(z&,TRUE%,16)
  39.  
  40. b$=GETSTRING$(b&)
  41. o$=GETSTRING$(o&)
  42. h$=GETSTRING$(h&)
  43.  
  44. PRINT "Die angegebene Zahl convertiert auf andere Zahlen-Basen:"
  45. PRINT
  46. PRINT "      binär: ";b$
  47. PRINT "      octal: ";o$
  48. PRINT "hexadezimal: ";h$
  49.  
  50. LIBRARY CLOSE
  51. END
  52.