Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

paulojr

Problema com HLOOPER

Recommended Posts

Olá galera, to precisando de uma ajudinha de vcs, estou tentando usar o HLOOPER 2 e esta dando o seguinte erro. :( :(

Tipo de erro:Erro de compilação do Microsoft VBScript (0x800A0411)Redefinição do nome/projeto/index.asp, line 61, column 4Dim HLooper1__numRows---^

Alguem ja teve este tipo de problema ??? :huh: existe alguma solução ?? :wacko: eu eu estou fazendo alguma coisa errada ? http://forum.imasters.com.br/public/style_emoticons/default/blush.gif Valew !

Compartilhar este post


Link para o post
Compartilhar em outros sites

o que ta acontecendo é que issoDim HLooper1__numRowsé uma declaração de variavele ta dizendo que ela já foi declarada antes e ali ta sendo redefinida...o que não pode em ASP...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salve marioufpa...

 

Cara em relação a variavel eu ja sabia que nao podia ser repetida a declaração, o problema é que nao tem outra variavel com o mesmo nome.

 

eu to usando sim o repeat region mas do DW e o nome da varialvel é outro.

 

o codigo da pagina é o seguinte:

 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!--#include file="Connections/loja.asp" -->

<%

Dim resultprods__MMColParam

resultprods__MMColParam = "1"

If (Request.Form("palavra") <> "") Then

  resultprods__MMColParam = Request.Form("palavra")

End If

%>

<%

Dim resultprods

Dim resultprods_numRows

 

Set resultprods = Server.CreateObject("ADODB.Recordset")

resultprods.ActiveConnection = MM_loja_STRING

resultprods.Source = "SELECT * FROM produtos WHERE produto LIKE '%" + Replace(resultprods__MMColParam, "'", "''") + "%'"

resultprods.CursorType = 0

resultprods.CursorLocation = 2

resultprods.LockType = 1

resultprods.Open()

 

resultprods_numRows = 0

%>

<%

Dim destaque__MMColParam

destaque__MMColParam = "d"

If (Request("MM_EmptyValue") <> "") Then

  destaque__MMColParam = Request("MM_EmptyValue")

End If

%>

<%

Dim destaque

Dim destaque_numRows

 

Set destaque = Server.CreateObject("ADODB.Recordset")

destaque.ActiveConnection = MM_loja_STRING

destaque.Source = "SELECT * FROM noticias WHERE destacar LIKE '%" + Replace(destaque__MMColParam, "'", "''") + "%' ORDER BY data DESC"

destaque.CursorType = 0

destaque.CursorLocation = 2

destaque.LockType = 1

destaque.Open()

 

destaque_numRows = 0

%>

<%

Dim HLooper1__numRows

HLooper1__numRows = -2

Dim HLooper1__index

HLooper1__index = 0

resultprods_numRows = resultprods_numRows + HLooper1__numRows

%>

<%

Dim Repeat1__numRows

Dim Repeat1__index

 

Repeat1__numRows = -1

Repeat1__index = 0

destaque_numRows = destaque_numRows + Repeat1__numRows

%>

 

<%

Dim HLooper1__numRows

HLooper1__numRows = -3

Dim HLooper1__index

HLooper1__index = 0

resultprods_numRows = resultprods_numRows + HLooper1__numRows

%>

 

<%

Dim MM_paramName

%>

<%

' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

 

Dim MM_keepNone

Dim MM_keepURL

Dim MM_keepForm

Dim MM_keepBoth

 

Dim MM_removeList

Dim MM_item

Dim MM_nextItem

 

' create the list of parameters which should not be maintained

MM_removeList = "&index="

If (MM_paramName <> "") Then

  MM_removeList = MM_removeList & "&" & MM_paramName & "="

End If

 

MM_keepURL=""

MM_keepForm=""

MM_keepBoth=""

MM_keepNone=""

 

' add the URL parameters to the MM_keepURL string

For Each MM_item In Request.QueryString

  MM_nextItem = "&" & MM_item & "="

  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then

    MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))

  End If

Next

 

' add the Form variables to the MM_keepForm string

For Each MM_item In Request.Form

  MM_nextItem = "&" & MM_item & "="

  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then

    MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))

  End If

Next

 

' create the Form + URL string and remove the intial '&' from each of the strings

MM_keepBoth = MM_keepURL & MM_keepForm

If (MM_keepBoth <> "") Then

  MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)

End If

If (MM_keepURL <> "")  Then

  MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)

End If

If (MM_keepForm <> "") Then

  MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

End If

 

' a utility function used for adding additional parameters to these strings

Function MM_joinChar(firstItem)

  If (firstItem <> "") Then

    MM_joinChar = "&"

  Else

    MM_joinChar = ""

  End If

End Function

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<%

function arrumaEnter(parametro)

  texto = replace(parametro,chr(13),"<br>")

  arrumaEnter = texto

end function

%>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Untitled Document</title>

<style type="text/css">

<!--

body {

margin-left: 0px;

margin-top: 0px;

margin-right: 0px;

margin-bottom: 0px;

}

.style1 {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 9px;

}

#noticias {

border-top: 1px solid #AEADAD;

border-right: 1px solid #AEADAD;

border-bottom: 1px solid #AEADAD;

border-left: 0px #AEADAD;

text-decoration: none;

height: 100%;

}

.style4 { font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 10px;

text-decoration: none;

color: #000000;

}

.style15 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; text-decoration: none; color: #000000; font-weight: bold; }

.style16 {color: #FF0000}

.backtitu {

background-attachment: fixed;

background-image: url(PROJETO%20PORTAL/images/back_title.gif);

background-repeat: no-repeat;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #993300;

font-weight: bold;

}

.style20 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none; color: #FF0000; font-weight: bold; }

-->

</style>

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_validateForm() { //v4.0

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);

    if (val) { nm=val.name; if ((val=val.value)!="") {

      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

      } else if (test!='R') { num = parseFloat(val);

        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

          min=test.substring(8,p); max=test.substring(p+1);

          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

    } } } else if (test.charAt(0) == 'R') errors += 'Digite uma palavra para efetuar a busca.\n'; }

  } if (errors) alert('Erros Encontrados:\n'+errors);

  document.MM_returnValue = (errors == '');

}

//-->

</script>

</head>

 

<body>

<table width="944" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr align="left" valign="top">

    <td width="21" rowspan="4" background="PROJETO PORTAL/images/layout-portal_01.gif"><img src="PROJETO%20PORTAL/images/layout-portal_01.gif" width="21" height="19"></td>

    <td height="131" colspan="4"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="909" height="131">

      <param name="movie" value="PROJETO%20PORTAL/top.swf">

      <param name=quality value=high><param name="LOOP" value="false"><param name="PLAY" value="false">

      <param name="Autoplay" value="false">

      <embed src="PROJETO%20PORTAL/top.swf" width="909" height="131" loop="false" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" play="false" autoplay="false"></embed>

    </object></td>

    <td width="21" rowspan="4" background="PROJETO PORTAL/images/layout-portal_03.gif"><img src="PROJETO%20PORTAL/images/layout-portal_03.gif" width="21" height="19"></td>

  </tr>

  <tr>

    <td width="25" rowspan="3" align="left" valign="top" background="PROJETO PORTAL/images/layout-portal_06.gif"><img src="PROJETO%20PORTAL/images/layout-portal_06.gif" width="25" height="23"></td>

    <td width="197" height="24" align="left" valign="top"><img src="PROJETO%20PORTAL/images/layout-portal01_07.gif" width="197" height="23"></td>

    <td width="663" align="left" valign="top"> </td>

    <td width="25" rowspan="3" align="left" valign="top" background="PROJETO PORTAL/images/layout-portal_09.gif"><img src="PROJETO%20PORTAL/images/layout-portal_09.gif" width="25" height="23"></td>

  </tr>

  <tr>

  <td height="100" colspan="2" align="left" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

      <tr>

        <td width="198" height="100%" align="left" valign="top"><table width="197" height="200%" border="0" cellpadding="0" cellspacing="0" id="noticias">

          <tr>

            <td width="196" height="23" align="right" valign="top" bgcolor="#E2E1E1"><div align="left"><img src="PROJETO%20PORTAL/images/layout-portal01_11.gif" width="196" height="23"></div></td>

          </tr>

          <tr>

            <td height="200%" align="left" valign="top" bgcolor="#E2E1E1"><table width="91%" border="0" align="center" cellpadding="0" cellspacing="0">

              <tr>

                <td height="62"><p>

                    <%

While ((Repeat1__numRows <> 0) AND (NOT destaque.EOF))

%>

                    <strong> <br>

                    <img src="PROJETO%20PORTAL/images/redbox.gif" width="3" height="3"> </strong><span class="style4"><%=(destaque.Fields.Item("resumo").Value)%></span><strong><br>

                    <A HREF="detalhes_noticias.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "cod_noticia=" & destaque.Fields.Item("cod_noticia").Value %>"><span class="style4">Leia mais</span><img src="Imagens/lupa1.gif" width="18" height="18" border="0"></A><br>

                    </strong> <img src="PROJETO%20PORTAL/images/linha.png" width="180" height="2">

                    <%

  Repeat1__index=Repeat1__index+1

  Repeat1__numRows=Repeat1__numRows-1

  destaque.MoveNext()

Wend

%>

                      </td>

              </tr>

            </table></td>

          </tr>

        </table></td>

        <td width="11"> </td>

        <td width="642" align="left" valign="top"><table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">

          <tr>

            <td height="35" valign="middle"><form action="result_prods.asp" method="post" name="formulario" id="formulario">

              <div align="right" class="style15">Buscar produto:

                  <input name="palavra" type="text" id="palavra" size="15">

                  <input name="Submit" type="submit" onClick="MM_validateForm('palavra','','R');return document.MM_returnValue" value="Buscar">

                  </div>

            </form></td>

          </tr>

          <tr>

            <td height="19"> </td>

          </tr>

          <tr>

            <td height="29" class="backtitu"><div align="center">RESULTADO DA BUSCA</div></td>

          </tr>

          <tr>

            <td height="19"> </td>

          </tr>

          <tr>

            <td height="29"><% If Not resultprods.EOF Or Not resultprods.BOF Then %>

                  <table width="100%">

                    <%

startrw = 0

endrw = HLooper1__index

numberColumns = 3

numrows = -1

while((numrows <> 0) AND (Not resultprods.EOF))

startrw = endrw + 1

endrw = endrw + numberColumns

%>

                    <tr align="center" valign="top">

                      <%

While ((startrw <= endrw) AND (Not resultprods.EOF))

%>

                      <td><table width="100%"  border="0" cellspacing="4" cellpadding="0" class="repeat">

                          <tr>

                            <th width="6%" scope="col"><img src="<%=(resultprods.Fields.Item("foto").Value)%>" width="68" height="68" border="1"></th>

                            <td width="94%" align="left" valign="top" scope="col"><p class="style15"><%=(resultprods.Fields.Item("produto").Value)%><br>

                                <span class="style16"><%= FormatCurrency((resultprods.Fields.Item("preco").Value), 2, -2, -2, -2) %></span></p>

                            <p class="style4 style16"><A HREF="detalhe_produto.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "cod_produto=" & resultprods.Fields.Item("cod_produto").Value %>"><strong>Detalhes</strong> <img src="PROJETO%20PORTAL/images/lupa1.gif" width="18" height="18" border="0"></A></p></td>

                          </tr>

                      </table></td>

                      <%

startrw = startrw + 1

resultprods.MoveNext()

Wend

%>

                    </tr>

                    <%

numrows=numrows-1

Wend

%>

                  </table>

                  <% End If ' end Not resultprods.EOF Or NOT resultprods.BOF %>

</td>

          </tr>

          <tr>

            <td height="10">              <div align="center" class="style20">

              <% If resultprods.EOF And resultprods.BOF Then %>

NENHUM PRODUTO ENCONTRADO NA SUA BUSCA<br>

<br>

POR FAVOR REFAZER A BUSCA

<% End If ' end resultprods.EOF And resultprods.BOF %>

            </div></td>

            </tr>

          <tr align="left" valign="top">

            <td height="93"> </td></tr>

        </table></td>

        <td width="11"> </td>

      </tr>

    </table></td>

  </tr>

  <tr>

    <td height="20" colspan="2" background="PROJETO PORTAL/images/layout-portal_14.gif"><div align="center"><span class="style1">© BLANCALION STUDIO DIGITAL 2002 -

      <%response.write Year(Now())%>

All Rights Reserved</span></div></td>

  </tr>

</table>

</body>

</html>

<%

resultprods.Close()

Set resultprods = Nothing

%>

<%

destaque.Close()

Set destaque = Nothing

%>

sera que alguem por favor poderia me ajudar ???

Compartilhar este post


Link para o post
Compartilhar em outros sites

<%

Dim HLooper1__numRows

HLooper1__numRows = -2

Dim HLooper1__index

HLooper1__index = 0

resultprods_numRows = resultprods_numRows + HLooper1__numRows

%>

<%

Dim Repeat1__numRows

Dim Repeat1__index

 

Repeat1__numRows = -1

Repeat1__index = 0

destaque_numRows = destaque_numRows + Repeat1__numRows

%>

 

<%

Dim HLooper1__numRows

HLooper1__numRows = -3

Dim HLooper1__index

HLooper1__index = 0

resultprods_numRows = resultprods_numRows + HLooper1__numRows

%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara valew a Dica, acho que de tanto olhar o codigo nao tinha visto que ta repetindo o hlloper.

 

acho que esta extension ta com pau...

 

Valew msm

 

BRIGADÃOOOOOOOOOOO... http://forum.imasters.com.br/public/style_emoticons/default/joia.gif http://forum.imasters.com.br/public/style_emoticons/default/joia.gif http://forum.imasters.com.br/public/style_emoticons/default/joia.gif http://forum.imasters.com.br/public/style_emoticons/default/joia.gif http://forum.imasters.com.br/public/style_emoticons/default/joia.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

a extensao fuciona perfeitamente cara,o que esta avendo e que você utilizou ela na pag e possivelmente modificou algo no codigo gerado por ela, dai quando você voutou a utlizar ela na mesma pagina ela declarou a mesma variavel usada anteriormente.poois quando naum se modifica o seu codigo as variaveis ficara assim.Dim HLooper1__numRowsDim HLooper2__numRowssempre numerando de acordo do numero de veses que você a utiliza!!!axu que e isso mermo!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

blema resolvido bye

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.