#75786 - 2003-07-15 11:33 AM
Re: Reading from INI file at same time
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
As a simpler and more flexible mechanism, use a modulo hash. You can do it on just the first character if you want: quote: $sFileName="Badge_"+(Asc(LCase($sLogin)) mod 3)+".ini"
Using the names from your example gives: quote: BUGAYORC=Badge_2.ini CHURCHMX=Badge_0.ini DELACRJV=Badge_1.ini
If you want to spread across more files, just change the modulo number from 3 to the number of files you require.
If you don't get a decent spread - perhaps many logins use the same first letter - sum the ASCII values of the login and apply the modulo to that instead.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|