Im trying to create an array by dynamically selecting values from several different fields in a table, but not all the fields will always have data in.
So what I want to know is what would happen in the following situation if several of the fields at random had no values?
In the example above ive left 3 of the aray values blank to simulate blank fields in the database.
What I need to know is would the array:
1) Break
2) skip the blank values and move straight to the next value in the list?
like this:
<img src="Pic1.jpg"> <br>
<img src="Pic2.jpg"> <br>
<img src="Pic3.jpg"> <br>
<img src="Pic6.jpg"> <br>
<img src="Pic7.jpg"> <br>
<img src="Pic8.jpg"> <br>
<img src="Pic10.jpg" ><br>
Or would it
3)produce blank outputs to match the blank fields like this:
<img src="Pic1.jpg"> <br>
<img src="Pic2.jpg"> <br>
<img src="Pic3.jpg"> <br>
<img src=""><br>
<img src=""><br>
<img src="Pic6.jpg"> <br>
<img src="Pic7.jpg"> <br>
<img src="Pic8.jpg"> <br>
<img src=""><br>
<img src="Pic10.jpg" ><br>
And is there a way of counting the number of actual values in a dynamic array?
So what I want to know is what would happen in the following situation if several of the fields at random had no values?
Code:
<%
Select Pic1, Pic2, Pic3, Pic4, Pic5, Pic6, Pic7, Pic8, Pic9, Pic10 From Gallery Where GalleryID = 123
%>
<%
Dim GalleryArray() 'Dynamic array
GalleryArray(0) = "rsGallery.Item("Pic1").value"
GalleryArray(1) = "rsGallery.Item("Pic2").value"
GalleryArray(2) = "rsGallery.Item("Pic3").value"
GalleryArray(3) = ""
GalleryArray(4) = ""
GalleryArray(5) = "rsGallery.Item("Pic6").value"
GalleryArray(6) = "rsGallery.Item("Pic7").value"
GalleryArray(7) = "rsGallery.Item("Pic8").value"
GalleryArray(8) = ""
GalleryArray(9) = "rsGallery.Item("Pic10").value"
For Each item In GalleryArray
%>
<img src="<% Response.Write(item) %><br>
Next
%>
What I need to know is would the array:
1) Break
2) skip the blank values and move straight to the next value in the list?
like this:
<img src="Pic1.jpg"> <br>
<img src="Pic2.jpg"> <br>
<img src="Pic3.jpg"> <br>
<img src="Pic6.jpg"> <br>
<img src="Pic7.jpg"> <br>
<img src="Pic8.jpg"> <br>
<img src="Pic10.jpg" ><br>
Or would it
3)produce blank outputs to match the blank fields like this:
<img src="Pic1.jpg"> <br>
<img src="Pic2.jpg"> <br>
<img src="Pic3.jpg"> <br>
<img src=""><br>
<img src=""><br>
<img src="Pic6.jpg"> <br>
<img src="Pic7.jpg"> <br>
<img src="Pic8.jpg"> <br>
<img src=""><br>
<img src="Pic10.jpg" ><br>
And is there a way of counting the number of actual values in a dynamic array?
Comment