CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: if\else hepl

  1. #1
    Join Date
    Oct 2011
    Posts
    34

    if\else hepl

    i have this bit of code
    Code:
    If CDbl(sAmount) < 0 Then
                If CDbl(sAmount) < 0 Then ' (MTRBC_ARRAY$(MTRBC_CCYAMOUNT)
                    SNEX_ARRAY$(EXE_CD) = "D"
                Else
                    SNEX_ARRAY$(EXE_CD) = "C"
                End If
                       sOut = ""
                      For j = 2 To UBound(SNEX_ARRAY$)
                          sOut = sOut & SNEX_ARRAY$(j)
                       
                       Next j
                  Call WritetoSNEXFile(sOut)
    what i need to do is if the amount is =0 then not to write it out to the file and if its not then do what i have there

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: if\else hepl

    Something like this ?
    Code:
    If Not CDbl(sAmount) = 0 Then
                If CDbl(sAmount) < 0 Then ' (MTRBC_ARRAY$(MTRBC_CCYAMOUNT)
                    SNEX_ARRAY$(EXE_CD) = "D"
                Else
                    SNEX_ARRAY$(EXE_CD) = "C"
                End If
                       sOut = ""
                      For j = 2 To UBound(SNEX_ARRAY$)
                          sOut = sOut & SNEX_ARRAY$(j)
                       
                       Next j
                  Call WritetoSNEXFile(sOut)
    End If
    Always use [code][/code] tags when posting code.

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

Featured