VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member RogerTango's Avatar
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    I have not seen any examples, but wondered if anyone has tried nested "if"?

    http://avisynth.nl/index.php/GScript

    Cheers,
    Andrew
    Quote Quote  
  2. Member RogerTango's Avatar
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    I just tried it, it works nested.

    Code:
    frate = LeftStr(string(FrameRate), 6)
    
    if (IsFrameBased == true){
    if (frate == "29.970"){
    subtitle("Nested If", align=6)
    }
    }
    Performs same as

    Code:
    frate = LeftStr(string(FrameRate), 6)
    
    if (IsFrameBased==true) and (frate = 29.970){
    subtitle("Nested If", align=6)
    }
    However, the above coding is not valid syntax.

    Andrew
    Quote Quote  
  3. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    You don't need GScript for Avisynth+, it's for old Avisynth.

    Originally Posted by RogerTango View Post
    However, the above coding is not valid syntax.
    Code:
    frate = LeftStr(string(FrameRate), 6)
    
    if (IsFrameBased == true && frate == "29.970"){
      subtitle("Nested If", align=6)
    }

    Originally Posted by RogerTango View Post
    Performs same as
    What it performs if it's not valid?
    Quote Quote  
  4. Yeah nesting works fine.

    Code:
    if (condition) {
    
        if (condition) { }
        else if (condition) { }
        else (condition) { }
    
    } else(condition) {
    
        if (condition) { }
    }
    VoodooFX, I think the GScript page is the only place you can find a description of the if-then-else constructs. There doesn't seem to be an Avisynth+ page for it, as such.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!