Skip to Content
avatar image
Former Member

what is the difference between syntax error runtime error?

what is the difference between syntax error runtime error?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 11, 2008 at 06:00 AM

    Hello

    A program with a syntax error cannot be executed.

    The program with a runtime error can be executed but dumps under certain conditions.

    Example: You have a division statement in your program. If for some reason the denominator becomes zero then you will get a runtime error (something like DIVISION_BY_ZERO).

    Syntax errors are static error that can be detected by the compiler.

    Runtime errors are dynamic error that cannot be detected by the compiler.

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 11, 2008 at 06:00 AM

    Hi

    Syntax error means you are not using proper syntx in coding

    Runtime error means syntax is correct but you are trying to do some operation whih is logically not possible like

    you are having a FM with 5 parameters and both of them are necessary to pass and you are calling it without passing them then it raise runtime error

    or

    a = 5 % 0.

    Regards

    Aditya

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 11, 2008 at 06:03 AM

    HI

    syntax error: if u have done mistake in declaring a particular predefined type then it gives syntax error.

    for example: if u have done any mistake in declaration i.e instead of ATLINE-SELECTION U WRITE AT LINE SELECTION.....IT GIVES SYNTAX ERROR.

    runtime error:the error which occurs during runtime.....

    for example: if u give 5/0...then it gives runtime error.

    if u declare a internal table with 5 feilds and u select 4 feilds and try to place in internal table...it gives runtime error.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 11, 2008 at 06:03 AM

    Hi,

    Syntax error:

    A syntax error refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language.

    If a syntax error is encountered during compilation it must be corrected if the source code is to be successfully compiled.

    Runtime error:

    An error that occurs during the execution of a program. In contrast, Syntax errors occur while a program is being compiled. Runtime errors indicate bugs in the program or problems that the designers had anticipated but could do nothing about. For example, running out of memory will often cause a runtime error.

    Note that runtime errors differ from bombs or crashes in that you can often recover gracefully from a runtime error.

    Add comment
    10|10000 characters needed characters exceeded