Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variables won't pass into code

Status
Not open for further replies.

ladybugz46

Technical User
Sep 26, 2002
7
0
0
US
I am admittedly new and I apologize for that. I have the following script and am trying to pick up variables that are in the page and feed into the script after reading the array. Fairly simple. Need to read the data from the array into the page. Script will read the array but won't pass the sku and origprice into the array. I am open to ideas and any help from all of you folks...suez



Dim outletPrice(10,2)
outletPrice(0,0) = "515304GS"
outletPrice(0,1) = "We Once Sold This For:"
outletPrice(0,2) = .50
outletPrice(1,0) = "513864JW"
outletPrice(1,1) = "Blown Away Before At:"
outletPrice(1,2) = .50
outletPrice(2,0) = "514471JW"
outletPrice(2,1) = "Originally:"
outletPrice(2,2) = .50
outletPrice(3,0) = "51FJ1483"
outletPrice(3,1) = "Suggested Price:"
outletPrice(3,2) = .50
outletPrice(4,0) = "51FJ1486"
outletPrice(4,1) = "Originally:"
outletPrice(4,2) = .50
outletPrice(5,0) = "51FJ1484"
outletPrice(5,1) = "Retail Price:"
outletPrice(5,2) = .50
outletPrice(6,0) = "513855JW"
outletPrice(6,1) = "Previously Priced at:"
outletPrice(6,2) = .50
outletPrice(7,0) = "513713JW"
outletPrice(7,1) = "Sold Before At:"
outletPrice(7,2) = .50
outletPrice(8,0) = "51FJ1477"
outletPrice(8,1) = "Originally:"
outletPrice(8,2) = .50
outletPrice(9,0) = "51FJ1476"
outletPrice(9,1) = "Retail Price:"
outletPrice(9,2) = .5
outletPrice(10,0) = "51FJ1475"
outletPrice(10,1) = "Previously Priced at:"
outletPrice(10,2) = .50


Dim sku
sku = "51FJ1476"
Dim origPrice
origPrice = "MpbPrice"

For i = LBound(outletPrice) to UBound(outletPrice)
if outletPrice(i,0) = "sku" Then
response.write(&quot;<b>Save Over</b>   &quot; & FormatPercent(outletPrice(i, 2)) & &quot;<br>&quot;)
response.write(outletPrice(i, 1) & origPrice & &quot;<BR>&quot;)
response.write(&quot;Now Only:    &quot; & FormatCurrency((origPrice)*(outletPrice(i, 2))) & &quot;<BR>&quot;)

Else
end if
next



Thanks!!!!!
 
Hi!! Progress at last and I do appreciate your help.

I have corrected the quotes and a couple of other things and the script is now as follows (same array):

Dim sku
sku = itmno 'with fixed variable (51FJ1475) script works
Dim origPrice
origPrice = itmpri

For i = LBound(outletPrice) to UBound(outletPrice)
if outletPrice(i,0) = sku Then
response.write(&quot;<b>Save Over</b>   &quot; & FormatPercent(outletPrice(i, 2)) & &quot;<br>&quot;)
response.write(outletPrice(i, 1) & FormatCurrency(origPrice) & &quot;<BR>&quot;)
response.write(&quot;Now Only:    &quot; & FormatCurrency((origPrice)*(outletPrice(i, 2))) & &quot;<BR>&quot;)

Else
end if
next


With 51FJ1475 as a fixed variable, the script read the following:

Save Over 50.00%
Previously Priced at:$6.19
Now Only: $3.10

That is the correct wording for the fixed variable, the correct prices for the item page I drew up (not the 51FJ1475 item. So it is pulling price right.


When I put back sku into the Dim statement (as above) to try and pick up the sku from the page, the script quits working all together.

Any ideas are appreciated, Thanks, Suez







 
Just a quick note: the script I am trying to pull these variables from is the following:

Dim itmav1
dim mcount

itmedp = trim(trans01.GetValue(&quot;ItemEdp&quot;,0))
imgovr = trim(trans01.GetValue(&quot;ItmImageOvrd&quot;,0))
itmdes = (trans01.GetValue(&quot;ItemDescription&quot;,0))
itmno = (trans01.GetValue(&quot;ItemNo&quot;,0))
itmpri = (trans01.GetValue(&quot;ItemPrice&quot;,0))
regpri = (trans01.GetValue(&quot;ItmMastPrice&quot;,0))
itminv = trim(trans01.GetValue(&quot;ItmAvailableInv&quot;,0))
'---CHECK FOR IMAGE AND DISPLAY IT
if itminv > &quot;0&quot; then itmavl = &quot;IN STOCK&quot; else itmavl = &quot;<a href=javascript:popUp2('nostock.htm')>OUT OF STOCK - click for details</a>&quot;

if len(trim(imgovr)) = 0 then
imgovr = itmedp
end if

thePath = &quot;images\&quot; & imgovr & &quot;B.jpg&quot;

Set fs=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
If (fs.FileExists(Server.Mappath(thePath)))=false Then
thePic = &quot;images\defaultB.jpg&quot;
else
thePic = &quot;images\&quot; & imgovr & &quot;B.jpg&quot;
end if
Set fs=nothing



the above does exist on the same page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top