Questions tagged [do-loops]

a 'do' loop is a specific type of iteration used to run code repeatedly based on the evaluation of a boolean statement or variable.

do (while) loops in Java: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html

do loops in Fortran: https://en.wikibooks.org/wiki/Fortran/Fortran_control#Loops

do loops in Scheme: https://schemers.org/Documents/Standards/R5RS/HTML/

389 questions
-1
votes
2 answers

Multiple strings to inntegers in SAS

I have a series of string variables (x, y, z) whose observations I need to change from strings (x= less than 1 mile, more than 1 mile less then 5 miles, etc.) to integers (xrecode= 1, 2, etc). Is there any automated way to do this? I need an…
Englishman Bob
  • 377
  • 2
  • 13
-1
votes
2 answers

PHP do-loop method

Can't seem to figure out where it's not working. In the center I need a line wiht only ++++++. But I can't seem to find it to work. I've got it to work with a while-loop and a for loop but not the do while loop. It's gotta look like this …
Deedss
  • 21
  • 3
-1
votes
4 answers

How to create a conversion of Fahrenheit to Celsius in java

The code should output a table for Fahrenheit and Celsius: public static void main(String[] args) { System.out.println("Fahrenheit\tCelsius"); System.out.println("======================="); for(int temp = -45; temp <= 120; temp += 5)…
A.B.
  • 7
  • 6
-1
votes
3 answers

How do I add inputs together in a do while loop?

hi im very new to javascript and stuck doing my homework. My question is how do I add multiple inputs together in a do while loop? I am supposed to get all the inputs added together then divided by the amount of inputs to get the average. For…
T.Trinh
  • 23
  • 4
-1
votes
1 answer

Vbscript for loop with len and mid

I was visiting Vxheaven.org , while i found this code to come up with a random file name . tmpname="" randomize(timer) namel=int(rnd(1)*20)+1 For lettre = 1 To namel randomize(timer) tmpname=tmpname & chr(int(rnd(1)*26)+97) Next typext =…
AkkixDev
  • 450
  • 3
  • 12
-1
votes
2 answers

Concatenating Variables in different datasets

I have multiple datasets with different columns. Let us suppose dataset 1 has col1,col2,col3 whereas datsets 2 as col1 and col2 only. Now I want to combine all these columns with a "," (comma).I have created a macro that will combine all the…
Swati Kanchan
  • 99
  • 2
  • 15
-1
votes
2 answers

Conditional Formatting Do Loop

I've code I want to apply to about 1,200 plus rows. Works fine for the first row I want it to apply to, if AC2 >= 1 then the row 2:2 changed to red, I want to repeat if AC3 >=1 then 3:3 red and so on... Sub…
Mikey
  • 165
  • 1
  • 14
-1
votes
2 answers

Adding loops to a formula and displaying only the values of the formula computation

I have two issues that I would appreciate a lot of help on: I have VBA linked to a button which computes values on some cells based on the inputted parameters. I am still a basic user however and could not get it to loop. The intention is for the…
-1
votes
3 answers

C++ loop each non-prime

I'm trying to do this : The User chooses one number The program calls the isaPrime() function so we see if number is prime or not. I wanted to do a loop so every time the number is not a prime, the user has to choose a new value. Here's the…
Amat Erasu
  • 73
  • 5
-1
votes
1 answer

sas macro for appending 24 tables

Hi I need help to append 24 sas tables. I would like to write a macro that appends 24 tables. How do I create a do loop with the least amount of typing. Thanks proc sql; create table master as select * from table1 union all select * from…
user601828
  • 499
  • 3
  • 7
  • 17
-1
votes
1 answer

Compile error: Invalid qualifier

I am trying to get my program to run through 2 workbooks and 3 worksheets. to validate some numbers for me. Sub Validate_Old_Data() Dim DBLbrow As Double Dim DBLAbrow As Double Dim DBLBbrow As Double Dim STRname As String Dim INTcc As Integer Dim…
Ori Meir
  • 51
  • 1
  • 7
-1
votes
1 answer

fortran77 do continue loops confused

I'm trying to translate a fortran program to a c++ version, and then I found such code: 100 DO 120 I=2,7 DO 110 J=1,3 IF(IU(J)/I*I-IU(J))120,110,120 110 CONTINUE GO TO 130 120 CONTINUE GO TO 150 130 DO 140 J=1,3 140 IU(J)=IU(J)/I …
-2
votes
1 answer

Do-while loop and arrays

Could someone please help me to make this loop? I want the user to have the option to continue Y/N at the end of the program to rerun or terminate it. Preferably a do-while loop? CODE (Java): public static void main(String[] args) { int size =…
sunnyb
  • 9
-2
votes
3 answers

How to display specific range in do loop in Ruby?

I'm having trouble display specific range of data in do-loop in Ruby. I Have this example code: Post
<% @post.each do |post| %>

<%= post.title…

laurence keith albano
  • 1,409
  • 4
  • 27
  • 59
-2
votes
1 answer

While loop and For loop together

Hi I want to run make for loop to run infinitely. for eg. while True: try: script() except Exception as e: script() continue as below because in For loop I have lists where i want to apply on scripts which run in…
1 2 3
25
26