From 32de39e587a6b4c1e51c03d0a9497e8c871ac60b Mon Sep 17 00:00:00 2001 From: LibreOfficiant Date: Fri, 20 Dec 2019 11:58:33 +0100 Subject: tdf#62326 &o &h literal notations &b notation isn't supported Change-Id: Ic1dd13326e13623d74c4bf70c6cdb01a33733b44 Reviewed-on: https://gerrit.libreoffice.org/85590 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/text/sbasic/shared/01020100.xhp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/source/text/sbasic/shared/01020100.xhp b/source/text/sbasic/shared/01020100.xhp index 8c68531a63..8b777f7ba3 100644 --- a/source/text/sbasic/shared/01020100.xhp +++ b/source/text/sbasic/shared/01020100.xhp @@ -27,7 +27,6 @@ -
names of variables @@ -35,6 +34,13 @@ types of variables declaring variables values;of variables + literals;integer + literals;hexadecimal + literals;integer + literals;octal + literals;&h notation + literals;&o notation + literals;floating-point constants arrays;declaring defining;constants @@ -117,16 +123,16 @@ If a decimal number is assigned to an integer variable, %PRODUCTNAME Basic rounds the figure up or down.information from "Programming Guide for BASIC" about decimal variables Single Variables -Single variables can take positive or negative values ranging from 3.402823 x 10E38 to 1.401298 x 10E-45. Single variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Single variables are suitable for mathematical calculations of average precision. Calculations require more time than for Integer variables, but are faster than calculations with Double variables. A Single variable requires 4 bytes of memory. The type-declaration character is "!". +Single variables can take positive or negative values ranging from 3.402823 x 10E38 to 1.401298 x 10E-45. Single variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Single variables are suitable for mathematical calculations of average precision. Calculations require more time than for Integer variables, but are faster than calculations with Double variables. A Single variable requires 4 bytes of memory. The type-declaration character is "!". Dim Variable! Dim Variable As Single Double Variables -Double variables can take positive or negative values ranging from 1.79769313486232 x 10E308 to 4.94065645841247 x 10E-324. Double variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Double variables are suitable for precise calculations. Calculations require more time than for Single variables. A Double variable requires 8 bytes of memory. The type-declaration character is "#". +Double variables can take positive or negative values ranging from 1.79769313486232 x 10E308 to 4.94065645841247 x 10E-324. Double variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Double variables are suitable for precise calculations. Calculations require more time than for Single variables. A Double variable requires 8 bytes of memory. The type-declaration character is "#". -Dim Variable# +Dim Variable# Dim Variable As Double @@ -137,6 +143,17 @@ Dim Variable As Currency +

Literals for integers

+Numbers can be encoded using octal and hexadecimal forms. + + xi = &o13 ' 8 + 3 + ci = &h65 ' 6*16 + 5 + MAX_Integer = &o77777 ' 32767 = &h7FFF + MIN_Integer = &o100000 ' -32768 = &h8000 + MAX_Long = &h7fffffff ' 2147483647 = &o17777777777 + MIN_Long = &h80000000 ' -2147483648 = &o20000000000 + + String Variables String variables can hold character strings with up to 65,535 characters. Each character is stored as the corresponding Unicode value. String variables are suitable for word processing within programs and for temporary storage of any non-printable character up to a maximum length of 64 Kbytes. The memory required for storing string variables depends on the number of characters in the variable. The type-declaration character is "$". -- cgit