#115571 - 2004-03-05 04:51 PM
Help, getting really confued! :-(
|
1984
Starting to like KiXtart
Registered: 2003-08-14
Posts: 150
|
Hey, can anyboy tell me why the "dell" part of the script is not working? The "comapq" and "hp" part works well, but i cannot get "dell" part to work, it just stops at the url, while it should use the $setag value and go on to next page.
$vendor = PC vendor
$setag = PC Serial no
Function Vensupp
Select
Case InStr($vendor,'dell') $url = 'http://support.euro.dell.com/uk/en/index.asp?referrer=%2Fuk%2Fen%2Fhome%2Easp&segment=BSD'+Join($setag,"+")
Case InStr($vendor,'compaq') $url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+')
Case InStr($vendor,'Hewlett-Packard') $url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+')
Case 1 $url = ''
EndSelect
If $url
Run 'cmd /c start '+$url
EndIf
EndFunction
C the
Edited by Cyrus (2004-03-05 04:53 PM)
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"
|
Top
|
|
|
|
#115573 - 2004-03-05 05:05 PM
Re: Help, getting really confued! :-(
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
double up the % and & characters...
Edited by Radimus (2004-03-05 05:06 PM)
|
Top
|
|
|
|
#115574 - 2004-03-05 05:08 PM
Re: Help, getting really confued! :-(
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
BTW... have you tried: 'https://support.dell.com/ProductSelection.aspx?SvcTag='+$serno 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+join(split($model),'+')
|
Top
|
|
|
|
#115576 - 2004-03-05 05:28 PM
Re: Help, getting really confued! :-(
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Code:
Function Vensupp($model,$setag) Select Case InStr($vendor,'dell') $url = 'http://support.euro.dell.com/uk/en/index.asp?referrer=%2Fuk%2Fen%2Fhome%2Easp&segment=BSD'+Join($setag,"+") Case InStr($vendor,'compaq') $url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+') Case InStr($vendor,'Hewlett-Packard') $url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+') Case "True" $url = '' EndSelect If $url ; Create Internet Explorer object $oIE = CreateObject("InternetExplorer.Application") $oIE.Visible=1 $oIE.Navigate($url) ; Wait for page to stop loading... While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop EndIf EndFunction
|
Top
|
|
|
|
#115578 - 2004-03-05 05:50 PM
Re: Help, getting really confued! :-(
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
double up the % and & characters... kix requires that
|
Top
|
|
|
|
#115580 - 2004-03-05 05:59 PM
Re: Help, getting really confued! :-(
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
What about doubling the "??"?
In KiX, the ? is reserved.
So, it should be -
'https://support.dell.com/ProductSelection.aspx??SvcTag='+$serno
Kent
|
Top
|
|
|
|
#115583 - 2004-03-05 09:30 PM
Re: Help, getting really confued! :-(
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
here is the IBM page...
"http://www-306.ibm.com/pc/support/site.wss/quickPath.do?quickPathEntry="+$serno
|
Top
|
|
|
|
#115585 - 2004-03-05 09:55 PM
Re: Help, getting really confued! :-(
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
you do realize that all those addl parameters are unnecessary...
this works just fine: 'http://support.euro.dell.com/uk/en/index.asp'
|
Top
|
|
|
|
#115587 - 2004-03-06 02:54 PM
Re: Help, getting really confued! :-(
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
What about doubling the "??"?
In KiX, the ? is reserved.
So, it should be -
'https://support.dell.com/ProductSelection.aspx??SvcTag='+$serno
Not quite right. Things like '@' and '$' and '%' are metacharacters which can be expanded inside strings and so need special attention. "?" is simply a keyword in the same way as "Break" or "Cls". When it is in a string it has no special meaning - at least not to KiXtart.
|
Top
|
|
|
|
#115588 - 2004-03-06 03:00 PM
Re: Help, getting really confued! :-(
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Thanx, but its not working :-( gives me "invalid method/function call: missing required parameter 1"
Apologies, I tidied up the function definition and I assumed that you would spot it.
Functions should be "black boxes". There are only two good reasons for using global variables in a function, and you are unlikely to come across them soon.
Therefore, to call the function, pass the parameters: Code:
$sResult=Vensupp($model,$setag)
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|