0
votes
2answers
45 views

I used while loop and my project become not responding (MATLAB)

I'm beginner in MATLAB programming. I'm working on statistic data and I have some problem with while looping. Here's the codes : % --- Executes on button press in b_analisa_data. function ...
0
votes
3answers
59 views

For loop not working - function only getting called once

I'm having some issues with my for loop. I've tried placing it in different areas and still, no luck. I'm working on a project that randomly changes the opacity of a rectangle (I have red, yellow, ...
2
votes
3answers
72 views

How to run several looping functions at the same time in python?

i've been working on a project that i was assigned to do. it is about some sort of parking lot where the cars that enter, are generated automaticly (done) now, I've put them into a 'waiting list ...
0
votes
1answer
20 views

Plese help me. Matlab 'while' loop. A set of data is given

Now I calculate the value of F from equation. From the F that I determined, I need to find the diameter from set of data. THe method is like this. If my F value is smaller than the value of F from ...
0
votes
2answers
72 views

PL SQL Function while loop ending unexpectedly

i have a function where i want to calculate seconds between two dates these seconds should be calculated only in our companys opening hours. because it can take several days for the task to be ...
1
vote
2answers
112 views

Combining Continuous Loop in Switch-Case Function

I have a robot performing a dance, and I am trying to make it so that during the dance, if at any point the robot runs into a wall (a while loop im assuming), it will display something on the lcd ...
0
votes
2answers
97 views

c++ functions while loop

When I type in a decimal for number of employees it outputs "Please enter a value of atleast 1" an infinite number of times. But shouldnt the decimal be truncated? How do i fix this so the decimal is ...
3
votes
3answers
133 views

Why `do { …; exit(…); } while (0)` in C? [duplicate]

As a C newbie I'm having trouble understanding the following code: #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \ } while (0) I gathered that the reason ...
0
votes
1answer
80 views

While loop using only mysql query language

I have some trigger to save call records as blob into database. I want to add some extra function that will execute each time with trigger and will help to keep database in some size limits: function ...
1
vote
3answers
86 views

Lua table read and match efficient

My problem is simple, i used to do this in order to check if any of my lines (see photo) bump into any other line (or trail of any other line). But the way i do this now is by doing a lot of if ...
0
votes
1answer
182 views

While Loop Won't loop C++

I can't seem to figure out why this while loop stopped looping. It was doing fine before I moved some code around. Now I got something else working and it just doesn't loop. I've also tried making ...
1
vote
1answer
55 views

functions outside of loop not updating

I'm trying to do a loop that display a few conditions based on load average and cpus/memory etc. However, it seems like it only pull the usage information once for the entire loop. I want it to update ...
1
vote
2answers
61 views

Return a value from a function called in while loop

The point is to guess a random number choosen from an interval of integers and do it within a fixed numbers of attempts. The main function asks the upper limit of the interval and the number of ...
-2
votes
1answer
59 views

Function to return a character into a while loop

I'm trying to write a calculation program that, when it has run through once asks the user if they wish to make another calculation. This has the form of a separate function that is called at ...
0
votes
2answers
42 views

printing randome choices from an array

I am working on a function that picks random numbers from a given array and prints them to stdout. These numbers should not repeat and how many numbers are picked is given to the function along with ...
2
votes
2answers
45 views

Cleanest way to use multiple values in a complex routine?

See the following pseudocode snippet that approximates my situation: function foo () { for ( velocity=0; velocity<100; velocity++ ) { root1 = computeRoot1(); root2 = computeRoot2(); ...
2
votes
1answer
468 views

Using a Loop Inside a Function

I'm still learning functions and how they work. I know what I'm doing wrong just not how to fix it. I am writing a function to pull image data out of a database and return it onto the screen. It works ...
1
vote
1answer
175 views

Perform loop while function return false until it return true (or fail)

How can i write this code with a loop ? $date = new DateTime; if(checkForDate($date->format('m')) == true) { return true; } else { $date->sub(new ...
0
votes
2answers
660 views

function while loop

I'm trying to get this function to work properly in javascript, well it is working properly what i can get to happen is the bottom console.log (work(" gallons of water has been extracted from the ...
2
votes
2answers
70 views

Javascript function breaking a whole program?

I've written a program that basically pops alert boxes whenever buttons are pressed. The problem is, one of my functions is behaving pretty weirdly and I can't figure out why. Sometimes the function ...
0
votes
1answer
561 views

MySQL While Loop in PHP Function

How can I transform a PHP Function's MySQL Loop in to an HTML custom markup tag? I have a MySQL While Loop in a PHP Function. Basically, block code so if need be, can be reused without any user ...
1
vote
2answers
89 views

Returning a list in a function. Also, issue with while loop

I'm new to programming/Python and having trouble creating a function. I'd like my function to allow a user to input words in a list and ask the user if they'd like to input additional words. If the ...
0
votes
1answer
428 views

My first table valued function and cursor

I have this query: SELECT name, lastname FROM contestant WHERE name= 'John' AND lastname = 'Smith' I get several results from the query above and I need to use them for the following query: ...
5
votes
2answers
277 views

How to write function simulating while loop in Scala

How can I write function which simulates while loop? It should takes 2 arguments: condition and expression to execute. I tried the following: val whileLoop: (Boolean,Any)=>Unit = ...
2
votes
1answer
189 views

Tips for function inside while loop and i=i+1, Matlab

I have a problem with a function in matlab. This specific function is for filtering light signals. As you can see below I added the coding I’ve used in the function and in the while loop itself. The ...
2
votes
2answers
123 views

Odd 'while' loop behavior with a subfunction call (MATLAB)

So I have this bizarre problem that I cannot figure out. I have a while loop that is passing values into a vector according to an index. These values are provided by a subfunction that is called. My ...
-1
votes
2answers
32 views

Isearch return t if found for loop function in Emacs Lisp

How to write a function where whenever a variable is found, it returns t (in order to allow a loop): (setq x 1) (while ("backward search for regexp "%x" equals true") ;where x is variable (setq x ...
1
vote
2answers
106 views

While loop exiting prematurely

So this program is supposed to unjumble a word to show valid words of the same length. This was an assignment that required dynamic memory allocation within functions and got rather messy. In the ...
0
votes
0answers
68 views

Money conversion issues

This is a money conversion program I've been working on. Laughably, I have everything working OK except for the actual currency conversion part. Any suggestions? Option Explicit On Option Strict On ...
-3
votes
1answer
109 views

call to undefined function in PHP [closed]

I have a PHP code which I am using to display the list of comments from my database to the webpage. CODE- while ($row = mysqli_fetch_assoc($query)) { // Loop through results of query if ...

1 2
15 30 50 per page