summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2021-01-14 23:12:17 +0100
committerOlivier Hallot <olivier.hallot@libreoffice.org>2021-01-16 00:01:35 +0100
commit2bc7a1de1c0ef5c736381dea36861320927496da (patch)
tree48f69054c1bb24d7abaa12c54fe8282b73e37c96
parenttdf#126492 add mention of new information sent in Crash Report (diff)
downloadhelp-2bc7a1de1c0ef5c736381dea36861320927496da.tar.gz
help-2bc7a1de1c0ef5c736381dea36861320927496da.zip
Updates/fixes typos in SF_Exception and SF_Dictionary
This patch improves the Help page for SF_Exception and fixes bookmarks and typos in SF_Dictionary Change-Id: I3c332e19c58f14a8fe85704b5b63c917a7ee0146 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/109287 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
-rw-r--r--source/text/sbasic/shared/03/sf_dictionary.xhp8
-rw-r--r--source/text/sbasic/shared/03/sf_exception.xhp121
2 files changed, 69 insertions, 60 deletions
diff --git a/source/text/sbasic/shared/03/sf_dictionary.xhp b/source/text/sbasic/shared/03/sf_dictionary.xhp
index 5ac5d79535..aab563fcff 100644
--- a/source/text/sbasic/shared/03/sf_dictionary.xhp
+++ b/source/text/sbasic/shared/03/sf_dictionary.xhp
@@ -19,12 +19,10 @@
<section id="abstract">
<bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id261582733781987">
<bookmark_value>Dictionary service</bookmark_value>
- <bookmark_value>API;DateTime</bookmark_value>
- <bookmark_value>API;PropertyValue</bookmark_value>
</bookmark>
<h1 id="hd_id731582733781114" xml-lang="en-US"><link href="text/sbasic/shared/03/sf_dictionary.xhp" name="ScriptForge.Dictionary service"><literal>ScriptForge</literal>.<literal>Dictionary</literal> service</link></h1>
-
+
<paragraph role="paragraph" id="par_id891582884466217" xml-lang="en-US">A dictionary is a collection of key-item pairs</paragraph>
<list type="unordered">
<listitem><paragraph id="par_id861582884516571" role="listitem" xml-lang="en-US">The key is a case-insensitive string</paragraph></listitem>
@@ -218,7 +216,7 @@
<paragraph role="bascode" localize="false" id="bas_id201601298295976">myDict.Add("p2", DateSerial(2020,9,28))</paragraph>
<paragraph role="bascode" localize="false" id="bas_id951601298323286">myDict.Add("p3", True)</paragraph>
<paragraph role="bascode" localize="false" id="bas_id731601298329491">myDict.Add("p4", Array(1,2,3))</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id451601298336500">MsgBox a.ConvertToJson() </paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id451601298336500">MsgBox myDict.ConvertToJson() </paragraph>
<paragraph role="bascode" localize="false" id="bas_id511610392557702">'{"p0": 12.5, "p1": "a string \u00e0\u00e9\"\u00ea", "p2": "2020-09-28", "p3": true, "p4": [1, 2, 3]}</paragraph>
</bascode>
</section>
@@ -227,6 +225,8 @@
<comment> ConvertToPropertyValues ----------------------------------------------------------------------------------------------------------------------- </comment>
<bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id991582889470402">
<bookmark_value>Dictionary service;ConvertToPropertyValues</bookmark_value>
+ <bookmark_value>API;PropertyValue</bookmark_value>
+ <bookmark_value>API;DateTime</bookmark_value>
</bookmark>
<h2 id="hd_id421582889470909" localize="false">ConvertToPropertyValues</h2>
<paragraph role="paragraph" id="par_id151582889470596">Store the content of the dictionary in an array of <literal>PropertyValues</literal>.</paragraph>
diff --git a/source/text/sbasic/shared/03/sf_exception.xhp b/source/text/sbasic/shared/03/sf_exception.xhp
index 585fcf8b2c..53cb407086 100644
--- a/source/text/sbasic/shared/03/sf_exception.xhp
+++ b/source/text/sbasic/shared/03/sf_exception.xhp
@@ -40,10 +40,13 @@
</list>
<h2 id="hd_id201586594659135" xml-lang="en-US">Service invocation</h2>
- <paragraph role="paragraph" id="par_id571586594672714" xml-lang="en-US">Next code snippets are equivalent:</paragraph>
+ <paragraph role="paragraph" id="par_id571586594672714" xml-lang="en-US">To invoke the <literal>Exception</literal> service, first you need to load the <literal>ScriptForge</literal> library using:</paragraph>
<bascode>
- <paragraph role="bascode" id="bas_id731608211525532">GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id181586594723543">SF_Exception.Raise(...)</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id731608211525532">GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id161610652161795">The following examples show three different approaches to call the method <literal>Raise</literal>. All other methods can be executed in a similar fashion.</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id881610652359633">SF_Exception.Raise(...)</paragraph>
</bascode>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id441586594733346">Dim exc : exc = SF_Exception</paragraph>
@@ -75,7 +78,8 @@
<paragraph id="par_id71584978715562" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
- <paragraph id="par_id581584978715701" role="tablecontent" xml-lang="en-US">The error message text.<br />Default is "" or standard Basic run-time error message.</paragraph>
+ <paragraph id="par_id581584978715701" role="tablecontent" xml-lang="en-US">The error message text.</paragraph>
+ <paragraph role="paragraph" id="par_id241610652688334">Default value is "" or a string containing the Basic run-time error message.</paragraph>
</tablecell>
</tablerow>
<tablerow>
@@ -86,7 +90,8 @@
<paragraph id="par_id211584978211383" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
- <paragraph id="par_id691584978211774" role="tablecontent" xml-lang="en-US">The code of the error. It can be a numeric value or text.<br />Default is 0 or standard Basic run-time error code.</paragraph>
+ <paragraph id="par_id691584978211774" role="tablecontent" xml-lang="en-US">The code of the error. It can be a numeric value or text.</paragraph>
+ <paragraph role="paragraph" id="par_id151610652632828">Default value is 0 or the numeric value corresponding to the Basic run-time error code.</paragraph>
</tablecell>
</tablerow>
<tablerow>
@@ -97,7 +102,8 @@
<paragraph id="par_id671584978666689" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
- <paragraph id="par_id951584978666296" role="tablecontent" xml-lang="en-US">The location in the code where the error occurred. It can be a numeric value or text.<br />Default is 0 or the code line number for a standard Basic run-time error.</paragraph>
+ <paragraph id="par_id951584978666296" role="tablecontent" xml-lang="en-US">The location in the code where the error occurred. It can be a numeric value or text.</paragraph>
+ <paragraph role="paragraph" id="par_id681610652723345">Default value is 0 or the code line number for a standard Basic run-time error.</paragraph>
</tablecell>
</tablerow>
</table>
@@ -106,9 +112,7 @@
<table id="tab_id441608131596153">
<tablerow>
- <tablecell><paragraph id="par_id941608131596153" role="tablehead"></paragraph></tablecell>
- <tablecell><paragraph id="par_id881608131596153" role="tablehead">Methods</paragraph></tablecell>
- <tablecell><paragraph id="par_id751608131596153" role="tablehead"></paragraph></tablecell>
+ <tablecell colspan="3"><paragraph id="par_id881608131596153" role="tablehead">Methods</paragraph></tablecell>
</tablerow>
<tablerow>
<tablecell>
@@ -120,14 +124,14 @@
</tablecell>
<tablecell>
<paragraph role="tablecontent" id="par_id871608132025242">
- <link href="text/sbasic/shared/03/sf_exception.xhp#ConsoleToFile" name="ConsoleToFile method">ConsoleToFile</link><br/><br/>
- <link href="text/sbasic/shared/03/sf_exception.xhp#DebugPrint" name="DebugPrint method">DebugPrint</link><br/>
+ <link href="text/sbasic/shared/03/sf_exception.xhp#ConsoleToFile" name="ConsoleToFile method">ConsoleToFile</link><br/>
+ <link href="text/sbasic/shared/03/sf_exception.xhp#DebugPrint" name="DebugPrint method">DebugPrint</link><br/><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" id="par_id831608132069033">
- <br/><link href="text/sbasic/shared/03/sf_exception.xhp#Raise" name="Raise method">Raise</link><br/>
- <link href="text/sbasic/shared/03/sf_exception.xhp#RaiseWarning" name="RaiseWarning method">RaiseWarning</link>
+ <link href="text/sbasic/shared/03/sf_exception.xhp#Raise" name="Raise method">Raise</link><br/>
+ <link href="text/sbasic/shared/03/sf_exception.xhp#RaiseWarning" name="RaiseWarning method">RaiseWarning</link><br/><br/>
</paragraph>
</tablecell>
</tablerow>
@@ -139,25 +143,28 @@
<bookmark_value>Exception service;Clear</bookmark_value>
</bookmark>
<h2 id="hd _id791579683635979" localize="false">Clear</h2>
- <paragraph role="paragraph" id="par_id271579683706571">Reset the current error status and clear the <literal>SF_Exception</literal> properties.</paragraph>
+ <paragraph role="paragraph" id="par_id271579683706571">Resets the current error status and clears the <literal>SF_Exception</literal> properties.</paragraph>
<h3 id="hd_id381579687079872"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id531579684617249">SF_Exception.Clear()</paragraph>
</bascode>
+ <h3 id="hd_id60159871817985"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
+ <paragraph role="paragraph" id="par_id701610654263121">The following example shows how to catch a division-by-zero exception, whose error code is 11.</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id631579688532444">Sub Example_Clear()</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id721587215452594">Dim a, b, c</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id431587221926496">On Local Error GoTo Catch</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id541601735163562">Try:</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id441587215463149"> a = 10 : b = 0</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id531587215470406"> c = a / b</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id361587215477209"> '...</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id931587215483393"> Exit Sub</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id851587215489779">Catch:</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id771587215496761"> If SF_Exception.Number = 11 Then SF_Exception.Clear()</paragraph>
- <paragraph role="bascode" id="bas_id51587215508130" xml-lang="en-US"> ' If division by zero, ignore the error</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id721587215452594"> Dim a, b, c</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id431587221926496"> On Local Error GoTo Catch</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id541601735163562"> Try:</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id441587215463149"> a = 10 : b = 0</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id531587215470406"> c = a / b</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id361587215477209"> '...</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id931587215483393"> Exit Sub</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id851587215489779"> Catch:</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id771587215496761"> If SF_Exception.Number = 11 Then SF_Exception.Clear()</paragraph>
+ <paragraph role="bascode" id="bas_id51587215508130" xml-lang="en-US"> 'If division by zero, ignore the error</paragraph>
<paragraph role="bascode" localize="false" id="bas_id801579688542131">End Sub</paragraph>
</bascode>
+ <tip id="par_id201610654368082">For a complete list of Basic run-time error codes, refer to <link href="text/sbasic/shared/01030300.xhp" name="Run-Time Error Codes">Debugging a Basic Program</link>.</tip>
</section>
<section id="Console">
@@ -166,15 +173,15 @@
<bookmark_value>Exception service;Console</bookmark_value>
</bookmark>
<h2 id="hd _id971598718179751" localize="false">Console</h2>
- <paragraph role="paragraph" id="par_id651598718179382">Display the console messages in a modal or non-modal dialog. In both modes, all the past messages issued by a <literal>DebugPrint()</literal> method or resulting from an exception are displayed. In non-modal mode, additionally, subsequent entries are added automatically.</paragraph>
+ <paragraph role="paragraph" id="par_id651598718179382">Displays the console messages in a modal or non-modal dialog. In both modes, all the past messages issued by a <literal>DebugPrint()</literal> method or resulting from an exception are displayed. In non-modal mode, subsequent entries are added automatically.</paragraph>
<paragraph role="paragraph" id="par_id161598718286205" xml-lang="en-US">If the console is already open, when non-modal, it is brought to the front.</paragraph>
- <paragraph role="paragraph" id="par_id801598718629151" xml-lang="en-US">A modal console is closed by the user. A non-modal console is closed by the user or at macro termination.</paragraph>
+ <paragraph role="paragraph" id="par_id801598718629151" xml-lang="en-US">A modal console can only be closed by the user. A non-modal console can either be closed by the user or upon macro termination.</paragraph>
<h3 id="hd_id681598718179603"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id341598718179145">SF_Exception.Console([Modal As Boolean])</paragraph>
</bascode>
<h3 id="hd_id761598718179784"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
- <paragraph role="paragraph" id="par_id511598718179819"><emph>Modal</emph>: Default = <literal>True</literal>.</paragraph>
+ <paragraph role="paragraph" id="par_id511598718179819"><emph>Modal</emph>: Determine if the console window is Modal (<literal>True</literal>) or Non-modal (<literal>False</literal>). Default value is <literal>True</literal>.</paragraph>
<h3 id="hd_id60159871817984"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id921598718179244">Sub Example_Console()</paragraph>
@@ -189,14 +196,15 @@
<bookmark_value>Exception service;ConsoleClear</bookmark_value>
</bookmark>
<h2 id="hd _id671587215098845" localize="false">ConsoleClear</h2>
- <paragraph role="paragraph" id="par_id641587215098903">Clear the console keeping an optional number of recent messages. If the console is activated in non-modal mode, it is refreshed.</paragraph>
+ <paragraph role="paragraph" id="par_id641587215098903">Clears the console keeping an optional number of recent messages. If the console is activated in non-modal mode, it is refreshed.</paragraph>
<h3 id="hd_id491587215098807"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id231587215098874">SF_Exception.ConsoleClear([Keep As Long])</paragraph>
</bascode>
<h3 id="hd_id211587215098692"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
- <paragraph role="paragraph" id="par_id351587215098527"><emph>Keep</emph>: The number of recent messages to be kept, default is 0.</paragraph>
+ <paragraph role="paragraph" id="par_id351587215098527"><emph>Keep</emph>: The number of recent messages to be kept. Default value is 0.</paragraph>
<h3 id="hd_id151587215098840"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
+ <paragraph role="paragraph" id="par_id521610655023824">The following example clears the console keeping the 10 most recent messages.</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id51158721509882">Sub Example_ConsoleClear()</paragraph>
<paragraph role="bascode" localize="false" id="bas_id981587215098452"> SF_Exception.ConsoleClear(10)</paragraph>
@@ -210,13 +218,13 @@
<bookmark_value>Exception service;ConsoleToFile</bookmark_value>
</bookmark>
<h2 id="hd _id691587218077803" localize="false">ConsoleToFile</h2>
- <paragraph role="paragraph" id="par_id281587218077400">Export the content of the console to a text file. If the file exists and the console is not empty, it is overwritten without warning. Returns <literal>True</literal> if successful.</paragraph>
+ <paragraph role="paragraph" id="par_id281587218077400">Exports the contents of the console to a text file. If the file already exists and the console is not empty, it will be overwritten without warning. Returns <literal>True</literal> if successful.</paragraph>
<h3 id="hd_id231587218077969"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id31587218077825">SF_Exception.ConsoleToFile(FileName As String) As Boolean</paragraph>
</bascode>
<h3 id="hd_id471587218077526"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
- <paragraph role="paragraph" id="par_id851587218077862"><emph>FileName</emph>: The name of the text file the console should be dumped into. The name is expressed as given by the current <literal>FileNaming</literal> property of the <literal>SF_FileSystem</literal> service. Default is any where both the <link href="text/sbasic/shared/00000002.xhp" name="Url notation">URL notation</link> and the native operating system format are admitted.</paragraph>
+ <paragraph role="paragraph" id="par_id851587218077862"><emph>FileName</emph>: The name of the text file the console should be dumped into. The name is expressed according to the current <literal>FileNaming</literal> property of the <literal>SF_FileSystem</literal> service. <link href="text/sbasic/shared/00000002.xhp" name="Url notation">URL notation</link> and the native operating system's format are both admitted.</paragraph>
<h3 id="hd_id361587218077347"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id431587218077131">Sub Example_ConsoleToFile()</paragraph>
@@ -231,7 +239,7 @@
<bookmark_value>Exception service;DebugPrint</bookmark_value>
</bookmark>
<h2 id="hd _id981587218637683" localize="false">DebugPrint</h2>
- <paragraph role="paragraph" id="par_id281587218637490">Assemble all the given arguments into a human-readable single string and add it as a new entry in the console.</paragraph>
+ <paragraph role="paragraph" id="par_id281587218637490">Assembles all the given arguments into a single human-readable string and adds it as a new entry in the console.</paragraph>
<h3 id="hd_id341587218637198"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id65158721863738">SF_Exception.DebugPrint(Arg0[, Arg1, ...])</paragraph>
@@ -241,7 +249,8 @@
<h3 id="hd_id501587218637514"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id871587218637476">Sub Example_DebugPrint()</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id58158721863732"> SF_Exception.DebugPrint(Null, Array(1, 2, 3), , SF_Exception, "line1" &amp; Chr(10) &amp; "Line2", DateSerial(2020, 04, 09))</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id58158721863732"> SF_Exception.DebugPrint(Null, Array(1, 2, 3), "line1" &amp; Chr(10) &amp; "Line2", DateSerial(2020, 04, 09))</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id151610655617295"> '[NULL] [ARRAY] (0:2) (1, 2, 3) line1\nLine2 2020-04-09</paragraph>
<paragraph role="bascode" localize="false" id="bas_id331587218637452">End Sub</paragraph>
</bascode>
</section>
@@ -252,21 +261,21 @@
<bookmark_value>Exception service;Raise</bookmark_value>
</bookmark>
<h2 id="hd _id551587219824275" localize="false">Raise</h2>
- <paragraph role="paragraph" id="par_id541587219824771">Generate a run-time error. An error message is displayed to the user and reported in the console. The execution is stopped. The <literal>Raise()</literal> method can be placed inside the normal script flow or in a dedicated error-handling routine.</paragraph>
+ <paragraph role="paragraph" id="par_id541587219824771">Generates a run-time error. An error message is displayed to the user and reported in the console. The execution is stopped. The <literal>Raise()</literal> method can be placed inside the normal script flow or in a dedicated error-handling routine.</paragraph>
<h3 id="hd_id10158721982478"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id29158721982455">SF_Exception.Raise([Number As Variant], [Source As Variant], [Description As String])</paragraph>
</bascode>
- <paragraph role="paragraph" id="par_id921587220542454" xml-lang="en-US">Next code snippets are equivalent. Keyword arguments are allowed.<literal>Source</literal> and <literal>Description</literal> arguments behave identically:</paragraph>
+ <paragraph role="paragraph" id="par_id921587220542454" xml-lang="en-US">The code snippets presented next are equivalent. They show alternative ways to raise an exception with code 2100.</paragraph>
<bascode>
- <paragraph role="bascode" localize="false" id="bas_id881587220508733">SF_Exception.Raise(11)</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id881587220508733">SF_Exception.Raise(2100)</paragraph>
</bascode>
<bascode>
- <paragraph role="bascode" id="bas_id491608216264445" localize="false">SF_Exception.Raise Number := 11</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id361587220516558">SF_Exception.Number = 2100</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id51587220525168">SF_Exception.Raise()</paragraph>
</bascode>
<bascode>
- <paragraph role="bascode" localize="false" id="bas_id361587220516558">SF_Exception.Number = 11</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id51587220525168">SF_Exception.Raise()</paragraph>
+ <paragraph role="bascode" id="bas_id491608216264445" localize="false">SF_Exception.Raise Number := 2100</paragraph>
</bascode>
<h3 id="hd_id711587219824373"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
<paragraph role="paragraph" id="par_id851587219824597"><emph>Number</emph>: The error code, as a number or as a string. Default value is that of <literal>Err</literal> Basic builtin function.</paragraph>
@@ -275,26 +284,26 @@
<h3 id="hd_id471587219824970"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id101587221964367">Sub Example_Raise()</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id681587221964375">Dim a, b, c</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id811587221964318">On Local Error GoTo Catch</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id511601735068745">Try:</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id831587221964580"> a = 10 : b = 0</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id4115872219641"> c = a / b</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id85158722196499"> '...</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id241587221964418"> Exit Sub</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id721587221964962">Catch:</paragraph>
- <paragraph role="bascode" id="bas_id211587222852310" xml-lang="en-US"> ' Variants below ...</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id681587221964375"> Dim a, b, c</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id811587221964318"> On Local Error GoTo Catch</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id511601735068745"> Try:</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id831587221964580"> a = 10 : b = 0</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id4115872219641"> c = a / b</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id85158722196499"> '...</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id241587221964418"> Exit Sub</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id721587221964962"> Catch:</paragraph>
+ <paragraph role="bascode" id="bas_id211587222852310" xml-lang="en-US"> 'See variants below ...</paragraph>
<paragraph role="bascode" localize="false" id="bas_id61587221964946">End Sub</paragraph>
</bascode>
- <paragraph role="paragraph" id="par_id111587222580987" xml-lang="en-US">For a standard behaviour:</paragraph>
+ <paragraph role="paragraph" id="par_id111587222580987" xml-lang="en-US">To raise an exception with the standard values:</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id341587222627299">Catch:</paragraph>
<paragraph role="bascode" localize="false" id="bas_id261587222635009"> SF_Exception.Raise()</paragraph>
</bascode>
- <paragraph role="paragraph" id="par_id751587222598238" xml-lang="en-US">To simulate another error:</paragraph>
+ <paragraph role="paragraph" id="par_id751587222598238" xml-lang="en-US">To raise an exception with an specific code:</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id421587222644102">Catch:</paragraph>
- <paragraph role="bascode" localize="false" id="bas_id171587222653391"> SF_Exception.Raise(12)</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id171587222653391"> SF_Exception.Raise(11)</paragraph>
</bascode>
<paragraph role="paragraph" id="par_id501587222607771" xml-lang="en-US">To replace the usual message:</paragraph>
<bascode>
@@ -314,17 +323,17 @@
<bookmark_value>Exception service;RaiseWarning</bookmark_value>
</bookmark>
<h2 id="hd _id391587224839449" localize="false">RaiseWarning</h2>
- <paragraph role="paragraph" id="par_id1001587224839900" xml-lang="en-US">This method has exactly the same syntax, arguments and behaviour as the <literal>Raise()</literal> method.</paragraph>
- <paragraph role="paragraph" id="par_id761587224839624" xml-lang="en-US">With the notable exception that <emph>the execution is not stopped</emph>.</paragraph>
+ <paragraph role="paragraph" id="par_id1001587224839900" xml-lang="en-US">This method has exactly the same syntax, arguments and behavior as the <literal>Raise()</literal> method.</paragraph>
+ <paragraph role="paragraph" id="par_id761587224839624" xml-lang="en-US">However, when a warning is raised, <emph>the macro execution is not stopped</emph>.</paragraph>
<h3 id="hd_id10158729182478"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id25197821982455">SF_Exception.RaiseWarning[Number As Variant], [Source As Variant], [Description As String])</paragraph>
</bascode>
<h3 id="hd_id10158927182478"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<bascode>
- <paragraph role="bascode" localize="false" id="bas_id71587222649657"> SF_Exception.RaiseWarning(Source:="Example_Raise()", _</paragraph>
- <paragraph role="bascode" id="bas_id841608217948025" xml-lang="en-US"> Description:="Something wrong happened !", _</paragraph>
- <paragraph role="bascode" id="bas_id361608217956289" xml-lang="en-US"> Number:="MyAppError")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id71587222649657">SF_Exception.RaiseWarning(Source:="Example_Raise()", _</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id841608217948025"> Description:="Something wrong happened !", _</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id361608217956289"> Number:="MyAppError")</paragraph>
</bascode>
</section>