[thelist] ASP Problem - Pulling schedules items in a loop?

Ken Schaefer Ken at adOpenStatic.com
Tue Jun 5 23:16:16 CDT 2007


Hi,

Just to make a small suggestion - in VB/VBA/VBScript/VB.NET, functions are
used when you need to return something to the caller. Subroutines (Sub) are
used when you don't want to return anything. If you are just using
Response.Write() to output things to the page, then use a Sub, not a
function. If you ever need to port this to VB.NET, you won't have
warnings/errors in your IDE.

Cheers
Ken

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Jon Hughes
Sent: Wednesday, 6 June 2007 12:56 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] ASP Problem - Pulling schedules items in a loop?

Ken,

Thank you for your suggestion.

I actually accomplished what I wanted by simply calling a function in
each block. The function wrote to the page (via response.write) each
variable.

Thank you all for your help,

 - Jon

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Ken Schaefer
Sent: Monday, June 04, 2007 5:48 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] ASP Problem - Pulling schedules items in a loop?

Jon,

...

And then, in your presentation section, you just iterate your array to
write
out your links:

<%= WriteLinks(myArray) %>
'
'
'
<%
Sub WriteLinks( _
	byVal myArray _
	)

	If isArray(myArray) then

		For i = 0 to UBound(myArray, 1) -1

			Response.Write("<a href=""" & myArray(i,1) &
"""><img
src=""" & myArray(i,2) & """></a>"

		Next

	Else

		Response.Write("no matching links")

	End If

End Sub
%>


Cheers
Ken
 



More information about the thelist mailing list