home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1997
/
ARCHIVE_97.iso
/
text
/
hints
/
vol_10
/
issue_05
< prev
next >
Wrap
Text File
|
1997-08-11
|
11KB
|
356 lines
Hints and Tips
10.5
Essential Selection demo CD Ö In Archive 10.1 p40, I wrote about YITM
öEssential CDò demo disc and its incompatibility with RiscPC 700
(RISCáOS 3.6) series 16-bit sound card, saying that it necessitated a
patch to be obtained and run first. This now only applies to the
original version 1 CD (December 1994) which was Acorn/PC dual
platform. The current version 2 (December 1995), Acorn platform only,
has the patch included on the CD-ROM and runs at start-up, offering
the choice of 8 or 16-bit sound. This later version also has several
additional demos of 1996 releases. It is a very well produced demo
disc of YITM educational multimedia catalogue and, best of all, it is
free!
10.5
Colin Sutton, Bradford
10.5
Hard disc nightmare Ö The tale of the lost IDE hard disc in last
monthæs Comment Column (10.4 p26) reminded me of a few weeks ago when
Iáaccidentally trashed my main SCSI HD. (Filecore wanted to know if
the disc had been formatted!) Like a fool, Iæd not taken backups
either.
10.5
Anyway, just before I was about to throw myself off the top of a very
tall building, I remembered the fsck suite from Sergio Monesi. Not
only did I manage to make my disc readable again (without
reformatting), but I also managed to recover all my lost files using
fsck and Hardfix.
10.5
I canæt recommend the fsck suite highly enough Ö it was the best ú5 I
ever spent.
10.5
Ian Clark <rooster@cat1.demon.co.uk>
10.5
PC partitions Ö Following on from my hint last month, p30, I have
just realised that I made
10.5
an elementary mistake in the !Boot file:
10.5
If PCDrives$Path=öò Then ...
10.5
should have been:
10.5
If ö<PCDrives$Path>ò=öò Then ...
10.5
Sorry about that!
10.5
Steve Drain <steve.d@virgin.net>
10.5
Polling the Wimp Ö One of the problems with version 3.1 of RISCáOS is
the time taken to page applications in and out of memory when
multitasking. (I have heard it said that this problem has been
overcome with later versions.) If the application, at the time of
paging in and out, occupies a large wimp slot, this situation is even
worse.
10.5
I find this problem most acute when using Twain with a scanner, but
other software, which is highly multitasking, can also slow down when
processing. Iáfind it essential to quit any large applications and
associated files, such as Impression, when acquiring an image from
the scanner, otherwise the scanner continually pauses as it waits for
the computer to catch up.
10.5
The solution is for software writers to only have the wimp Épollæ
them when it is necessary, and to keep the slot sizes to a minimum.
Could the latter be achieved by storing large stationary data in the
System sprite pool? Hum! The former should be done by sending the
correct poll word and by setting up a list of messages you wish to
receive.
10.5
The poll word, sent when you call Wimp_Poll, is to state which events
you are interested in receiving, and the list of messages contains
those you wish to receive via a message event. The message list is
important because of the large, and ever expanding, number of
messages that are Ébroadcastæ around the wimp. If you do not state
which messages you are interested in, you will be sent all of the
broadcast messages, such as when a directory is opened!
10.5
The messages you wish to receive should be stated as:
10.5
DEF PROCWimp_Start(taskname$)
10.5
ON ERROR PROCError:END
10.5
DIM wimp% 256
10.5
task%=0
10.5
wimp%!0=1 :REM Message_DataSave
10.5
wimp%!4=2 :REM Message_DataSaveAck
10.5
wimp%!8=3 :REM Message_DataLoad
10.5
wimp%!12=4 :REM Message_DataLoadAck
10.5
wimp%!16=8 :REM Message_PreQuit
10.5
wimp%!20=&502 :REM Message_HelpRequest
10.5
wimp%!24=&400C1 :REM Message_
10.5
ModeChange
10.5
wimp%!28=&808C1 :REM Message_
10.5
TaskWindow_Output
10.5
wimp%!32=0 :REM end of list
10.5
SYSòWimp_Initialiseò,310,&4B534154,
10.5
taskname$,wimp% TO ,task%
10.5
ENDPROC
10.5
Please note that the version number used here is 310 (as in 3.10 Ö
there may be important additions for later versions) and also there
are many other possible messages you may like to receive.
10.5
The wimp poll will only return to your task if an event has occurred
that you have stated you are interested in. If it is of no
consequence that the pointer has entered a window that you own, you
should mask this event out. If you do not, your application will be
paged into memory, an event ÉPointer_Entering_Windowæ will be sent to
you, you will ignore it, request the next wimp poll and be paged out
of memory.
10.5
A far more important event to mask out is the Null_Reason_Code event.
This event will page in your application whenever the user is not
clicking away, to allow background processing. If you donæt need to
do any background processing, mask it out!
10.5
Some code:
10.5
REM Stages of the applicationæs life
10.5
PROCWimp_Start(òMy Applicationò)
10.5
PROCSetInitialData
10.5
PROCWaitForEvent
10.5
PROCWimp_CloseDown
10.5
END
10.5
REM The applications base state,
10.5
waiting for instruction
10.5
DEF PROCWaitForEvent
10.5
finished%=0 :REM Global variable can
10.5
be set anywhere
10.5
REPEAT
10.5
PROCCallWimpPoll(%1)
10.5
REM mask out null event
10.5
UNTIL finished%
10.5
ENDPROC
10.5
DEF PROCWimp_CloseDown
10.5
REM close any files and tidy up and
10.5
then...
10.5
SYSòWimp_CloseDownò,task%,òTASKò
10.5
ENDPROC
10.5
DEF PROCPolling
10.5
REM call procedure during extensive
10.5
processing to keep multitasking
10.5
PROCCallWimpPoll(%0)
10.5
WHILE Paused%=1 AND Aborted%=0
10.5
PROCCallWimpPoll(%1)
10.5
REM mask out null event whilst
10.5
processing paused
10.5
ENDWHILE
10.5
ENDPROC
10.5
DEF PROCCallWimpPoll(idle%)
10.5
REM polling the wimp for events and a
10.5
short break in processing!
10.5
LOCAL event%,mask%
10.5
mask%=%11100100110000+idle%
10.5
REM masked out events 4,5,8,11,12,13
10.5
as will not respond to them
10.5
SYSòWimp_Pollò,mask%,wimp% TO event%
10.5
CASE event% OF
10.5
WHEN0 : REM will give you control
10.5
back for further processing
10.5
WHEN2 : PROCEvent_WindowOpen
10.5
WHEN3 : PROCEvent_CloseWindow
10.5
WHEN6 : PROCEvent_MouseClick
10.5
WHEN9 : PROCEvent_MenuChoice
10.5
WHEN17,18: PROCEvent_Message
10.5
REM those stated in PROCWimp_Start
10.5
ENDCASE
10.5
IF finished%=1 THEN Aborted%=1
10.5
REM Aborted% is used here as a means
10.5
REM to drop through processing for
10.5
REM various reasons and not just
10.5
REM when finishing!
10.5
ENDPROCáuá
10.5
Robert Lytton, Leeds
10.5
Printing from both RISC OS and Windows Ö I have an Aleph One PC
podule card in my A540, and I find printing from Windows, through the
A540 and a Turbo Driver, to be terribly slow. There are various
Éfixesæ for this, but I need things to work for my non-technical wife
(not the other one). So I decided to buy a printer sharer (RS number
215-016) and connect it to both the A540 printer port (using the
Turbo Driver cable) and to the PC card (with a regular cable). I then
configured the PC card to use its own printer port. To work in
Windows it is vital to turn off the Windows Éfast print to portæ
option which is on by default. From the Control panel, you must go
through Printers, to Connect, to find the box to click.
10.5
Brian Cowan <UHAP027@vms.rhbnc.ac.uk>
10.5
StrongED & Keystroke Ö Has anyone tried the combination of Keystroke
and StrongED? At first when I moved over to StrongED, I had real
difficulties because Keystroke does not seem to be able to
communicate with StrongED when it comes to cursor movements within
öInsert textò commands. (Has anyone else had that problem and/or
solved it?)
10.5
Anyway, I have got round it to some extent by using the \@ within
StrongED to mark a place to which the cursor should go, and using
Keystroke to enter the characters that call up the abbreviation.
10.5
For example, I need keystrokes that simplify some of the editing when
answering emails. So suppose I start with the following text:
10.5
> end of the paragraph.
10.5
>
10.5
> This is the start of the
10.5
I have a Keystroke that is defined as |?|?$; (i.e.ádelete, delete
followed by $;) and then I have a StrongED abbreviation definition
for $; as \n\n\@\n\@ which means type two returns, mark where the
cursor is to go (\@), do another return and then go back to where we
want the cursor. I then put the cursor on the blank line between the
two paragraphs that I want to split, and I end up with:
10.5
> end of the paragraph.
10.5
I type on this line... etc
10.5
> This is the start of the
10.5
StrongED is extremely powerful, and Iæm hoping weæll soon have some
articles on it, hopefully two lots, one for beginners (because I
found it very difficult to get started) and one to encourage people
into using it more deeply.
10.5
One other quick hint (from Guttorm Vik himself) is to use ` for your
abbreviation definitions instead of $. The reason for using it is
that, unlike $, it is an un-shifted character and is therefore
quicker to type. So, I have things like:
10.5
`ri RISCáOS
10.5
`rp RiscPC
10.5
`sm StrongARM
10.5
`sa Small Ads
10.5
`se StrongED
10.5
In each case, itæs three simple un-shifted keystrokes to produce
complex combinations of shifted and un-shifted letters.
10.5
Oh, and I use `` for öUKPò which I use in emails instead of the pound
sign which isnæt handled properly by email systems that canæt cope
with MIME encoding.
10.5
Ed. <paul.NCS@paston.co.uk>
10.5
System font Ö Since starting to use email, Iáhave been using system
font much more frequently, especially because of !PtrCopy which is so
useful for avoiding having to re-type email addresses Ö just öwipeò
them from some text file into the writeable icon of the öMail toò
window Ö see 9.8 p23. (but Iádigress!)
10.5
The thing I hate about the system font is the Éslashedæ zeros which I
find so difficult to read. I used to use a command in my boot file
that reprogrammed the screen definition of the zero, so I set out to
find it again and reinstall it on my StrongARM RiscPC! Iáfound it in
Archive 1.12! It was given in the form of VDU commands:
10.5
VDU23,48,60,102,102,102,102,102,60,0
10.5
VDU23,79,126,102,102,102,102,102,126,0
10.5
These can be put in a Basic program, but if you want to use an Obey
file, and put it in the PreDesk directory, you need the command line
equivalent:
10.5
*echo<23><48><60><102><102><102><102>
10.5
<102><60><0>
10.5
*echo<23><79><126><102><102><102>
10.5
<102><102><126><0>
10.5
This redefines the zero (ASCII 48) into the shape of the capital O,
and then squares up the shape of the capital O (ASCII 79) to
differentiate the two.
10.5
Ed. <paul.NCS@paston.co.uk>