Sign in to follow this  
Followers 0
layer

Do Until and Else If

4 posts in this topic

Here, I'll give part of the code, just the basics...

Do
    $get = GUIGetMsg()
    if $get = $f then
        CDtray ("F:", "Open")
     elseif $get= $e Then
        CDtray ("E:", "Open")
             else 
        if $get= $a Then
           CdTray ("A:", "Open")
Until $get = $GUI_EVENT_CLOSE

im not sure how to fit all of those else's and if's in the do until...anyone have any ideas? :)


FootbaG

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You have no EndIfs.

Do
   $get = GUIGetMsg()
   if $get = $f then
       CDtray ("F:", "Open")
    elseif $get= $e Then
       CDtray ("E:", "Open")
    elseif $get= $a Then
          CdTray ("A:", "Open")
    EndIf
Until $get = $GUI_EVENT_CLOSE

Why don't you do something like this though:

While 1
   $get = GUIGetMsg()
   Select
   Case $get = $GUI_EVENT_CLOSE
       ExitLoop
   Case $get = $f
       CDtray ("F:", "Open")
    Case $get= $e
       CDtray ("E:", "Open")
    Case $get= $a
          CdTray ("A:", "Open")
    Endselect
WEnd

[Edit]

Code fixed

Edited by the_lord_mephy

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

thank you sir, works great, i used your suggestion too with the While 1 and Wend instead of Do Until

Except, there is supposed to be no "then" statements in the Case thing.

Thank you!


FootbaG

Share this post


Link to post
Share on other sites

Oh yeah whoops I just copy pasted your script and replaced the elseifs with Cases. whoops gunna fix that


My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

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