Home » Archimedes archive » Archimedes World » AW-1994-04-Disc1.adf » Disk1Apr94 » !AWApr94/Goodies/NumberCon/!Help

!AWApr94/Goodies/NumberCon/!Help

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1994-04-Disc1.adf » Disk1Apr94
Filename: !AWApr94/Goodies/NumberCon/!Help
Read OK:
File size: 19A9 bytes
Load address: 0000
Exec address: 0000
File contents
                               Number Converter
                                By David Pratt
                            Version 1.00 - 02/01/94

�����������������������������������������������������������������������������

Aim - The aim of this program is to allow you to convert binary, decimal
      and hexadecimal into binary, decimal and hexadecimal numbers!

Use - This program is very easy to use. To load, follow the below
      instructions.

       i) Double click on the !NumConv icon.

      That was easy enough! To use the program follow the below instructions
      
       i) Load up !NumConv (see above)
      ii) Click on the !NumConv icon on the iconbar
     iii) A window will appear
      iv) To the left are three icons labelled Binary, Decimal and
          Hexadecimal. You can only select one at a time. To convert a 
          binary number, click on the Binary icon, for decimal the Decimal 
          icon and for hexadecimal the Hexadecimal icon.
       v) Once you have selected the icon you require, click on the
          appropriate white icon on the right hand side of the window
      vi) Now type in the number in the box. You will only be able to type
          in certain numbers and letter in the appropriate boxes 

           In the Binary box only      0 1 
           In the Decimal box only     0 1 2 3 4 5 6 7 8 9 
           In the Hexadecimal box only 0 1 2 3 4 5 6 7 8 9 A B C D E F

     vii) Now click on the Calculate button and the appropriate conversions
          will appear in the other two boxes

    viii) To clear all the boxex, click on the Clear button

      This program supports interactive help. If you have RISC OS 3, click
      on the Apps icon on the iconbar, and double click on !Help. Position
      the pointer over the icon you want to know about. If you have RISCOS 2
      then !Help will be on your Application Disc 1

�����������������������������������������������������������������������������  
Slightly techinal parts
-----------------------

 Binary numbers - Binary numbers are made up of 0's and 1's. The lowest level
                  language used on computers is in binary code
 Decimal numbers - Decimal numbers are those from 0 to 9, the way we count

 Hexadecimal numbers - Like decimal, but with A, B, C, D, E and F making it 
                       a sixteen number system

�����������������������������������������������������������������������������

The way the program works
-------------------------

This program uses the Wimp Extension module, written by Jon Ribbens. If you 
are a programmer you will possible know about Interface. WimpExt what
Interface and a lot more. It can put icons on the iconbar, to change the pointer shape, to pop icons in and out, link windows so they move about together (for toolboxes and windows-in-windows), there are facilities for options window handling, for dialogue boxes, for controlling indirected icons, for loading templates, for colour menus, for RAM templates, for dragging icons, for menu handling, for draw-files and sprites, for immediate windows, for memory management, etc., etc.). And it can do 3D icon, as you can see in this program.

And now a brief run down of the program

Lines      Description
-----      -----------

3 - 6      Memory allocation
13 - 26    Main Wimp poll
28 - 31    Initialisation routine
33 - 43    Loads the templates
45 - 64    Creates the meni
66 - 68    Creates the icon bar icon
70 - 77    Routine for Wimp Poll reasons 17-19
79 - 83    Error procedure
85 - 87    Redraw procedure, needed to display the 3D icons
89 - 110   Checks for mouse clicks inside the NumConv window
112 - 117  Checks whether Quit has been clicked on
119 - 123  Shutdown procedure
125 - 147  Help procedure. Sends help about the icons to !Help
149 - 153  Code that is run when the Clear icon is clicked on
155 - 213  Code that is run when the Calculate icon is clicked on. See below 

157 - 162  Looks at the three radio icons in the Main window. If the Binary
           one is selected, input$ is Binary, when Decimal is selected
           input$ is Decimal and ...... when Hexadecimal is selected, 
           input$ is Hexadecimal

164        The start of a CASE statement
 
165 - 172  This converts the binary number into a decimal and hexadecimal 
           number

174 - 190  This converts the decimal number into a binary and hexadecimal 
           number

192 - 211  This converts the hexadecimal number into a decimal and binary 
           number                                                        

The main code in these parts are as below 
-----------------------------------------

SYS "WimpExt_GetIcon",,,main%,6 TO ,,,number$ 
   Reads the number in the input box and puts it into number$ as a string

IF number$="" THEN ENDPROC
   If there is no number, the procedure ends

$convert=number$
SYS "OS_ReadUnsigned",2,convert TO ,,decimal
SYS "WimpExt_SetIconStringN",,,main%,7,STR$(decimal)
   Converts the number into a decimal number

SYS "OS_ReadUnsigned",2,convert TO ,,hex
SYS "WimpExt_SetIconStringN",,,main%,8,STR$~(hex)
   Converts the number into a hexadecimal number

SYS"OS_ConvertBinary4",EVAL(number$),convert,100 TO binary$
 REPEAT
  IF LEFT$(binary$,1) = "0" THEN
   newlen=LEN(binary$)-1
   binary$=RIGHT$(binary$,newlen)
   end=FALSE
  ELSE
    end=TRUE
  ENDIF
 UNTIL end=TRUE
SYS "WimpExt_SetIconStringN",,,main%,6,binary$
   Converts the decimal number into a binary number and strips any preceding
   0's

$convert=number$
SYS"OS_ReadUnsigned",10,convert TO ,,hex
SYS "WimpExt_SetIconStringN",,,main%,8,STR$~(hex)
   Converts the decimal number into a hexadecimal number

SYS"OS_ConvertBinary4",EVAL("&"+number$),convert,100 TO binary$
REPEAT
 IF LEFT$(binary$,1) = "0" THEN
  newlen=LEN(binary$)-1
  binary$=RIGHT$(binary$,newlen) 
  end=FALSE
 ELSE
  end=TRUE
 ENDIF
UNTIL end=TRUE
SYS "WimpExt_SetIconStringN",,,main%,6,binary$
   Converts the hexadecimal number into a binary number and strips off any
   preceding 0's

FOR BD=convert TO convert+99
 ?BD=&D
NEXT BD
SYS"OS_BinaryToDecimal",EVAL("&"+number$),convert,100
decimal$=$convert
SYS "WimpExt_SetIconStringN",,,main%,7,decimal$
   Converts the hexadecimal number into a decimal number

And that's all there is to it. Simple as that. If you are a keen programmer
then WimpExt is a very good module to get and, in the words of the author,
allows you to think less 'It's a Desktop program' and more 'It's a program to
do ...'




�����������������������������������������������������������������������������   
00000000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4e  |               N|
00000020  75 6d 62 65 72 20 43 6f  6e 76 65 72 74 65 72 0a  |umber Converter.|
00000030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000050  42 79 20 44 61 76 69 64  20 50 72 61 74 74 0a 20  |By David Pratt. |
00000060  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000070  20 20 20 20 20 20 20 20  20 20 20 56 65 72 73 69  |           Versi|
00000080  6f 6e 20 31 2e 30 30 20  2d 20 30 32 2f 30 31 2f  |on 1.00 - 02/01/|
00000090  39 34 0a 0a a4 a4 a4 a4  a4 a4 a4 a4 a4 a4 a4 a4  |94..............|
000000a0  a4 a4 a4 a4 a4 a4 a4 a4  a4 a4 a4 a4 a4 a4 a4 a4  |................|
*
000000e0  a4 0a 0a 41 69 6d 20 2d  20 54 68 65 20 61 69 6d  |...Aim - The aim|
000000f0  20 6f 66 20 74 68 69 73  20 70 72 6f 67 72 61 6d  | of this program|
00000100  20 69 73 20 74 6f 20 61  6c 6c 6f 77 20 79 6f 75  | is to allow you|
00000110  20 74 6f 20 63 6f 6e 76  65 72 74 20 62 69 6e 61  | to convert bina|
00000120  72 79 2c 20 64 65 63 69  6d 61 6c 0a 20 20 20 20  |ry, decimal.    |
00000130  20 20 61 6e 64 20 68 65  78 61 64 65 63 69 6d 61  |  and hexadecima|
00000140  6c 20 69 6e 74 6f 20 62  69 6e 61 72 79 2c 20 64  |l into binary, d|
00000150  65 63 69 6d 61 6c 20 61  6e 64 20 68 65 78 61 64  |ecimal and hexad|
00000160  65 63 69 6d 61 6c 20 6e  75 6d 62 65 72 73 21 0a  |ecimal numbers!.|
00000170  0a 55 73 65 20 2d 20 54  68 69 73 20 70 72 6f 67  |.Use - This prog|
00000180  72 61 6d 20 69 73 20 76  65 72 79 20 65 61 73 79  |ram is very easy|
00000190  20 74 6f 20 75 73 65 2e  20 54 6f 20 6c 6f 61 64  | to use. To load|
000001a0  2c 20 66 6f 6c 6c 6f 77  20 74 68 65 20 62 65 6c  |, follow the bel|
000001b0  6f 77 0a 20 20 20 20 20  20 69 6e 73 74 72 75 63  |ow.      instruc|
000001c0  74 69 6f 6e 73 2e 0a 0a  20 20 20 20 20 20 20 69  |tions...       i|
000001d0  29 20 44 6f 75 62 6c 65  20 63 6c 69 63 6b 20 6f  |) Double click o|
000001e0  6e 20 74 68 65 20 21 4e  75 6d 43 6f 6e 76 20 69  |n the !NumConv i|
000001f0  63 6f 6e 2e 0a 0a 20 20  20 20 20 20 54 68 61 74  |con...      That|
00000200  20 77 61 73 20 65 61 73  79 20 65 6e 6f 75 67 68  | was easy enough|
00000210  21 20 54 6f 20 75 73 65  20 74 68 65 20 70 72 6f  |! To use the pro|
00000220  67 72 61 6d 20 66 6f 6c  6c 6f 77 20 74 68 65 20  |gram follow the |
00000230  62 65 6c 6f 77 20 69 6e  73 74 72 75 63 74 69 6f  |below instructio|
00000240  6e 73 0a 20 20 20 20 20  20 0a 20 20 20 20 20 20  |ns.      .      |
00000250  20 69 29 20 4c 6f 61 64  20 75 70 20 21 4e 75 6d  | i) Load up !Num|
00000260  43 6f 6e 76 20 28 73 65  65 20 61 62 6f 76 65 29  |Conv (see above)|
00000270  0a 20 20 20 20 20 20 69  69 29 20 43 6c 69 63 6b  |.      ii) Click|
00000280  20 6f 6e 20 74 68 65 20  21 4e 75 6d 43 6f 6e 76  | on the !NumConv|
00000290  20 69 63 6f 6e 20 6f 6e  20 74 68 65 20 69 63 6f  | icon on the ico|
000002a0  6e 62 61 72 0a 20 20 20  20 20 69 69 69 29 20 41  |nbar.     iii) A|
000002b0  20 77 69 6e 64 6f 77 20  77 69 6c 6c 20 61 70 70  | window will app|
000002c0  65 61 72 0a 20 20 20 20  20 20 69 76 29 20 54 6f  |ear.      iv) To|
000002d0  20 74 68 65 20 6c 65 66  74 20 61 72 65 20 74 68  | the left are th|
000002e0  72 65 65 20 69 63 6f 6e  73 20 6c 61 62 65 6c 6c  |ree icons labell|
000002f0  65 64 20 42 69 6e 61 72  79 2c 20 44 65 63 69 6d  |ed Binary, Decim|
00000300  61 6c 20 61 6e 64 0a 20  20 20 20 20 20 20 20 20  |al and.         |
00000310  20 48 65 78 61 64 65 63  69 6d 61 6c 2e 20 59 6f  | Hexadecimal. Yo|
00000320  75 20 63 61 6e 20 6f 6e  6c 79 20 73 65 6c 65 63  |u can only selec|
00000330  74 20 6f 6e 65 20 61 74  20 61 20 74 69 6d 65 2e  |t one at a time.|
00000340  20 54 6f 20 63 6f 6e 76  65 72 74 20 61 20 0a 20  | To convert a . |
00000350  20 20 20 20 20 20 20 20  20 62 69 6e 61 72 79 20  |         binary |
00000360  6e 75 6d 62 65 72 2c 20  63 6c 69 63 6b 20 6f 6e  |number, click on|
00000370  20 74 68 65 20 42 69 6e  61 72 79 20 69 63 6f 6e  | the Binary icon|
00000380  2c 20 66 6f 72 20 64 65  63 69 6d 61 6c 20 74 68  |, for decimal th|
00000390  65 20 44 65 63 69 6d 61  6c 20 0a 20 20 20 20 20  |e Decimal .     |
000003a0  20 20 20 20 20 69 63 6f  6e 20 61 6e 64 20 66 6f  |     icon and fo|
000003b0  72 20 68 65 78 61 64 65  63 69 6d 61 6c 20 74 68  |r hexadecimal th|
000003c0  65 20 48 65 78 61 64 65  63 69 6d 61 6c 20 69 63  |e Hexadecimal ic|
000003d0  6f 6e 2e 0a 20 20 20 20  20 20 20 76 29 20 4f 6e  |on..       v) On|
000003e0  63 65 20 79 6f 75 20 68  61 76 65 20 73 65 6c 65  |ce you have sele|
000003f0  63 74 65 64 20 74 68 65  20 69 63 6f 6e 20 79 6f  |cted the icon yo|
00000400  75 20 72 65 71 75 69 72  65 2c 20 63 6c 69 63 6b  |u require, click|
00000410  20 6f 6e 20 74 68 65 0a  20 20 20 20 20 20 20 20  | on the.        |
00000420  20 20 61 70 70 72 6f 70  72 69 61 74 65 20 77 68  |  appropriate wh|
00000430  69 74 65 20 69 63 6f 6e  20 6f 6e 20 74 68 65 20  |ite icon on the |
00000440  72 69 67 68 74 20 68 61  6e 64 20 73 69 64 65 20  |right hand side |
00000450  6f 66 20 74 68 65 20 77  69 6e 64 6f 77 0a 20 20  |of the window.  |
00000460  20 20 20 20 76 69 29 20  4e 6f 77 20 74 79 70 65  |    vi) Now type|
00000470  20 69 6e 20 74 68 65 20  6e 75 6d 62 65 72 20 69  | in the number i|
00000480  6e 20 74 68 65 20 62 6f  78 2e 20 59 6f 75 20 77  |n the box. You w|
00000490  69 6c 6c 20 6f 6e 6c 79  20 62 65 20 61 62 6c 65  |ill only be able|
000004a0  20 74 6f 20 74 79 70 65  0a 20 20 20 20 20 20 20  | to type.       |
000004b0  20 20 20 69 6e 20 63 65  72 74 61 69 6e 20 6e 75  |   in certain nu|
000004c0  6d 62 65 72 73 20 61 6e  64 20 6c 65 74 74 65 72  |mbers and letter|
000004d0  20 69 6e 20 74 68 65 20  61 70 70 72 6f 70 72 69  | in the appropri|
000004e0  61 74 65 20 62 6f 78 65  73 20 0a 0a 20 20 20 20  |ate boxes ..    |
000004f0  20 20 20 20 20 20 20 49  6e 20 74 68 65 20 42 69  |       In the Bi|
00000500  6e 61 72 79 20 62 6f 78  20 6f 6e 6c 79 20 20 20  |nary box only   |
00000510  20 20 20 30 20 31 20 0a  20 20 20 20 20 20 20 20  |   0 1 .        |
00000520  20 20 20 49 6e 20 74 68  65 20 44 65 63 69 6d 61  |   In the Decima|
00000530  6c 20 62 6f 78 20 6f 6e  6c 79 20 20 20 20 20 30  |l box only     0|
00000540  20 31 20 32 20 33 20 34  20 35 20 36 20 37 20 38  | 1 2 3 4 5 6 7 8|
00000550  20 39 20 0a 20 20 20 20  20 20 20 20 20 20 20 49  | 9 .           I|
00000560  6e 20 74 68 65 20 48 65  78 61 64 65 63 69 6d 61  |n the Hexadecima|
00000570  6c 20 62 6f 78 20 6f 6e  6c 79 20 30 20 31 20 32  |l box only 0 1 2|
00000580  20 33 20 34 20 35 20 36  20 37 20 38 20 39 20 41  | 3 4 5 6 7 8 9 A|
00000590  20 42 20 43 20 44 20 45  20 46 0a 0a 20 20 20 20  | B C D E F..    |
000005a0  20 76 69 69 29 20 4e 6f  77 20 63 6c 69 63 6b 20  | vii) Now click |
000005b0  6f 6e 20 74 68 65 20 43  61 6c 63 75 6c 61 74 65  |on the Calculate|
000005c0  20 62 75 74 74 6f 6e 20  61 6e 64 20 74 68 65 20  | button and the |
000005d0  61 70 70 72 6f 70 72 69  61 74 65 20 63 6f 6e 76  |appropriate conv|
000005e0  65 72 73 69 6f 6e 73 0a  20 20 20 20 20 20 20 20  |ersions.        |
000005f0  20 20 77 69 6c 6c 20 61  70 70 65 61 72 20 69 6e  |  will appear in|
00000600  20 74 68 65 20 6f 74 68  65 72 20 74 77 6f 20 62  | the other two b|
00000610  6f 78 65 73 0a 0a 20 20  20 20 76 69 69 69 29 20  |oxes..    viii) |
00000620  54 6f 20 63 6c 65 61 72  20 61 6c 6c 20 74 68 65  |To clear all the|
00000630  20 62 6f 78 65 78 2c 20  63 6c 69 63 6b 20 6f 6e  | boxex, click on|
00000640  20 74 68 65 20 43 6c 65  61 72 20 62 75 74 74 6f  | the Clear butto|
00000650  6e 0a 0a 20 20 20 20 20  20 54 68 69 73 20 70 72  |n..      This pr|
00000660  6f 67 72 61 6d 20 73 75  70 70 6f 72 74 73 20 69  |ogram supports i|
00000670  6e 74 65 72 61 63 74 69  76 65 20 68 65 6c 70 2e  |nteractive help.|
00000680  20 49 66 20 79 6f 75 20  68 61 76 65 20 52 49 53  | If you have RIS|
00000690  43 20 4f 53 20 33 2c 20  63 6c 69 63 6b 0a 20 20  |C OS 3, click.  |
000006a0  20 20 20 20 6f 6e 20 74  68 65 20 41 70 70 73 20  |    on the Apps |
000006b0  69 63 6f 6e 20 6f 6e 20  74 68 65 20 69 63 6f 6e  |icon on the icon|
000006c0  62 61 72 2c 20 61 6e 64  20 64 6f 75 62 6c 65 20  |bar, and double |
000006d0  63 6c 69 63 6b 20 6f 6e  20 21 48 65 6c 70 2e 20  |click on !Help. |
000006e0  50 6f 73 69 74 69 6f 6e  0a 20 20 20 20 20 20 74  |Position.      t|
000006f0  68 65 20 70 6f 69 6e 74  65 72 20 6f 76 65 72 20  |he pointer over |
00000700  74 68 65 20 69 63 6f 6e  20 79 6f 75 20 77 61 6e  |the icon you wan|
00000710  74 20 74 6f 20 6b 6e 6f  77 20 61 62 6f 75 74 2e  |t to know about.|
00000720  20 49 66 20 79 6f 75 20  68 61 76 65 20 52 49 53  | If you have RIS|
00000730  43 4f 53 20 32 0a 20 20  20 20 20 20 74 68 65 6e  |COS 2.      then|
00000740  20 21 48 65 6c 70 20 77  69 6c 6c 20 62 65 20 6f  | !Help will be o|
00000750  6e 20 79 6f 75 72 20 41  70 70 6c 69 63 61 74 69  |n your Applicati|
00000760  6f 6e 20 44 69 73 63 20  31 0a 0a a4 a4 a4 a4 a4  |on Disc 1.......|
00000770  a4 a4 a4 a4 a4 a4 a4 a4  a4 a4 a4 a4 a4 a4 a4 a4  |................|
*
000007b0  a4 a4 a4 a4 a4 a4 a4 a4  20 20 0a 53 6c 69 67 68  |........  .Sligh|
000007c0  74 6c 79 20 74 65 63 68  69 6e 61 6c 20 70 61 72  |tly techinal par|
000007d0  74 73 0a 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |ts.-------------|
000007e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 0a 20 42 69 6e  |----------.. Bin|
000007f0  61 72 79 20 6e 75 6d 62  65 72 73 20 2d 20 42 69  |ary numbers - Bi|
00000800  6e 61 72 79 20 6e 75 6d  62 65 72 73 20 61 72 65  |nary numbers are|
00000810  20 6d 61 64 65 20 75 70  20 6f 66 20 30 27 73 20  | made up of 0's |
00000820  61 6e 64 20 31 27 73 2e  20 54 68 65 20 6c 6f 77  |and 1's. The low|
00000830  65 73 74 20 6c 65 76 65  6c 0a 20 20 20 20 20 20  |est level.      |
00000840  20 20 20 20 20 20 20 20  20 20 20 20 6c 61 6e 67  |            lang|
00000850  75 61 67 65 20 75 73 65  64 20 6f 6e 20 63 6f 6d  |uage used on com|
00000860  70 75 74 65 72 73 20 69  73 20 69 6e 20 62 69 6e  |puters is in bin|
00000870  61 72 79 20 63 6f 64 65  0a 20 44 65 63 69 6d 61  |ary code. Decima|
00000880  6c 20 6e 75 6d 62 65 72  73 20 2d 20 44 65 63 69  |l numbers - Deci|
00000890  6d 61 6c 20 6e 75 6d 62  65 72 73 20 61 72 65 20  |mal numbers are |
000008a0  74 68 6f 73 65 20 66 72  6f 6d 20 30 20 74 6f 20  |those from 0 to |
000008b0  39 2c 20 74 68 65 20 77  61 79 20 77 65 20 63 6f  |9, the way we co|
000008c0  75 6e 74 0a 0a 20 48 65  78 61 64 65 63 69 6d 61  |unt.. Hexadecima|
000008d0  6c 20 6e 75 6d 62 65 72  73 20 2d 20 4c 69 6b 65  |l numbers - Like|
000008e0  20 64 65 63 69 6d 61 6c  2c 20 62 75 74 20 77 69  | decimal, but wi|
000008f0  74 68 20 41 2c 20 42 2c  20 43 2c 20 44 2c 20 45  |th A, B, C, D, E|
00000900  20 61 6e 64 20 46 20 6d  61 6b 69 6e 67 20 69 74  | and F making it|
00000910  20 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | .              |
00000920  20 20 20 20 20 20 20 20  20 61 20 73 69 78 74 65  |         a sixte|
00000930  65 6e 20 6e 75 6d 62 65  72 20 73 79 73 74 65 6d  |en number system|
00000940  0a 0a a4 a4 a4 a4 a4 a4  a4 a4 a4 a4 a4 a4 a4 a4  |................|
00000950  a4 a4 a4 a4 a4 a4 a4 a4  a4 a4 a4 a4 a4 a4 a4 a4  |................|
*
00000980  a4 a4 a4 a4 a4 a4 a4 a4  a4 a4 a4 a4 a4 a4 a4 0a  |................|
00000990  0a 54 68 65 20 77 61 79  20 74 68 65 20 70 72 6f  |.The way the pro|
000009a0  67 72 61 6d 20 77 6f 72  6b 73 0a 2d 2d 2d 2d 2d  |gram works.-----|
000009b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000009c0  2d 2d 2d 2d 0a 0a 54 68  69 73 20 70 72 6f 67 72  |----..This progr|
000009d0  61 6d 20 75 73 65 73 20  74 68 65 20 57 69 6d 70  |am uses the Wimp|
000009e0  20 45 78 74 65 6e 73 69  6f 6e 20 6d 6f 64 75 6c  | Extension modul|
000009f0  65 2c 20 77 72 69 74 74  65 6e 20 62 79 20 4a 6f  |e, written by Jo|
00000a00  6e 20 52 69 62 62 65 6e  73 2e 20 49 66 20 79 6f  |n Ribbens. If yo|
00000a10  75 20 0a 61 72 65 20 61  20 70 72 6f 67 72 61 6d  |u .are a program|
00000a20  6d 65 72 20 79 6f 75 20  77 69 6c 6c 20 70 6f 73  |mer you will pos|
00000a30  73 69 62 6c 65 20 6b 6e  6f 77 20 61 62 6f 75 74  |sible know about|
00000a40  20 49 6e 74 65 72 66 61  63 65 2e 20 57 69 6d 70  | Interface. Wimp|
00000a50  45 78 74 20 77 68 61 74  0a 49 6e 74 65 72 66 61  |Ext what.Interfa|
00000a60  63 65 20 61 6e 64 20 61  20 6c 6f 74 20 6d 6f 72  |ce and a lot mor|
00000a70  65 2e 20 49 74 20 63 61  6e 20 70 75 74 20 69 63  |e. It can put ic|
00000a80  6f 6e 73 20 6f 6e 20 74  68 65 20 69 63 6f 6e 62  |ons on the iconb|
00000a90  61 72 2c 20 74 6f 20 63  68 61 6e 67 65 20 74 68  |ar, to change th|
00000aa0  65 20 70 6f 69 6e 74 65  72 20 73 68 61 70 65 2c  |e pointer shape,|
00000ab0  20 74 6f 20 70 6f 70 20  69 63 6f 6e 73 20 69 6e  | to pop icons in|
00000ac0  20 61 6e 64 20 6f 75 74  2c 20 6c 69 6e 6b 20 77  | and out, link w|
00000ad0  69 6e 64 6f 77 73 20 73  6f 20 74 68 65 79 20 6d  |indows so they m|
00000ae0  6f 76 65 20 61 62 6f 75  74 20 74 6f 67 65 74 68  |ove about togeth|
00000af0  65 72 20 28 66 6f 72 20  74 6f 6f 6c 62 6f 78 65  |er (for toolboxe|
00000b00  73 20 61 6e 64 20 77 69  6e 64 6f 77 73 2d 69 6e  |s and windows-in|
00000b10  2d 77 69 6e 64 6f 77 73  29 2c 20 74 68 65 72 65  |-windows), there|
00000b20  20 61 72 65 20 66 61 63  69 6c 69 74 69 65 73 20  | are facilities |
00000b30  66 6f 72 20 6f 70 74 69  6f 6e 73 20 77 69 6e 64  |for options wind|
00000b40  6f 77 20 68 61 6e 64 6c  69 6e 67 2c 20 66 6f 72  |ow handling, for|
00000b50  20 64 69 61 6c 6f 67 75  65 20 62 6f 78 65 73 2c  | dialogue boxes,|
00000b60  20 66 6f 72 20 63 6f 6e  74 72 6f 6c 6c 69 6e 67  | for controlling|
00000b70  20 69 6e 64 69 72 65 63  74 65 64 20 69 63 6f 6e  | indirected icon|
00000b80  73 2c 20 66 6f 72 20 6c  6f 61 64 69 6e 67 20 74  |s, for loading t|
00000b90  65 6d 70 6c 61 74 65 73  2c 20 66 6f 72 20 63 6f  |emplates, for co|
00000ba0  6c 6f 75 72 20 6d 65 6e  75 73 2c 20 66 6f 72 20  |lour menus, for |
00000bb0  52 41 4d 20 74 65 6d 70  6c 61 74 65 73 2c 20 66  |RAM templates, f|
00000bc0  6f 72 20 64 72 61 67 67  69 6e 67 20 69 63 6f 6e  |or dragging icon|
00000bd0  73 2c 20 66 6f 72 20 6d  65 6e 75 20 68 61 6e 64  |s, for menu hand|
00000be0  6c 69 6e 67 2c 20 66 6f  72 20 64 72 61 77 2d 66  |ling, for draw-f|
00000bf0  69 6c 65 73 20 61 6e 64  20 73 70 72 69 74 65 73  |iles and sprites|
00000c00  2c 20 66 6f 72 20 69 6d  6d 65 64 69 61 74 65 20  |, for immediate |
00000c10  77 69 6e 64 6f 77 73 2c  20 66 6f 72 20 6d 65 6d  |windows, for mem|
00000c20  6f 72 79 20 6d 61 6e 61  67 65 6d 65 6e 74 2c 20  |ory management, |
00000c30  65 74 63 2e 2c 20 65 74  63 2e 29 2e 20 41 6e 64  |etc., etc.). And|
00000c40  20 69 74 20 63 61 6e 20  64 6f 20 33 44 20 69 63  | it can do 3D ic|
00000c50  6f 6e 2c 20 61 73 20 79  6f 75 20 63 61 6e 20 73  |on, as you can s|
00000c60  65 65 20 69 6e 20 74 68  69 73 20 70 72 6f 67 72  |ee in this progr|
00000c70  61 6d 2e 0a 0a 41 6e 64  20 6e 6f 77 20 61 20 62  |am...And now a b|
00000c80  72 69 65 66 20 72 75 6e  20 64 6f 77 6e 20 6f 66  |rief run down of|
00000c90  20 74 68 65 20 70 72 6f  67 72 61 6d 0a 0a 4c 69  | the program..Li|
00000ca0  6e 65 73 20 20 20 20 20  20 44 65 73 63 72 69 70  |nes      Descrip|
00000cb0  74 69 6f 6e 0a 2d 2d 2d  2d 2d 20 20 20 20 20 20  |tion.-----      |
00000cc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0a 0a 33 20 2d  |-----------..3 -|
00000cd0  20 36 20 20 20 20 20 20  4d 65 6d 6f 72 79 20 61  | 6      Memory a|
00000ce0  6c 6c 6f 63 61 74 69 6f  6e 0a 31 33 20 2d 20 32  |llocation.13 - 2|
00000cf0  36 20 20 20 20 4d 61 69  6e 20 57 69 6d 70 20 70  |6    Main Wimp p|
00000d00  6f 6c 6c 0a 32 38 20 2d  20 33 31 20 20 20 20 49  |oll.28 - 31    I|
00000d10  6e 69 74 69 61 6c 69 73  61 74 69 6f 6e 20 72 6f  |nitialisation ro|
00000d20  75 74 69 6e 65 0a 33 33  20 2d 20 34 33 20 20 20  |utine.33 - 43   |
00000d30  20 4c 6f 61 64 73 20 74  68 65 20 74 65 6d 70 6c  | Loads the templ|
00000d40  61 74 65 73 0a 34 35 20  2d 20 36 34 20 20 20 20  |ates.45 - 64    |
00000d50  43 72 65 61 74 65 73 20  74 68 65 20 6d 65 6e 69  |Creates the meni|
00000d60  0a 36 36 20 2d 20 36 38  20 20 20 20 43 72 65 61  |.66 - 68    Crea|
00000d70  74 65 73 20 74 68 65 20  69 63 6f 6e 20 62 61 72  |tes the icon bar|
00000d80  20 69 63 6f 6e 0a 37 30  20 2d 20 37 37 20 20 20  | icon.70 - 77   |
00000d90  20 52 6f 75 74 69 6e 65  20 66 6f 72 20 57 69 6d  | Routine for Wim|
00000da0  70 20 50 6f 6c 6c 20 72  65 61 73 6f 6e 73 20 31  |p Poll reasons 1|
00000db0  37 2d 31 39 0a 37 39 20  2d 20 38 33 20 20 20 20  |7-19.79 - 83    |
00000dc0  45 72 72 6f 72 20 70 72  6f 63 65 64 75 72 65 0a  |Error procedure.|
00000dd0  38 35 20 2d 20 38 37 20  20 20 20 52 65 64 72 61  |85 - 87    Redra|
00000de0  77 20 70 72 6f 63 65 64  75 72 65 2c 20 6e 65 65  |w procedure, nee|
00000df0  64 65 64 20 74 6f 20 64  69 73 70 6c 61 79 20 74  |ded to display t|
00000e00  68 65 20 33 44 20 69 63  6f 6e 73 0a 38 39 20 2d  |he 3D icons.89 -|
00000e10  20 31 31 30 20 20 20 43  68 65 63 6b 73 20 66 6f  | 110   Checks fo|
00000e20  72 20 6d 6f 75 73 65 20  63 6c 69 63 6b 73 20 69  |r mouse clicks i|
00000e30  6e 73 69 64 65 20 74 68  65 20 4e 75 6d 43 6f 6e  |nside the NumCon|
00000e40  76 20 77 69 6e 64 6f 77  0a 31 31 32 20 2d 20 31  |v window.112 - 1|
00000e50  31 37 20 20 43 68 65 63  6b 73 20 77 68 65 74 68  |17  Checks wheth|
00000e60  65 72 20 51 75 69 74 20  68 61 73 20 62 65 65 6e  |er Quit has been|
00000e70  20 63 6c 69 63 6b 65 64  20 6f 6e 0a 31 31 39 20  | clicked on.119 |
00000e80  2d 20 31 32 33 20 20 53  68 75 74 64 6f 77 6e 20  |- 123  Shutdown |
00000e90  70 72 6f 63 65 64 75 72  65 0a 31 32 35 20 2d 20  |procedure.125 - |
00000ea0  31 34 37 20 20 48 65 6c  70 20 70 72 6f 63 65 64  |147  Help proced|
00000eb0  75 72 65 2e 20 53 65 6e  64 73 20 68 65 6c 70 20  |ure. Sends help |
00000ec0  61 62 6f 75 74 20 74 68  65 20 69 63 6f 6e 73 20  |about the icons |
00000ed0  74 6f 20 21 48 65 6c 70  0a 31 34 39 20 2d 20 31  |to !Help.149 - 1|
00000ee0  35 33 20 20 43 6f 64 65  20 74 68 61 74 20 69 73  |53  Code that is|
00000ef0  20 72 75 6e 20 77 68 65  6e 20 74 68 65 20 43 6c  | run when the Cl|
00000f00  65 61 72 20 69 63 6f 6e  20 69 73 20 63 6c 69 63  |ear icon is clic|
00000f10  6b 65 64 20 6f 6e 0a 31  35 35 20 2d 20 32 31 33  |ked on.155 - 213|
00000f20  20 20 43 6f 64 65 20 74  68 61 74 20 69 73 20 72  |  Code that is r|
00000f30  75 6e 20 77 68 65 6e 20  74 68 65 20 43 61 6c 63  |un when the Calc|
00000f40  75 6c 61 74 65 20 69 63  6f 6e 20 69 73 20 63 6c  |ulate icon is cl|
00000f50  69 63 6b 65 64 20 6f 6e  2e 20 53 65 65 20 62 65  |icked on. See be|
00000f60  6c 6f 77 20 0a 0a 31 35  37 20 2d 20 31 36 32 20  |low ..157 - 162 |
00000f70  20 4c 6f 6f 6b 73 20 61  74 20 74 68 65 20 74 68  | Looks at the th|
00000f80  72 65 65 20 72 61 64 69  6f 20 69 63 6f 6e 73 20  |ree radio icons |
00000f90  69 6e 20 74 68 65 20 4d  61 69 6e 20 77 69 6e 64  |in the Main wind|
00000fa0  6f 77 2e 20 49 66 20 74  68 65 20 42 69 6e 61 72  |ow. If the Binar|
00000fb0  79 0a 20 20 20 20 20 20  20 20 20 20 20 6f 6e 65  |y.           one|
00000fc0  20 69 73 20 73 65 6c 65  63 74 65 64 2c 20 69 6e  | is selected, in|
00000fd0  70 75 74 24 20 69 73 20  42 69 6e 61 72 79 2c 20  |put$ is Binary, |
00000fe0  77 68 65 6e 20 44 65 63  69 6d 61 6c 20 69 73 20  |when Decimal is |
00000ff0  73 65 6c 65 63 74 65 64  0a 20 20 20 20 20 20 20  |selected.       |
00001000  20 20 20 20 69 6e 70 75  74 24 20 69 73 20 44 65  |    input$ is De|
00001010  63 69 6d 61 6c 20 61 6e  64 20 2e 2e 2e 2e 2e 2e  |cimal and ......|
00001020  20 77 68 65 6e 20 48 65  78 61 64 65 63 69 6d 61  | when Hexadecima|
00001030  6c 20 69 73 20 73 65 6c  65 63 74 65 64 2c 20 0a  |l is selected, .|
00001040  20 20 20 20 20 20 20 20  20 20 20 69 6e 70 75 74  |           input|
00001050  24 20 69 73 20 48 65 78  61 64 65 63 69 6d 61 6c  |$ is Hexadecimal|
00001060  0a 0a 31 36 34 20 20 20  20 20 20 20 20 54 68 65  |..164        The|
00001070  20 73 74 61 72 74 20 6f  66 20 61 20 43 41 53 45  | start of a CASE|
00001080  20 73 74 61 74 65 6d 65  6e 74 0a 20 0a 31 36 35  | statement. .165|
00001090  20 2d 20 31 37 32 20 20  54 68 69 73 20 63 6f 6e  | - 172  This con|
000010a0  76 65 72 74 73 20 74 68  65 20 62 69 6e 61 72 79  |verts the binary|
000010b0  20 6e 75 6d 62 65 72 20  69 6e 74 6f 20 61 20 64  | number into a d|
000010c0  65 63 69 6d 61 6c 20 61  6e 64 20 68 65 78 61 64  |ecimal and hexad|
000010d0  65 63 69 6d 61 6c 20 0a  20 20 20 20 20 20 20 20  |ecimal .        |
000010e0  20 20 20 6e 75 6d 62 65  72 0a 0a 31 37 34 20 2d  |   number..174 -|
000010f0  20 31 39 30 20 20 54 68  69 73 20 63 6f 6e 76 65  | 190  This conve|
00001100  72 74 73 20 74 68 65 20  64 65 63 69 6d 61 6c 20  |rts the decimal |
00001110  6e 75 6d 62 65 72 20 69  6e 74 6f 20 61 20 62 69  |number into a bi|
00001120  6e 61 72 79 20 61 6e 64  20 68 65 78 61 64 65 63  |nary and hexadec|
00001130  69 6d 61 6c 20 0a 20 20  20 20 20 20 20 20 20 20  |imal .          |
00001140  20 6e 75 6d 62 65 72 0a  0a 31 39 32 20 2d 20 32  | number..192 - 2|
00001150  31 31 20 20 54 68 69 73  20 63 6f 6e 76 65 72 74  |11  This convert|
00001160  73 20 74 68 65 20 68 65  78 61 64 65 63 69 6d 61  |s the hexadecima|
00001170  6c 20 6e 75 6d 62 65 72  20 69 6e 74 6f 20 61 20  |l number into a |
00001180  64 65 63 69 6d 61 6c 20  61 6e 64 20 62 69 6e 61  |decimal and bina|
00001190  72 79 20 0a 20 20 20 20  20 20 20 20 20 20 20 6e  |ry .           n|
000011a0  75 6d 62 65 72 20 20 20  20 20 20 20 20 20 20 20  |umber           |
000011b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000011d0  20 20 20 20 20 20 20 20  20 20 20 20 20 0a 0a 54  |             ..T|
000011e0  68 65 20 6d 61 69 6e 20  63 6f 64 65 20 69 6e 20  |he main code in |
000011f0  74 68 65 73 65 20 70 61  72 74 73 20 61 72 65 20  |these parts are |
00001200  61 73 20 62 65 6c 6f 77  20 0a 2d 2d 2d 2d 2d 2d  |as below .------|
00001210  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001230  2d 2d 2d 0a 0a 53 59 53  20 22 57 69 6d 70 45 78  |---..SYS "WimpEx|
00001240  74 5f 47 65 74 49 63 6f  6e 22 2c 2c 2c 6d 61 69  |t_GetIcon",,,mai|
00001250  6e 25 2c 36 20 54 4f 20  2c 2c 2c 6e 75 6d 62 65  |n%,6 TO ,,,numbe|
00001260  72 24 20 0a 20 20 20 52  65 61 64 73 20 74 68 65  |r$ .   Reads the|
00001270  20 6e 75 6d 62 65 72 20  69 6e 20 74 68 65 20 69  | number in the i|
00001280  6e 70 75 74 20 62 6f 78  20 61 6e 64 20 70 75 74  |nput box and put|
00001290  73 20 69 74 20 69 6e 74  6f 20 6e 75 6d 62 65 72  |s it into number|
000012a0  24 20 61 73 20 61 20 73  74 72 69 6e 67 0a 0a 49  |$ as a string..I|
000012b0  46 20 6e 75 6d 62 65 72  24 3d 22 22 20 54 48 45  |F number$="" THE|
000012c0  4e 20 45 4e 44 50 52 4f  43 0a 20 20 20 49 66 20  |N ENDPROC.   If |
000012d0  74 68 65 72 65 20 69 73  20 6e 6f 20 6e 75 6d 62  |there is no numb|
000012e0  65 72 2c 20 74 68 65 20  70 72 6f 63 65 64 75 72  |er, the procedur|
000012f0  65 20 65 6e 64 73 0a 0a  24 63 6f 6e 76 65 72 74  |e ends..$convert|
00001300  3d 6e 75 6d 62 65 72 24  0a 53 59 53 20 22 4f 53  |=number$.SYS "OS|
00001310  5f 52 65 61 64 55 6e 73  69 67 6e 65 64 22 2c 32  |_ReadUnsigned",2|
00001320  2c 63 6f 6e 76 65 72 74  20 54 4f 20 2c 2c 64 65  |,convert TO ,,de|
00001330  63 69 6d 61 6c 0a 53 59  53 20 22 57 69 6d 70 45  |cimal.SYS "WimpE|
00001340  78 74 5f 53 65 74 49 63  6f 6e 53 74 72 69 6e 67  |xt_SetIconString|
00001350  4e 22 2c 2c 2c 6d 61 69  6e 25 2c 37 2c 53 54 52  |N",,,main%,7,STR|
00001360  24 28 64 65 63 69 6d 61  6c 29 0a 20 20 20 43 6f  |$(decimal).   Co|
00001370  6e 76 65 72 74 73 20 74  68 65 20 6e 75 6d 62 65  |nverts the numbe|
00001380  72 20 69 6e 74 6f 20 61  20 64 65 63 69 6d 61 6c  |r into a decimal|
00001390  20 6e 75 6d 62 65 72 0a  0a 53 59 53 20 22 4f 53  | number..SYS "OS|
000013a0  5f 52 65 61 64 55 6e 73  69 67 6e 65 64 22 2c 32  |_ReadUnsigned",2|
000013b0  2c 63 6f 6e 76 65 72 74  20 54 4f 20 2c 2c 68 65  |,convert TO ,,he|
000013c0  78 0a 53 59 53 20 22 57  69 6d 70 45 78 74 5f 53  |x.SYS "WimpExt_S|
000013d0  65 74 49 63 6f 6e 53 74  72 69 6e 67 4e 22 2c 2c  |etIconStringN",,|
000013e0  2c 6d 61 69 6e 25 2c 38  2c 53 54 52 24 7e 28 68  |,main%,8,STR$~(h|
000013f0  65 78 29 0a 20 20 20 43  6f 6e 76 65 72 74 73 20  |ex).   Converts |
00001400  74 68 65 20 6e 75 6d 62  65 72 20 69 6e 74 6f 20  |the number into |
00001410  61 20 68 65 78 61 64 65  63 69 6d 61 6c 20 6e 75  |a hexadecimal nu|
00001420  6d 62 65 72 0a 0a 53 59  53 22 4f 53 5f 43 6f 6e  |mber..SYS"OS_Con|
00001430  76 65 72 74 42 69 6e 61  72 79 34 22 2c 45 56 41  |vertBinary4",EVA|
00001440  4c 28 6e 75 6d 62 65 72  24 29 2c 63 6f 6e 76 65  |L(number$),conve|
00001450  72 74 2c 31 30 30 20 54  4f 20 62 69 6e 61 72 79  |rt,100 TO binary|
00001460  24 0a 20 52 45 50 45 41  54 0a 20 20 49 46 20 4c  |$. REPEAT.  IF L|
00001470  45 46 54 24 28 62 69 6e  61 72 79 24 2c 31 29 20  |EFT$(binary$,1) |
00001480  3d 20 22 30 22 20 54 48  45 4e 0a 20 20 20 6e 65  |= "0" THEN.   ne|
00001490  77 6c 65 6e 3d 4c 45 4e  28 62 69 6e 61 72 79 24  |wlen=LEN(binary$|
000014a0  29 2d 31 0a 20 20 20 62  69 6e 61 72 79 24 3d 52  |)-1.   binary$=R|
000014b0  49 47 48 54 24 28 62 69  6e 61 72 79 24 2c 6e 65  |IGHT$(binary$,ne|
000014c0  77 6c 65 6e 29 0a 20 20  20 65 6e 64 3d 46 41 4c  |wlen).   end=FAL|
000014d0  53 45 0a 20 20 45 4c 53  45 0a 20 20 20 20 65 6e  |SE.  ELSE.    en|
000014e0  64 3d 54 52 55 45 0a 20  20 45 4e 44 49 46 0a 20  |d=TRUE.  ENDIF. |
000014f0  55 4e 54 49 4c 20 65 6e  64 3d 54 52 55 45 0a 53  |UNTIL end=TRUE.S|
00001500  59 53 20 22 57 69 6d 70  45 78 74 5f 53 65 74 49  |YS "WimpExt_SetI|
00001510  63 6f 6e 53 74 72 69 6e  67 4e 22 2c 2c 2c 6d 61  |conStringN",,,ma|
00001520  69 6e 25 2c 36 2c 62 69  6e 61 72 79 24 0a 20 20  |in%,6,binary$.  |
00001530  20 43 6f 6e 76 65 72 74  73 20 74 68 65 20 64 65  | Converts the de|
00001540  63 69 6d 61 6c 20 6e 75  6d 62 65 72 20 69 6e 74  |cimal number int|
00001550  6f 20 61 20 62 69 6e 61  72 79 20 6e 75 6d 62 65  |o a binary numbe|
00001560  72 20 61 6e 64 20 73 74  72 69 70 73 20 61 6e 79  |r and strips any|
00001570  20 70 72 65 63 65 64 69  6e 67 0a 20 20 20 30 27  | preceding.   0'|
00001580  73 0a 0a 24 63 6f 6e 76  65 72 74 3d 6e 75 6d 62  |s..$convert=numb|
00001590  65 72 24 0a 53 59 53 22  4f 53 5f 52 65 61 64 55  |er$.SYS"OS_ReadU|
000015a0  6e 73 69 67 6e 65 64 22  2c 31 30 2c 63 6f 6e 76  |nsigned",10,conv|
000015b0  65 72 74 20 54 4f 20 2c  2c 68 65 78 0a 53 59 53  |ert TO ,,hex.SYS|
000015c0  20 22 57 69 6d 70 45 78  74 5f 53 65 74 49 63 6f  | "WimpExt_SetIco|
000015d0  6e 53 74 72 69 6e 67 4e  22 2c 2c 2c 6d 61 69 6e  |nStringN",,,main|
000015e0  25 2c 38 2c 53 54 52 24  7e 28 68 65 78 29 0a 20  |%,8,STR$~(hex). |
000015f0  20 20 43 6f 6e 76 65 72  74 73 20 74 68 65 20 64  |  Converts the d|
00001600  65 63 69 6d 61 6c 20 6e  75 6d 62 65 72 20 69 6e  |ecimal number in|
00001610  74 6f 20 61 20 68 65 78  61 64 65 63 69 6d 61 6c  |to a hexadecimal|
00001620  20 6e 75 6d 62 65 72 0a  0a 53 59 53 22 4f 53 5f  | number..SYS"OS_|
00001630  43 6f 6e 76 65 72 74 42  69 6e 61 72 79 34 22 2c  |ConvertBinary4",|
00001640  45 56 41 4c 28 22 26 22  2b 6e 75 6d 62 65 72 24  |EVAL("&"+number$|
00001650  29 2c 63 6f 6e 76 65 72  74 2c 31 30 30 20 54 4f  |),convert,100 TO|
00001660  20 62 69 6e 61 72 79 24  0a 52 45 50 45 41 54 0a  | binary$.REPEAT.|
00001670  20 49 46 20 4c 45 46 54  24 28 62 69 6e 61 72 79  | IF LEFT$(binary|
00001680  24 2c 31 29 20 3d 20 22  30 22 20 54 48 45 4e 0a  |$,1) = "0" THEN.|
00001690  20 20 6e 65 77 6c 65 6e  3d 4c 45 4e 28 62 69 6e  |  newlen=LEN(bin|
000016a0  61 72 79 24 29 2d 31 0a  20 20 62 69 6e 61 72 79  |ary$)-1.  binary|
000016b0  24 3d 52 49 47 48 54 24  28 62 69 6e 61 72 79 24  |$=RIGHT$(binary$|
000016c0  2c 6e 65 77 6c 65 6e 29  20 0a 20 20 65 6e 64 3d  |,newlen) .  end=|
000016d0  46 41 4c 53 45 0a 20 45  4c 53 45 0a 20 20 65 6e  |FALSE. ELSE.  en|
000016e0  64 3d 54 52 55 45 0a 20  45 4e 44 49 46 0a 55 4e  |d=TRUE. ENDIF.UN|
000016f0  54 49 4c 20 65 6e 64 3d  54 52 55 45 0a 53 59 53  |TIL end=TRUE.SYS|
00001700  20 22 57 69 6d 70 45 78  74 5f 53 65 74 49 63 6f  | "WimpExt_SetIco|
00001710  6e 53 74 72 69 6e 67 4e  22 2c 2c 2c 6d 61 69 6e  |nStringN",,,main|
00001720  25 2c 36 2c 62 69 6e 61  72 79 24 0a 20 20 20 43  |%,6,binary$.   C|
00001730  6f 6e 76 65 72 74 73 20  74 68 65 20 68 65 78 61  |onverts the hexa|
00001740  64 65 63 69 6d 61 6c 20  6e 75 6d 62 65 72 20 69  |decimal number i|
00001750  6e 74 6f 20 61 20 62 69  6e 61 72 79 20 6e 75 6d  |nto a binary num|
00001760  62 65 72 20 61 6e 64 20  73 74 72 69 70 73 20 6f  |ber and strips o|
00001770  66 66 20 61 6e 79 0a 20  20 20 70 72 65 63 65 64  |ff any.   preced|
00001780  69 6e 67 20 30 27 73 0a  0a 46 4f 52 20 42 44 3d  |ing 0's..FOR BD=|
00001790  63 6f 6e 76 65 72 74 20  54 4f 20 63 6f 6e 76 65  |convert TO conve|
000017a0  72 74 2b 39 39 0a 20 3f  42 44 3d 26 44 0a 4e 45  |rt+99. ?BD=&D.NE|
000017b0  58 54 20 42 44 0a 53 59  53 22 4f 53 5f 42 69 6e  |XT BD.SYS"OS_Bin|
000017c0  61 72 79 54 6f 44 65 63  69 6d 61 6c 22 2c 45 56  |aryToDecimal",EV|
000017d0  41 4c 28 22 26 22 2b 6e  75 6d 62 65 72 24 29 2c  |AL("&"+number$),|
000017e0  63 6f 6e 76 65 72 74 2c  31 30 30 0a 64 65 63 69  |convert,100.deci|
000017f0  6d 61 6c 24 3d 24 63 6f  6e 76 65 72 74 0a 53 59  |mal$=$convert.SY|
00001800  53 20 22 57 69 6d 70 45  78 74 5f 53 65 74 49 63  |S "WimpExt_SetIc|
00001810  6f 6e 53 74 72 69 6e 67  4e 22 2c 2c 2c 6d 61 69  |onStringN",,,mai|
00001820  6e 25 2c 37 2c 64 65 63  69 6d 61 6c 24 0a 20 20  |n%,7,decimal$.  |
00001830  20 43 6f 6e 76 65 72 74  73 20 74 68 65 20 68 65  | Converts the he|
00001840  78 61 64 65 63 69 6d 61  6c 20 6e 75 6d 62 65 72  |xadecimal number|
00001850  20 69 6e 74 6f 20 61 20  64 65 63 69 6d 61 6c 20  | into a decimal |
00001860  6e 75 6d 62 65 72 0a 0a  41 6e 64 20 74 68 61 74  |number..And that|
00001870  27 73 20 61 6c 6c 20 74  68 65 72 65 20 69 73 20  |'s all there is |
00001880  74 6f 20 69 74 2e 20 53  69 6d 70 6c 65 20 61 73  |to it. Simple as|
00001890  20 74 68 61 74 2e 20 49  66 20 79 6f 75 20 61 72  | that. If you ar|
000018a0  65 20 61 20 6b 65 65 6e  20 70 72 6f 67 72 61 6d  |e a keen program|
000018b0  6d 65 72 0a 74 68 65 6e  20 57 69 6d 70 45 78 74  |mer.then WimpExt|
000018c0  20 69 73 20 61 20 76 65  72 79 20 67 6f 6f 64 20  | is a very good |
000018d0  6d 6f 64 75 6c 65 20 74  6f 20 67 65 74 20 61 6e  |module to get an|
000018e0  64 2c 20 69 6e 20 74 68  65 20 77 6f 72 64 73 20  |d, in the words |
000018f0  6f 66 20 74 68 65 20 61  75 74 68 6f 72 2c 0a 61  |of the author,.a|
00001900  6c 6c 6f 77 73 20 79 6f  75 20 74 6f 20 74 68 69  |llows you to thi|
00001910  6e 6b 20 6c 65 73 73 20  27 49 74 27 73 20 61 20  |nk less 'It's a |
00001920  44 65 73 6b 74 6f 70 20  70 72 6f 67 72 61 6d 27  |Desktop program'|
00001930  20 61 6e 64 20 6d 6f 72  65 20 27 49 74 27 73 20  | and more 'It's |
00001940  61 20 70 72 6f 67 72 61  6d 20 74 6f 0a 64 6f 20  |a program to.do |
00001950  2e 2e 2e 27 0a 0a 0a 0a  0a a4 a4 a4 a4 a4 a4 a4  |...'............|
00001960  a4 a4 a4 a4 a4 a4 a4 a4  a4 a4 a4 a4 a4 a4 a4 a4  |................|
*
000019a0  a4 a4 a4 a4 a4 a4 20 20  20                       |......   |
000019a9