Home » Archimedes archive » Archimedes World » AW-1994-08-Disc1.adf » Disk1Aug94 » !AWAug94/Goodies/Locate/OverWrite/RSI/Schema/Tutorial/Macros/FindPlace

!AWAug94/Goodies/Locate/OverWrite/RSI/Schema/Tutorial/Macros/FindPlace

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-08-Disc1.adf » Disk1Aug94
Filename: !AWAug94/Goodies/Locate/OverWrite/RSI/Schema/Tutorial/Macros/FindPlace
Read OK:
File size: 02A6 bytes
Load address: 0000
Exec address: 0000
File contents
macro findplace(sheet,block())
local res,whole,instruction,newselection,rownum,errortype
errortype=4
if sheet<>"Tutorial" then
  res=query("This button has no effect unless used from the spreadhseet \"Tutorial\".","Cancel","OK")
  =res
endif
instruction=int(input("Go to Screen","Which Screen number?","","OK","Cancel"))
if type(instruction)=errortype then ="Cancelled"
if instruction<1 or instruction>18 then
  res=query("Screens are numbered from 1 to 18","Cancel","OK")
  =instruction
endif
rownum=13*(instruction-1)
whole=wholesheet(sheet)
res=changeselection(whole(rownum,0)..whole(rownum,0),3)
rem res=changeselection(whole(rownum+1,0)..whole(rownum+1,0),1)
=res
endmacro
00000000  6d 61 63 72 6f 20 66 69  6e 64 70 6c 61 63 65 28  |macro findplace(|
00000010  73 68 65 65 74 2c 62 6c  6f 63 6b 28 29 29 0a 6c  |sheet,block()).l|
00000020  6f 63 61 6c 20 72 65 73  2c 77 68 6f 6c 65 2c 69  |ocal res,whole,i|
00000030  6e 73 74 72 75 63 74 69  6f 6e 2c 6e 65 77 73 65  |nstruction,newse|
00000040  6c 65 63 74 69 6f 6e 2c  72 6f 77 6e 75 6d 2c 65  |lection,rownum,e|
00000050  72 72 6f 72 74 79 70 65  0a 65 72 72 6f 72 74 79  |rrortype.errorty|
00000060  70 65 3d 34 0a 69 66 20  73 68 65 65 74 3c 3e 22  |pe=4.if sheet<>"|
00000070  54 75 74 6f 72 69 61 6c  22 20 74 68 65 6e 0a 20  |Tutorial" then. |
00000080  20 72 65 73 3d 71 75 65  72 79 28 22 54 68 69 73  | res=query("This|
00000090  20 62 75 74 74 6f 6e 20  68 61 73 20 6e 6f 20 65  | button has no e|
000000a0  66 66 65 63 74 20 75 6e  6c 65 73 73 20 75 73 65  |ffect unless use|
000000b0  64 20 66 72 6f 6d 20 74  68 65 20 73 70 72 65 61  |d from the sprea|
000000c0  64 68 73 65 65 74 20 5c  22 54 75 74 6f 72 69 61  |dhseet \"Tutoria|
000000d0  6c 5c 22 2e 22 2c 22 43  61 6e 63 65 6c 22 2c 22  |l\".","Cancel","|
000000e0  4f 4b 22 29 0a 20 20 3d  72 65 73 0a 65 6e 64 69  |OK").  =res.endi|
000000f0  66 0a 69 6e 73 74 72 75  63 74 69 6f 6e 3d 69 6e  |f.instruction=in|
00000100  74 28 69 6e 70 75 74 28  22 47 6f 20 74 6f 20 53  |t(input("Go to S|
00000110  63 72 65 65 6e 22 2c 22  57 68 69 63 68 20 53 63  |creen","Which Sc|
00000120  72 65 65 6e 20 6e 75 6d  62 65 72 3f 22 2c 22 22  |reen number?",""|
00000130  2c 22 4f 4b 22 2c 22 43  61 6e 63 65 6c 22 29 29  |,"OK","Cancel"))|
00000140  0a 69 66 20 74 79 70 65  28 69 6e 73 74 72 75 63  |.if type(instruc|
00000150  74 69 6f 6e 29 3d 65 72  72 6f 72 74 79 70 65 20  |tion)=errortype |
00000160  74 68 65 6e 20 3d 22 43  61 6e 63 65 6c 6c 65 64  |then ="Cancelled|
00000170  22 0a 69 66 20 69 6e 73  74 72 75 63 74 69 6f 6e  |".if instruction|
00000180  3c 31 20 6f 72 20 69 6e  73 74 72 75 63 74 69 6f  |<1 or instructio|
00000190  6e 3e 31 38 20 74 68 65  6e 0a 20 20 72 65 73 3d  |n>18 then.  res=|
000001a0  71 75 65 72 79 28 22 53  63 72 65 65 6e 73 20 61  |query("Screens a|
000001b0  72 65 20 6e 75 6d 62 65  72 65 64 20 66 72 6f 6d  |re numbered from|
000001c0  20 31 20 74 6f 20 31 38  22 2c 22 43 61 6e 63 65  | 1 to 18","Cance|
000001d0  6c 22 2c 22 4f 4b 22 29  0a 20 20 3d 69 6e 73 74  |l","OK").  =inst|
000001e0  72 75 63 74 69 6f 6e 0a  65 6e 64 69 66 0a 72 6f  |ruction.endif.ro|
000001f0  77 6e 75 6d 3d 31 33 2a  28 69 6e 73 74 72 75 63  |wnum=13*(instruc|
00000200  74 69 6f 6e 2d 31 29 0a  77 68 6f 6c 65 3d 77 68  |tion-1).whole=wh|
00000210  6f 6c 65 73 68 65 65 74  28 73 68 65 65 74 29 0a  |olesheet(sheet).|
00000220  72 65 73 3d 63 68 61 6e  67 65 73 65 6c 65 63 74  |res=changeselect|
00000230  69 6f 6e 28 77 68 6f 6c  65 28 72 6f 77 6e 75 6d  |ion(whole(rownum|
00000240  2c 30 29 2e 2e 77 68 6f  6c 65 28 72 6f 77 6e 75  |,0)..whole(rownu|
00000250  6d 2c 30 29 2c 33 29 0a  72 65 6d 20 72 65 73 3d  |m,0),3).rem res=|
00000260  63 68 61 6e 67 65 73 65  6c 65 63 74 69 6f 6e 28  |changeselection(|
00000270  77 68 6f 6c 65 28 72 6f  77 6e 75 6d 2b 31 2c 30  |whole(rownum+1,0|
00000280  29 2e 2e 77 68 6f 6c 65  28 72 6f 77 6e 75 6d 2b  |)..whole(rownum+|
00000290  31 2c 30 29 2c 31 29 0a  3d 72 65 73 0a 65 6e 64  |1,0),1).=res.end|
000002a0  6d 61 63 72 6f 0a                                 |macro.|
000002a6