Jump to content

Do Until and Else If


layer
 Share

Recommended Posts

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
Link to comment
Share on other sites

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]
Link to comment
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]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...