Avatar billede mortency Nybegynder
02. november 2004 - 10:18 Der er 3 kommentarer og
1 løsning

Sub feil med If then end if

Hva er feil med denne sub?

Det virker hvis jeg deler if setningen over 3 linjer

Sub SubBold(strInput)
Dim BoldList
    BoldList = BoldList & "<option value='100'" & If strInput = "100" then & " selected " End if & ">100</option>"
    'BoldList = BoldList & "<option value='200'" & If strInput = "200" then & " selected " End if & ">200</option>"
    'BoldList = BoldList & "<option value='300'" & If strInput = "300" then & " selected " End if & ">300</option>"
    'BoldList = BoldList & "<option value='normal'" & If strInput = "normal" then & " selected " End if & ">Normal</option>"
    'BoldList = BoldList & "<option value='500'" & If strInput = "500" then & " selected " End if & ">500</option>"
    'BoldList = BoldList & "<option value='600'" & If strInput = "600" then & " selected " End if & ">600</option>"
    'BoldList = BoldList & "<option value='bold'" & If strInput = "bold" then & " selected " End if & ">Fet</option>"
    'BoldList = BoldList & "<option value='800'" & If strInput = "800" then & " selected " End if & ">800</option>"
    'BoldList = BoldList & "<option value='900'" & If strInput = "900" then & " selected " End if & ">900</option>"
    Response.Write(BoldList)
End sub
Avatar billede mortency Nybegynder
02. november 2004 - 10:31 #1
Er dette eneste måten jeg kan løse dette på?

<option value="100" <%If strInput = "18px" then %> selected<%End if%>>18 100</option>
Avatar billede mortency Nybegynder
02. november 2004 - 10:43 #2
Kan det løses på en bedre måte en dette?

Sub SubBold(strInput)
    If strInput = strInput Then
        BoldList = BoldList & "<option value='" & strInput & "' selected>" & strInput & "</option>"
    End if
   
    BoldList = BoldList & "<option value='100'>100</option>"
    BoldList = BoldList & "<option value='200'>200</option>"
    BoldList = BoldList & "<option value='300'>300</option>"
    BoldList = BoldList & "<option value='normal'>Normal</option>"
    BoldList = BoldList & "<option value='500'>500</option>"
    BoldList = BoldList & "<option value='600'>600</option>"
    BoldList = BoldList & "<option value='bold'>Fet</option>"
    BoldList = BoldList & "<option value='800'>800</option>"
    BoldList = BoldList & "<option value='900'>900</option>"
    Response.Write(BoldList)
End sub
Avatar billede mortency Nybegynder
02. november 2004 - 10:44 #3
Nå kommer jo feltet to ganger....
Avatar billede mortency Nybegynder
06. januar 2005 - 15:46 #4
lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester