On 07/01/2014 16:46, Urs Koenig (QL) wrote:
Thanks for the fast response Bob.

Bob Spelten wrote:
There is a tool QWIRC by Per Witte to rename hard disks (Dilwyn's site).
Now I remember, one needs a tool for that and what a wonder QWIRC is already
on my system.

Urs
--------------------------------------------------
http://www.youtube.com/QLvsJAGUAR
https://plus.google.com/104042128125238901905/posts
Sinclair, QL, ATARI, JAGUAR, NUON, APPLE & more...

Sensible chap

I found an ancient piece of SBasic that renames a QLWA-type hard disk without any frills. Just re-tested it briefly on latest QPC2 and it appears to work. Own risk, and all that!

Per

100 REMark WIN hard disk rename
110 REMark pjwitte 1998
120 REMark V0.03
130 :
140 ch = 1: namel% = 10: esc$ = CHR$(27)
150 CLS#ch
160 PRINT#ch; '      Rename harddisk'
170 PRINT#ch; 'Note: No other application'
180 PRINT#ch; 'may access the hard disk'
190 PRINT#ch; 'during this call'
200 PRINT#ch\\ 'Enter drive number <1..8> ';
210 CURSEN#ch
220 REPeat
230  n$ = INKEY$(#ch; -1)
240  IF n$ INSTR '12345678' & esc$: EXIT
250  BEEP 999, 999
260 END REPeat
270 CURDIS#ch: BEEP 2, 2
280 IF n$ = esc$: PRINT#ch; '^ESC': STOP
290 PRINT#ch; n$
300 w = FOPEN("win" & n$ & '_*D2d')
310 IF w = -9 THEN
320  PRINT#ch; 'HD is in use. Close all open'
330  PRINT#ch; 'channels on this drive and'
340  PRINT#ch; 'then try again.': STOP
350  ELSE : IF w < 0: ERT w
360 END IF
370 GET#w\ 0; sec$
380 n$ = sec$(1 TO 4)
390 IF n$ <> 'QLWA' THEN
400  PRINT#ch; 'Unsupported hard disk format:' !n$: CLOSE#w: STOP
410 END IF
420 n$ = sec$(7 TO 6 + namel%)
430 PRINT#ch\\ 'Current name is "'; n$; '"'
440 PRINT#ch\\'Enter new name (max'! namel%! 'chars)'
450 INPUT#ch;, n$: n% = LEN(n$)
460 IF n% = 0: PRINT#ch; 'Aborted': CLOSE#w: STOP
470 IF n% < namel%: n$ = n$ & FILL$(' ', namel% - LEN(n$))
480 FOR i% = 1 TO namel%: sec$(6 + i%) = n$(i%)
490 PRINT#ch; 'Writing...'
500 PUT#w\ 0; sec$: CLOSE#w
510 PRINT#ch\\ 'Done': BEEP 2, 2
520 :

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to