473,508 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Potential Loop

Please look at the code below:

Would this code cause an infinite loop at any logic?

Sub Page_Load( sender , e ) handles Mybase.Load

sw = new StringWriter
hw = new HtmlTextWriter(sw)
MyBase.Render(hw) '<-- would this code call this sub again,
'thus causing infinite loop?
hw.close

debug.print sw.ToString()

end Sub

Sep 9 '05 #1
1 1233
Not a VB expert but there is no condition that this could cause an
infinite loop ...

The code behind this is the following (from reflector)

Protected Overridable Sub Render(ByVal writer As HtmlTextWriter)
Me.RenderChildren(writer)
End Sub

Protected Overridable Sub RenderChildren(ByVal writer As
HtmlTextWriter)
If (Not Me._renderMethod Is Nothing) Then
Me._renderMethod.Invoke(writer, Me)
Else
If (Not Me._controls Is Nothing) Then
Dim num1 As Integer = Me._controls.Count
Dim num2 As Integer
For num2 = 0 To num1 - 1
Me._controls.Item(num2).RenderControl(writer)
Next num2
End If
End If
End Sub

Public Sub RenderControl(ByVal writer As HtmlTextWriter)
If Not Me.flags.Item(16) Then
Dim context1 As HttpContext = IIf((Me._page Is Nothing),
Nothing, Me._page._context)
If ((Not context1 Is Nothing) AndAlso
context1.TraceIsEnabled) Then
Dim num1 As Integer =
context1.Response.GetBufferedLength
Me.Render(writer)
Dim num2 As Integer =
context1.Response.GetBufferedLength
context1.Trace.AddControlSize(Me.UniqueID, (num2 -
num1))
Else
Me.Render(writer)
End If
End If
End Sub

Sep 9 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1638
by: R.Gill | last post by:
We are researching the business potential of providing PHP/MySQL consulting services. Can anybody here have an idea of any published market forecast report giving the approximate Market size ( in...
0
990
by: Andy Leszczynski | last post by:
Python 2.3, one of the latest Twisted version: I noted that under Linux there is not way to Control-C the reactor loop. After digging a little I found that following change helpes: # diff...
27
3868
by: Mark | last post by:
I'm curious to get feedback regarding the potential SVG has in performing the same functionality as PDF for fixing documents. Thanks. Mark
11
1919
by: jbruno4000 | last post by:
I want to develop a C++ portfolio containing applications that will hopefully impress potential employers for Entry Level C++ jobs. I'm hoping some of you more experienced types might provide...
4
2618
by: Jack Clift | last post by:
Dear Sirs, Sorry, have reposted from another section as have not received any responses... I am using createDocumentFromUrl to obtain data from the web, which is called several times (>100)...
1
290
by: tascien | last post by:
Please look at the code below: Would this code cause an infinite loop at any logic? Sub Page_Load( sender , e ) handles Mybase.Load sw = new StringWriter hw = new HtmlTextWriter(sw)...
8
8300
by: vidya.bhagwath | last post by:
Hello Experts, I am using std::string object as a member variable in one of the my class. The same class member function operates on the std::string object and it appends some string to that...
2
1444
by: Chris | last post by:
I'm developing an ASP.NET Page that processes some files, does some things to them. I'd like to have a gridview that displays each file, and it's status, if it's done processing, still processing,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.