Results 1 to 5 of 5

Thread: Is this possible? [Resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    229

    Is this possible? [Resolved]

    VB Code:
    1. Select Case Extention
    2.       Case "com"
    3.       Case "exe"
    4.       Case "gif" Or "jpg" 'Or "jpeg" Or "jpe" Or "psd" Or "pdd" Or "bmp" Or "pict" Or "pcx" Or "tif" Or "tiff" Or "png"
    5.         ImageNum = 10
    6.       Case "mp3" 'Or "wav" Or "ram" Or "ra" Or "rm" Or "au"
    7.         ImageNum = 6
    8.       Case "txt"
    9.       Case "zip"
    10.       Case Else
    11.         ImageNum = 5
    12.     End Select

    Well I know that the code I posted won't work, but is there a similar way to do it? Or must I type every single last CASE statement?
    Last edited by INF3RN0666; May 18th, 2003 at 03:11 PM.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Instead of using 'Or', just use a comma.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    229
    WOW...how did i miss that? LOL thanx man! Fewf, saves me sooo much time and typing!

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    You might want to use the statement

    Select Case LCase$(Extention)

    string comparisons are case sensitive. So if Extention happened to be Jpeg, the Case Else would be used.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    229
    Don't worry, it's already been taken care of as i assign the value to the variable. But thanx for pointing it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width