|
That's what i used in a little app to add an entry (i'm doing the rest with Net.Data) and i'm pretty satisfied with it. I just multiply two randoms and store user-id and ip-addr. This can be used for a re-start of the application, too. H *------------------------------------------------------------------------- FWEBSTATE UF A E K DISK *------------------------------------------------------------------------- D p_User S 10 VARYING D p_IPADDR S 15 VARYING D p_StateId S 10P 0 *------------------------------------------------------------------------- D rand PR 10U 0 EXTPROC('rand') D srand PR EXTPROC('srand') D Basis 10U 0 *------------------------------------------------------------------------- D h_base S 10U 0 INZ(0) D h_random S 10U 0 *------------------------------------------------------------------------- C *ENTRY PLIST C PARM p_StateId * C DOU *IN99 = *ON <-+ C EVAL h_random = rand * rand ! C EVAL WS_STATEID = h_random ! C WS_STATEID CHAIN(N) WEBSTATE 99 ! C ENDDO <-+ * C EVAL p_StateId = h_random * C RESET WEBSTATER C EVAL WS_STATEID = h_random C EVAL WS_User = p_User C EVAL WS_IPADDR = p_IPADDR C TIME WS_CTIMSTP C WRITE WEBSTATER * C RETURN *------------------------------------------------------------------------- * * * *------------------------------------------------------------------------- C *INZSR BEGSR * eine Basis für die Pseudo-Zufallszahlen festlegen C TIME h_Dec12 12 0 C EVAL h_base = h_Dec12 / 100 C EVAL h_random = h_base C CALLP srand(h_base) C ENDSR *------------------------------------------------------------------------- 0.02 Euro best regards, Anton Gombkötö
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.