473,732 Members | 2,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looping code that i cant seem to work out!

Sorry for the post in this NG but im short on time to get this working
and i haven't seem to of got a response anywhere else.

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Queryst ring("id") = "" then
TidF=Request.Fo rm("TidF")
Else
TidF=Request.Qu erystring("id")
End If

The data Request.Form("T idF") comes from a form if submit is pressed.

The data Request.Queryst ring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.

Oct 23 '06 #1
3 1286
The "If-Else" statement won't cause your code to loop because it's just
a conditional statement. Maybe the behaviour is caused by a different
part of your code? Do you have any "For", "While", "Do...While " or
"For Each" statements?

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/

Luke - ea********@gmai l.com wrote:
Sorry for the post in this NG but im short on time to get this working
and i haven't seem to of got a response anywhere else.

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Queryst ring("id") = "" then
TidF=Request.Fo rm("TidF")
Else
TidF=Request.Qu erystring("id")
End If

The data Request.Form("T idF") comes from a form if submit is pressed.

The data Request.Queryst ring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.
Oct 23 '06 #2
Chris Fulstow wrote:
The "If-Else" statement won't cause your code to loop because it's just
a conditional statement. Maybe the behaviour is caused by a different
part of your code? Do you have any "For", "While", "Do...While " or
"For Each" statements?

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/

Luke - ea********@gmai l.com wrote:
>Sorry for the post in this NG but im short on time to get this working
and i haven't seem to of got a response anywhere else.

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Queryst ring("id") = "" then
TidF=Request.Fo rm("TidF")
Else
TidF=Request.Qu erystring("id")
End If

The data Request.Form("T idF") comes from a form if submit is pressed.

The data Request.Queryst ring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.
Thanks for the reply, yes it does contain a loop but the code only seems
to keep looping round since ive added the If statement to get the data.

Here is my code.

http://rafb.net/paste/results/qXOfJn50.html

thanks agian!
Oct 23 '06 #3

Maybe not the complete answer, but here is a helper.
If Request.Queryst ring("id") = "" then
TidF=Request.Fo rm("TidF")
Else
TidF=Request.Qu erystring("id")
End If

if ( Request.Queryst ring("id") is nothing) then
'' "id" not present, check for TidF
if not (Request.Form(" TidF") is nothing) then
TidF=Request.Fo rm("TidF")
else
throw new ArgumentExcepti on("Form( TidF ) expected.")
end if

else

if Request.Queryst ring("id").Leng th <= 0 then
throw new ArgumentExcepti on("Querystring ( id) expected.")
end if
TidF=Request.Qu erystring("id")

end if
Don't check for empty strings as the "exists or not exists". Check for the
object existing or not (null in C# / Nothing in VB.net)

...
<ea********@gma il.comwrote in message
news:vN******** ************@ec lipse.net.uk...
Sorry for the post in this NG but im short on time to get this working
and i haven't seem to of got a response anywhere else.

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Queryst ring("id") = "" then
TidF=Request.Fo rm("TidF")
Else
TidF=Request.Qu erystring("id")
End If

The data Request.Form("T idF") comes from a form if submit is pressed.

The data Request.Queryst ring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.

Oct 23 '06 #4

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

Similar topics

4
1867
by: Colin Steadman | last post by:
I've create a simple survey using ASP. Its finished and works, but one aspect of my coding is annoying me and I cant figure out a better way of doing it. Basically the questions are stored in an Access 2000 table like this: QUESTION_NUMBER QUESTION 1 Question 1 text.... 2 Question 2 text....
6
3921
by: Dave | last post by:
I have to automate a process that assigns sales leads to sales people. For example: Every day we buy a list of sales leads, it ranges in size from 50 - 100 records. We have a team of sales people that also can range from 5 - 8 people. I need to take the new records and divide them evenly among the sales people.
10
2501
by: Virus | last post by:
Ok well what I am trying to do is have 1.) the background color to change randomly with 5 different colors.(change on page load) 2,) 10 different quotes randomly fadeing in and out in random spots on the webpage. with a delay timer on them, so they keep changing as the page is open. Not random each time the page is loaded. If anyone can help it would be greatly appreaciated, I have tried many of
27
2625
by: Mike P | last post by:
I will be passing my function a two dimensional array of varying length. Within that array is one data point, and the number of times it should loop through. So, for example, I might pass this to the function: example = new Array("A",2); example = new Array("Q",4); function loopIt(example);
4
1682
by: Paul M | last post by:
Larry, i've got an xml file which has multiple cities as the top level item. When i read it in using XMLReader, and define the variables, as below, it finds the correct number of cities in the xml file, but repeats the first one 3 times. I'm sure its something minor but i just cant seem to figure it out. here is the XML, and source code below:
5
1487
by: Girish | last post by:
hey all, im building a asp.net project in vs.net. Is there a way to have the codebehind files sit in a different folder outside the website folder altogether? example: The aspx files are in this directory c:\inetput\wwwroot\testapp
0
3223
by: marfi95 | last post by:
I have an animated gif playing fine in a picture box. However, I don't want it to keep looping, I only want to play it twice. I found some code that gets the active frame and loads it looping through, but I cant get it to work. With this code, it didn't do any animation. I found this: For f = 0 To animatedGif.GetFrameCount(frameDimension) - 1 animatedGif.SelectActiveFrame(frameDimension, f) Dim memoryStream As New...
6
1822
by: Luke - eat.lemons | last post by:
Hi, Im pretty new to asp so all light on this question would be great. Basically i need to test to see what value is set (where to retrieve the data from) so ive done it like this: If Request.Querystring("id") = "" then TidF=Request.Form("TidF") Else
24
2418
by: tanmay | last post by:
please tell me how to get the following output using loops... 1) * * * * * * * * * * * * * * * *
0
8773
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9445
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9306
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9234
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9180
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2177
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.