DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4

Thread: Wierd If clause

  1. #1
    Larry Guest

    Wierd If clause


    Hi:
    I have following code:
    Set n = MyRecordset("NumberOfRadioButtons")
    For i = 1 to n
    Set CurrentOptionText = MyRecordset("OptionText" & i)
    if CurrentOptionText <> "" then
    Response.Write i
    Response.Write "<input type=""radio"" name=""Selections"" value=""VotingOption"""
    & i & ">"
    Response.Write CurrentOptionText
    Response.Write "<BR>"
    end if
    Next

    n is a number I read from database, then I will display n choices, with the
    info I stored in the database, I set those text to CurrentOptionText everytime...
    For some reasons, all the Response.Write clauses have been executed beside
    Response.Write CurrentOptionText.
    It is really strange... does anyone know why?



  2. #2
    Lia Guest

    Re: Wierd If clause


    "Larry" <larry@levelogic.com> wrote:
    >
    >Hi:
    >I have following code:
    >Set n = MyRecordset("NumberOfRadioButtons")
    >For i = 1 to n
    > Set CurrentOptionText = MyRecordset("OptionText" & i)
    > if CurrentOptionText <> "" then
    > Response.Write i
    > Response.Write "<input type=""radio"" name=""Selections"" value=""VotingOption"""
    >& i & ">"
    > Response.Write CurrentOptionText
    > Response.Write "<BR>"
    > end if
    >Next
    >
    >n is a number I read from database, then I will display n choices, with

    the
    >info I stored in the database, I set those text to CurrentOptionText everytime...
    >For some reasons, all the Response.Write clauses have been executed beside
    >Response.Write CurrentOptionText.
    >It is really strange... does anyone know why?
    >
    >


    I saw you're checking for CurrentOptionText<>"", have you tried making sure
    it's not null? Just a thought...

    Lia


  3. #3
    Larry Guest

    Re: Wierd If clause


    that's what I am checking... I made sure it wasn't null in another piece of
    code.
    "Lia" <lingersoll@thesiggroup.com> wrote:
    >
    >"Larry" <larry@levelogic.com> wrote:
    >>
    >>Hi:
    >>I have following code:
    >>Set n = MyRecordset("NumberOfRadioButtons")
    >>For i = 1 to n
    >> Set CurrentOptionText = MyRecordset("OptionText" & i)
    >> if CurrentOptionText <> "" then
    >> Response.Write i
    >> Response.Write "<input type=""radio"" name=""Selections"" value=""VotingOption"""
    >>& i & ">"
    >> Response.Write CurrentOptionText
    >> Response.Write "<BR>"
    >> end if
    >>Next
    >>
    >>n is a number I read from database, then I will display n choices, with

    >the
    >>info I stored in the database, I set those text to CurrentOptionText everytime...
    >>For some reasons, all the Response.Write clauses have been executed beside
    >>Response.Write CurrentOptionText.
    >>It is really strange... does anyone know why?
    >>
    >>

    >
    >I saw you're checking for CurrentOptionText<>"", have you tried making sure
    >it's not null? Just a thought...
    >
    >Lia
    >



  4. #4
    Kimoanh T. Vo Guest

    Re: Wierd If clause


    Larry,
    Would this helps?

    Response.Write "<input type=""radio"" name=""Selections""" &
    " value=""VotingOption" & i & """> " & MyRecordset("OptionText") & i

    Regards,
    kv-



    "Larry" <larry@levelogic.com> wrote:
    >
    >that's what I am checking... I made sure it wasn't null in another piece

    of
    >code.
    >"Lia" <lingersoll@thesiggroup.com> wrote:
    >>
    >>"Larry" <larry@levelogic.com> wrote:
    >>>
    >>>Hi:
    >>>I have following code:
    >>>Set n = MyRecordset("NumberOfRadioButtons")
    >>>For i = 1 to n
    >>> Set CurrentOptionText = MyRecordset("OptionText" & i)
    >>> if CurrentOptionText <> "" then
    >>> Response.Write i
    >>> Response.Write "<input type=""radio"" name=""Selections"" value=""VotingOption"""
    >>>& i & ">"
    >>> Response.Write CurrentOptionText
    >>> Response.Write "<BR>"
    >>> end if
    >>>Next
    >>>
    >>>n is a number I read from database, then I will display n choices, with

    >>the
    >>>info I stored in the database, I set those text to CurrentOptionText everytime...
    >>>For some reasons, all the Response.Write clauses have been executed beside
    >>>Response.Write CurrentOptionText.
    >>>It is really strange... does anyone know why?
    >>>
    >>>

    >>
    >>I saw you're checking for CurrentOptionText<>"", have you tried making

    sure
    >>it's not null? Just a thought...
    >>
    >>Lia
    >>

    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links