CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2019
    Posts
    8

    Get Off Formula in beforehand

    Hey Peoples,

    I got a short Question. I am using this Code but if the first Formula is true it steps one to next one. Can I get off in beforehand? (Like Exit Sub in VBA)
    Or must I nest the If Clauses?

    Code:
        Dim HMV(), KST() as String
        Dim LKZ() as Number
            HMV = Array("0440010", _
                        "1940013", _
                        "5045011", "5045012")
            LKZ = Array(8, 9)
            KST = Array("105313145", "185313145")
    
    	If SelectPosition({AUFDRUP_TXT.HiMi-IDNr}, "00", {AUFDRUP_TXT.REZANT}, 100, Count({AUFDRUP_TXT.POSNUM})) Then Formula = True
    
        If Not AreCriteriaTrue( _
                                IsCriteriaTrue(2, 0, 0, HMV, {@strHilfsmittel_Nummer (oP)}, 7), _
                                IsCriteriaTrue(1, LKZ, {@strHilfsmittel_LKZ}, "", "", 0), _
                                IsCriteriaTrue(2, 0, 0, KST, {AUFDRUK_TXT.K-IKNUM}, 0), _
                                True) Then Formula = True

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Get Off Formula in beforehand

    Why not using IF THEN ELSE construction?
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2019
    Posts
    8

    Re: Get Off Formula in beforehand

    Yes, that's what I'm supposed to do (Nest the If Clause like I said in my first post). My question was, if there is an other possibilty instead of nesting, like "Exit Formula" or "Exit Sub".
    I just know "Exit For" (requires a For Loop) or "Exit Do" (requires a Do Loop). If there isn't any other way, I am fine with that . Thanks for your Reply and have a nice weekend.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Get Off Formula in beforehand

    Victor Nijegorodov

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