1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2cdf0e10cSrcweir 3226a8927SAndrew Rist<!--*********************************************************** 4ea1160e6Smseidel * 5226a8927SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 6226a8927SAndrew Rist * or more contributor license agreements. See the NOTICE file 7226a8927SAndrew Rist * distributed with this work for additional information 8226a8927SAndrew Rist * regarding copyright ownership. The ASF licenses this file 9226a8927SAndrew Rist * to you under the Apache License, Version 2.0 (the 10226a8927SAndrew Rist * "License"); you may not use this file except in compliance 11226a8927SAndrew Rist * with the License. You may obtain a copy of the License at 12ea1160e6Smseidel * 13226a8927SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 14ea1160e6Smseidel * 15226a8927SAndrew Rist * Unless required by applicable law or agreed to in writing, 16226a8927SAndrew Rist * software distributed under the License is distributed on an 17226a8927SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18226a8927SAndrew Rist * KIND, either express or implied. See the License for the 19226a8927SAndrew Rist * specific language governing permissions and limitations 20226a8927SAndrew Rist * under the License. 21ea1160e6Smseidel * 22226a8927SAndrew Rist ***********************************************************--> 23226a8927SAndrew Rist 24ea1160e6Smseidel<helpdocument version="1.0"> 25cdf0e10cSrcweir<meta> 26cdf0e10cSrcweir<topic id="textsbasicshared01030300xml" indexer="include" status="PUBLISH"> 27cdf0e10cSrcweir<title id="tit" xml-lang="en-US">Debugging a Basic Program</title> 28cdf0e10cSrcweir<filename>/text/sbasic/shared/01030300.xhp</filename> 29cdf0e10cSrcweir</topic> 30cdf0e10cSrcweir</meta> 31cdf0e10cSrcweir<body> 32cdf0e10cSrcweir<section id="basicfehler"> 338b0727e7Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3153344"> 348b0727e7Smseidel<bookmark_value>debugging Basic programs</bookmark_value> 35cdf0e10cSrcweir<bookmark_value>variables; observing values</bookmark_value> 36cdf0e10cSrcweir<bookmark_value>watching variables</bookmark_value> 37cdf0e10cSrcweir<bookmark_value>run-time errors in Basic</bookmark_value> 38cdf0e10cSrcweir<bookmark_value>error codes in Basic</bookmark_value> 39cdf0e10cSrcweir<bookmark_value>breakpoints</bookmark_value> 40cdf0e10cSrcweir<bookmark_value>Call Stack window</bookmark_value> 41cdf0e10cSrcweir</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> 42cdf0e10cSrcweir</section> 43cdf0e10cSrcweir<paragraph role="heading" id="hd_id3159224" xml-lang="en-US" level="2" l10n="U" oldref="4">Breakpoints and Single Step Execution</paragraph> 44cdf0e10cSrcweir<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> 45cdf0e10cSrcweir<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> 46ea1160e6Smseidel<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> 47cdf0e10cSrcweir<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> 48cdf0e10cSrcweir<paragraph role="heading" id="hd_id3153825" xml-lang="en-US" level="3" l10n="U" oldref="9">Properties of a Breakpoint</paragraph> 49cdf0e10cSrcweir<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> 50*23444184Smseidel<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> 51cdf0e10cSrcweir<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> 52cdf0e10cSrcweir<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> 53cdf0e10cSrcweir<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> 54cdf0e10cSrcweir<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> 55cdf0e10cSrcweir<paragraph role="heading" id="hd_id3150439" xml-lang="en-US" level="2" l10n="U" oldref="14">Observing the Value of Variables</paragraph> 56cdf0e10cSrcweir<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> 57cdf0e10cSrcweir<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> 58cdf0e10cSrcweir<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> 59cdf0e10cSrcweir<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> 60cdf0e10cSrcweir<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> 61cdf0e10cSrcweir<paragraph role="heading" id="hd_id3150594" xml-lang="en-US" level="2" l10n="CHG" oldref="24">List of Run-Time Errors</paragraph> 62cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#allerrors"/> 63cdf0e10cSrcweir</body> 64cdf0e10cSrcweir</helpdocument> 65