#129914 - 2004-11-19 04:45 PM
Re: Split???
|
Anonymous
Anonymous
Unregistered
|
ok, i can get it to work using: $check=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings","MinorVersion") $array=Split($check,';')[2] for each $element in $array $element ? next If $array=("Q811383") "YES IT WORKS" else "IT DON'T WORK" ENDIF ---------- BUT, like i said the "Q811383" might not be the [2] on all the PC's. Anyway i can get it to search through all substrings?
getting warmer 
|
|
Top
|
|
|
|
#129915 - 2004-11-19 04:48 PM
Re: Split???
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
you are half way there... use split() and ascan() toghther!
Code:
if ascan(split($check,";"),"Q811383")+1 ;yes it works else ;no... endif
also... you could just instr()
Code:
if instr($check,"Q811383") ;yes.... else ;no... endif
Bryce
|
|
Top
|
|
|
|
#129916 - 2004-11-19 04:52 PM
Re: Split???
|
otf
Getting the hang of it
Registered: 2003-11-21
Posts: 53
Loc: Scotland
|
did i tell you i luv ya cheers boss, you da man! horraaa
|
|
Top
|
|
|
|
#129918 - 2004-11-19 10:35 PM
Re: Split???
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I think that INSTR() would be a better choice and more efficient to see if a string was contained within a larger string.
Edited by Howard Bullock (2004-11-20 05:57 AM)
|
|
Top
|
|
|
|
#129920 - 2004-11-22 10:44 AM
Re: Split???
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Code:
if instr($check,"Q811383;")
will prevent potential false-positives.
Better would be: Code:
if instr(";"+$check+";",";Q811383;")
|
|
Top
|
|
|
|
#129924 - 2004-11-22 12:54 PM
Re: Split???
|
otf
Getting the hang of it
Registered: 2003-11-21
Posts: 53
Loc: Scotland
|
well, as usual you guys demonstrate how it's really done. i thank y'all for your help (even if it reminds me how poor my logic is )
|
|
Top
|
|
|
|
#129926 - 2004-11-22 01:21 PM
Re: Split???
|
otf
Getting the hang of it
Registered: 2003-11-21
Posts: 53
Loc: Scotland
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1046 anonymous users online.
|
|
|