bmallett
10-22-2007, 04:58 PM
As you can see from this code, I am rough at the least with VBS. I hope this is the forum to put this in, I didn't see another more suiting.
Please look at the following…
Everything works fine, what I need though is a way to insert a line between a and b as shown commented out, (j), from which what number is entered as “j” will run the rest of “b” down for each (j). I hope this makes sense.
Basically a function from within a function driven by a variable within the first… I know…confusing. Any help would be greatly appreciated.
<script language="vbs">
function c1(x, a, b, c, d, e, f, g, h)
a = InputBox("Please enter the style number of the mat for mat number " & x & ".", "Mat " & x & " Style Number", "STYLE")
‘ NEW LINE HERE
‘ j = InputBox(“Please enter the number of cutouts for mat number” & x & “.”, “Mat “ & x & “ Cutouts”, “Enter Cutout Number Here”)
b = InputBox("Please select the cutout shape for mat number " & x & ".", "Mat " & x & " Cutout Shape", "(1)Rectangle/Square - (2)Round - (3)Oval - (4)Other")
Select Case b
Case 1
c = InputBox("Please enter the size of side 1.", "Rectangle/Square - Side 1", "Example - 1 or 1-1/2")
d = InputBox("Please enter the size of side 2.", "Rectangle/Square - Side 2", "Example - 1 or 1-1/2")
Case 2
e = InputBox("Please enter the radius of cutout 1.", "Round - Radius", "Example - 1 or 1-1/2")
Case 3
f = InputBox("Please enter the first radius of cutout 1.", "Oval - Radius 1", "Example - 1 or 1-1/2")
g = InputBox("Please enter the second radius of cutout 1.", "Oval - Radius 2", "Example - 1 or 1-1/2")
Case 4
h = InputBox("Please enter the manually calculated area for cutout 1.", "Other - Area", "Example - 1 or 1-1/2")
Case Else
MsgBox "You have selected an invalid option. Please reselect.",48,"Invalid Option for Cutout Shape"
call c1(x, a, b, c, d, e, f, g, h)
end Select
end function
ID1 = InputBox("Please enter the ID of side 1 for the frame you are building.", "Frame ID Side 1", "Example - 10 or 10-1/2")
ID2 = InputBox("Please enter the ID of side 2 for the frame you are building.", "Frame ID Side 2", "Example - 10 or 10-1/2")
OD1 = InputBox("Please enter the OD of side 1 for the frame you are building. You entered " & ID1 & "IN for ID", "Frame OD Side 1", "Example - 10 or 10-1/2")
OD2 = InputBox("Please enter the OD of side 2 for the frame you are building. You entered " & ID2 & "IN for ID", "Frame OD Side 2", "Example - 10 or 10-1/2")
matnumber = InputBox("Please enter the number of mats used in the frame you are building.", "Frame Mat Number")
Select Case matnumber
Case 0
Case 1
call c1(1, ms1, cs1, sq11, sq12, c1r, o1r1, o1r2, m1)
Case 2
call c1(1, ms1, cs1, sq11, sq12, c1r, o1r1, o1r2, m1)
call c1(2, ms2, cs2, sq21, sq22, c2r, o2r1, o2r2, m2)
end Select
</script>
Please look at the following…
Everything works fine, what I need though is a way to insert a line between a and b as shown commented out, (j), from which what number is entered as “j” will run the rest of “b” down for each (j). I hope this makes sense.
Basically a function from within a function driven by a variable within the first… I know…confusing. Any help would be greatly appreciated.
<script language="vbs">
function c1(x, a, b, c, d, e, f, g, h)
a = InputBox("Please enter the style number of the mat for mat number " & x & ".", "Mat " & x & " Style Number", "STYLE")
‘ NEW LINE HERE
‘ j = InputBox(“Please enter the number of cutouts for mat number” & x & “.”, “Mat “ & x & “ Cutouts”, “Enter Cutout Number Here”)
b = InputBox("Please select the cutout shape for mat number " & x & ".", "Mat " & x & " Cutout Shape", "(1)Rectangle/Square - (2)Round - (3)Oval - (4)Other")
Select Case b
Case 1
c = InputBox("Please enter the size of side 1.", "Rectangle/Square - Side 1", "Example - 1 or 1-1/2")
d = InputBox("Please enter the size of side 2.", "Rectangle/Square - Side 2", "Example - 1 or 1-1/2")
Case 2
e = InputBox("Please enter the radius of cutout 1.", "Round - Radius", "Example - 1 or 1-1/2")
Case 3
f = InputBox("Please enter the first radius of cutout 1.", "Oval - Radius 1", "Example - 1 or 1-1/2")
g = InputBox("Please enter the second radius of cutout 1.", "Oval - Radius 2", "Example - 1 or 1-1/2")
Case 4
h = InputBox("Please enter the manually calculated area for cutout 1.", "Other - Area", "Example - 1 or 1-1/2")
Case Else
MsgBox "You have selected an invalid option. Please reselect.",48,"Invalid Option for Cutout Shape"
call c1(x, a, b, c, d, e, f, g, h)
end Select
end function
ID1 = InputBox("Please enter the ID of side 1 for the frame you are building.", "Frame ID Side 1", "Example - 10 or 10-1/2")
ID2 = InputBox("Please enter the ID of side 2 for the frame you are building.", "Frame ID Side 2", "Example - 10 or 10-1/2")
OD1 = InputBox("Please enter the OD of side 1 for the frame you are building. You entered " & ID1 & "IN for ID", "Frame OD Side 1", "Example - 10 or 10-1/2")
OD2 = InputBox("Please enter the OD of side 2 for the frame you are building. You entered " & ID2 & "IN for ID", "Frame OD Side 2", "Example - 10 or 10-1/2")
matnumber = InputBox("Please enter the number of mats used in the frame you are building.", "Frame Mat Number")
Select Case matnumber
Case 0
Case 1
call c1(1, ms1, cs1, sq11, sq12, c1r, o1r1, o1r2, m1)
Case 2
call c1(1, ms1, cs1, sq11, sq12, c1r, o1r1, o1r2, m1)
call c1(2, ms2, cs2, sq21, sq22, c2r, o2r1, o2r2, m2)
end Select
</script>