Announcement

Collapse
No announcement yet.

Is there a way to tell which line called a function?

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

  • Is there a way to tell which line called a function?

    Hello friends,

    I am having an issue which occurs randomly. My assumption at the moment is that the issue is being caused by a race between data transfer from the screen to the hardware connected to the screen.

    It would be helpful to me if there is a way to find out which line called the function I am inspecting.

    For instance does something like the following exist:

    Code:
    func main()
    
        //first call
        foo();
    
        //second call
        foo();
    
    endfunc
    
    func foo()
    
        to(COM0); print("Called on line: ", [LineNumber], LF);
    
    endfunc

  • #2
    Hi,

    There is unfortunately no function for retrieving source code information such as line numbers. You may do this instead:

    Code:
    func main()
    
       //first call
       foo(1);
    
       //second call
       foo(2);
    
    endfunc
    
    func foo(var n)
    
       to(COM0); print("Called on line: ", [DEC] n);
    
    endfunc
    Hope this helps.

    Comment


    • #3
      You haven't described your problem.

      Could you be needing to use sys_EventsPostpone() and sys_EventsResume() ?
      Mark

      Comment

      Working...
      X