Self made function is stalling!

Results 1 to 2 of 2

Thread: Self made function is stalling!

  1. #1
    Join Date
    Dec 1969

    Default Self made function is stalling!

    hey there,<BR><BR>hope anyone can help me with this problem. I`m using the following For/Next loop in an ASP page to display results of a matching calculation between a job profile and multiple skillset profiles of potential workers (pardon my english ;). I`ve made a Function thats calculates the matching score between the job profile and a single skillset profile at a time. Because the function can only handle one skillset profile at a time Ì`ve put it in this loop in order to match multiple skillset profiles in one time.<BR><BR>the function is called:<BR>Function matchMaker(intOpdrachtProfiel, intStudentProfiel)<BR><BR>and this is the loop:<BR>If request.QueryString("func") = "match" Then<BR><BR>Dim studentenForm<BR>Dim studentenArray<BR>intOpdrachtprofiel = request.Form("opdrachtprofiel")<BR> <BR>studentenForm = request.Form("studentprofiel")<BR>studentenArray = split(studentenForm, ", ")<BR><BR> <BR>For P=0 To uBound(studentenArray)<BR><BR>response.Write(match Maker(intOpdrachtprofiel, studentenArray(P)) & "<BR>") <BR><BR>Next <BR><BR>End If<BR><BR>The loop only runs once, displaying one result. After that it stalls, no errormessages. I`ve checked studentenArray(), and it is filled with multiple values.<BR><BR>The function matchMaker uses on its turn a few sub`s and function`s, could this be a reason for stalling the loop? Also, in the function matchMaker I`m using about 3 for/next loops, they do use a different value (I) as the above mentioned loop.<BR><BR>If it is usefull that I post the function code then let me know in a reply, its pretty long though!<BR><BR>thanks in advance,<BR><BR>joost, amsterdam<BR>

  2. #2
    Join Date
    Dec 1969

    Default Make sure all the functions...

    ...DIM their own variables. <BR><BR>Not just loop counters; *ALL* variables.<BR><BR>Unless you *KNOW* that you need a particular variable to be global to the entire page, it should be local to the funtions/subs.<BR><BR>I have no idea if that is the problem, without seeing code, but it&#039;s certainly a possible one.<BR><BR>

Posting Permissions

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