nested if statements in pascal fuck me up

Discussion in 'Computer Programming, Emulation, and Game Modding' started by leafeon34, Mar 28, 2016.

  1. leafeon34
    OP

    leafeon34 GBAtemp Advanced Fan

    Member
    611
    335
    Sep 30, 2014
    I've been working on a task for uni and decided to try using a nested if statement rather than a case statement. But I've now learned that each time I try a nested if statement I get either a logic error or a syntax error.

    I've tried as many variations on this code that I can think of and they either won't compile or they execute //do something else when intX is less than 5000.

    I'm probably missing something obvious here.
     
  2. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,500
    5,464
    Mar 17, 2010
    Norway
    Alola
    Adding a begin/end to the inside statement should prevent that.
     
  3. leafeon34
    OP

    leafeon34 GBAtemp Advanced Fan

    Member
    611
    335
    Sep 30, 2014
    Wow. After all this time it actually fucking works. Thank you :)