Register for your free account! | Forgot your password?

You last visited: Today at 16:03

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Frage

Discussion on Frage within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
amnesi's Avatar
 
elite*gold: 25
Join Date: Jun 2010
Posts: 1,076
Received Thanks: 290
Frage

Also das wenn eine Zahl zwischen der und der Zahl ist dann..
wie könnte man das anstellen?
Das sollte dann ungefähr so aussehen

PHP Code:
$Zahl random(1,20)
if 
$Zahl zwischen 1-10 Then 
    msgbox
(0,"Zahl","Zahl ist zwischen 1 und 10")
Else
    
msgbox(0,"Zahl","Zahl ist zwischen 11 und 20")
endif 

€: hat sich erledigt für die, die es interresiert, es geht so:

um herrauszufinden ob eine Zahl zwischen 1 und 10 oder 11 und 20 ist könnte das so aussehen:

PHP Code:
$Zahl random(1,20,1)

if 
$Zahl >= And $Zahl <= 10 Then
    msgbox
(0,"Zahl","Zahl ist zwischen 1 und 10")
Else
    
msgbox(0,"Zahl","Zahl ist zwischen 11 und 20")
endif 
amnesi is offline  
Old 11/11/2010, 18:52   #2
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
Quote:
Originally Posted by amnesi View Post
Also das wenn eine Zahl zwischen der und der Zahl ist dann..
wie könnte man das anstellen?
Das sollte dann ungefähr so aussehen

PHP Code:
$Zahl random(1,20)
if 
$Zahl zwischen 1-10 Then 
    msgbox
(0,"Zahl","Zahl ist zwischen 1 und 10")
Else
    
msgbox(0,"Zahl","Zahl ist zwischen 11 und 20")
endif 

zb so

PHP Code:
$Zahl random(1,201)
if (
$Zahl 1) AND ($Zahl 10Then
    msgbox
(0,"Zahl","Zahl ist zwischen 1 und 10")
Else
    
msgbox(0,"Zahl","Zahl ist zwischen 11 und 20")
endif


MsgBox("","",$Zahl) ;zum überprüfen obs stimmt.. 

wobei es in dem bsp auch so gehen würde: if $Zahl < 10 Then , da es ja eh von 1 anfängt...
aber das sollte ja als bsp sein denk ich mal..
omer36 is offline  
Reply




All times are GMT +1. The time now is 16:04.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.