Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More then and less then?

Status
Not open for further replies.

marcel2

Vendor
Mar 9, 2003
14
NL
How can I get this to work I need to calculate if something is more then 7 and less then 12 the answer has to be 2. I did try this but it's not working.

if ($UNKMH > 7 && < 12) {$UNBFT =&quot;2&quot;;}

I'm a new with writing so please gif me the sollution.

Greatings
Marcel
 
Thanks for the quick help it's working.

I hope you can help me with this to
If there is a type of weather I want a picture to be displayd I do get the name of the picture but the picture wil not display.

# Weather images
@WIMGS=(&quot;blank.gif&quot;,
&quot;blank.gif&quot;,
&quot;frigid.gif&quot;,
&quot;snowwindy.gif&quot;,
&quot;fog.gif&quot;,
&quot;drizzle.gif&quot;,
&quot;rain.gif&quot;,
&quot;hail.gif&quot;,
&quot;thunderstorm.gif&quot;,
&quot;thunderstorm.gif&quot;);

($WW1)=($WW=~/(\d)./);
if ($WW1) { $WW1=&quot;@Wy[$WW1]&quot;;
$wimg=$WIMGS[$WW1];

} else { $WW1=&quot;N/B&quot;;
$wimg=$WIMGS[0];

}

Hope you can help me with this to.
Greatings
Marcel
 
We'll need some more details on this one. What is in $WW ? What is this referring to: @Wy[$WW1] ?
Something like this might be better done with an associative array (hash), but that depends on your input.

----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
WW = a field in the dbase*. txt file

if ($W1.$W1.$WW eq &quot;nullnullnull&quot;) {
$WEATHER=&quot;N/B&quot;;
} else {
$WEATHER=&quot;$WW1 / $W1, $W2&quot;
}
@Wy=(&quot;No rain&quot;,
&quot;No rain,&quot;,
&quot;Rain in past hour&quot;,
&quot;Snow/wind&quot;,
&quot;Haze&quot;, ex,ex,

A picture has to be displayed if the code in the dbase now *.txt but it wil be MySQL is not NULL but if it's 3 it shows Snow/wind as text that works and it has to show the picture snowwindy.gif

@WIMGS=(&quot;blank.gif&quot;,
&quot;blank.gif&quot;,
&quot;frigid.gif&quot;,
&quot;snowwindy.gif&quot;,
&quot;fog.gif&quot;,
&quot;drizzle.gif&quot;,
&quot;rain.gif&quot;,
&quot;hail.gif&quot;,

first is alway 0.

Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top