Re: CASE issue...
- From: Grand_Poobah <iss_boss.delete@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Aug 2007 22:14:43 -0400
--->
Here is my code, I try to run a case select function, but it keeps coming back blank.... any help would be greatly appreciated:
On Error Resume Next
Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
Set objShell=CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strCommandLine = "pspecs " & strONum
strView = "c:\view\"
objExplorer.Navigate "file:///C:\Scripts\dropdown.htm" objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 250
objExplorer.Height = 175 objExplorer.Visible = 1
Do While (objExplorer.Document.Body.All.OKClicked.Value = "")
Wscript.Sleep 250
Loop
strType = objExplorer.Document.Body.All.OKClicked.Value
strONum = objExplorer.Document.Body.All.fldOrderNum.Value
objExplorer.Quit
Wscript.Sleep 250
If strType = "Cancelled" Then
Wscript.Quit
End If
If strONum = NULL Then
wscript.echo "Order number required"
Wscript.Quit
End If
' =====================================================================
' Locates file and copies it over
' =====================================================================
objShell.Run strCommandLine, 1, true
if strType = "Production" then
strCopy = "c:\view\" & strONum & ".rel"
strK = "k:\prod\" & strONum & ".rel" strO = "o:\prod\" & strONum & ".rel" strcamb = "s:\cambak\prod\" & strONum & ".rel" strHold = "k:\hold\prod\" & strONum & ".rel" strProd = "o:\prod\" & intProd(strONum) & "\" & strONum & ".rel"
wscript.echo strProd
if objFSO.FileExists(strK) Then
wscript.echo "Found in the K"
objFSO.CopyFile strK, strCopy, true
elseif objFSO.FileExists(strO) then
wscript.echo "Found in the O"
objFSO.CopyFile strO, strCopy, true
elseif objFSO.FileExists(strcamb) then
wscript.echo "Found in the CAMBAK"
objFSO.CopyFile strcamb, strCopy, true
elseif objFSO.FileExists(strHold) then
wscript.echo "Found in the Hold"
objFSO.CopyFile strHold, strCopy, true
elseif objFSO.FileExists(strProd) then
wscript.echo "Found in the " & intProd(strONum)
objFSO.CopyFile strProd, strCopy, true
else
wscript.echo "File not found"
End if
strProd = "o:\prod\" & strTotal & ".rel"
else
strCopy = strview & "P" & strONum & ".rel"
strproto = "S:\MODEM\REL\P" & strONum & ".rel"
objFSO.CopyFile strProto, strCopy, true
wscript.echo "File Copied"
end if
' =====================================================================
' End
' =====================================================================
Function intProd(ByVal intChar)
Select Case intChar
Case intChar > 0 and intChar <= 5000
intProd = "01k-5k"
Case intChar > 5001 and intChar <= 10000
intProd = "05k-10k"
Case intChar > 10001 and intChar <= 15000
intProd = "10k-15k"
Case intChar > 15001 and intChar <= 20000
intProd = "15k-20k"
Case intChar > 20001 and intChar <= 25000
intProd = "20K-25k"
Case intChar > 25001 and intChar <= 30000
intProd = "25k-30k"
Case intChar > 30001 and intChar <= 35000
intProd = "30k-35k"
Case intChar > 35001 and intChar <= 40000
intProd = "35k-40k"
Case intChar > 40001 and intChar <= 45000
intProd = "40k-45k"
Case intChar > 45001 and intChar <= 50000
intProd = "45k-50k"
Case intChar > 50001 and intChar <= 55000
intProd = "50k-55k"
Case intChar > 55001 and intChar <= 60000
intProd = "55k-60k"
Case intChar > 60001 and intChar <= 65000
intProd = "60k-65k"
Case intChar > 65001 and intChar <= 70000
intProd = "65k-70k"
Case intChar > 70001 and intChar <= 75000
intProd = "70k-75k"
Case intChar > 75001 and intChar <= 80000
intProd = "75k-80k"
Case intChar > 80001 and intChar <= 85000
intProd = "80k-85k"
Case intChar > 85001 and intChar <= 90000
intProd = "85k-90k"
Case intChar > 90001 and intChar <= 95000
intProd = "90k-95k"
Case intChar > 95001 and intChar <= 100000
intProd = "95k-100k"
Case Else
intProd = "100K"
End Select
End Function
Shouldn't the Function be declared like this?
Function intProd(ByVal intChar) AS STRING
GP
.
- References:
- CASE issue...
- From: bpaul833
- CASE issue...
- Prev by Date: Re: Detect installed version number of active x control
- Next by Date: Re: Set statement WMI null / empty? error checking on object?
- Previous by thread: CASE issue...
- Next by thread: Re: CASE issue...
- Index(es):
Relevant Pages
|