Sign in to follow this  
Followers 0
walle

Func DriverStatus(), Doing wrong as always

7 posts in this topic

Func DriverStatus()
$var1 = DriveStatus( "e:\" )
MsgBox(4096,"Status",$var1)
EndFunc

If $var1 = "NOTREADY" Then
    Msgbox(4096,"INGEN DVD-R SKIVA FUNNEN","Sätt i en DVDr skiva")
    EndIf

Well, as you probably can see, this script won't work....

I'm still learing, Can u lend me a helping hand?

Share this post


Link to post
Share on other sites



You need to perform the func ... something like this ?

If DriverStatus() = "NOTREADY" Then
    Msgbox(4096,"INGEN DVD-R SKIVA FUNNEN","Sätt i en DVDr skiva")
EndIf
;
Func DriverStatus()
    Return  DriveStatus( "e:\" )
EndFunc

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ah, stupid me, Thanks for the fast replay!

Back too scripting, you will probably hear more from me ^^

Share this post


Link to post
Share on other sites

No need for a function here, how about somthing like

CODE
Select

Case DriveStatus( "e:\" ) = "UNKNOWN"

MsgBox(0, "", "Drive status: unknown")

Case DriveStatus( "e:\" ) = "READY"

MsgBox(0, "", "Drive status: ready")

Case DriveStatus( "e:\" ) = "NOTREADY"

MsgBox(0, "", "Drive status: not ready")

Case DriveStatus( "e:\" ) = "INVALID"

MsgBox(0, "", "Drive status: invalid")

EndSelect

Share this post


Link to post
Share on other sites

No need for a function here, how about somthing like

CODE
Select

Case DriveStatus( "e:\" ) = "UNKNOWN"

MsgBox(0, "", "Drive status: unknown")

Case DriveStatus( "e:\" ) = "READY"

MsgBox(0, "", "Drive status: ready")

Case DriveStatus( "e:\" ) = "NOTREADY"

MsgBox(0, "", "Drive status: not ready")

Case DriveStatus( "e:\" ) = "INVALID"

MsgBox(0, "", "Drive status: invalid")

EndSelect

OR

Switch DriveStatus("e:\")
    Case "UNKNOWN"
        MsgBox(0, "", "Drive status: unknown")
    Case "READY"
        MsgBox(0, "", "Drive status: ready")
    Case "NOTREADY"
        MsgBox(0, "", "Drive status: not ready")
    Case "INVALID"
        MsgBox(0, "", "Drive status: invalid")
EndSwitch

Share this post


Link to post
Share on other sites

Symantics..:)

Share this post


Link to post
Share on other sites

Well, that's a new approach!

Select, Case, Endselect worked better with the rest of the script

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0