Home » Archimedes archive » Archimedes World » AW-1995-05-Disc1.adf » AWMay95_1 » InTheMag/DrawBasic/!DrawBasic/Library/Examples/Chapter/Ex_5_12b

InTheMag/DrawBasic/!DrawBasic/Library/Examples/Chapter/Ex_5_12b

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-1995-05-Disc1.adf » AWMay95_1
Filename: InTheMag/DrawBasic/!DrawBasic/Library/Examples/Chapter/Ex_5_12b
Read OK:
File size: 0192 bytes
Load address: 0000
Exec address: 0000
File contents
REM Creates a user-defined pattern

�Width(10)
 f=�HLine(1,1,5)
�Dash@(f,�NewPattern)
�Quit

DEF �NewPattern
LOCAL pattern
pattern=�DashPattern(3)   : REM pattern has 3 elements
�DashLength(pattern,1,20) : REM 1st element (stroke) of length 20 points
�DashLength(pattern,2,10) : REM 2nd element (dash) of length 10 points
�DashLength(pattern,3,5)  : REM 3rd element (stroke) of length 5 points
=pattern
00000000  52 45 4d 20 43 72 65 61  74 65 73 20 61 20 75 73  |REM Creates a us|
00000010  65 72 2d 64 65 66 69 6e  65 64 20 70 61 74 74 65  |er-defined patte|
00000020  72 6e 0a 0a a0 57 69 64  74 68 28 31 30 29 0a 20  |rn...Width(10). |
00000030  66 3d bb 48 4c 69 6e 65  28 31 2c 31 2c 35 29 0a  |f=.HLine(1,1,5).|
00000040  a0 44 61 73 68 40 28 66  2c bb 4e 65 77 50 61 74  |.Dash@(f,.NewPat|
00000050  74 65 72 6e 29 0a a0 51  75 69 74 0a 0a 44 45 46  |tern)..Quit..DEF|
00000060  20 bb 4e 65 77 50 61 74  74 65 72 6e 0a 4c 4f 43  | .NewPattern.LOC|
00000070  41 4c 20 70 61 74 74 65  72 6e 0a 70 61 74 74 65  |AL pattern.patte|
00000080  72 6e 3d bb 44 61 73 68  50 61 74 74 65 72 6e 28  |rn=.DashPattern(|
00000090  33 29 20 20 20 3a 20 52  45 4d 20 70 61 74 74 65  |3)   : REM patte|
000000a0  72 6e 20 68 61 73 20 33  20 65 6c 65 6d 65 6e 74  |rn has 3 element|
000000b0  73 0a a0 44 61 73 68 4c  65 6e 67 74 68 28 70 61  |s..DashLength(pa|
000000c0  74 74 65 72 6e 2c 31 2c  32 30 29 20 3a 20 52 45  |ttern,1,20) : RE|
000000d0  4d 20 31 73 74 20 65 6c  65 6d 65 6e 74 20 28 73  |M 1st element (s|
000000e0  74 72 6f 6b 65 29 20 6f  66 20 6c 65 6e 67 74 68  |troke) of length|
000000f0  20 32 30 20 70 6f 69 6e  74 73 0a a0 44 61 73 68  | 20 points..Dash|
00000100  4c 65 6e 67 74 68 28 70  61 74 74 65 72 6e 2c 32  |Length(pattern,2|
00000110  2c 31 30 29 20 3a 20 52  45 4d 20 32 6e 64 20 65  |,10) : REM 2nd e|
00000120  6c 65 6d 65 6e 74 20 28  64 61 73 68 29 20 6f 66  |lement (dash) of|
00000130  20 6c 65 6e 67 74 68 20  31 30 20 70 6f 69 6e 74  | length 10 point|
00000140  73 0a a0 44 61 73 68 4c  65 6e 67 74 68 28 70 61  |s..DashLength(pa|
00000150  74 74 65 72 6e 2c 33 2c  35 29 20 20 3a 20 52 45  |ttern,3,5)  : RE|
00000160  4d 20 33 72 64 20 65 6c  65 6d 65 6e 74 20 28 73  |M 3rd element (s|
00000170  74 72 6f 6b 65 29 20 6f  66 20 6c 65 6e 67 74 68  |troke) of length|
00000180  20 35 20 70 6f 69 6e 74  73 0a 3d 70 61 74 74 65  | 5 points.=patte|
00000190  72 6e                                             |rn|
00000192