summaryrefslogtreecommitdiff
path: root/source/text/sbasic/shared/01030300.xhp
blob: 71eabb8486711ebd074b2d5cb5f5856d4e295a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0" encoding="UTF-8"?>



<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->


		<helpdocument version="1.0">
<meta>
<topic id="textsbasicshared01030300xml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">Debugging a Basic Program</title>
<filename>/text/sbasic/shared/01030300.xhp</filename>
</topic>
</meta>
<body>
<section id="basicfehler">
<bookmark xml-lang="en-US" branch="index" id="bm_id3153344"><bookmark_value>debugging Basic programs</bookmark_value>
<bookmark_value>variables; observing values</bookmark_value>
<bookmark_value>watching variables</bookmark_value>
<bookmark_value>run-time errors in Basic</bookmark_value>
<bookmark_value>error codes in Basic</bookmark_value>
<bookmark_value>breakpoints</bookmark_value>
<bookmark_value>Call Stack window</bookmark_value>
</bookmark><paragraph role="heading" id="hd_id3153344" xml-lang="en-US" level="1"><link href="text/sbasic/shared/01030300.xhp">Debugging a Basic Program</link></paragraph>
</section>
<paragraph role="heading" id="hd_id3159224" xml-lang="en-US" level="2">Breakpoints and Single Step Execution</paragraph>
<paragraph role="paragraph" id="par_id3150682" xml-lang="en-US">You can check each line in your Basic program for errors using single step execution. Errors are easily traced since you can immediately see the result of each step. A pointer in the breakpoint column of the Editor indicates the current line. You can also set a breakpoint if you want to force the program to be interrupted at a specific position.</paragraph>
<paragraph role="paragraph" id="par_id3147303" xml-lang="en-US">Double-click in the <emph>breakpoint</emph> column at the left of the Editor window to toggle a breakpoint at the corresponding line. When the program reaches a breakpoint, the program execution is interrupted.</paragraph>
<paragraph role="paragraph" id="par_id3155805" xml-lang="en-US">The <emph>single step </emph>execution using the <emph>Single Step</emph> icon causes the program to branch into procedures and functions.</paragraph>
<paragraph role="paragraph" id="par_id3151110" xml-lang="en-US">The procedure step execution using the <emph>Procedure Step</emph> icon causes the program to skip over procedures and functions as a single step.</paragraph>
<paragraph role="heading" id="hd_id3153825" xml-lang="en-US" level="3">Properties of a Breakpoint</paragraph>
<paragraph role="paragraph" id="par_id3147574" xml-lang="en-US">The properties of a breakpoint are available through its context menu by right-clicking the breakpoint in the breakpoint column.</paragraph>
<paragraph role="paragraph" id="par_id3148473" xml-lang="en-US">You can <emph>activate</emph> and <emph>deactivate</emph> a breakpoint by selecting <emph>Active</emph> from its context menu. When a breakpoint is deactivated, it does not interrupt the program execution. </paragraph>
<paragraph role="paragraph" id="par_id3159413" xml-lang="en-US">Select <emph>Properties</emph> from the context menu of a breakpoint or select <emph>Breakpoints</emph> from the context menu of the breakpoint column to call the <emph>Breakpoints</emph> dialog where you can specify other breakpoint options.</paragraph>
<paragraph role="paragraph" id="par_id3156280" xml-lang="en-US">The list displays all <emph>breakpoints</emph> with the corresponding line number in the source code. You can activate or deactivate a selected breakpoint by checking or clearing the <emph>Active</emph> box.</paragraph>
<paragraph role="paragraph" id="par_id3158407" xml-lang="en-US">The <emph>Pass Count</emph> specifies the number of times the breakpoint can be passed over before the program is interrupted. If you enter 0 (default setting) the program is always interrupted as soon as a breakpoint is encountered.</paragraph>
<paragraph role="paragraph" id="par_id3153968" xml-lang="en-US">Click <emph>Delete</emph> to remove the breakpoint from the program.</paragraph>
<paragraph role="heading" id="hd_id3150439" xml-lang="en-US" level="2">Observing the Value of Variables</paragraph>
<paragraph role="paragraph" id="par_id3153368" xml-lang="en-US">You can monitor the values of a variable by adding it to the <emph>Watch</emph> window. To add a variable to the list of watched variables, type the variable name in the <emph>Watch</emph> text box and press Enter.</paragraph>
<paragraph role="paragraph" id="par_id3146986" xml-lang="en-US">The values of variables are only displayed if they are in scope. Variables that are not defined at the current source code location display ("Out of Scope") instead of a value.</paragraph>
<paragraph role="paragraph" id="par_id3145272" xml-lang="en-US">You can also include arrays in the Watch window. If you enter the name of an array variable without an index value in the Watch text box, the content of the entire array is displayed.</paragraph>
<paragraph role="tip" id="par_id3145749" xml-lang="en-US">If you rest the mouse over a predefined variable in the Editor at run-time, the content of the variable is displayed in a pop-up box.</paragraph><paragraph role="heading" id="hd_id3148618" xml-lang="en-US" level="2">The Call Stack Window</paragraph>
<paragraph role="paragraph" id="par_id3154491" xml-lang="en-US"><ahelp hid="HID_BASICIDE_STACKWINDOW_LIST">Provides an overview of the call hierarchy of procedures and functions.</ahelp> You can determine which procedures and functions called which other procedures and functions at the current point in the source code.</paragraph>
<paragraph role="heading" id="hd_id3150594" xml-lang="en-US" level="2">List of Run-Time Errors</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#allerrors"/>
</body>
</helpdocument>