How about:
OPEN 'TESTFILE' ELSE STOP
CLEARFILE
FOR X=1 TO 20000
id =
SYSTEM(21):'_':DATE():'_':TIME():'_':SYSTEM(9):'_':RND(32000):'_':RND(16000)
WRITE '' ON id
NEXT X
While this is by no means scientifically fool proof, it did produce 20,000
unique keys.
I'm sure our American Idle will fire me again for this ;-)
Dan
On Wed, Apr 8, 2009 at 8:43 PM, Ken Brown <[email protected]> wrote:
>
> We are using jbase 3.4 but will upgrade soon.
>
> I would like to create a unique record id for a heavily used file
> without the need to read a number off a stack, lock it and increment
> it before writing away.
>
> I was thinking of using PORT_DATE()_TIME() but as the user may write
> to this file many times within a routine TIME() SYSTEM(12) or SYSTEM
> (1007) do not carry sufficient precision.
>
> I tested this by :-
>
> FOR X=1 TO 500
> CRT PORT:" ":DATE():" ":TIME():" ":SYSTEM(9):" ":SYSTEM(12):" ":SYSTEM
> (1007):" ":SYSTEM(2001)
> NEXT X
>
>
> Any ideas?
>
> Also, what does SYSTEM(2001) carry?
>
> Ken Brown
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
Please read the posting guidelines at:
http://groups.google.com/group/jBASE/web/Posting%20Guidelines
IMPORTANT: Type T24: at the start of the subject line for questions specific to
Globus/T24
To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
-~----------~----~----~----~------~----~------~--~---