Desktop version

Main > Forum > Learning > 1C Mobile Developer Course > How can I show the line numbers in my code

Forum

Search UsersRules
How can I show the line numbers in my code
#1
Active user
Points:: 0
Joined:: Jan 11, 2021

Hi everyone,
I see in debuger there are many time it mention the bug is in the line number ...
So my question is how can I show the line number (so it is easier to find the bug

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

Hello,

in 1C there are several ways to look for bugs in the program code.

Suppose we have a line of code with an error (screen 1).

If we run this code, then during execution the system will notify us of an error and indicate the place where the bug occurred (screen 2).

If now we click on the "Details" button, and then the "Designer" button, then we will get exactly to the place where the error occurred (screens 3 and 4).

Profile
#3
Administrator
Points:: 0
Joined:: Oct 3, 2019

But it is considered a good form among the developers to use the "Try - Except - EndTry" construction (screen 1).

But if we run this code now, an error will occur, but we will not see it. How can we see this error?

The first way. It's necessary to enable the "Stop on errors" option in the "Designer" (screenshots 2 and 3).

Now the system itself will show you where the error occurred (screen 4).

Profile
#4
Administrator
Points:: 0
Joined:: Oct 3, 2019

All of the above is relevant only for development and debugging mode. What if we need to determine where the error occurred in the program's operating mode?

In this case, we can use the second method to find out where the error occurred.

To do this, we introduce an additional operator into the "Try - Except - EndTry" construction, which will show us the information we need in case of an error (screen 1).

In this case, we will see both the description of the error and the place in the source code where the error occurred (screen 2).

Hopefully answered your question :-)

Profile
#5
Active user
Points:: 0
Joined:: Mar 22, 2021



Great! Thanks. I ve see the line number in there right - bottom corner of the sceen. And it í also really helpful

Profile
#6
Administrator
Points:: 0
Joined:: Oct 3, 2019

I understood what you wanted :-)

Here's some more useful information. Check out the screenshot - using the context menu in the source code, you can jump to any line of text you need.

Profile
#7
Active user
Points:: 0
Joined:: Mar 22, 2021

Thanks for sharing this

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.