Skip to main content

Questions tagged [if-statement]

An "if" statement is a flow control structure in most programming languages that branches execution flow depending on a binary condition, generally evaluated at runtime. If statements are also commonly also called conditionals. When using this tag please also include an appropriate language tag, such as e.g. "java" if your question is language-specific.

0 votes
1 answer
17 views

SAS how to use character variable in if statment

I want to use character variable for if statement comparison, however why SAS always trying to treat it as numeric? let VAR = "apple" other code... %macro Exec_day1(); If &VAR. eq &...
Yumeng Xu's user avatar
  • 225
0 votes
1 answer
14 views

How if condition works in SAS background?

How do if works if i write the code below: data B; h= 1; D="M"; run; data c; set b; length nn $30; type = vtype(H); if type eq "N" then nn=put(h,best.); else if type eq ...
Kavya's user avatar
  • 1
0 votes
0 answers
1k views

Iterations and multi-replacement

I have a file named file.in that contains 6 columns of data. One of the columns contains the mean and another contains the error. File.in is around 900 lines long with a different value for mean and ...
Allyand Camshow's user avatar
0 votes
1 answer
39 views

How to compare float numbers in an if conditional in BASH?

My code is: #!/bin/bash rm N_Matrix.csv Lineas=`wc -l $1| awk '{print $1}'` for (( i = 1 ; i <= Lineas ; i++ )); do Numer_1=`awk -vvar=$i 'NR==var' $1` for (( j = 1 ; j <= Lineas ; j++ ))...
Another.Chemist's user avatar
-2 votes
3 answers
85 views

How can I rewrite this block of if / Else if into a more structured, condensed and optimal way. (C#)

In C# .NET. This block of if/else if works fine, but its getting cumbersome to maintain and read. I want a more optimized writing style. if (Globals.SRSI < 10 && Globals.SRSI != 0 &&...
Harold's user avatar
  • 11
-3 votes
2 answers
51 views

program doesn't start and there isn't an issue that comes up after I run it. While loops, myFunction() and if

I am making a program where you have to guess the secret password. If you don't then the program will alert you. I expect that the problem lies with label. I have tried innerText, innerHTML, ...
daniel's user avatar
  • 13
-7 votes
0 answers
33 views

Code will use "if", "else", "else if" statement [closed]

if, else, else if statement: if else else if Get JavaScript. Get it for the JavaScript code. Tips: Use this if, else, else if statement. Get if, else, else if statement. What if the code will ...
Eramae Canonigo Hernan's user avatar
0 votes
1 answer
13 views

PBI - Year total value does not reflect the DAX I wrote

Screen shot of my Dax and Table All past data in actuals are finalized. If I only show actuals data, the full year graph looks off due to the rest of the year being 0. So, we wanted to set if future ...
James Tolford's user avatar
0 votes
0 answers
29 views

Depended dropdown with extra nested if statement

I have the following code, that works, for a depended dropdown menu. Right now it does: IF column 5 <> "", then put depended dropdown of that name in column 6. And if column 6 <> ...
Jody's user avatar
  • 1
-3 votes
1 answer
73 views

How to repeat an action until something specific is entered?

This was my original idea: import os, time while True: os.startfile(r"c:\Users\owcor\OneDrive\Desktop\notepad.exe") time.sleep(5) inp = input("") if inp == "...
Weegee's user avatar
  • 11
0 votes
4 answers
69 views

Why does my if statement return false when using 'and not'? [duplicate]

I am trying to make a hangman game in python for practice(I'm pretty new to coding and a total newbie with python) When i try to check if a 'chosenLetter' is in 'randomWord' and not in the '...
M. de Brock's user avatar
0 votes
2 answers
76 views

Can an else if statement be used to create a step-wise reveal of elements with JavaScript?

Edit: Thank you! This problem is resolved. This was my first StackExchange question and you've all been very kind in responding so quickly, insightfully and thoroughly. I'm building a page that has an ...
J Park's user avatar
  • 3
-4 votes
2 answers
36 views

Repeated result for if statement in python [duplicate]

token_list = ['lg', 'was', 'beaten'] defined_words = ['hand', 'leg', 'head', 'arm', 'finger', 'wrist', 'thigh'] for i in range(0, len(token_list), 1): if token_list[i] in defined_words: ...
Oghenetejiri Obesare's user avatar
-1 votes
0 answers
11 views

Mark Cell as Y if 0, N is greater than 0 and cell to remain blank if no input and registered as a blank cell

I am trying to find a formula the will mark Cell as Y if 0, N if cell is greater than 0 and the cell to remain blank if there is no input in that cell =IF(K18=0;"Y";"N") but if i ...
Ashley Fleming's user avatar
1 vote
1 answer
27 views

Multireplacement in .dat file lines

I have a .dat file. I want to read each line and replace a value in each line with a different value. Then save this to a new out.dat file. Every replacement is independent and I want to copy over the ...
Allyand Camshow's user avatar

15 30 50 per page
1
2 3 4 5
4148