Announcement

Collapse
No announcement yet.

Main()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Main()

    Not sure if it has been noted in the past, but i had function Main()
    instead of function main() and because of the capital M it never executed. The EFS parser should probably show error saying there's no main function or something?

  • #2
    Hello trade_addict,

    JavaScript is a case sensitive language. The type of error you are referring to is considered a logical error. The syntax checker in the EFS Editor is only looking for invalid syntax. A user-defined function named Main() is not illegal, which is why no syntax error is generated. Catching these logic errors is a process that must be performed by the programmer, which is referred to as debugging. To have our software attempt to catch logic errors would require us to make some assumptions as to what the programmer was intending to do, which I'm sure you can image would be very difficult. For example, in EFS, some users create EFS files that contain a collection of user-defined functions that can be called by another EFS. It would not need a main() function in that case. Hopefully you can see the problem we would run into by attempting to generate logic error messages.

    To assist you with the debugging process you can use the debugPrintln() function. By placing this function in various places in your code, you will be able to tell if specific sections of code are being executed by passing a string to the function. This string may simply be a message, or a concatenated message with custom variables from your code so you can see their values as well. The information is printed to the Formula Output Window (Tools-->EFS).

    If you have any trouble debugging your code for logic errors and need some help. Post your details along with your code here in the forums.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X