Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2005, 11:32 PM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Script timeout (processing long loops)


Hello,

  First of all sorry for the long code. But i want to explain clearly what i am doing.

For i = 0 To UBound(arrResSizes) - 1
            For j = 0 To UBound(arrqty) - 1
                For k = 1 To totopr Step 8
                    tempjob = right(jc,5)
                    tempsize = left(arrResSizes(i) & " ", 3)
                    headsize = left(arrResSizes(i) & " ", 6)
                    tempqty = Right(" " & CStr(arrqty(j)), 2)
                    templay = Right(" " & CStr(lno), 3)
                    tempbdl = Right(" " & bdlno, 5)
                    tempopr = Right("00" & k, 2)
                    'tempcolor = Left(getColorName(arrColorCodes(j)) & " ", 6)
                    tempcolor=left(dict.Item(cstr(arrColorCodes(j))) & " ",6)
                    strop = strop & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & " " & tempopr & " " & headsize & " "
                    If (k + 1) <= totopr Then
                        tempopr = Right("00" & k + 1, 2)
                        strop = strop & tempopr & " " & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & vbcrlf & vbcrlf & vbcrlf
                    Else
                        strop = strop & vbcrlf & vbcrlf & vbcrlf
                    End If
                    If (k + 2) <= totopr Then
                        tempopr = Right("00" & k + 2, 2)
                    strop = strop & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & " " & tempopr & " " & tempqty & " PCS" & " "
                    Else
                        strop = strop & " " & tempqty & " PCS "
                    End If

                    If (k + 3) <= totopr Then
                        tempopr = Right("00" & k + 3, 2)
                        strop = strop & tempopr & " " & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & vbcrlf & vbcrlf & vbcrlf
                    Else
                        strop = strop & vbcrlf & vbcrlf & vbcrlf
                    End If
                    If (k + 4) <= totopr Then
                        tempopr = Right("00" & k + 4, 2)
                        strop = strop & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & " " & tempopr & " " & tempcolor & " "
                    Else
                        strop = strop & " " & tempcolor
                    End If

                    If (k + 5) <= totopr Then
                        tempopr = Right("00" & k + 5, 2)
                        strop = strop & tempopr & " " & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & vbcrlf & vbcrlf & vbcrlf
                    Else
                        strop = strop & vbcrlf & vbcrlf & vbcrlf
                    End If

                    If (k + 6) <= totopr Then
                        tempopr = Right("00" & k + 6, 2)
                        strop = strop & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & " " & tempopr & " " & tempjob & " "
                    Else
                        strop = strop & " " & tempjob
                    End If

                    If (k + 7) <= totopr Then
                        tempopr = Right("00" & k + 7, 2)
                        strop = strop & tempopr & " " & tempjob & " " & tempsize & " " & tempqty & " " & templay & " " & tempbdl & " " & tempopr & vbcrlf & vbcrlf & vbcrlf
                    Else
                        strop = strop & vbcrlf & vbcrlf & vbcrlf
                    End If
                Next
                bdlno = bdlno + 1
                rowcounter = 1
            Next
        Next


The first loop may be having 5 iterations(0 to 5)
Second - (0 to 20)
third may be (1 to 52)

Its taking so much time to produce the final output(nearly 5 mts). I got an error initially "Script timeout". I have set the value to 180
"server.scripttimeout=180" Now its ok. But taking some long time to display output. Even in the server itself.

Some times the first loop may be 0 to 12

Is my coding is wrong? or any other sollution is there to get the fast output for this?

Pls help me. After executing i am saving the output(strop) in a text file using FSO(that my need).

Thanks in advance.


 
Old January 5th, 2005, 12:06 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,


  The output could be liek this

http://m.1asphost.com/tsimsha/tickets.txt


-----------

 
Old January 5th, 2005, 03:31 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

  Nothing wrong with your code. Most killer likely to be with string concatenation, memory allocation. Modify a bit in your code.

You said that you are writing to a text file.

Instead of concatenating all the data to on single variable, write to file at every statge.


----------
Rajani






Similar Threads
Thread Thread Starter Forum Replies Last Post
break for-each loops, or limit amount of loops warhero XSLT 2 July 4th, 2007 02:18 AM
Script taking too long mmltonge Classic ASP Professional 3 April 16th, 2007 06:56 PM
While loops and For loops in XSLT spencer.clark XSLT 1 August 5th, 2005 09:50 AM
Modifying long text in a long field sajsal Classic ASP Databases 1 February 20th, 2004 12:36 PM
How can I modify script timeout? tlbacon527 Classic ASP Professional 3 February 5th, 2004 09:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.