Home » Archimedes archive » Acorn User » AU 1997-10 A.adf » Extras » Apple][e/PD/FileAct/!FileAct/Examples/KeyActDir/SetCurDir

Apple][e/PD/FileAct/!FileAct/Examples/KeyActDir/SetCurDir

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 » Acorn User » AU 1997-10 A.adf » Extras
Filename: Apple][e/PD/FileAct/!FileAct/Examples/KeyActDir/SetCurDir
Read OK:
File size: 03E4 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >SetCurDir
   20REM
   30REM
   40REM Set current directory to path of filer window where pointer is
   50REM
   60REM
   70
   80DIM B_Dum% 256
   90
  100REM
  110REM
  120REM WIMP initialisation (have to be a WIMP task !)
  130REM
  140REM
  150
  160B_Dum%!0=0
  170SYS "Wimp_Initialise",310,&4B534154,"SetCurDir",B_Dum% TO V%,App_Handle%
  180IF V%<310 THEN ERROR 1,"Sorry, I need WIMP 3.10 or later."
  190
  200REM
  210REM
  220REM Set current directory
  230REM
  240REM
  250
  260SYS "Wimp_GetPointerInfo",,B_Dum%
  270window%=B_Dum%!12
  280IF window%>=0 THEN
  290 !B_Dum%=window%
  300 SYS "XWimp_GetWindowInfo",,B_Dum% OR 1<<0 TO ;f%
  310 IF (f% AND 1<<0)=0 THEN
  320  titlef%=B_Dum%!60
  330  IF titlef% AND 1<<0 THEN
  340   IF titlef% AND 1<<8 THEN
  350    txp%=B_Dum%!76
  360    txm%=255
  370   ELSE
  380    txp%=B_Dum%+76
  390    txm%=12
  400   ENDIF
  410   title$=""
  420   ix%=0
  430   WHILE (txp%?ix%>=32) AND (ix%<txm%)
  440   title$+=CHR$(txp%?ix%)
  450   ix%+=1
  460   ENDWHILE
  470   SYS "XOS_CLI","Dir "+title$
  480  ENDIF
  490 ENDIF
  500ENDIF
  510
  520REM
  530REM
  540REM WIMP finalisation
  550REM
  560REM
  570
  580SYS "Wimp_CloseDown",App_Handle%,&4B534154
  590
� >SetCurDir
�
�
(D� Set current directory to path of filer window where pointer is
2�
<�
F
P� B_Dum% 256
Z
d�
n�
x4� WIMP initialisation (have to be a WIMP task !)
��
��
�
�B_Dum%!0=0
�Jș "Wimp_Initialise",310,&4B534154,"SetCurDir",B_Dum% � V%,App_Handle%
�6� V%<310 � � 1,"Sorry, I need WIMP 3.10 or later."
�
��
��
�� Set current directory
��
��
�
$ș "Wimp_GetPointerInfo",,B_Dum%
window%=B_Dum%!12
� window%>=0 �
" !B_Dum%=window%
,2 ș "XWimp_GetWindowInfo",,B_Dum% � 1<<0 � ;f%
6 � (f% � 1<<0)=0 �
@  titlef%=B_Dum%!60
J  � titlef% � 1<<0 �
T   � titlef% � 1<<8 �
^    txp%=B_Dum%!76
h    txm%=255
r   �
|    txp%=B_Dum%+76
�    txm%=12
�   �
�   title$=""
�   ix%=0
�%   ȕ (txp%?ix%>=32) � (ix%<txm%)
�   title$+=�(txp%?ix%)
�
   ix%+=1
�   �
�!   ș "XOS_CLI","Dir "+title$
�  �
� �
��
�
�
�
� WIMP finalisation
&�
0�
:
D-ș "Wimp_CloseDown",App_Handle%,&4B534154
N
�
00000000  0d 00 0a 10 f4 20 3e 53  65 74 43 75 72 44 69 72  |..... >SetCurDir|
00000010  0d 00 14 05 f4 0d 00 1e  05 f4 0d 00 28 44 f4 20  |............(D. |
00000020  53 65 74 20 63 75 72 72  65 6e 74 20 64 69 72 65  |Set current dire|
00000030  63 74 6f 72 79 20 74 6f  20 70 61 74 68 20 6f 66  |ctory to path of|
00000040  20 66 69 6c 65 72 20 77  69 6e 64 6f 77 20 77 68  | filer window wh|
00000050  65 72 65 20 70 6f 69 6e  74 65 72 20 69 73 0d 00  |ere pointer is..|
00000060  32 05 f4 0d 00 3c 05 f4  0d 00 46 04 0d 00 50 10  |2....<....F...P.|
00000070  de 20 42 5f 44 75 6d 25  20 32 35 36 0d 00 5a 04  |. B_Dum% 256..Z.|
00000080  0d 00 64 05 f4 0d 00 6e  05 f4 0d 00 78 34 f4 20  |..d....n....x4. |
00000090  57 49 4d 50 20 69 6e 69  74 69 61 6c 69 73 61 74  |WIMP initialisat|
000000a0  69 6f 6e 20 28 68 61 76  65 20 74 6f 20 62 65 20  |ion (have to be |
000000b0  61 20 57 49 4d 50 20 74  61 73 6b 20 21 29 0d 00  |a WIMP task !)..|
000000c0  82 05 f4 0d 00 8c 05 f4  0d 00 96 04 0d 00 a0 0e  |................|
000000d0  42 5f 44 75 6d 25 21 30  3d 30 0d 00 aa 4a c8 99  |B_Dum%!0=0...J..|
000000e0  20 22 57 69 6d 70 5f 49  6e 69 74 69 61 6c 69 73  | "Wimp_Initialis|
000000f0  65 22 2c 33 31 30 2c 26  34 42 35 33 34 31 35 34  |e",310,&4B534154|
00000100  2c 22 53 65 74 43 75 72  44 69 72 22 2c 42 5f 44  |,"SetCurDir",B_D|
00000110  75 6d 25 20 b8 20 56 25  2c 41 70 70 5f 48 61 6e  |um% . V%,App_Han|
00000120  64 6c 65 25 0d 00 b4 36  e7 20 56 25 3c 33 31 30  |dle%...6. V%<310|
00000130  20 8c 20 85 20 31 2c 22  53 6f 72 72 79 2c 20 49  | . . 1,"Sorry, I|
00000140  20 6e 65 65 64 20 57 49  4d 50 20 33 2e 31 30 20  | need WIMP 3.10 |
00000150  6f 72 20 6c 61 74 65 72  2e 22 0d 00 be 04 0d 00  |or later."......|
00000160  c8 05 f4 0d 00 d2 05 f4  0d 00 dc 1b f4 20 53 65  |............. Se|
00000170  74 20 63 75 72 72 65 6e  74 20 64 69 72 65 63 74  |t current direct|
00000180  6f 72 79 0d 00 e6 05 f4  0d 00 f0 05 f4 0d 00 fa  |ory.............|
00000190  04 0d 01 04 24 c8 99 20  22 57 69 6d 70 5f 47 65  |....$.. "Wimp_Ge|
000001a0  74 50 6f 69 6e 74 65 72  49 6e 66 6f 22 2c 2c 42  |tPointerInfo",,B|
000001b0  5f 44 75 6d 25 0d 01 0e  15 77 69 6e 64 6f 77 25  |_Dum%....window%|
000001c0  3d 42 5f 44 75 6d 25 21  31 32 0d 01 18 12 e7 20  |=B_Dum%!12..... |
000001d0  77 69 6e 64 6f 77 25 3e  3d 30 20 8c 0d 01 22 14  |window%>=0 ...".|
000001e0  20 21 42 5f 44 75 6d 25  3d 77 69 6e 64 6f 77 25  | !B_Dum%=window%|
000001f0  0d 01 2c 32 20 c8 99 20  22 58 57 69 6d 70 5f 47  |..,2 .. "XWimp_G|
00000200  65 74 57 69 6e 64 6f 77  49 6e 66 6f 22 2c 2c 42  |etWindowInfo",,B|
00000210  5f 44 75 6d 25 20 84 20  31 3c 3c 30 20 b8 20 3b  |_Dum% . 1<<0 . ;|
00000220  66 25 0d 01 36 16 20 e7  20 28 66 25 20 80 20 31  |f%..6. . (f% . 1|
00000230  3c 3c 30 29 3d 30 20 8c  0d 01 40 17 20 20 74 69  |<<0)=0 ...@.  ti|
00000240  74 6c 65 66 25 3d 42 5f  44 75 6d 25 21 36 30 0d  |tlef%=B_Dum%!60.|
00000250  01 4a 18 20 20 e7 20 74  69 74 6c 65 66 25 20 80  |.J.  . titlef% .|
00000260  20 31 3c 3c 30 20 8c 0d  01 54 19 20 20 20 e7 20  | 1<<0 ...T.   . |
00000270  74 69 74 6c 65 66 25 20  80 20 31 3c 3c 38 20 8c  |titlef% . 1<<8 .|
00000280  0d 01 5e 16 20 20 20 20  74 78 70 25 3d 42 5f 44  |..^.    txp%=B_D|
00000290  75 6d 25 21 37 36 0d 01  68 10 20 20 20 20 74 78  |um%!76..h.    tx|
000002a0  6d 25 3d 32 35 35 0d 01  72 08 20 20 20 cc 0d 01  |m%=255..r.   ...|
000002b0  7c 16 20 20 20 20 74 78  70 25 3d 42 5f 44 75 6d  ||.    txp%=B_Dum|
000002c0  25 2b 37 36 0d 01 86 0f  20 20 20 20 74 78 6d 25  |%+76....    txm%|
000002d0  3d 31 32 0d 01 90 08 20  20 20 cd 0d 01 9a 10 20  |=12....   ..... |
000002e0  20 20 74 69 74 6c 65 24  3d 22 22 0d 01 a4 0c 20  |  title$="".... |
000002f0  20 20 69 78 25 3d 30 0d  01 ae 25 20 20 20 c8 95  |  ix%=0...%   ..|
00000300  20 28 74 78 70 25 3f 69  78 25 3e 3d 33 32 29 20  | (txp%?ix%>=32) |
00000310  80 20 28 69 78 25 3c 74  78 6d 25 29 0d 01 b8 1a  |. (ix%<txm%)....|
00000320  20 20 20 74 69 74 6c 65  24 2b 3d bd 28 74 78 70  |   title$+=.(txp|
00000330  25 3f 69 78 25 29 0d 01  c2 0d 20 20 20 69 78 25  |%?ix%)....   ix%|
00000340  2b 3d 31 0d 01 cc 08 20  20 20 ce 0d 01 d6 21 20  |+=1....   ....! |
00000350  20 20 c8 99 20 22 58 4f  53 5f 43 4c 49 22 2c 22  |  .. "XOS_CLI","|
00000360  44 69 72 20 22 2b 74 69  74 6c 65 24 0d 01 e0 07  |Dir "+title$....|
00000370  20 20 cd 0d 01 ea 06 20  cd 0d 01 f4 05 cd 0d 01  |  ..... ........|
00000380  fe 04 0d 02 08 05 f4 0d  02 12 05 f4 0d 02 1c 17  |................|
00000390  f4 20 57 49 4d 50 20 66  69 6e 61 6c 69 73 61 74  |. WIMP finalisat|
000003a0  69 6f 6e 0d 02 26 05 f4  0d 02 30 05 f4 0d 02 3a  |ion..&....0....:|
000003b0  04 0d 02 44 2d c8 99 20  22 57 69 6d 70 5f 43 6c  |...D-.. "Wimp_Cl|
000003c0  6f 73 65 44 6f 77 6e 22  2c 41 70 70 5f 48 61 6e  |oseDown",App_Han|
000003d0  64 6c 65 25 2c 26 34 42  35 33 34 31 35 34 0d 02  |dle%,&4B534154..|
000003e0  4e 04 0d ff                                       |N...|
000003e4