Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    Function Code: (Physically at the top of the file if that makes any difference. I deleted a bunch of sql statement fragments, but trust me , the SQL code works. I just cant' get the function to be called)


    Code:
    <SCRIPT language=Javascript 2.1 > 
    Function TotalSQL(PersonID_List) {
        var FullSQL = "Select Person.Name,Person.Type,Person.Sex,... 
       FullSQL = FullSQL & "IPList.AttendingMD as Attending, ...
        FullSQL = FullSQL & "PtList.Status, IPList.Service"
    
        var iSql = " FROM PtList RIGHT JOIN (Person LEFT JOIN ...
        isql = iSQl & " GROUP BY Person.Name, ..., 
        iSQL = iSQL & " HAVING (Person.PersonID " & PersonID_List & ")"
        
        TotalSQL = FullSQL & iSQL
    }
    </SCRIPT>


    Calling Code:
    Code:
    strTemp0 = TotalSQL(PersonID_List)
    strTemp0 has been declared, PersonID_List has been declared, and is has appropriate text.

    The error message reads: Type mismatch: 'TotalSQL'

    which tends to indicate that TotalSQL has not been declared. But it has hasn't it????
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    You're using a Javascript call and Javascript doesn't return variables like that; instead use [minicode]return TotalSQL;[/minicode]. Also the string concatenation operator for Javascript is +, not & like VB. Finally, although it isn't required, each statement in JS should be terminated with a semicolon
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    Ok, I terminated all the lines with ;

    Code:
        
        TotalSQL = FullSQL + iSQL;
        Return TotalSQL;
    changed all the & to +

    Same message. It's not accepting the function declaration for some reason.
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    How are you calling the function? The declaration looks fine to me.

    If you have Netscape 4 or (better yet) Mozilla, view the page in question and then in the Location bar type "javascript:" and press Enter to see actually useful JS debugging information, unlike IE's worthless debugger.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    I'm downloading Netscape 7.0 now. Bear with me.
    DerFarm
    I talk to squirrels.
    Squirrels Answer.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:49 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com