From: "Clive D.W. Feather" <Clive@on-the-train.demon.co.uk>
Subject: Re: Passwords
Date: Mon, 16 Dec 1996 12:05:42 +0000
Reply-To: clive@demon.net

In article <58p6l4$g6v@freyja.mimir.com>, Pete Bentley <pete@sorted.org>
writes
>One step up from
>there, hire someone to produce a programmatic way of testing passwords
>and throw lots of CPU grunt at it. Better yet, hire a good
>cryptographer to break the encryption method used --- I seem to recall
>reading an approximate description of it and it isn't very
>strong...certainly nothing like IDEA or triple DES. In fact, there's a
>vague (and possibly false) memory telling me someone posted something
>to comp.sys.psion a year or more ago saying they had a program which
>could crack the encryption relatively quickly.

I've cracked the encryption used by the appropriate system calls, which
is also the system used in Word files. It's pretty simple - full details
are in the Psionics Files, but basically:

  - Password is scrambled to form a 9 byte pattern.
  - The first 7 bytes of that pattern are added to the end to make a
    16 byte key sequence.
  - cyphertext[i] = (plaintext[i] + key[i%16]) %256

(or it may be subtraction; I forget which offhand). Anyway, it's a
Viginere encryption with a known length key which has an internal
pattern to it. Assuming that the most frequent byte value represents
space usually breaks it - I have a program to do this (and no, I am
*not* going to post it).

Clive D.W. Feather    | Associate Director  | Director
Tel: +44 181 371 1138 | Demon Internet Ltd. | CityScape Internet Services Ltd.
Fax: +44 181 371 1150 | <clive@demon.net>   | <cdwf@cityscape.co.uk>


From: ali-manson@psion.com (Alasdair Manson)
Subject: Re: Asynchronous I/O calls (long because of example code)
Date: Wed, 18 Dec 1996 03:03:40 GMT

On Tue, 17 Dec 1996 00:49:22 -0500, jfmezei
<nospam.jfmezei@videotron.ca> wrote:

>Is there an equivalent in EPOC ?

If I understand you correctly you need a wait-handler.

>What exactly are the wait handlers ? Any examples ?

Here is a simple example of a wait-handler which allows a program to
continue beeping even when the code is inside the (synchronous) HWIF
dialog. This code is ready to compile under the Psion SIBO C SDK:

#include <p_std.h>
#include <p_file.h>
#include <wlib.h>
#include <hwif.h>


LOCAL_D TEXT *cmds[]=
    {
    "aAbout",
    "bBeep",
    "xExit",
    NULL
    };

LOCAL_D H_MENU_DATA mdata[]=
    {
    "WaitHandler",3,
    NULL
    };

GLDEF_D TEXT ** _cmds=(&cmds[0]);
GLDEF_D H_MENU_DATA * _mdata=(&mdata[0]);

typedef struct
    {
    VOID *timH;
    WORD timstat;
    ULONG timint;
    WORD duration;
    WORD pitch;
    } TIMCB;

LOCAL_D TIMCB tcb={0,0,20L,5,320};

LOCAL_D UINT MainWid;

LOCAL_C VOID About(VOID)
    {
    TEXT buf[20];
    H_DI_TEXT txt;

    if (uOpenDialog("About WaitHandler"))
	return;
    txt.str=(&buf[0]);
    uZTStoBCS(&buf[0],"Version 2.0");
    txt.type=H_DTEXT_ALIGN_CENTRE;
    if (uAddDialogItem(H_DIALOG_TEXT,NULL,&txt))
	return;
    if (uAddButtonList("Continue",W_KEY_ESCAPE,NULL))
	return;
    uRunDialog();
    }

LOCAL_C VOID ControlBeep(VOID)
    {
    LONG newtimint,newduration,newpitch;
    H_DI_NUMBER htimint,hduration,hpitch;

    newtimint=tcb.timint;
    newduration=tcb.duration;
    newpitch=tcb.pitch;
    htimint.value=(&newtimint);
    htimint.low=5;
    htimint.high=100;
    hduration.value=(&newduration);
    hduration.low=1;
    hduration.high=20;
    hpitch.value=(&newpitch);
    hpitch.low=100;
    hpitch.high=800;
    if (uOpenDialog("Beep control"))
	return;
    if (uAddDialogItem(H_DIALOG_NUMBER,"Gap between beeps",&htimint))
	return;
    if (uAddDialogItem(H_DIALOG_NUMBER,"Beep duration",&hduration))
	return;
    if (uAddDialogItem(H_DIALOG_NUMBER,"Beep pitch",&hpitch))
	return;
    if (uRunDialog()<=0)
	return;
    tcb.timint=newtimint;
    tcb.duration=newduration;
    tcb.pitch=newpitch;
    }

LOCAL_C VOID ManageCommand(INT keycode)
    {
    INT index;

    index=uLocateCommand(keycode);
    switch (index)
	{
    case 0:
	About();
	break;
    case 1:
	ControlBeep();
	break;
    case 2:
	p_exit(0);
	}
    }

LOCAL_C VOID QueueTimer(TIMCB *ptcb)
    {
    p_ioa4(ptcb->timH,P_FRELATIVE,&ptcb->timstat,&ptcb->timint);
    }

LOCAL_C INT TimHandler(TIMCB *ptcb)
    {
    if (ptcb->timstat==E_FILE_PENDING)
	return(P_SIGNAL_UNUSED);
    p_sound(ptcb->duration,ptcb->pitch);
    QueueTimer(ptcb);
    return(P_SIGNAL_ENABLE);
    }

LOCAL_C VOID MainLoop(VOID)
    {
    INT ret;
    WMSG_KEY key;

    FOREVER
	{
	uGetKey(&key);
	if (key.keycode&W_SPECIAL_KEY)
	    ManageCommand(key.keycode&(~W_SPECIAL_KEY));
	else if (key.keycode==W_KEY_MENU && !(key.modifiers&W_CTRL_MODIFIER))
	    {
	    ret=uPresentMenus();
	    if (ret>0)
		ManageCommand(ret);
	    }
	}
    }

LOCAL_C VOID ReduceScreenSize(VOID)
    {
    W_WINDATA wd;

    wd.extent.tl.x=wd.extent.tl.y=0;
    wd.extent.width=189;
    wd.extent.height=80;
    wSetWindow(MainWid,W_WIN_EXTENT,&wd);
    if (uErrorValue(wCheckPoint()))
	p_exit(0);
    }

LOCAL_C VOID SpecificInit(VOID)
    {
    HANDLE hand;

    MainWid=uFindMainWid();
    ReduceScreenSize();
    gCreateTempGC0(MainWid);
    gBorder(W_BORD_CORNER_4);
    gFreeTempGC();
    wsEnable();
    p_open(&tcb.timH,"TIM:",-1);
    QueueTimer(&tcb);
    hand=p_svecadd((VOID *)TimHandler,&tcb);
    p_sveccall(hand,TRUE);
    }

GLDEF_C VOID main(VOID)
    {
    uCommonInit();
    SpecificInit();
    MainLoop();
    }

If you want any more information, mail me and I can send you an
extract from the SDK documentation which might make this clearer.
All the best

Ali

From: jfmezei <nospam.jfmezei@videotron.ca>
Subject: Re: Asynchronous I/O calls (long because of example code)
Date: Wed, 18 Dec 1996 01:25:06 -0500

Alasdair Manson wrote:
> >What exactly are the wait handlers ? Any examples ?
> 
> Here is a simple example of a wait-handler
[example C program]

> If you want any more information, mail me and I can send you an
> extract from the SDK documentation which might make this clearer.

Thanks for the code example. I'll have to study it in depth. I asked
this because the SDK documentation wasn't very obvious to me. I guess
I'll re-read that part with your example program and hopefully
understand it fully.
Thanks again.

From: steveg@dircon.co.uk (Stephen Godfrey)
Subject: Re: Help: gCLOCK
Date: 18 Dec 1996 21:40:17 GMT

In article <329fe8da.3650142@news>, brendan@informatik.uni-bremen.de (Brendan 
W. Breede) wrote:

> I suppose for type 5 I have to add parameters to the call like in
> gCLOCK, though I haven't tested this yet.

For formatted clocks you need to use a different call, as the following 
example shows. This call is equivalent to wsCreateClock2() in C.

Cheers
Steve
http://www.users.dircon.co.uk/~steveg/

PROC test:
  global id%
  id%=clock:(5,150,40,0,$8000,16395,9,"%h%:%m%:%s   %e   %d%/%m%/%y")
  get
  rem
  rem clock:(type%,x%,y%,offset%,flags%,font%,style%,format$)
  rem
  rem type% is one of:
  rem     0 - small digital
  rem     1 - medium
  rem     2 - large analog
  rem     3 - medium2
  rem     4 - extra large analog
  rem     5 - formatted
  rem     6 - siena/s3c medium
  rem     7 - s3c large
  rem
  rem flag% is one or more of:
  rem    16 - with date
  rem    32 - with second hand
  rem    64 - force analog
  rem   128 - force digital
  rem   256 - with ampm
  rem   512 - centred
  rem  2048 - draw in grey plane
  rem  8192 - right align
  rem 32768 - with box
  rem
  rem font% is:
  rem 16384 - s3 font
  rem 16385 - s3 font bold
  rem 16386 - s3 font digits
  rem 16387 - mono 8x8
  rem 16388 - roman 8
  rem 16389 - roman 11
  rem 16390 - roman 13
  rem 16391 - roman 16
  rem 16392 - swiss 8
  rem 16393 - swiss 11
  rem 16394 - swiss 13
  rem 16395 - swiss 16
  rem 16396 - mono 6x6
  rem 24600 - digital large
  rem 24609 - digital small
  rem
  rem style% is:
  rem     0 - normal
  rem     1 - bold
  rem     2 - underline
  rem     4 - inverse
  rem     8 - double
  rem    16 - monospaceds
  rem    32 - italic
  rem
ENDP

PROC clock:(t%,x%,y%,o%,f%,fo%,st%,f$)
  local gi%(31),fmt$(32)
  rem keep the following 8 variables together
  local win%,type%,xp%,yp%,offset%,flags%,font%,style%

  ginfo gi%()

  win%    = gi%(31)
  type%   = t%
  xp%     = x%
  yp%     = y%
  offset% = o%
  flags%  = f%
  font%   = fo%
  style%  = st%
  
  if type%=5
    fmt$=f$+chr$(0) rem formatted type
  else
    fmt$=chr$(0) rem should be null otherwise
  endif
  return call($ed8d,addr(win%),uadd(addr(fmt$),1),0,0,0)
ENDP

From: brendan@informatik.uni-bremen.de (Brendan W. Breede)
Subject: Re: Machine detection
Date: Sat, 21 Dec 1996 07:40:40 GMT

In article <1996122102350767213@zetnet.co.uk> Anthony Walker
<tony.walker@zetnet.co.uk> wrote:

>Does someone know how to tell the difference (in code) between a 3a, 
>3c and Siena. I tried the $8B-01 system call and the Siena emulator 
>gave me back the same screen ID as the 3a (11) when it plainly isn't 
>the same type of screen. 

To tell what machine you're running on check the first digit of the
rom version:

  mach%=CALL($2A8B)/$1000

where mach% will then be within the range 1..5

   1  = Series 3
   2  = Workabout
   3  = Series 3a
   4  = Siena
   5  = Series 3c

__________________________________\____________________Brendan W. Breede
brendan@informatik.uni-bremen.de              \
http://www.informatik.uni-bremen.de/~brendan/  \


From: ali-manson@psion.com (Alasdair Manson)
Subject: Re: Calling HWIF routines from OPL
Date: Fri, 27 Dec 1996 19:59:39 GMT

On Fri, 27 Dec 1996 11:42:19 -0500, jfmezei
<nospam.jfmezei@videotron.ca> wrote:

>OK, what is the trick in calling non-EPOC routines from OPL ?
>
>(eg: the HWIF routines such as the HEB (text editor) routines ?
>
>What sort of work is involved in getting that to work ? I assume that
>one must somehow get an address of the routines in the libraries 
>and directly call those from OPL ?????

Hello

I was pretty sure that I mailed you all of the support files for this
already. There is already an OPL API for this code which I wrote some
time ago. It is not 100% complete nor is it fully tested but it seems
to work fine and I know a few developers have used it in their
applications.

Send an email message to ali-manson@psion.com and I'll send you the
code. The code assumes that you have a copy of the Psion SIBO OPL SDK

Writing the API was not complex but was somewhat labourious. If you
look at the source for the various functions you'll see a close
parallel between the C functions and the OPL equivalents. For example,
look at the source for the HWIF function hEBSenseText() it is:

	GLDEF_C TEXT *hEBSenseText(VOID *ebH)
	    {
	    SE_EDWIN sense;
	
	    p_send3(ebH,O_WN_SENSE,&sense);
	    return(sense.buf);
	    }

the OPL equivalent is:

	PROC hEBSenseText(e%)

	   LOCAL             sense%(2)
	   LOCAL             pSense%

	   pSense% = ADDR(sense%())
	   SEND(e%, O_WN_SENSE, #pSense%)
	   RETURN sense%(1)
	
	ENDP

Where the following defines are used (primarily to aid legibility of
the code):

	#define hEBSenseText            EBSnsT%:
	#define O_WN_SENSE 11

All the best
Ali

From: jfmezei <nospam.jfmezei@videotron.ca>
Subject: Re: Calling HWIF routines from OPL
Date: Tue, 31 Dec 1996 07:46:16 -0500

Alasdair Manson wrote:
> No. The source of the entire HWIF library is supplied with all
> versions of the SIBO C SDK to allow people to do exactly this kind of
> thing.

Well, I checked on the "optional" disk and yes, there is a ZIP file
with the source code on it. Neat stuff. I have a feeling I'll have a lot
of fun playing with this !


From: Andrew Scheele <shay@turtle.demon.co.uk>
Subject: RE: Raising to Powers
Date: Thu, 02 Jan 1997 20:48:19

Use logs!!
	 z
if    x=y
then ln(x)=z.ln(y)
       (z.ln(y))
and  x=e

or in OPL:
x=exp(z*ln(y))

Simple.

From: brendan@informatik.uni-bremen.de (Brendan W. Breede)
Subject: Re: Raising to Powers
Date: Fri, 03 Jan 1997 09:39:00 GMT

In article <MSGCNTR852238100@turtle.demon.co.uk> Andrew Scheele
<shay@turtle.demon.co.uk> wrote:

>Use logs!!
>         z
>if    x=y
>then ln(x)=z.ln(y)
>       (z.ln(y))
>and  x=e
>
>or in OPL:
>x=exp(z*ln(y))
>
>Simple.

errm...    x=z**y    looks a slight bit simpler... ;-)
____________________________\____________________Brendan W. Breede
brendan@informatik.uni-bremen.de              \
http://www.informatik.uni-bremen.de/~brendan/  \


From: alanc@donor2.demon.co.uk (Alan Clifford)
Subject: How to find out how much data in low level serial buffers ?
Date: 03 Jan 97 21:05:03 
X-FTN-To: Andy French

Hello Andy

Replying to a message of Andy French to All:

 AF> Any one know how I can find out how much data there is in (and the
 AF> actual size of) the low level rx & tx serial buffers. I'm using OPL
 AF> and TTY:A

 AF> Any ponters to where this and other such useful information can be
 AF> freely found would also be appreciated.

I'm using

IOW(-1,10,Rlen%, Rlen%)

to get the the number of bytes in the input buffer (ref: Psionics file:
Devices).  I open the device with LOPEN "TTY:A"

Alan

From: ali-manson@psion.com (Alasdair Manson)
Subject: Re: Workabout OFF key
Date: Sat, 04 Jan 1997 21:51:28 GMT

On Fri, 03 Jan 1997 11:10:40 -0500, Walter Perz <wperz+@pitt.edu>
wrote:

>Does anyone have any suggestions (code snippets would be great) on how to 
>disable the OFF key with software?

If you simply capture the off key you will achieve your objective. In
OPL use WSKCAP%: in the OPL Library or in C use wCaptureKey() in WLIB.

All the best
Ali

From: "J.G. Ramage" <jgr@ulysses.att.com>
Subject: Re: Window server interrupts and subfunctions
Date: Fri, 3 Jan 1997 20:27:59 GMT

jfmezei wrote:
> 
> A while back, someone posted the CALL code to place your process in
> the foreground and background. I beleive that those are Window Server
> calls.
> 
> The SIBO C documentation does have the "C" documentation on the names
> and arguments to the routines, but it lacks the window server interrupt
> and subfunction numbers in the appendix at the end, thus making those
> calls hard to make from OPL.
> 
> Question:
> 
>         How does on go about finding those all-too-=important interrupt
>     numbers for the window server ? It is hidden somewhere on the
>         diskettes in a include file or something ?
> 
> Or: what are the interrupt/function numbers for foresground/background ?
> (as a starter...)

Yes, they are buried in the wlib.lib file.  They are in assembled
machine code under the last reference to the name of the function.

To get the codes you want, continually attempt to 'find' the name of the
window server function as it appears in the SDK docs until you don't
find any more.  Then, look at the 8086 machine code (you're looking for
the byte codes for MOVAH and INT) and take the numbers from that and
function number becomes the val after the MOVAH and the val after INT
combined into one word to get the call number (i.e.  <MOVAH>FF<INT>BB
becomes call number FFBB).  To find what vals to put in the registers,
you have to look at the wlib.h file and find the calling skeleton of the
function.  Then scroll up to the first #pragma statement and see what
registers are used by the calling conventions.

If you need more help, mail me at DRamage@worldnet.net or
Damage@juno.com for a more concise answer  ;)

Dan Ramage
(Author of the partially finished Wserver Psionics file)
  Damage@juno.com
  DRamage@worldnet.att.net
  75452.3714@compuserve.com

From: ali-manson@psion.com (Alasdair Manson)
Subject: Re: Detecting tagged files in OPL
Date: Tue, 07 Jan 1997 15:06:11 GMT

On 6 Jan 1997 12:24:30 GMT, mnd@st-andrews.ac.uk (Martin N Dunstan)
wrote:

>Hi,
>
>   From within OPL I would like to use dFILE and get the user to
>choose a file. If the user presses TAB and uses the file selector
>to tag several files then all that the dialog returns is the name
>of the last file.
>
>   Is there anyway that an OPL program can obtain a list of the
>files that were tagged to allow it to work on multiple files just
>like the "Delete File" option from the system screen?
>
>   Martin
>

Try this:

REM Module - TAGGING.OPL

REM Demo of how to allow multiple
REM file selection from OPL

REM Written by Jezar at Psion.
REM You have a royalty free right to
REM use and distribute this software in
REM any way you see fit, provided you
REM agree that neither Jezar nor Psion
REM can be held responsible for the
REM consequences of its use.

REM Use at your own risk.
REM No warranties.

REM This shows how to get a complete
REM list of tagged files from the user.
REM There is, regrettably, not enough
REM space here for a full explanation,
REM but basically, it tells the 
REM requester not to destroy the list.
REM We then talk to the list ourselves,
REM and destroy it by sending a message.

REM Hope this is of use,
REM Jezar@cix.compulink.co.uk
REM 01:42 23/11/94 (yawn!)

PROC TagDemo%:
	LOCAL ret%
	WHILE 1
		PRINT "Press TAB, and tag several files"
		PRINT "by using the '+' key"
		ret% = FileTag%:("Example of Tagging
Files","Action","File:","\OPL\",0)
		PRINT "Dialog returned:",ret% 
		GET
		CLS
	ENDWH
ENDP

PROC Action%:(name$)
	REM Your "action" routine can
	REM return non-zero to state that
	REM it wants NO more filenames sent.
	REM This is just a simple demo:
	
	PRINT name$
ENDP

PROC FileTag%:(Title$,Action$,Prompt$,fname$,flags%)
	LOCAL total%,count%,n$(130)
	LOCAL d$(130),o%(8),ret%,vastr%
	
	REM File edit boxes are NOT allowed:
	IF (flags% AND 1)
		RAISE -2
	ENDIF
	n$=fname$
	
	REM Present the dialog:
	dINIT Title$
	REM Keep together--------------
	dFILE n$,Prompt$,flags%
	vastr%=KeepTag%:
	REM ---------------------------
	ONERR Clean::
	ret%=DIALOG
	IF ret%=0
		RAISE 0
	ENDIF
	
	REM Get basic details (if any):
	total%=CALL($CF,vastr%,1)
	IF total%>=1
		REM Full path of tagged items:
		d$=VAstr$:(vastr%,0)
		count%=1
	ENDIF
	IF total%>=2
		REM First file name tagged:
		n$=VAstr$:(vastr%,1)
		count%=2
	ENDIF
	
	REM Collect/process all the files:
	WHILE 1
		n$=PARSE$(n$,d$,o%())
		IF @%(Action$):(n$) :REM Your proc.
			RAISE 0 :REM You've finished?
		ENDIF
		IF count%>=total%
			RAISE 0 :REM All done?
		ENDIF
		REM Get next tagged name:
		n$=VAstr$:(vastr%,count%)
		count%=count%+1
	ENDWH
	
Clean::
	ONERR OFF
	REM We MUST destroy the VASTR object:
	CALL($CF,vastr%,0)
	IF ERR
		RAISE ERR
	ENDIF
	RETURN ret% :REM DIALOG return code.
ENDP

PROC KeepTag%:
REM  This procedure tells a file
REM  requester just declared, not to
REM  destroy its list of tagged files.
REM  We will return the handle of that
REM  list, to use and destroy later.
	
	LOCAL fnselwn%,flgadr%,vastr%,dlgptr%
	LOCAL UADD&,UADD%,index%,idxptr%
	
	UADD&=&00CBC303
	UADD%=ADDR(UADD&)
	
	dlgptr%=PEEKW($36)
	
	REM Get index of file requester:
	idxptr%=USR(UADD%,dlgptr%,$3D,0,0)
	index%=PEEKB(idxptr%)-2
	
	REM Ask for handle of file requester:
	fnselwn%=CALL($CF,dlgptr%,21,index%)
	
	REM Get and set the flag to keep tags:
	flgadr%=USR(UADD%,fnselwn%,$20,0,0)
	POKEW flgadr%,(PEEKW(flgadr%) OR $0800)
	
	REM Get handle of the VASTR object:
	vastr%=PEEKW(USR(UADD%,fnselwn%,$1c,0,0))
	RETURN vastr%
ENDP

PROC VAstr$:(vastr%,index%)
REM  Retrieve a string from a
REM  VASTR object.
REM  (Generally useful procedure)
	
	LOCAL UADD&,len%,str%
	LOCAL txt$(255),txtLBC%,txtZTS%
	
	REM Get LBC and ZTS pointers:
	UADD&=&00CBC303 :REM Unsigned add
	txtLBC%=ADDR(txt$)
	txtZTS%=USR(ADDR(UADD&),txtLBC%,1,0,0)
	
	REM Get/check string length:
	len%=CALL($CF,vastr%,15,index%)
	IF len%<0 OR len%>255
		RAISE -112 :REM String too long
	ENDIF
	
	REM Get string data:
	str%=CALL($CF,vastr%,20,index%)
	CALL($AC,0,0,0,str%,txtZTS%)
	POKEB txtLBC%,len%
	
	RETURN txt$
ENDP

REM End of file - Tagging.opl

This code assumes some understanding of the variable array classes in
OLIB but it is pretty straightforward. If you have access to the SIBO
C SDK, this will be a lot easier to understand.

All the best
Ali


From: brendan@informatik.uni-bremen.de (Brendan W. Breede)
Subject: Re: PSION 3a Simulator
Date: Tue, 14 Jan 1997 21:29:22 GMT

In article <01bbf019$877a2bc0$357faac2@dassault> "Gregory Buscail"
<dassault@emirates.net.ae> wrote:

>Does someone know if it's possible in OPL to detect the use of the
>simulator ? If yes How

PROC ChkEmul%:
	LOCAL s%
	s%=SECOND
	CALL($0189,0,0,56) :REM sleep for 56 ticks
	s%=SECOND-s%
	IF s%<0
		s%=s%+60
	ENDIF
	RETURN s%
ENDP

OS interrupt $89, function 01 lets the system sleep for the given
number of timer-ticks (56 in this case). Since the Psion has 32 ticks
per second and the PC definately 18.2 per second, there's a certain
time difference when the process is sent to sleep for a given tick
amount.
56 ticks on a Psion gives 1.88 seconds, on a PC 3.3 secs.
I.e., if you get a value of less than 3 from ChkEmul%:, your program
runs definately on a Series 3,3a,3c,... If you get more than 2 seconds,
it _MAY_ run on a PC, since other running processes may slow down
your process. So I suggest to run ChkEmul%: up to three times again
if it results to any number larger than 2.
You may as well experiment with the number of ticks up to your needs.
___________________________________\____________________Brendan W. Breede
brendan@informatik.uni-bremen.de              \
http://www.informatik.uni-bremen.de/~brendan/  \


From: "Greg Nikoloff" <gmn@geac.co.nz>
Subject: Re: Opening files using OVAL
Date: 20 Jan 1997 06:17:25 GMT

Jason <liant@liant.demon.co.uk> wrote in article
<32E0160D.55A0@liant.demon.co.uk>...
> Hi,
> 
> I am evaluating OVAL and having a problem opening DBF database files.
> 
> It seems that an OVAL program treats files (.DBF databases) >as
> directory's.
> 
> For example if I try to open the file LOC::M:\DAT\JASON.DBF which does
> exist as a real DBF file the OVAL program complains and says..
> 
> Cannot Open File LOC::M:\DAT\JASON.DBF\
> 
> It seems to put a backslash on the end of the filename.
> 
> I have confirmed this by using CreateDatabase. When this is done a
> DIRECTORY is created and NOT a real DBF file!!!
> 
> What on earth am I doing wrong!! Is this a bug in OVAL???
> 
> Please respond to jason@liant.co.uk I am sending this main from an
> alternate mail client.
> 

Umm, no OVAL is not wrong [AFAIK], here you are obviously unfamiliar with
Visual Basic and its workings. OVAL works the same way that Visual Basic
does in this area.

When you use a 'CreateDatabase' or 'OpenDatabase' Statement for a DBASE III
or IV [and I would bet a Psion DBF] file, you need to name the DIRECTORY
where the file(s) will be found in the open database statement [this is
because in OVAL/VB it treats all the files in a directory as a single
'database' and you can open more than one '.DBF' file in the
directory/'database' at once.]

So, to open a DBF file you give the OpenDatabase statement the DIRECTORY
path where the .DBF file(s) is to be found.
e.g. set mydatabase = OpenDatabase("LOC::M:\DAT\".....)

Then you use the returned  database object [mydatabase as per above] in a
OpenTable [or CreateDynaset etc] statement to open the particular .DBF file
you want to work with.
[which you can then use the movenext, append and other methods to work
with].

And of course if theres more than one DBF file in the .DBF directory -
[Database] then you can do cross .DBF file SQL statements - something that
normally is quite useful and requires tedious programming otherwise].

I suggest that if you have any difficulties in this area that you seriously
consider learning Visual Basic [ver 3 or 4] as well. not only will this
give you a set of manuals [in paper form] to read/digest, it will also give
you a similar development platform on the PC to write programs on as well].

However, I hope this helps you make some more progress.

Regards
Greg Nikoloff
gmn@geac.co.nz
