Can a else if, or else statment contain a condition ? If the condition is not meet then, nothing happens other wise one of the else if or if statements is read ?

Member Avatar
Member Avatar
+0 forum 38

Hi, Im trying to extract data from sql server where conditions are multiple and variying I have a datagridview with 2 columns ID and Name I need to create Select Query to extract data where condition is 'ID should be equal to the value or values in Datagridview ID Column. im using sql server 2008 r2 vb.net 2010 Please help Thank you

Member Avatar
Member Avatar
+0 forum 9

i write a code of multithreading in which arise an race condition code is below class Race1{ public void show(String s){ try{ System.out.print("["+s); Thread.sleep(1000); }catch(InterruptedException e){ e.printStackTrace(); } System.out.println("]"); } } class Checking implements Runnable{ Race1 ob=new Race1(); String s; public Checking(String s){ this.s=s; } public void run(){ synchronized(ob){ ob.show(s); } } } class RaceCondition2{ public static void main(String args[]){ Thread t1=new Thread(new Checking("Hello")); Thread t2=new Thread(new Checking("World")); Thread t3=new Thread(new Checking("Complete")); t1.start(); t2.start(); t3.start(); try{ t1.join(); t2.join(); t3.join(); }catch(InterruptedException e){ e.printStackTrace(); } } } but problem is that i handle it by `synchronized block` in line no `27` and …

Member Avatar
Member Avatar
+0 forum 5

Wordpress - I want to use a title condition for displaying info on a page, from a MySQL table "country". The condition must compare the title with the names in the column "name" and when it match a value than display on the page the text from column "description" from the same row with the matching value. Example : title(USA)=column name (USA) get/fetch column (description) (the description from row USA). I had tryed a code <?php $page_name = $wp_query->post->post_name; query_posts('category_name='. $page_name); ?> <?php global $wpdb; $result = $wpdb->get_row ("SELECT name FROM country WHERE parent IN (SELECT parent FROM country WHERE …

Member Avatar
Member Avatar
+0 forum 2

I made a new MySQL table in Phpmyadmin in Wordpress in the same database from Wordpress but a new table. I want to make a new page and add a script in the body that allows: 1. when i insert the page title to the new page, the script should search the database table "workers" just in the column "name" and when it matches title(example "Jimbo") to the value in the column "name" (example "Jimbo") than display the "description" from name "Jimbo" (as in the table look down just "Jones"). It must search and display automatically. 2. or when i …

Member Avatar
Member Avatar
+0 forum 2

Hi Just asking for a better solution for my approach in getting sql result with different multiple conditions based on comboboxes. I have a 4 comboboxes, for Branch, Type, Status and other info. User can select conditions from this comboboxes. The default value is "All", meaning no specific condition at all, but can choose from this cb's simultaneously. For example the user can choose specific type with all status and all other info, can also choose specific type, condition and all other info. in short he can select any combination of conditions from this cb's. I know I could query …

Member Avatar
Member Avatar
+0 forum 12

How To Determine The Best Score? I am doing a lab regarding 'guess number game' Actually,the answer should be the random number,but I set the exact number to 88,because it is easy for me to test other requirement. I need to printf("Best Score so far [X]") How to make comparison between the previous and now guess game,and define the best score. #include <stdio.h> int main() { int GusNum,TotalNum,BesSor,a; char again; do { TotalNum=0; do { printf("Guess what the lucky number is <between 1 and 100>,then <Enter>:"); scanf("%d",&GusNum); if(GusNum>=89&&GusNum<=100) printf("The number you typed is [%d] -Too LARGE,guess the lucky number again!\n\n",GusNum); …

Member Avatar
Member Avatar
+0 forum 3

I have 2 processes (producer and consumer) sharing an int deque in shared memory, I have the producer process put 2 numbers in the deque and then it gets in a wait state losing its mutex lock. I then have the consumer process removing the numbers and printing them. It then does a notify on the condition which the producer is waiting on. The consumer then goes on its own wait on a second condition. After this case the producer does not wake up. I am using the same mutex between the processes. Please find all code below. Include file …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone! So, I hereby hope to show that I've made progress in coding java (largely due to the help of this great community). I want to thank everyone for dealing with me (especially James). :) The goal: The code below is supposed to seed a layout of boats into a 2D array. This is part 1 of an excersize I've given myself - create code to seed boats horrizontally and vertically, boats must not collide, boats must not be out of bounds. The issue: Usually the layout comes out just fine. But sometimes, some boats are missing in length …

Member Avatar
Member Avatar
+0 forum 32

Hello Good day. Here is the problem I am trying to solve. I have a table as seen below. ![232465554203149acd8363d3a4a127ae](/attachments/large/3/232465554203149acd8363d3a4a127ae.jpg "232465554203149acd8363d3a4a127ae") My GOAL: Columns A through G are going to be filled with integers. (I have already created an integer model so that these cells only take integers). As the cells in that range are filled, the Totals column will decrease in number until it reaches zero. So far I have managed to use a TableModelListener to respond to the changing cell values. What I wish to do now is to prevent a cell, *that is being edited*, from *accepting* …

Member Avatar
Member Avatar
+0 forum 14

hai everybody, i need help in multiple true if condition IF (condition 1 is true) { $('.cCal').css('border-color','red'); return false; } and (condition 2 is true) { $('.cCal2').css('border-color','red'); return false; } (condition 3 is true) { $('.cCal3').css('border-color','red'); return false; } this syntax working only one condition is true. more than one condition is true meand excute only first statemnt i want to more than one true condition execute all the fucntion plz help me.

Member Avatar
Member Avatar
-1 forum 2

In this code, I need to put a limitation in every part where the user is asked to input data. The user will be asked to input a grade ranging from 50-100, and if his input is not in the range, the program will display a warning, and if the user inputted the wrong range 3 times, the program will terminate. What should be the proper way? I can't get it right when I use iteratives. code: #include<stdio.h> #include<conio.h> main () { float csPrelim, prelimExam, prelimGrade; float csMidterm, midtermExam, midtermGrade; float csFinals, finalsExam, finalsGrade; int username,userpass; int a; a = …

Member Avatar
Member Avatar
+0 forum 1

Hi, I'm new to junit. I want to create test cases for if condition,loops. do we have any guidelines to write test cases for if conditions.Can any1 explain with an example. Thanks in advance. Lavanya

Member Avatar
Member Avatar
+0 forum 2

Hello, I was given a question a few few days back to write a program that lets a user enter a value for an angle and quadrant in which the angle lies is printed using switch statement. I was able to make this program using if-else very easily but making it with switch statement is a problem.. I tried using [CODE]switch (angle) { case (angle>=0 && angle<=90): printf("1st quadrant"); break; . . . . }[/CODE] and so on....(where angle is the variable in which the value of angle is stored ) it gives me the error "Case constant required in …

Member Avatar
Member Avatar
+0 forum 7

hi. uhm. im having a problem with coding such conditional statement that would check if a certain input contains a certain subs tring. for example. i have a text box that is used for the user to input a string. (0,1) then i have a command button to determine if the string inputted contains a sub string of '1' on the 3rd position. if the inputted string includes '1' at the third position then a label would display "accepted!" if not, "not accepted" eg. input | output 000101 not accepted 001001 accepted 011010 accepted 11001 not accepted thankyou so much …

Member Avatar
Member Avatar
+0 forum 7

Here is code which i am using Please check it first [CODE] for(x=0; x<=y; x++){ if(a=x||b=x||c=x){ printf("Value =%d",x); } } [/CODE] In this code x is a base for the loop i want loop till y (variable). Now inside the loop i want to check a condition if x (variable) is equal to any of these Variables a,b,c then print the Value of x. This code is not working i get Lvalue error with it. Regards

Member Avatar
Member Avatar
+0 forum 2

I am working on improving the visual appeal of table rows. The data in table rows is generated dynamically and has lots of information. There is a column in that table which gives the time when that particular information row was issued. On the basis of the days/months etc before which the information was issued, I have to color the different rows. It's exactly like as shown in the following link : [url]http://www.nseindia.com/live_market/dynaContent/live_watch/equities_stock_watch.htm[/url] Moreover, the table rows must also have a small colored bar,the color of which will be determined by another field in the same row.I am wondering how …

Member Avatar
Member Avatar
+0 forum 17

Hi Everyone, I want to write a condition for Datetime to show gridview. The condition is that the gridview has to show data for updating datas in DB only from [B]Friday 5:00pm to Saturday 4:00PM[/B] How can I give this condition.I had tried various datetime methods but i cant figure it out. Can Someone help me to write this condition. Thanks Pavan Kumar

Member Avatar
Member Avatar
+0 forum 1

Hi i'm new to xslt the below code for getting chart in pdf after clicking the chart checkbox [CODE] <xsl:if test="$chartimage"> <fo:block text-align="center" space-after="8em"> <fo:external-graphic xmlns:fo="http://www.w3.org/1999/XSL/Format" scaling="uniform"> [B]<xsl:attribute name="src">[/B] <xsl:value-of select="concat(concat('url(',$chartimage),')')" /> </xsl:attribute> </fo:external-graphic> </fo:block> <xsl:if test="$chartPageBreak='true'"> <fo:block break-after="page" /> </xsl:if></xsl:if> [/CODE] bold coded setted attribute name through that they are getting url this is happening when the chart checkbox clicking this below code for getting table without condition i can get by default but i disable the check box of table the table also coming with the chart. i don't know how to fix it. this are in the …

Member Avatar
+0 forum 0

Hi masters! I have a problem with my while loop. I realised that my code does not work the way I want. It has to check if sum of def, mid and att variables is different from 10 or if style variable is different from multiple strings. So if any of them does not meet the requirement, repeat the code in {} . My style condition which is repeated is interfering with other style conditions. So my question is - How to write this while loop (or it doesn't have to be while) to give me the thing I want? …

Member Avatar
Member Avatar
+0 forum 3

Hello, I have a string taken as input from user. I just want to check if a particular character within that string, is part of Standard English character set or not. How do I code the IF condition for this purpose? Regards, Arvind.

Member Avatar
Member Avatar
+0 forum 4

Hi! On school we got exercise to calculate how much the length of substance grow when we know original length and temperature change. So,the case goes that i have value temperature coefficient of different substances and i have to multiply them. I'd like to it without doing several condition statements. I tried to do a class and function but it didn't work out. Here's the code, and i don't have any clue how to finish it. It should calculate like aluminium*1meter*1celsius and print out answer without using condition statements, but is there a way to do it? [CODE]#-*- coding: cp1252 …

Member Avatar
Member Avatar
+0 forum 4

Hi, is it ok to use an if condition as a presence check, this is my code - [ICODE]if (textBox1 != null) { MessageBox.Show("Dont Leave Blank"); } else MessageBox.Show("Successfully added");[/ICODE] my code runs however no matter if there is text in textbox1 or if its left empty it shows "Dont Leave Blank" any suggestions? thanks

Member Avatar
Member Avatar
+0 forum 4

Hello! I'm a beginner in the worl of C++. I'm building a program that acts as a launcher for a game. In it I have Start and Exit button. What I want the Start button to do is start an .exe with extra conditions: IP and Port. [CODE] if (nResponse == IDOK) { // Code when hit Start } [/CODE] Code what I want to enter is: [CODE]dklegend.exe NEWSTART Futec(***********:9909)[/CODE] How should I have my if condition written to make this happen? The app is an MFC!

Member Avatar
Member Avatar
+0 forum 3

Hi I'm trying to modify a Shipping module for an online shop but I'm not getting it to work...I want to put two options on that, if customer chooses first option he gets one price for the shipment if he chooses second option then he gets a different price. The original module only allows one option for Shipment Method and I want to add a second option using two radio buttons. Basically I want to check what radio button is selected and then get the value, if first radio button is checked get it's value if the second radio button …

Member Avatar
Member Avatar
+0 forum 5

Do you know that there is clean way of doing what C-language ternary operator ? does in Python's recent versions. It is if with special twist. The syntax is: [CODE]'The value if true' if <condition> else 'Value when false'[/CODE] Values can be any type. You can put this structure to replace single value. In this classic number guess game version we practise using the structure even in a nested way. This is not maybe so advisable general way, as it is less clear than many print statements in normal if statement. Anyway, this came first to my mind as demonstration …

Member Avatar
+0 forum 0

Hello I was helping a fellow daniwebber and I noticed that I have no idea if it is possible and how the syntax works for it. Any help appreciated. example of how I think it works. [CODE] function retTrue(){ return true; } //code in if if(retTrue()){ //do some php } [/CODE]

Member Avatar
Member Avatar
+0 forum 5

The End.