#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    17
    Rep Power
    0

    Missing comma (,) during words


    Hi,

    Please, can anyone let me know what wrong with the following code.

    Coz I want Film,Dance,Music like (comma) during words.

    But I got only FilmDance,Music whatever I try I got without
    comma behind Film.

    I want comma(,) behind Film but I want only when I choose more than Film. Like eg(Film,Dance) but if only Film I want eg(Film) no comma.

    Please, can anyone advice me for this. Thanks.

    <%
    Dim strArtFields
    strArtFields = ""
    If Len(rs("Artistic_Field_Literary_Arts")) >0 Then strArtFields = strArtFields & "," & rs("Artistic_Field_Literary_Arts")
    If Len(rs("Artistic_Field_Dance")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Dance")
    If Len(rs("Artistic_Field_Music")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Music")
    If Len(rs("Artistic_Field_Theatre")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Theatre")
    If Len(rs("Artistic_Field_Visual_Arts")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Visual_Arts")
    If Len(rs("Artistic_Field_Others")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Others")

    If Left(strArtFields, 1) = "," Then strArtFields = Right(strArtFields, Len(strArtFields) -1)

    response.write rs("Artistic_Field_Film") & strArtFields
    %>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    113
    Rep Power
    9
    Code:
    <% 
    Dim strArtFields
     strArtFields = ""
     If Len(rs("Artistic_Field_Literary_Arts")) >0 Then strArtFields = strArtFields & "," & rs("Artistic_Field_Literary_Arts")
     If Len(rs("Artistic_Field_Dance")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Dance")
     If Len(rs("Artistic_Field_Music")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Music")
     If Len(rs("Artistic_Field_Theatre")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Theatre")
     If Len(rs("Artistic_Field_Visual_Arts")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Visual_Arts")
     If Len(rs("Artistic_Field_Others")) >0 then strArtFields = strArtFields & "," & rs("Artistic_Field_Others") 
     If trim(rs("Artistic_Field_Film") & " ") >"" then strArtFields = rs("Artistic_Field_Film") & ", " & strArtFields 
    If Left(strArtFields, 1) = "," Then strArtFields = Right(strArtFields, Len(strArtFields) -1)
     
    response.write strArtFields
     %>
    That should work
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    Missing comma (,) during words


    Check your sentences to see which ones open with an introductory word, phrase, or clause.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    Croatia
    Posts
    65
    Rep Power
    2
    Tray too find sentences for your work.

IMN logo majestic logo threadwatch logo seochat tools logo