From 71d9804e62dfb6435b99f7e1020db0ce8fdb7e87 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Wed, 17 May 2017 09:18:45 -0300 Subject: tdf#84675 (part3) Document Basic constants Document Basic constants more explicitely. Change-Id: I76958041552148cc65e5bfb49eed6944991a0637 Reviewed-on: https://gerrit.libreoffice.org/37705 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot (cherry picked from commit a50d8ddab0d6037ee72424a21a18b9d07d53bdb7) Reviewed-on: https://gerrit.libreoffice.org/37772 --- AllLangHelp_sbasic.mk | 1 + source/text/sbasic/shared/03000000.xhp | 61 +++++----- source/text/sbasic/shared/03040000.xhp | 201 +++++++++++++++++++++++++++++++++ 3 files changed, 232 insertions(+), 31 deletions(-) create mode 100644 source/text/sbasic/shared/03040000.xhp diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d93e0b745a..4ac32080be 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -144,6 +144,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03030301 \ helpcontent2/source/text/sbasic/shared/03030302 \ helpcontent2/source/text/sbasic/shared/03030303 \ + helpcontent2/source/text/sbasic/shared/03040000 \ helpcontent2/source/text/sbasic/shared/03050000 \ helpcontent2/source/text/sbasic/shared/03050100 \ helpcontent2/source/text/sbasic/shared/03050200 \ diff --git a/source/text/sbasic/shared/03000000.xhp b/source/text/sbasic/shared/03000000.xhp index 27cb476658..46d180104f 100644 --- a/source/text/sbasic/shared/03000000.xhp +++ b/source/text/sbasic/shared/03000000.xhp @@ -1,6 +1,5 @@ - - + +--> - - -Run-Time Functions -/text/sbasic/shared/03000000.xhp - - -Sun Microsystems, Inc. - + + Run-Time Functions + /text/sbasic/shared/03000000.xhp + + - - -
- Run-Time Functions - This section describes the Runtime Functions of %PRODUCTNAME Basic. -
- - - - - - - - - - - - - -
+ + +
+ +Run-Time Functions +This section describes the Runtime Functions of %PRODUCTNAME Basic. +
+ + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03040000.xhp b/source/text/sbasic/shared/03040000.xhp new file mode 100644 index 0000000000..ec80f030d6 --- /dev/null +++ b/source/text/sbasic/shared/03040000.xhp @@ -0,0 +1,201 @@ + + + + + + + Basic Constants + /text/sbasic/shared/03040000.xhp + + + + + + +
+ + Pi;Basic constant + Null;Basic constant + Empty;Basic constant + Nothing;Basic constant + Basic constant;Nothing + Basic constant;Null + Basic constant;Empty + Basic constant;Pi + Basic constant;False + Basic constant;True + + + +Basic Constants +Constants used in Basic programs +
+ +Boolean constants + + + + + Name + + + Type + + + Value + + + + + True + + + Boolean + + + 1 + + + + + False + + + Boolean + + + 0 + + +
+ + +Example + +Dim bPositive as Boolean +bPositive = True + + +Mathematical constant + + + + + Name + + + Type + + + Value + + + + + Pi + + + Double + + + 3.14159265358979 + + +
+ + +Example + +Function Rad2Deg( aRad as Double) As Double +Rad2Deg = aRad * 180.00 / Pi +End Function + + +Object Constants + + + + + Name + + + Type + + + Usage + + + + + Empty + + + Variant + + + The Empty value indicates that the variable is not initialized. + + + + + Null + + + null + + + Indicates that the variable does not contain data. + + + + + Nothing + + + Object + + + Assign the Nothing object to a variable to remove a previous assignment. + + +
+ + +Example + +SubExampleEmpty +Dim sVar As Variant + sVar = Empty + Print IsEmpty(sVar) ' Returns True +End Sub +Sub ExampleNull +Dim vVar As Variant + MsgBox IsNull(vVar) +End Sub +Sub ExampleNothing +Dim oDoc As Object + Set oDoc = ThisComponent + Print oDoc.Title + oDoc = Nothing + Print oDoc ‘ Error +End Sub + + + +
-- cgit v1.2.3