Hi Everybody.

I need some ideas how to get the unique number in the range 1-9999 for my
application. It has to be absolutely uniq for any instance of my application.
What I am doing is I try to create on my server file name with certain
prefix and
four digit number and try to see if I can open it exclusively. If I can then
it's uniq.
I am using Fcreate(MyFileName). The problem that I have is FCREATE function
works very slow when it cannot create file. Does anyone know how to bypass
FCREATE() to check for exclusive excess or may have any other ideas to my
problem?

Thanks in advance

Leon

Re: Uniq Number by Edhy

Edhy
Thu Oct 21 19:27:05 CDT 2004

Take a look at FileToSTR()

--
Edhy Rijo
Programming System Solutions www.progytech.com
Bronx NY


"Leon" <Leon@discussions.microsoft.com> wrote in message
news:CD2C77BB-D28F-42F2-AB2B-AA46BCC8286E@microsoft.com...
> Hi Everybody.
>
> I need some ideas how to get the unique number in the range 1-9999 for my
> application. It has to be absolutely uniq for any instance of my
> application.
> What I am doing is I try to create on my server file name with certain
> prefix and
> four digit number and try to see if I can open it exclusively. If I can
> then
> it's uniq.
> I am using Fcreate(MyFileName). The problem that I have is FCREATE
> function
> works very slow when it cannot create file. Does anyone know how to bypass
> FCREATE() to check for exclusive excess or may have any other ideas to my
> problem?
>
> Thanks in advance
>
> Leon



Re: Uniq Number by tom

tom
Fri Oct 22 03:31:29 CDT 2004

Hi Leon,

why not use a small table with 9999 records containing 1-9999 and check with
rlock() ?
Greetings
tom


"Leon" <Leon@discussions.microsoft.com> schrieb im Newsbeitrag
news:CD2C77BB-D28F-42F2-AB2B-AA46BCC8286E@microsoft.com...
> Hi Everybody.
>
> I need some ideas how to get the unique number in the range 1-9999 for my
> application. It has to be absolutely uniq for any instance of my
application.
> What I am doing is I try to create on my server file name with certain
> prefix and
> four digit number and try to see if I can open it exclusively. If I can
then
> it's uniq.
> I am using Fcreate(MyFileName). The problem that I have is FCREATE
function
> works very slow when it cannot create file. Does anyone know how to bypass
> FCREATE() to check for exclusive excess or may have any other ideas to my
> problem?
>
> Thanks in advance
>
> Leon



Re: Uniq Number by Olaf

Olaf
Fri Oct 22 04:20:02 CDT 2004

Why not first see if the file is already there with
FOPEN(), ADIR() or FILE() ?

ADIR() with a file mask of "????name.txt"
would give you the files that are already there...

Bye, Olaf.