Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_30.ADF » P/+wine1
P/+wine1
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 » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_30.ADF |
Filename: | P/+wine1 |
Read OK: | ✔ |
File size: | 056B bytes |
Load address: | 2B206576 |
Exec address: | 656E6977 |
File contents
"WINEDIT" ========= If you have access to an Acorn machine with the Risc OS desktop,you'll have noticed the fancy text entry boxes. These allow cursor editing of the entered text,which,if long enough,is centred in the box,and scrolled from right to left. The FN I have written may be incorporated into all your programs that require text input,as it's better than BASIC's INPUT command which uses OSWORD 0. The parameters passed when calling the function allow the setting of: 1)Default string eg."TextFile" 2)Window width - odd numbers will work best 3)Max length - a beep (VDU7) is emitted if the string is too long 4)Window position - where on the screen the box is to appear. 5)Background colour - your choice. The cursor editing status,using *FX4 is preserved during the FN,as are the window settings before calling it. However,you'll need to set the text background colour back to whatever it was before calling the FN - this isn't preserved. As usual,I've only done half a job - as an exercise for the reader perhaps someone could add a test for valid characters eg.if a filename is required the filename cannot contain a space so this should be ignored. I suggest a use of INSTR,or the purchaseof a Risc PC - tell me how you get on Robert Sprowson.
00000000 0d 22 57 49 4e 45 44 49 54 22 0d 3d 3d 3d 3d 3d |."WINEDIT".=====| 00000010 3d 3d 3d 3d 0d 0d 49 66 20 79 6f 75 20 68 61 76 |====..If you hav| 00000020 65 20 61 63 63 65 73 73 20 74 6f 20 61 6e 20 41 |e access to an A| 00000030 63 6f 72 6e 20 6d 61 63 68 69 6e 65 20 0d 77 69 |corn machine .wi| 00000040 74 68 20 74 68 65 20 52 69 73 63 20 4f 53 20 64 |th the Risc OS d| 00000050 65 73 6b 74 6f 70 2c 79 6f 75 27 6c 6c 20 68 61 |esktop,you'll ha| 00000060 76 65 20 0d 6e 6f 74 69 63 65 64 20 74 68 65 20 |ve .noticed the | 00000070 66 61 6e 63 79 20 74 65 78 74 20 65 6e 74 72 79 |fancy text entry| 00000080 20 62 6f 78 65 73 2e 0d 0d 54 68 65 73 65 20 61 | boxes...These a| 00000090 6c 6c 6f 77 20 63 75 72 73 6f 72 20 65 64 69 74 |llow cursor edit| 000000a0 69 6e 67 20 6f 66 20 74 68 65 20 0d 65 6e 74 65 |ing of the .ente| 000000b0 72 65 64 20 74 65 78 74 2c 77 68 69 63 68 2c 69 |red text,which,i| 000000c0 66 20 6c 6f 6e 67 20 65 6e 6f 75 67 68 2c 69 73 |f long enough,is| 000000d0 20 0d 63 65 6e 74 72 65 64 20 69 6e 20 74 68 65 | .centred in the| 000000e0 20 62 6f 78 2c 61 6e 64 20 73 63 72 6f 6c 6c 65 | box,and scrolle| 000000f0 64 20 66 72 6f 6d 0d 72 69 67 68 74 20 74 6f 20 |d from.right to | 00000100 6c 65 66 74 2e 0d 0d 54 68 65 20 46 4e 20 49 20 |left...The FN I | 00000110 68 61 76 65 20 77 72 69 74 74 65 6e 20 6d 61 79 |have written may| 00000120 20 62 65 20 0d 69 6e 63 6f 72 70 6f 72 61 74 65 | be .incorporate| 00000130 64 20 69 6e 74 6f 20 61 6c 6c 20 79 6f 75 72 20 |d into all your | 00000140 70 72 6f 67 72 61 6d 73 20 0d 74 68 61 74 20 72 |programs .that r| 00000150 65 71 75 69 72 65 20 74 65 78 74 20 69 6e 70 75 |equire text inpu| 00000160 74 2c 61 73 20 69 74 27 73 20 62 65 74 74 65 72 |t,as it's better| 00000170 20 0d 74 68 61 6e 20 42 41 53 49 43 27 73 20 49 | .than BASIC's I| 00000180 4e 50 55 54 20 63 6f 6d 6d 61 6e 64 20 77 68 69 |NPUT command whi| 00000190 63 68 20 75 73 65 73 20 0d 4f 53 57 4f 52 44 20 |ch uses .OSWORD | 000001a0 30 2e 0d 0d 54 68 65 20 70 61 72 61 6d 65 74 65 |0...The paramete| 000001b0 72 73 20 70 61 73 73 65 64 20 77 68 65 6e 20 63 |rs passed when c| 000001c0 61 6c 6c 69 6e 67 20 74 68 65 20 66 75 6e 63 74 |alling the funct| 000001d0 69 6f 6e 20 61 6c 6c 6f 77 20 74 68 65 20 73 65 |ion allow the se| 000001e0 74 74 69 6e 67 20 6f 66 3a 0d 0d 31 29 44 65 66 |tting of:..1)Def| 000001f0 61 75 6c 74 20 73 74 72 69 6e 67 20 65 67 2e 22 |ault string eg."| 00000200 54 65 78 74 46 69 6c 65 22 0d 32 29 57 69 6e 64 |TextFile".2)Wind| 00000210 6f 77 20 77 69 64 74 68 20 2d 20 6f 64 64 20 6e |ow width - odd n| 00000220 75 6d 62 65 72 73 20 77 69 6c 6c 20 77 6f 72 6b |umbers will work| 00000230 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00000240 20 20 62 65 73 74 0d 33 29 4d 61 78 20 6c 65 6e | best.3)Max len| 00000250 67 74 68 20 2d 20 61 20 62 65 65 70 20 28 56 44 |gth - a beep (VD| 00000260 55 37 29 20 69 73 20 65 6d 69 74 74 65 64 0d 20 |U7) is emitted. | 00000270 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 | if| 00000280 20 74 68 65 20 73 74 72 69 6e 67 20 69 73 20 74 | the string is t| 00000290 6f 6f 20 0d 20 20 20 20 20 20 20 20 20 20 20 20 |oo . | 000002a0 20 20 20 6c 6f 6e 67 0d 34 29 57 69 6e 64 6f 77 | long.4)Window| 000002b0 20 70 6f 73 69 74 69 6f 6e 20 2d 20 77 68 65 72 | position - wher| 000002c0 65 20 6f 6e 20 74 68 65 20 73 63 72 65 65 6e 0d |e on the screen.| 000002d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000002e0 20 20 20 20 74 68 65 20 62 6f 78 20 69 73 20 74 | the box is t| 000002f0 6f 20 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |o . | 00000300 20 20 20 20 20 20 20 61 70 70 65 61 72 2e 0d 35 | appear..5| 00000310 29 42 61 63 6b 67 72 6f 75 6e 64 20 63 6f 6c 6f |)Background colo| 00000320 75 72 20 2d 20 79 6f 75 72 20 63 68 6f 69 63 65 |ur - your choice| 00000330 2e 0d 0d 54 68 65 20 63 75 72 73 6f 72 20 65 64 |...The cursor ed| 00000340 69 74 69 6e 67 20 73 74 61 74 75 73 2c 75 73 69 |iting status,usi| 00000350 6e 67 20 2a 46 58 34 20 69 73 0d 70 72 65 73 65 |ng *FX4 is.prese| 00000360 72 76 65 64 20 64 75 72 69 6e 67 20 74 68 65 20 |rved during the | 00000370 46 4e 2c 61 73 20 61 72 65 20 74 68 65 0d 77 69 |FN,as are the.wi| 00000380 6e 64 6f 77 20 73 65 74 74 69 6e 67 73 20 62 65 |ndow settings be| 00000390 66 6f 72 65 20 63 61 6c 6c 69 6e 67 20 69 74 2e |fore calling it.| 000003a0 0d 0d 48 6f 77 65 76 65 72 2c 79 6f 75 27 6c 6c |..However,you'll| 000003b0 20 6e 65 65 64 20 74 6f 20 73 65 74 20 74 68 65 | need to set the| 000003c0 20 74 65 78 74 0d 62 61 63 6b 67 72 6f 75 6e 64 | text.background| 000003d0 20 63 6f 6c 6f 75 72 20 62 61 63 6b 20 74 6f 20 | colour back to | 000003e0 77 68 61 74 65 76 65 72 20 69 74 0d 77 61 73 20 |whatever it.was | 000003f0 62 65 66 6f 72 65 20 63 61 6c 6c 69 6e 67 20 74 |before calling t| 00000400 68 65 20 46 4e 20 2d 20 74 68 69 73 20 69 73 6e |he FN - this isn| 00000410 27 74 0d 70 72 65 73 65 72 76 65 64 2e 0d 0d 41 |'t.preserved...A| 00000420 73 20 75 73 75 61 6c 2c 49 27 76 65 20 6f 6e 6c |s usual,I've onl| 00000430 79 20 64 6f 6e 65 20 68 61 6c 66 20 61 20 6a 6f |y done half a jo| 00000440 62 20 2d 20 61 73 0d 61 6e 20 65 78 65 72 63 69 |b - as.an exerci| 00000450 73 65 20 66 6f 72 20 74 68 65 20 72 65 61 64 65 |se for the reade| 00000460 72 20 70 65 72 68 61 70 73 0d 73 6f 6d 65 6f 6e |r perhaps.someon| 00000470 65 20 63 6f 75 6c 64 20 61 64 64 20 61 20 74 65 |e could add a te| 00000480 73 74 20 66 6f 72 20 76 61 6c 69 64 0d 63 68 61 |st for valid.cha| 00000490 72 61 63 74 65 72 73 20 65 67 2e 69 66 20 61 20 |racters eg.if a | 000004a0 66 69 6c 65 6e 61 6d 65 20 69 73 20 72 65 71 75 |filename is requ| 000004b0 69 72 65 64 0d 74 68 65 20 66 69 6c 65 6e 61 6d |ired.the filenam| 000004c0 65 20 63 61 6e 6e 6f 74 20 63 6f 6e 74 61 69 6e |e cannot contain| 000004d0 20 61 20 73 70 61 63 65 20 73 6f 0d 74 68 69 73 | a space so.this| 000004e0 20 73 68 6f 75 6c 64 20 62 65 20 69 67 6e 6f 72 | should be ignor| 000004f0 65 64 2e 0d 0d 49 20 73 75 67 67 65 73 74 20 61 |ed...I suggest a| 00000500 20 75 73 65 20 6f 66 20 49 4e 53 54 52 2c 6f 72 | use of INSTR,or| 00000510 20 74 68 65 20 0d 70 75 72 63 68 61 73 65 6f 66 | the .purchaseof| 00000520 20 61 20 52 69 73 63 20 50 43 20 2d 20 74 65 6c | a Risc PC - tel| 00000530 6c 20 6d 65 20 68 6f 77 20 79 6f 75 0d 67 65 74 |l me how you.get| 00000540 20 6f 6e 0d 0d 20 20 20 20 20 20 20 20 20 20 20 | on.. | 00000550 20 20 20 20 20 20 20 20 20 20 52 6f 62 65 72 74 | Robert| 00000560 20 53 70 72 6f 77 73 6f 6e 2e 0d | Sprowson..| 0000056b