For Programmers: Free Programming Magazines  


Home > Archive > Clarion > September 2006 > Problem with STATUS function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with STATUS function
Francisco

2006-09-10, 6:55 pm

I need use de STATUS function to test if a PDF file is open.
I red the Clarion 6.3 Build 9053 Help:
"The STATUS procedure returns zero (0) if the file is not open, and the
file's access mode if it is open."

But when I use it, appears the following message:
"Syntax error: No matching prototype available"

Where is my error and how do I correct it?

Any help is appreciated.

Francisco

Olivier Cretey

2006-09-11, 6:55 pm

Francisco,


Extract from the online help:

STATUS(| file |)
| window |

STATUS Returns the passed file, window or report status.

File: The label of a FILE statement.
Window: The label of a WINDOW, APPLICATION, or REPORT structure, or
valid built-in variables TARGET, PRINTER, or SYSTEM.

This means that, in order to test a pdf file, you have to declare a FILE
structure pointing to the pdf filename.

Something like that:

! data
MyPdfFile FILE, DRIVER('DOS')
Rec RECORD
Buff String(1024)
END
END

! Later in your code
! you assign the physical name of you file
! to the dos file structure declared as above
MyPdfFile{Prop:Name} = 'MypdfFileName.pdf'

! test if opened
IF STATUS(MyPdfFile)
Message(MyPdfFile{Prop:Name} & ' Status : Opened')
ELSE
Message(MyPdfFile{Prop:Name} & ' Status : Closed')
END

Or you could try to open() your file (no create attribute in the file
declaration !) and test the resulting ErrorCode()
! another way to test if opened
OPEN(MyPdfFile)
IF ERRORCODE() = 52 ! File Already Open
END

Regards

--
Olivier Cretey
o.cretey@cia-informatique.com
www.cia-informatique.com
Verneuil sur Seine (78), France


Francisco

2006-09-11, 6:55 pm


Olivier Cretey ha escrito:

> Francisco,
>
>
> Extract from the online help:
>
> ...............
>
> Regards
>
> --
> Olivier Cretey
> o.cretey@cia-informatique.com
> www.cia-informatique.com
> Verneuil sur Seine (78), France


Thanks for the answer.
Francisco

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com