- Total Members: 220,328
- Threads: 525,402
- Posts: 977,028
Great community. Great ideas.
Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.
-
November 13th, 2012, 01:44 PM
#1
Problem with For loop in VBScript
Hi all,
I have a code that checks for following logic in VBScript
One array holds the Index number of which should not be displayed in page.
The Second Array is a general Array with few data.
Now I want to display only those elements that are not having the Index sepcified in first array.
for eg:- if one array has 2,3,6,8 as prohibited indexes, the the second array should display data at indexes 1,4,5,7,9... I have formulated the logic as follows but I observe the first loop variable 'ki' takes the upperbound of array.i.e it executes only the first statement in loop and then it executes the remaining by looping in, I am lost by this weird behaviour. Can Anyone solve this issue or justify this? I have posted the code for your reference...
for ki=0 to UBound(elec_course_grade)
if(elec_course_grade(ki)<>"") then
for j=0 to UBound(core_courseIndex)
if(core_courseIndex(j)<>"") then
Response.write "comparing.."&core_courseindex(j)&" and "&ki&"<br>"
if(core_courseIndex(j)=ki) then
Response.write " Match found in array"&core_courseIndex(j)&" value of ki="&ki&"<br>"
else
Response.write "Not Equal"&"<br>"
end if
end if
Next
end if
Next
-
November 14th, 2012, 08:52 AM
#2
I think line '
if(core_courseIndex(j)=ki) then
should be
if(core_courseIndex(j)=elec_course_grade(ki)) then
GK
__________________________________________________ _____
if you found this post is useful click scale

(right side on this reply ) and agree
Similar Threads
-
By apporter in forum .NET Development
Replies: 1
Last Post: February 22nd, 2008, 06:26 AM
-
By kmtiburona in forum Windows Scripting
Replies: 3
Last Post: November 20th, 2007, 08:40 AM
-
By david_918891 in forum ASP Development
Replies: 1
Last Post: March 9th, 2005, 02:41 PM
-
By ap390 in forum ASP Development
Replies: 3
Last Post: October 20th, 2004, 09:09 AM
-
By ProEdge in forum .NET Development
Replies: 25
Last Post: August 24th, 2004, 10:16 PM