How can I show the line numbers in my code

For students who study 1C Mobile course.

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 11, 2021
Company: Robot cho mọi người

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

 
#2
People who like this:0Yes/0No
Administrator
Rating: 13
Joined: Oct 3, 2019
Company:

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).

Download 1.png (4.21 KB)
Download 2.png (7.03 KB)
Download 3.png (14.77 KB)
Download 4.png (4.47 KB)
 
#3
People who like this:0Yes/0No
Administrator
Rating: 13
Joined: Oct 3, 2019
Company:

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).

Download 1.png (5.3 KB)
Download 2.png (17.26 KB)
Download 3.png (11.36 KB)
Download 4.png (18.57 KB)
 
#4
People who like this:0Yes/0No
Administrator
Rating: 13
Joined: Oct 3, 2019
Company:

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 :-)

Download 1.png (6.47 KB)
Download 2.png (5.13 KB)
 
#5
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 22, 2021
Company: 1C Vietnam



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

 
#6
People who like this:0Yes/0No
Administrator
Rating: 13
Joined: Oct 3, 2019
Company:

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.

Download 1.png (47.78 KB)
 
#7
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 22, 2021
Company: 1C Vietnam

Thanks for sharing this

 
Subscribe
Be the first to know tips & trick on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.