FINDFILE Example


Example 1:

 

FileName

DIM

100

 

Size

FORM

7

 

Write

DIM

14

 

Name

DIM

100

 

AltName

DIM

100

 

Path

DIM

100

 

AltPath

DIM

100

 

Attrib

FORM

4

 

Reply

DIM

1

 

*.........................................................................

.

.Select a File

.

 

 

 

 

GETFNAME

OPEN,"Select a file",Name,Path,"*"

 

IF

NOT OVER

 

 

PACK

FileName WITH Name,Path

 

*

 

 

 

.Retrieve the info

.

 

 

 

FINDFILE

FileName,Filesize=Size,Write=Write:

 

 

Name=Name,AltName=AltName,Attributes=Attrib:

 

 

 

Path=Path,AltPath=AltPath

 

*

 

 

 

.Display the info

.

 

 

 

 

Display

*N,"FileName: ",FileName:

 

 

 

*N,"Name: ",Name,*N,"Path: ",Path:

 

 

 

*N,"Alternate Name: ",ALTNAME:

 

 

 

*N,"Alternate Path: ",ALTPATH:

 

 

 

*N,"Size: ",Size:

 

 

 

*N,"Attributes: ",Attrib:

 

 

 

*N,"Write: ",Write

 

.

 

 

 

 

KEYIN

*N,REPLY

 

 

ENDIF

 

 

 

This example program allows selection of a file by the user. The FINDFILE instruction is then used to retrieve file information which is then displayed on the screen.

 



PL/B Language Reference