Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Type Mismatch error....

    I get this error:
    Response object error 'ASP 0106 : 80020005'

    Type Mismatch

    /cvibe/c-link.asp, line 0

    An unhandled data type was encountered.


    C-Link file contents....
    Code:
    <html>
      <head>
        <title>Whats New - www.c-vibe.com</title>
        <!-- #INCLUDE file="includes\header.asp" -->
        <!-- #INCLUDE file="functions\folderFunctions.asp" -->
      </head>
      
    <body bgcolor="<%=bgColor2%>" topmargin="5px" background="<%=bg%>">
    <script language="JavaScript1.2">mmLoadMenus();</script>
    <table width="<%=tblWidth%>" align="center" border="1" cellpadding="0" cellspacing="0" id="mainTbl" bgcolor="black" bordercolor="<%=lightBlue%>">
      <tr> 
        <td> 
          <!--#INCLUDE file="bannerNmenu.asp"-->
         </td>
                <%response.flush%>
      </tr>
    
      <tr>
        <td>
          <!--Container for the main part for the wattsnew page... -->
          <table width="900px" cellpadding="5" cellspacing="0" border="0">
            <tr>
              <td width="80%" valign="top">
              <%
              Dim fId
              fId = CLINK
              folderDisplay(fId)          %>
              
              </td>
              
              <td valign="top">
              Random Images...
              <!--#INCLUDE file="randomPics.asp"-->
              </td>
            </tr>
          </table>        
        </td>
      </tr>
    </table>
    </body>
    </html>
    I think the problem is at that line really (in red)...
    here is also that function....
    Code:
    'Display functions..............................................................
    function folderDisplay(fId)
      'A valid folderId must be dimmed before this inclusion and initialised to some value
      Dim folderId
      folderId = CInt(fId)
      grabFolder folderId,"full"  
      response.write folderId
      
    
    end function
    Once I try to write out the folder id.... I get that error... the one at the top of my post.... plz help
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    what is CLINK.. if its not an earlier global variable that would just be trying to use Empty but i duno if thats the problem

    however thats not line 0 anyway.. have you tried commenting out that response.flush as nowhere on that page (althoguh possibly on an earlier include) does it use response.buffer = true

    also even earlier than this you have

    <body bgcolor="<%=bgColor2%>" topmargin="5px" background="<%=bg%>">
    so that might come up as line 0 and be a problem with those values.. or does it just say line 0 if it cant find which line its on or its a syntax not runtime error or something maby..

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ghell
    what is CLINK.. if its not an earlier global variable that would just be trying to use Empty but i duno if thats the problem

    however thats not line 0 anyway.. have you tried commenting out that response.flush as nowhere on that page (althoguh possibly on an earlier include) does it use response.buffer = true

    also even earlier than this you have

    <body bgcolor="<%=bgColor2%>" topmargin="5px" background="<%=bg%>">
    so that might come up as line 0 and be a problem with those values.. or does it just say line 0 if it cant find which line its on or its a syntax not runtime error or something maby..
    CLINK is a global constant that I use... it is defined in the folderFunctions.asp file. It is not empty, I have written it out to the browser to test.

    bgColor and bg are all define in my header file...

    I tried both putting the lines:
    <%@ Language=VBScript %>
    <%option explicit
    Response.Buffer=true%>
    at the top and I also tried commenting out the flush... none worked
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #4
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    This is very frustrating...
    this works...
    Code:
    function folderDisplay(fId)
      'A valid folderId must be dimmed before this inclusion and initialised to some value
      fId = CInt(fId)
      response.write fId
      grabFolder fId,"full"  
    end function
    with the response before i call grabFolder.. but this arrangement gives me the error.

    Code:
    function folderDisplay(fId)
      'A valid folderId must be dimmed before this inclusion and initialised to some value
      fId = CInt(fId)
      grabFolder fId,"full"  
      response.write fId
    
    end function
    It gives me an error if I attempt to write out fId after I am finished calling the grabFolder...
    The grabFolder takes in two parameters... an int and a string. It makes NO reference to "fid".
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #5
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    To make it even more confusing... here's what I found.
    This doesn't work...

    Code:
    function folderDisplay(fId)
      'A valid folderId must be dimmed before this inclusion and initialised to some value
      fId = CInt(fId)
      grabFolder fId,"full"  
      response.write fId
    
    end function
    But this works...

    Code:
    function folderDisplay(fId)
      'A valid folderId must be dimmed before this inclusion and initialised to some value
      fId = CInt(fId)
      grabFolder (fId),"full"  
      response.write fId
    
    end function
    ...if i bracket the fid..
    can anyone help explainin what could be going on here?
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #6
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    when calling the sub try

    Call grabFolder(fId, "full")


    this probably wont fix it but might releave some of that confusing parenthasis stuff

    also do u have on error resume next on or on error goto 0 because on error resume next can do things like exit the function on an error which might be why in one order it works and in one it doesnt..

  • #7
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ghell
    when calling the sub try

    Call grabFolder(fId, "full")


    this probably wont fix it but might releave some of that confusing parenthasis stuff

    also do u have on error resume next on or on error goto 0 because on error resume next can do things like exit the function on an error which might be why in one order it works and in one it doesnt..
    Where exactly should I try putting that? Oh and using the call syntax gives the same error when its not bracketed.

    But I really am trying to understand what is happening. What is causing the error so that I can be very sure of it and I can know what to do to correct it.
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #8
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    *shrugs* when calling subs use

    Call subname(arg1, arg2, etc)
    or
    subname arg1, ag2, etc

    i was thinking it might be a problem if you used the () as it would kinda read it as

    subname(arg1), arg2

    which should throw an error if you have on error goto 0 on or just do nothing if you have on error resume next on.. this might not be the error at all however

  • #9
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I inserted the on error thing at the top... now its stop giving me the error
    But I still cannot use the variable fid anywhere...
    If I try to print it out... it doesn't print anything.. If I add extra text to the write string like...
    response.write "the fid is: " & (fId)
    It still doesn't print out a thing!
    And I need to use the fid during the rest of the course of the function
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #10
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    well you should use
    On Error Goto 0
    for developing (this is usually what it is by default) and then
    On Error Resume Next
    once its finished (you can switch between them at any time)


    goto 0 throws an error, resume next allows you to handle it in its own way (it just continues to the next line but functions the next line is the next line outside the function), i would make sure it was on goto 0 at the moment
    when using resume next you can use this sort of thing to make the final product a bit neater:
    Code:
    If Err.Number <> 0 Then
        Response.Write Err.Description
        Response.End
    End If
    look at the Err object in "vbscript reference" or [d] in my signature for further help

    really folder display should be a sub not a function anyway as it does not return anything.

    try using this page:
    Code:
    on error goto 0
    
    'it is a good idea to give arguments unique names, it does not need to be fId here
    Sub folderDisplay(folderId)
      'write the number to make sure its ok at this point
      Response.Write "|" & folderId & "|"
      
      Call grabFolder(folderId, "full")
      
      'write the number to make sure it hasnt disapeared by here
      Response.Write "!" & folderId & "!"
    End Sub
    
    Sub grabFolder(grabFolderId, strFullVar)
      ...
    End Sub
    
    'sample data
    Dim CLINK
    CLINK = 4
    
    Dim fId
    fId = CInt(CLINK)
    Call folderDisplay(fId)
    i have a feeling the problem will be in grabFolder() if it is anywhere
    Last edited by ghell; 08-22-2005 at 04:11 PM.

  • #11
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Alright... have a look at the first few rows of my grabFolder function
    Code:
    function grabFolder(folderArray,mode)  
      'Takes as input... list of folder indices
      Dim req           'Requested number of folders for grabbbing... 
      if not isArray(folderArray) AND isNumeric(folderArray) then
        folderArray = Array(folderArray)
      end if
      req = ubound(folderArray)
      
      Dim sqlWhere
      if req = 0 then
        sqlWhere = " folderId=" & folderArray(0)
        else if req > 0 then
          sqlWhere = " folderId IN (" & join(folderArray,",") & ")" 
          else
            if blnDebug then response.write "No folders specified for grab!"
            Exit Function
        end if
      end if
    .
    .
    .
    .
    .
    end function
    It is supposed to taken in an array and a string... An array of ints... But I attempted to make it flexible. so it checks to see if I only supplied an int and a string and then converts the single int to an array... then runs the functions again.

    See anything there that would cause a problem?
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #12
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    change it to a sub (and dont forget Exit Fucntion --> Exit Sub)

  • #13
    Regular Coder
    Join Date
    Sep 2004
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @jaywhy13,
    I think the problem here is fId = CInt(fId) in your folderDisplay function. My advice would be to change the fId inside of your function to some other variable. It's not good to use the same variable names unless you are passing them in by reference. Also, if your function does not return anything, I would make it a Sub instead.

  • #14
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    um.. i just said all of that


    Sub grabFolder
    should fix i think..

  • #15
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by neocool00
    @jaywhy13,
    I think the problem here is fId = CInt(fId) in your folderDisplay function. My advice would be to change the fId inside of your function to some other variable. It's not good to use the same variable names unless you are passing them in by reference. Also, if your function does not return anything, I would make it a Sub instead.
    @neocool00,
    thanks for ur suggestions... u 2 ghell.. however none of those worked. The CInt function was not the problem... i tried using CInt after I was getting the error. Tried changing it to a sub.. that didn't solve the problem. The objective of the grab functions are not to return a value, they just grab some data and store them in some global arrays. I pick up that you're saying that by principle that should be a Sub... thanks for pointin that out.

    For the most part I only use the variable names for reference because they are all just functions.

    I've got 1000 lines of functions, some of them don't return a value.. is that reason to be concerned?
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished


  •  
    Page 1 of 3 123 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •