A while loop is a control structure used in many languages to loop over a set of instructions as long as a particular condition is met.

learn more… | top users | synonyms (2)

0
votes
7answers
37 views

Return True if alphanumeric (No methods or import allowed)

What would be a good way to make a function return True if, and only if, what is inputted is alphanumeric (contains only letters or numbers), without using methods or import? So far in class, we only ...
0
votes
1answer
25 views

jquery toggle one div in php while loop

I have this While loop in my php code where I echo rows inside one div that acts like a button and when I press that "button" I want to hide/show the connected div with the jQuery function "toggle". I ...
0
votes
3answers
33 views

php while loop wont compare variables

I am trying to make a dynamic division that changes its id with a variables. In addition to this, the dvision is a popup. The division has to be unique, since I am pulling info from a database. What I ...
0
votes
1answer
111 views

Visual C# very poor performance in while loop

I am having some trouble with while loops in C#. This happens let's say once per week. I am looping through a SQL Server data reader and I read simple strings, doubles etc ... I don't understand why ...
0
votes
1answer
22 views

issue with requirejs being called in switch satement

I am having an issue where I am reading a json object to build out a form. As I read the form field types I go through a switch statement on how to build the field with bootstraps. In some cases I ...
1
vote
2answers
26 views

Making a simple adventure game. Want to use a While loop to keep the input prompt rolling after each action

I did this in a previous adventure using this code: def lobby(): invalid_check == True while invalid_check == True: #This "while" loops exists solely to loop the command sequence should the user ...
0
votes
1answer
9 views

Java: change variable from outside while looping through a while queque

I am a Java Beginner and have a little question. I have got 2 Classes: the first one is a java formular, the important code is: @Override public void keyPressed(KeyEvent event) { int key = ...
0
votes
8answers
61 views

Using a timer in a while true loop in Python

I have a problem in managing a infinite while loop in Python, in which I would insert a timer as a sort of "watchdog". I try to explain better: the script has to listen on a serial channel and wait ...
0
votes
5answers
49 views

How to compare floating point numbers and integers

I am trying to create a program that checks if an equation creates a whole number answer but the equation creates floating point numbers that won't compare to integers. When it gets to the first ...
0
votes
0answers
80 views

A While Loop doesn't break inside of a function, but it does in the main method c++ [closed]

I'm working on a project with numbers. Fairly simple, the user inputs numbers separated by whitespace and terminated by ^z. I have to calculate the max, min, mean, median, variance and mode, then set ...
0
votes
0answers
23 views

Running a DELETE stored procedure but finding degradation in performance in WHILE loop as iterations increase

Have a quick general question. I have a table I'm trying to purge a table. I'm deleting using a WHILE loop with WAITFOR DELAY time of 50ms between batches and 2000 records per batch. The real issue is ...
0
votes
3answers
90 views

Python read file in while loop

I am currently in some truble regarding python and reading files. I have to open a file in a while loop and do some stuff with the values of the file. The results are written into a new file. This new ...
0
votes
1answer
20 views

How to get the file count from a loop process to count in a content section outside of the loop

I am stuck. You will see I have var *$file_count_header*. I am simply trying to get this to increase in number along with the same counts as *$file_count* (ideally just use the same variable). ...
0
votes
3answers
72 views

While loops (Python) [closed]

I have a while loop that returns the number of 'rushes' it takes to get up a hill. The size of the hill is the 'slope height' and the height run up is the 'rush_height_gain' minus the 'back_sliding'. ...
0
votes
1answer
42 views

php while loop will not increment database column

I have a function like this: function searchSingleUrlGraph($mysql){ $query="SELECT * FROM `dailydata` WHERE `userid`='".$_SESSION['userdata']['userid']."' AND `url`='faboolis.com'"; ...
1
vote
1answer
55 views

Nested while loop is not working as expected

I'm having a problem in php. I tried to show all data and then put them in a nested loop. but the second loop only returns nulls. I don't know what I did wrong. <?php ...
0
votes
2answers
58 views

Java, need a while loop to reach eof. i.e.while !eof, keep parsing

I currently have a working parser. It parses a file once(not what I want it to do) and then outputs parsed data into a file. I need it to keep parsing and appending to the same output file until the ...
4
votes
2answers
149 views

How to break a while loop in C on linux by taking any value from keyboard?

The program I am building runs in an infinite while loop with a switch case in it. I want to insert a while loop under each case and perform few operations in the loop, but the loop should exit as ...
1
vote
4answers
90 views

Integer validation for input

I tried to prompt user for input and do the validation. For example, my program must take in 3 user inputs. Once it hits non-integer, it will print error message and prompt for input again. Here is ...
0
votes
3answers
37 views

Java Actionlistener submit buttons

When I input something into the textbox my application freezes and stops responding if I hit enter. Its a game where you try to gets a number between 1 and 100. I think I need a submit button or an ...
0
votes
3answers
68 views

Loop enters infinite loop if cout is missing

I have encountered something very strange. The code I am having trouble with is: int stringPos; int found1; while (stringPos < 1); { //start searching inString for framen starting at foundn ...
1
vote
1answer
48 views

Stuck in while loop; MATLAB GUI [duplicate]

I am fairly new to MatLab GUI building and I have a "continue" button in the GUI. So basically, at some point in my program, the program has to wait for the user to click on the "continue" button to ...
0
votes
3answers
46 views

While loop executes a statement that I need to store in Java

I couldn't find a better way to word the question but here is what I would like to do. I am using the RandomAccessFile class to do various things with an input file. I would like to check to make ...
-1
votes
1answer
42 views

How do I fix my table from breaking my css div? PHP LOOP

I have a header div, content div, and a footer div, and my content is a PHP loop returning results from my database, but my results are under my footer div, and my footer div is up over my content ...
1
vote
5answers
95 views

How can I output several numbers per line in java

Hi I am new in programming,so please don't laugh from my stupid question. I wrote program which ask user for input a number than program should output all the numbers from 0 to that entered ...
1
vote
3answers
58 views

PHP echo '<p>' printing <p> </p>

Hi i am trying to create a loop in php to display a list of categories the loop is working fine and sql queries pulls all the correct information however im trying to echo out a tag for every 4 times ...
0
votes
0answers
19 views

Specifying number of dropdown menus by choosing value from a dropdown

Badly needed help here! :( Getting straight to the point, I want to specify number of dropdown menus by choosing a value from my first dropdown. Enter Desired Number of Superstars: <select ...
0
votes
2answers
72 views

if statements acting differently

Doing a homework problem with the following code, when I enter -1 when the program runs, controller inserts the String even though it's not supposed to when -1 is entered. The do while loop uses the ...
3
votes
1answer
42 views

Error with query and while loop

Been trying to figure this out for a couple of days now. Havn't come up with any solution and I've searched and asked friends about it. But with no good results. When I user $db->query(); It gives me ...
0
votes
1answer
38 views

How do I avoid recursively adding arrays when I need to merge two arrays in a while-loop?

Working with pygame, I am trying to create a larger list out of two smaller lists. This needs to be done during the game loop because those lists contain pygame.Rect objects which determine collision ...

1 2 3 4 5 115
15 30 50 per page