
-----------------------------------
person
Thu Jan 13, 2005 4:09 pm

need help for no values
-----------------------------------
When i run this code, there is obviously going to be 2 variables that dont have a value. How do i tell the computer that to make the variables with no values have a value equal to 40. Here's my code.

var as : int := Rand.Int (1, 100)
var s1, s2, s3, s4, s5 : int
if as >= 1 and as = 51 and as = 76 and as = 90 and as = 51 and as = 76 and as = 1 and as = 83 and as = 26 and as = 64 and as = 40 and as = 71 and as = 51 and as = 76 and as = 1 and as = 83 and as = 26 and as = 64 and as = 40 and as = 71 then
    s4 := 30
else
    s5 := 30
end if

-----------------------------------
Neo
Thu Jan 13, 2005 4:39 pm

Re: need help for no values
-----------------------------------
When i run this code, there is obviously going to be 2 variables that dont have a value. How do i tell the computer that to make the variables with no values have a value equal to 40. Here's my code.

Whuh? :? 
You want a variable to have a value of 40?

var variable_name:=40
  :roll: 
Use code takes to avoid having bits of ur code turn into emoticons.

-----------------------------------
Tony
Thu Jan 13, 2005 4:48 pm


-----------------------------------
are you asking for a [url=http://www.compsci.ca/v2/viewtopic.php?t=7330]suspension ?

-----------------------------------
Cervantes
Thu Jan 13, 2005 5:05 pm

Re: need help for no values
-----------------------------------
When i run this code, there is obviously going to be 2 variables that dont have a value. How do i tell the computer that to make the variables with no values have a value equal to 40. Here's my code.

Whuh? :? 
You want a variable to have a value of 40?

var variable_name:=40
  :roll: 
Use code takes to avoid having bits of ur code turn into emoticons.
He's asking how to check if a variable has no value.  Look at his program, everything is based on the value of 'as'.  
In this case, person, what you could do is, when you declare those five variables, give them all a value of 40.  When your program runs, some of them will be changed.  The ones that aren't changed would be the ones that would have had no value if you don't assign them a value when you declare them.
-Cervantes
