WP7 - IsolatedStorageSettings using IF STATEMENTS?

53 views Asked by At

i was just playing around with the isolated storage settings in my app and i decided to add these options: Alphabetically, Newsets to oldest and Oldest to newest. all these values are stored in a listpicker and they save and load fine but the error is that when i add more if statements it wont work. e.g. this is what wont work:

 Try
        Dim ListOrder As Byte = CByte(AppSettings("OrderNotes"))
        If ListOrder = 1 Then
            AscendingOrder()
        ElseIf ListOrder = 1 Then
            NewestOldest()
        ElseIf ListOrder = 2 Then
            OldestNewest()
        End If
    Catch ex As KeyNotFoundException
        AppSettings.Save()
    End Try

This will work:

Try
        Dim ListOrder As Byte = CByte(AppSettings("OrderNotes"))
        If ListOrder = 1 Then
            AscendingOrder()
        ElseIf ListOrder = 2 Then
            NewestOldest()
        End If
    Catch ex As KeyNotFoundException
        AppSettings.Save()
    End Try

Seems that only if it's either If or else. can't be elseif else if else if... so on. Is there a way to solve this? so i can choose more than 2 options.

Thanks!

0

There are 0 answers