1*cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2*cdf0e10cSrcweir 3*cdf0e10cSrcweir 4*cdf0e10cSrcweir 5*cdf0e10cSrcweir<!-- 6*cdf0e10cSrcweir *********************************************************************** 7*cdf0e10cSrcweir * 8*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9*cdf0e10cSrcweir * 10*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 11*cdf0e10cSrcweir * 12*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 13*cdf0e10cSrcweir * 14*cdf0e10cSrcweir * This file is part of OpenOffice.org. 15*cdf0e10cSrcweir * 16*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 17*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 18*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 19*cdf0e10cSrcweir * 20*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 21*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 22*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 24*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 27*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 28*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 29*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 30*cdf0e10cSrcweir * 31*cdf0e10cSrcweir ************************************************************************ 32*cdf0e10cSrcweir --> 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir <helpdocument version="1.0"> 36*cdf0e10cSrcweir<meta> 37*cdf0e10cSrcweir<topic id="textsbasicshared01030300xml" indexer="include" status="PUBLISH"> 38*cdf0e10cSrcweir<title id="tit" xml-lang="en-US">Debugging a Basic Program</title> 39*cdf0e10cSrcweir<filename>/text/sbasic/shared/01030300.xhp</filename> 40*cdf0e10cSrcweir</topic> 41*cdf0e10cSrcweir</meta> 42*cdf0e10cSrcweir<body> 43*cdf0e10cSrcweir<section id="basicfehler"> 44*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="index" id="bm_id3153344"><bookmark_value>debugging Basic programs</bookmark_value> 45*cdf0e10cSrcweir<bookmark_value>variables; observing values</bookmark_value> 46*cdf0e10cSrcweir<bookmark_value>watching variables</bookmark_value> 47*cdf0e10cSrcweir<bookmark_value>run-time errors in Basic</bookmark_value> 48*cdf0e10cSrcweir<bookmark_value>error codes in Basic</bookmark_value> 49*cdf0e10cSrcweir<bookmark_value>breakpoints</bookmark_value> 50*cdf0e10cSrcweir<bookmark_value>Call Stack window</bookmark_value> 51*cdf0e10cSrcweir</bookmark><comment>mw deleted "Basic;"</comment><paragraph role="heading" id="hd_id3153344" xml-lang="en-US" level="1" l10n="U" oldref="1"><link href="text/sbasic/shared/01030300.xhp">Debugging a Basic Program</link></paragraph> 52*cdf0e10cSrcweir</section> 53*cdf0e10cSrcweir<paragraph role="heading" id="hd_id3159224" xml-lang="en-US" level="2" l10n="U" oldref="4">Breakpoints and Single Step Execution</paragraph> 54*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3150682" xml-lang="en-US" l10n="U" oldref="5">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> 55*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3147303" xml-lang="en-US" l10n="U" oldref="7">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> 56*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3155805" xml-lang="en-US" l10n="U" oldref="8">The <emph>single step </emph>execution using the <emph>Single Step</emph> icon causes the program to branch into procedures and functions.</paragraph> 57*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3151110" xml-lang="en-US" l10n="U" oldref="25">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> 58*cdf0e10cSrcweir<paragraph role="heading" id="hd_id3153825" xml-lang="en-US" level="3" l10n="U" oldref="9">Properties of a Breakpoint</paragraph> 59*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3147574" xml-lang="en-US" l10n="U" oldref="26">The properties of a breakpoint are available through its context menu by right-clicking the breakpoint in the breakpoint column.</paragraph> 60*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148473" xml-lang="en-US" l10n="U" oldref="10">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> 61*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3159413" xml-lang="en-US" l10n="U" oldref="27">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> 62*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3156280" xml-lang="en-US" l10n="U" oldref="11">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> 63*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3158407" xml-lang="en-US" l10n="U" oldref="12">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> 64*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3153968" xml-lang="en-US" l10n="U" oldref="13">Click <emph>Delete</emph> to remove the breakpoint from the program.</paragraph> 65*cdf0e10cSrcweir<paragraph role="heading" id="hd_id3150439" xml-lang="en-US" level="2" l10n="U" oldref="14">Observing the Value of Variables</paragraph> 66*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3153368" xml-lang="en-US" l10n="U" oldref="15">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> 67*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3146986" xml-lang="en-US" l10n="U" oldref="16">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> 68*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3145272" xml-lang="en-US" l10n="U" oldref="17">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> 69*cdf0e10cSrcweir<paragraph role="tip" id="par_id3145749" xml-lang="en-US" l10n="U" oldref="19">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><comment>UFI: removed help id</comment><paragraph role="heading" id="hd_id3148618" xml-lang="en-US" level="2" l10n="U" oldref="20">The Call Stack Window</paragraph> 70*cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154491" xml-lang="en-US" l10n="U" oldref="21"><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> 71*cdf0e10cSrcweir<paragraph role="heading" id="hd_id3150594" xml-lang="en-US" level="2" l10n="CHG" oldref="24">List of Run-Time Errors</paragraph> 72*cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#allerrors"/> 73*cdf0e10cSrcweir</body> 74*cdf0e10cSrcweir</helpdocument> 75