From 6614bedceadcc07ec082c5e926107f27903bda5c Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Mon, 25 Jan 2016 20:07:10 +0100 Subject: fix validation errors by round-trip through helpauthoring extension lots of missing attributes "id" and "xml-lang" (extension patched to keep bascode tag) Change-Id: I9c5600b6fa133a6b1062803eadb976e043db7a4a --- source/text/sbasic/shared/01020100.xhp | 509 ++++++++++++++++--------------- source/text/sbasic/shared/01020300.xhp | 184 +++++------ source/text/sbasic/shared/03010101.xhp | 92 +++--- source/text/sbasic/shared/03010102.xhp | 119 ++++---- source/text/sbasic/shared/03010103.xhp | 94 +++--- source/text/sbasic/shared/03010201.xhp | 79 ++--- source/text/sbasic/shared/03010301.xhp | 69 +++-- source/text/sbasic/shared/03010302.xhp | 69 +++-- source/text/sbasic/shared/03010303.xhp | 69 +++-- source/text/sbasic/shared/03010304.xhp | 100 +++--- source/text/sbasic/shared/03010305.xhp | 71 ++--- source/text/sbasic/shared/03020101.xhp | 94 +++--- source/text/sbasic/shared/03020102.xhp | 98 +++--- source/text/sbasic/shared/03020103.xhp | 109 ++++--- source/text/sbasic/shared/03020104.xhp | 92 +++--- source/text/sbasic/shared/03020201.xhp | 109 +++---- source/text/sbasic/shared/03020202.xhp | 125 ++++---- source/text/sbasic/shared/03020203.xhp | 97 +++--- source/text/sbasic/shared/03020204.xhp | 112 +++---- source/text/sbasic/shared/03020205.xhp | 87 +++--- source/text/sbasic/shared/03020301.xhp | 99 +++--- source/text/sbasic/shared/03020401.xhp | 71 +++-- source/text/sbasic/shared/03020402.xhp | 56 ++-- source/text/sbasic/shared/03020403.xhp | 75 ++--- source/text/sbasic/shared/03020404.xhp | 104 ++++--- source/text/sbasic/shared/03020405.xhp | 100 +++--- source/text/sbasic/shared/03020406.xhp | 59 ++-- source/text/sbasic/shared/03020407.xhp | 56 ++-- source/text/sbasic/shared/03020408.xhp | 61 ++-- source/text/sbasic/shared/03020409.xhp | 96 +++--- source/text/sbasic/shared/03020410.xhp | 54 ++-- source/text/sbasic/shared/03020411.xhp | 133 ++++---- source/text/sbasic/shared/03020412.xhp | 70 +++-- source/text/sbasic/shared/03020413.xhp | 64 ++-- source/text/sbasic/shared/03020414.xhp | 88 +++--- source/text/sbasic/shared/03020415.xhp | 62 ++-- source/text/sbasic/shared/03030107.xhp | 61 ++-- source/text/sbasic/shared/03030110.xhp | 242 ++++++++------- source/text/sbasic/shared/03030111.xhp | 82 ++--- source/text/sbasic/shared/03030112.xhp | 82 ++--- source/text/sbasic/shared/03030113.xhp | 82 ++--- source/text/sbasic/shared/03030114.xhp | 82 ++--- source/text/sbasic/shared/03030115.xhp | 80 ++--- source/text/sbasic/shared/03030116.xhp | 80 ++--- source/text/sbasic/shared/03030120.xhp | 297 +++++++++--------- source/text/sbasic/shared/03030130.xhp | 64 ++-- source/text/sbasic/shared/03030203.xhp | 55 ++-- source/text/sbasic/shared/03030204.xhp | 67 ++-- source/text/sbasic/shared/03030205.xhp | 93 +++--- source/text/sbasic/shared/03030206.xhp | 91 +++--- source/text/sbasic/shared/03030301.xhp | 56 ++-- source/text/sbasic/shared/03030302.xhp | 56 ++-- source/text/sbasic/shared/03030303.xhp | 71 +++-- source/text/sbasic/shared/03050100.xhp | 80 ++--- source/text/sbasic/shared/03050500.xhp | 102 ++++--- source/text/sbasic/shared/03060100.xhp | 80 ++--- source/text/sbasic/shared/03060200.xhp | 77 ++--- source/text/sbasic/shared/03060300.xhp | 77 ++--- source/text/sbasic/shared/03060400.xhp | 75 ++--- source/text/sbasic/shared/03060500.xhp | 77 ++--- source/text/sbasic/shared/03060600.xhp | 77 ++--- source/text/sbasic/shared/03070100.xhp | 75 ++--- source/text/sbasic/shared/03070200.xhp | 75 ++--- source/text/sbasic/shared/03070300.xhp | 75 ++--- source/text/sbasic/shared/03070400.xhp | 75 ++--- source/text/sbasic/shared/03070500.xhp | 64 ++-- source/text/sbasic/shared/03070600.xhp | 74 ++--- source/text/sbasic/shared/03080101.xhp | 87 +++--- source/text/sbasic/shared/03080102.xhp | 85 +++--- source/text/sbasic/shared/03080103.xhp | 87 +++--- source/text/sbasic/shared/03080104.xhp | 87 +++--- source/text/sbasic/shared/03080201.xhp | 69 +++-- source/text/sbasic/shared/03080202.xhp | 75 ++--- source/text/sbasic/shared/03080301.xhp | 73 +++-- source/text/sbasic/shared/03080302.xhp | 83 ++--- source/text/sbasic/shared/03080401.xhp | 67 ++-- source/text/sbasic/shared/03080501.xhp | 65 ++-- source/text/sbasic/shared/03080502.xhp | 62 ++-- source/text/sbasic/shared/03080601.xhp | 71 +++-- source/text/sbasic/shared/03080701.xhp | 131 ++++---- source/text/sbasic/shared/03080801.xhp | 93 +++--- source/text/sbasic/shared/03080802.xhp | 61 ++-- source/text/sbasic/shared/03090101.xhp | 85 +++--- source/text/sbasic/shared/03090102.xhp | 83 ++--- source/text/sbasic/shared/03090201.xhp | 148 ++++----- source/text/sbasic/shared/03090202.xhp | 155 +++++----- source/text/sbasic/shared/03090301.xhp | 107 +++---- source/text/sbasic/shared/03090303.xhp | 97 +++--- source/text/sbasic/shared/03090402.xhp | 77 ++--- source/text/sbasic/shared/03090403.xhp | 84 ++--- source/text/sbasic/shared/03090404.xhp | 90 +++--- source/text/sbasic/shared/03090405.xhp | 66 ++-- source/text/sbasic/shared/03090406.xhp | 116 +++---- source/text/sbasic/shared/03090407.xhp | 68 +++-- source/text/sbasic/shared/03090408.xhp | 56 ++-- source/text/sbasic/shared/03090409.xhp | 64 ++-- source/text/sbasic/shared/03090410.xhp | 75 ++--- source/text/sbasic/shared/03090412.xhp | 121 ++++---- source/text/sbasic/shared/03100100.xhp | 82 ++--- source/text/sbasic/shared/03100300.xhp | 65 ++-- source/text/sbasic/shared/03100400.xhp | 63 ++-- source/text/sbasic/shared/03100500.xhp | 67 ++-- source/text/sbasic/shared/03100600.xhp | 67 ++-- source/text/sbasic/shared/03100700.xhp | 68 +++-- source/text/sbasic/shared/03100900.xhp | 67 ++-- source/text/sbasic/shared/03101000.xhp | 159 +++++----- source/text/sbasic/shared/03101100.xhp | 81 ++--- source/text/sbasic/shared/03101120.xhp | 83 ++--- source/text/sbasic/shared/03101130.xhp | 83 ++--- source/text/sbasic/shared/03101140.xhp | 83 ++--- source/text/sbasic/shared/03101300.xhp | 81 ++--- source/text/sbasic/shared/03101400.xhp | 81 ++--- source/text/sbasic/shared/03101500.xhp | 81 ++--- source/text/sbasic/shared/03101600.xhp | 81 ++--- source/text/sbasic/shared/03102000.xhp | 83 ++--- source/text/sbasic/shared/03102100.xhp | 167 +++++----- source/text/sbasic/shared/03102101.xhp | 128 ++++---- source/text/sbasic/shared/03102200.xhp | 63 ++-- source/text/sbasic/shared/03102300.xhp | 69 +++-- source/text/sbasic/shared/03102400.xhp | 65 ++-- source/text/sbasic/shared/03102600.xhp | 63 ++-- source/text/sbasic/shared/03102700.xhp | 69 +++-- source/text/sbasic/shared/03102900.xhp | 84 ++--- source/text/sbasic/shared/03103000.xhp | 84 ++--- source/text/sbasic/shared/03103100.xhp | 62 ++-- source/text/sbasic/shared/03103200.xhp | 59 ++-- source/text/sbasic/shared/03103300.xhp | 65 ++-- source/text/sbasic/shared/03103400.xhp | 54 ++-- source/text/sbasic/shared/03103450.xhp | 54 ++-- source/text/sbasic/shared/03103500.xhp | 84 ++--- source/text/sbasic/shared/03103600.xhp | 351 ++++++++++----------- source/text/sbasic/shared/03103700.xhp | 68 +++-- source/text/sbasic/shared/03104500.xhp | 80 ++--- source/text/sbasic/shared/03110100.xhp | 94 +++--- source/text/sbasic/shared/03120101.xhp | 70 +++-- source/text/sbasic/shared/03120102.xhp | 70 +++-- source/text/sbasic/shared/03120103.xhp | 71 +++-- source/text/sbasic/shared/03120104.xhp | 65 ++-- source/text/sbasic/shared/03120201.xhp | 75 ++--- source/text/sbasic/shared/03120202.xhp | 75 ++--- source/text/sbasic/shared/03120301.xhp | 140 ++++----- source/text/sbasic/shared/03120302.xhp | 69 +++-- source/text/sbasic/shared/03120303.xhp | 82 ++--- source/text/sbasic/shared/03120304.xhp | 107 +++---- source/text/sbasic/shared/03120305.xhp | 81 ++--- source/text/sbasic/shared/03120306.xhp | 92 +++--- source/text/sbasic/shared/03120307.xhp | 84 ++--- source/text/sbasic/shared/03120308.xhp | 111 +++---- source/text/sbasic/shared/03120309.xhp | 81 ++--- source/text/sbasic/shared/03120310.xhp | 67 ++-- source/text/sbasic/shared/03120311.xhp | 79 ++--- source/text/sbasic/shared/03120314.xhp | 140 ++++----- source/text/sbasic/shared/03120401.xhp | 80 ++--- source/text/sbasic/shared/03120403.xhp | 98 +++--- source/text/sbasic/shared/03130500.xhp | 184 +++++------ source/text/sbasic/shared/03130700.xhp | 63 ++-- source/text/sbasic/shared/03130800.xhp | 64 ++-- source/text/sbasic/shared/03131000.xhp | 59 ++-- source/text/sbasic/shared/03131300.xhp | 55 ++-- source/text/sbasic/shared/03131400.xhp | 55 ++-- source/text/sbasic/shared/03131600.xhp | 78 ++--- source/text/sbasic/shared/03132000.xhp | 196 ++++++------ source/text/sbasic/shared/03132200.xhp | 62 ++-- source/text/sbasic/shared/03132400.xhp | 59 ++-- source/text/scalc/01/02140700.xhp | 2 +- source/text/scalc/01/func_averageif.xhp | 2 +- source/text/scalc/01/func_averageifs.xhp | 2 +- source/text/scalc/01/func_imsinh.xhp | 2 +- source/text/scalc/01/stat_data.xhp | 4 +- source/text/scalc/01/statistics.xhp | 2 +- source/text/scalc/guide/formulas.xhp | 1 - source/text/shared/01/01010100.xhp | 7 +- source/text/shared/optionen/01040400.xhp | 2 - source/text/simpress/presenter.xhp | 2 +- 174 files changed, 7724 insertions(+), 7090 deletions(-) (limited to 'source/text') diff --git a/source/text/sbasic/shared/01020100.xhp b/source/text/sbasic/shared/01020100.xhp index ab0ee8ef16..54f685dcac 100644 --- a/source/text/sbasic/shared/01020100.xhp +++ b/source/text/sbasic/shared/01020100.xhp @@ -1,7 +1,5 @@ - - - + +--> - - - -Using Variables -/text/sbasic/shared/01020100.xhp - + + Using Variables + /text/sbasic/shared/01020100.xhp + + + +
-names of variables -variables; using -types of variables -declaring variables -values;of variables -constants -arrays;declaring -defining;constants + + names of variables + variables; using + types of variables + declaring variables + values;of variables + constants + arrays;declaring + defining;constants -Using Variables -The following describes the basic use of variables in $[officename] Basic. + + +Using Variables +The following describes the basic use of variables in $[officename] Basic.
-Naming Conventions for Variable Identifiers -A variable name can consist of a maximum of 255 characters. The first character of a variable name must be a letter A-Z or a-z. Numbers can also be used in a variable name, but punctuation symbols and special characters are not permitted, with exception of the underscore character ("_"). In $[officename] Basic variable identifiers are not case-sensitive. Variable names may contain spaces but must be enclosed in square brackets if they do. -Examples for variable identifiers: + +Naming Conventions for Variable Identifiers +A variable name can consist of a maximum of 255 characters. The first character of a variable name must be a letter A-Z or a-z. Numbers can also be used in a variable name, but punctuation symbols and special characters are not permitted, with exception of the underscore character ("_"). In $[officename] Basic variable identifiers are not case-sensitive. Variable names may contain spaces but must be enclosed in square brackets if they do. +Examples for variable identifiers: + - - + + -MyNumber=5 + MyNumber=5 - - -Correct - - - - + + + Correct + + + + -MyNumber5=15 + MyNumber5=15 - - -Correct - - - - + + + Correct + + + + -MyNumber_5=20 + MyNumber_5=20 - - -Correct - - - - + + + Correct + + + + -My Number=20 + My Number=20 - - -Not valid, variable with space must be enclosed in square brackets - - - - + + + Not valid, variable with space must be enclosed in square brackets + + + + -[My Number]=12 + [My Number]=12 - - -Correct - - - - + + + Correct + + + + -DéjàVu=25 + DéjàVu=25 - - -Not valid, special characters are not allowed - - - - + + + Not valid, special characters are not allowed + + + + -5MyNumber=12 + 5MyNumber=12 - - -Not valid, variable may not begin with a number - - - - + + + Not valid, variable may not begin with a number + + + + -Number,Mine=12 + Number,Mine=12 - - -Not valid, punctuation marks are not allowed - - + + + Not valid, punctuation marks are not allowed + +
-Declaring Variables -In $[officename] Basic you don't need to declare variables explicitly. A variable declaration can be performed with the Dim statement. You can declare more than one variable at a time by separating the names with a comma. To define the variable type, use either a type-declaration sign after the name, or the appropriate key word. -Examples for variable declarations: + + +Declaring Variables +In $[officename] Basic you don't need to declare variables explicitly. A variable declaration can be performed with the Dim statement. You can declare more than one variable at a time by separating the names with a comma. To define the variable type, use either a type-declaration sign after the name, or the appropriate key word. +Examples for variable declarations: + - - + + -Dim a$ + Dim a$ - - -Declares the variable "a" as a String - - - - + + + Declares the variable "a" as a String + + + + -Dim a As String + Dim a As String - - -Declares the variable "a" as a String - - - - + + + Declares the variable "a" as a String + + + + -Dim a$, b As Integer + Dim a$, b As Integer - - -Declares one variable as a String and one as an Integer - - - - + + + Declares one variable as a String and one as an Integer + + + + -Dim c As Boolean + Dim c As Boolean - - -Declares c as a Boolean variable that can be TRUE or FALSE - - + + + Declares c as a Boolean variable that can be TRUE or FALSE + +
-It is very important when declaring variables that you use the type-declaration character each time, even if it was used in the declaration instead of a keyword. Thus the following statements are invalid: + +It is very important when declaring variables that you use the type-declaration character each time, even if it was used in the declaration instead of a keyword. Thus the following statements are invalid: + - - + + -Dim a$ + Dim a$ - - -Declares "a" as a String - - - - + + + Declares "a" as a String + + + + -a="TestString" + a="TestString" - - -Type-declaration missing: "a$=" - - + + + Type-declaration missing: "a$=" + +
-Once you have declared a variable as a certain type, you cannot declare the variable under the same name again as a different type! -Forcing Variable Declarations -To force declaration of variables, use the following command: + +Once you have declared a variable as a certain type, you cannot declare the variable under the same name again as a different type! + +Forcing Variable Declarations +To force declaration of variables, use the following command: -Option Explicit +Option Explicit -The Option Explicit statement has to be the first line in the module, before the first SUB. Generally, only arrays need to be declared explicitly. All other variables are declared according to the type-declaration character, or - if omitted - as the default type Single. -Variable Types -$[officename] Basic supports four variable classes: +The Option Explicit statement has to be the first line in the module, before the first SUB. Generally, only arrays need to be declared explicitly. All other variables are declared according to the type-declaration character, or - if omitted - as the default type Single. + +Variable Types +$[officename] Basic supports four variable classes: + - - -Numeric variables can contain number values. Some variables are used to store large or small numbers, and others are used for floating-point or fractional numbers. - - - -String variables contain character strings. - - - -Boolean variables contain either the TRUE or the FALSE value. - - - -Object variables can store objects of various types, like tables and documents within a document. - - -Integer Variables -Integer variables range from -32768 to 32767. If you assign a floating-point value to an integer variable, the decimal places are rounded to the next integer. Integer variables are rapidly calculated in procedures and are suitable for counter variables in loops. An integer variable only requires two bytes of memory. "%" is the type-declaration character. + + Numeric variables can contain number values. Some variables are used to store large or small numbers, and others are used for floating-point or fractional numbers. + + + String variables contain character strings. + + + Boolean variables contain either the TRUE or the FALSE value. + + + Object variables can store objects of various types, like tables and documents within a document. + + +Integer Variables +Integer variables range from -32768 to 32767. If you assign a floating-point value to an integer variable, the decimal places are rounded to the next integer. Integer variables are rapidly calculated in procedures and are suitable for counter variables in loops. An integer variable only requires two bytes of memory. "%" is the type-declaration character. -Dim Variable% -Dim Variable As Integer +Dim Variable% +Dim Variable As Integer -Long Integer Variables -Long integer variables range from -2147483648 to 2147483647. If you assign a floating-point value to a long integer variable, the decimal places are rounded to the next integer. Long integer variables are rapidly calculated in procedures and are suitable for counter variables in loops for large values. A long integer variable requires four bytes of memory. "&" is the type-declaration character. + +Long Integer Variables +Long integer variables range from -2147483648 to 2147483647. If you assign a floating-point value to a long integer variable, the decimal places are rounded to the next integer. Long integer variables are rapidly calculated in procedures and are suitable for counter variables in loops for large values. A long integer variable requires four bytes of memory. "&" is the type-declaration character. -Dim Variable& -Dim Variable As Long +Dim Variable& +Dim Variable As Long -Decimal Variablessee i64349 -Decimal variables can take positive or negative numbers or zero. Accuracy is up to 29 digits.i85284You can use plus (+) or minus (-) signs as prefixes for decimal numbers (with or without spaces). -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 "!". + +Decimal Variablessee i64349 +Decimal variables can take positive or negative numbers or zero. Accuracy is up to 29 digits.i85284 +You can use plus (+) or minus (-) signs as prefixes for decimal numbers (with or without spaces). +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 "!". -Dim Variable! -Dim Variable As Single +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 +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 As Double +Dim Variable# +Dim Variable As Double -Currency Variables -Currency variables are internally stored as 64-bit numbers (8 Bytes) and displayed as a fixed-decimal number with 15 non-decimal and 4 decimal places. The values range from -922337203685477.5808 to +922337203685477.5807. Currency variables are used to calculate currency values with a high precision. The type-declaration character is "@". + +Currency Variables +Currency variables are internally stored as 64-bit numbers (8 Bytes) and displayed as a fixed-decimal number with 15 non-decimal and 4 decimal places. The values range from -922337203685477.5808 to +922337203685477.5807. Currency variables are used to calculate currency values with a high precision. The type-declaration character is "@". -Dim Variable@ -Dim Variable As Currency +Dim Variable@ +Dim Variable As Currency -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 "$". + +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 "$". -Dim Variable$ -Dim Variable As String +Dim Variable$ +Dim Variable As String -Boolean Variables -Boolean variables store only one of two values: TRUE or FALSE. A number 0 evaluates to FALSE, every other value evaluates to TRUE. + +Boolean Variables +Boolean variables store only one of two values: TRUE or FALSE. A number 0 evaluates to FALSE, every other value evaluates to TRUE. -Dim Variable As Boolean +Dim Variable As Boolean -Date Variables -Date variables can only contain dates and time values stored in an internal format. Values assigned to Date variables with Dateserial, Datevalue, Timeserial or Timevalue are automatically converted to the internal format. Date-variables are converted to normal numbers by using the Day, Month, Year or the Hour, Minute, Second function. The internal format enables a comparison of date/time values by calculating the difference between two numbers. These variables can only be declared with the key word Date. + +Date Variables +Date variables can only contain dates and time values stored in an internal format. Values assigned to Date variables with Dateserial, Datevalue, Timeserial or Timevalue are automatically converted to the internal format. Date-variables are converted to normal numbers by using the Day, Month, Year or the Hour, Minute, Second function. The internal format enables a comparison of date/time values by calculating the difference between two numbers. These variables can only be declared with the key word Date. -Dim Variable As Date +Dim Variable As Date -Initial Variable Values -As soon as the variable has been declared, it is automatically set to the "Null" value. Note the following conventions: - -Numeric variables are automatically assigned the value "0" as soon as they are declared. - -Date variables are assigned the value 0 internally; equivalent to converting the value to "0" with the Day, Month, Year or the Hour, Minute, Second function. - -String variables are assigned an empty-string ("") when they are declared. -Arrays -$[officename] Basic knows one- or multi-dimensional arrays, defined by a specified variable type. Arrays are suitable for editing lists and tables in programs. Individual elements of an array can be addressed through a numeric index. -Arrays must be declared with the Dim statement. There are several ways to define the index range of an array: + +Initial Variable Values +As soon as the variable has been declared, it is automatically set to the "Null" value. Note the following conventions: + Numeric variables are automatically assigned the value "0" as soon as they are declared. + Date variables are assigned the value 0 internally; equivalent to converting the value to "0" with the Day, Month, Year or the Hour, Minute, Second function. + String variables are assigned an empty-string ("") when they are declared. + +Arrays +$[officename] Basic knows one- or multi-dimensional arrays, defined by a specified variable type. Arrays are suitable for editing lists and tables in programs. Individual elements of an array can be addressed through a numeric index. +Arrays must be declared with the Dim statement. There are several ways to define the index range of an array: + - - + + -Dim Text$(20) + Dim Text$(20) - - -21 elements numbered from 0 to 20 - - - - + + + 21 elements numbered from 0 to 20 + + + + -Dim Text$(5,4) + Dim Text$(5,4) - - -30 elements (a matrix of 6 x 5 elements) - - - - + + + 30 elements (a matrix of 6 x 5 elements) + + + + -Dim Text$(5 To 25) + Dim Text$(5 To 25) - - -21 elements numbered from 5 to 25 - - - - + + + 21 elements numbered from 5 to 25 + + + + -Dim Text$(-15 To 5) + Dim Text$(-15 To 5) - - -21 elements (including 0), numbered from -15 to 5 - - + + + 21 elements (including 0), numbered from -15 to 5 + +
-The index range can include positive as well as negative numbers. i36558 -Constants -Constants have a fixed value. They are only defined once in the program and cannot be redefined later: + +The index range can include positive as well as negative numbers. i36558 + +Constants +Constants have a fixed value. They are only defined once in the program and cannot be redefined later: -Const ConstName=Expression +Const ConstName=Expression -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/01020300.xhp b/source/text/sbasic/shared/01020300.xhp index 26c174f040..70d2b0813a 100644 --- a/source/text/sbasic/shared/01020300.xhp +++ b/source/text/sbasic/shared/01020300.xhp @@ -1,7 +1,5 @@ - - - + +--> - - - -Using Procedures and Functions -/text/sbasic/shared/01020300.xhp - + + Using Procedures and Functions + /text/sbasic/shared/01020300.xhp + + + +
-procedures -functions;using -variables;passing to procedures and functions -parameters;for procedures and functions -parameters;passing by reference or value -variables;scope -scope of variables -GLOBAL variables -PUBLIC variables -PRIVATE variables -functions;return value type -return value type of functions + + procedures + functions;using + variables;passing to procedures and functions + parameters;for procedures and functions + parameters;passing by reference or value + variables;scope + scope of variables + GLOBAL variables + PUBLIC variables + PRIVATE variables + functions;return value type + return value type of functions -Using Procedures and Functions -The following describes the basic use of procedures and functions in $[officename] Basic. -
-When you create a new module, $[officename] Basic automatically inserts a SUB called "Main". This default name has nothing to do with the order or the starting point of a $[officename] Basic project. You can also safely rename this SUB. -Some restrictions apply for the names of your public variables, subs, and functions. You must not use the same name as one of the modules of the same library. -Procedures (SUBS) and functions (FUNCTIONS) help you maintaining a structured overview by separating a program into logical pieces. -One benefit of procedures and functions is that, once you have developed a program code containing task components, you can use this code in another project. -Passing Variables to Procedures (SUB) and Functions (FUNCTION) -Variables can be passed to both procedures and functions. The SUB or FUNCTION must be declared to expect parameters: +Using Procedures and Functions +The following describes the basic use of procedures and functions in $[officename] Basic. + +When you create a new module, $[officename] Basic automatically inserts a SUB called "Main". This default name has nothing to do with the order or the starting point of a $[officename] Basic project. You can also safely rename this SUB. +Some restrictions apply for the names of your public variables, subs, and functions. You must not use the same name as one of the modules of the same library. +Procedures (SUBS) and functions (FUNCTIONS) help you maintaining a structured overview by separating a program into logical pieces. +One benefit of procedures and functions is that, once you have developed a program code containing task components, you can use this code in another project. + +Passing Variables to Procedures (SUB) and Functions (FUNCTION) +Variables can be passed to both procedures and functions. The SUB or FUNCTION must be declared to expect parameters: -Sub SubName(Parameter1 As Type, Parameter2 As Type,...) -Program code -End Sub +Sub SubName(Parameter1 As Type, Parameter2 As Type,...) +Program code +End Sub -The SUB is called using the following syntax: +The SUB is called using the following syntax: -SubName(Value1, Value2,...) +SubName(Value1, Value2,...) -The parameters passed to a SUB must fit to those specified in the SUB declaration. -The same process applies to FUNCTIONS. In addition, functions always return a function result. The result of a function is defined by assigning the return value to the function name: +The parameters passed to a SUB must fit to those specified in the SUB declaration. +The same process applies to FUNCTIONS. In addition, functions always return a function result. The result of a function is defined by assigning the return value to the function name: -Function FunctionName(Parameter1 As Type, Parameter2 As Type,...) As Type -Program code -FunctionName=Result -End Function +Function FunctionName(Parameter1 As Type, Parameter2 As Type,...) As Type +Program code +FunctionName=Result +End Function -The FUNCTION is called using the following syntax: +The FUNCTION is called using the following syntax: -Variable=FunctionName(Parameter1, Parameter2,...) +Variable=FunctionName(Parameter1, Parameter2,...) -You can also use the fully qualified name to call a procedure or function:
-Library.Module.Macro() -
For example, to call the Autotext macro from the Gimmicks library, use the following command:
-Gimmicks.AutoText.Main() -
-Passing Variables by Value or Reference -Parameters can be passed to a SUB or a FUNCTION either by reference or by value. Unless otherwise specified, a parameter is always passed by reference. That means that a SUB or a FUNCTION gets the parameter and can read and modify its value. -If you want to pass a parameter by value insert the key word "ByVal" in front of the parameter when you call a SUB or FUNCTION, for example: +You can also use the fully qualified name to call a procedure or function:
Library.Module.Macro()
For example, to call the Autotext macro from the Gimmicks library, use the following command:
Gimmicks.AutoText.Main()
+ +Passing Variables by Value or Reference +Parameters can be passed to a SUB or a FUNCTION either by reference or by value. Unless otherwise specified, a parameter is always passed by reference. That means that a SUB or a FUNCTION gets the parameter and can read and modify its value. +If you want to pass a parameter by value insert the key word "ByVal" in front of the parameter when you call a SUB or FUNCTION, for example: -Result = Function(ByVal Parameter) +Result = Function(ByVal Parameter) -In this case, the original content of the parameter will not be modified by the FUNCTION since it only gets the value and not the parameter itself. -Scope of Variables -A variable defined within a SUB or FUNCTION, only remains valid until the procedure is exited. This is known as a "local" variable. In many cases, you need a variable to be valid in all procedures, in every module of all libraries, or after a SUB or FUNCTION is exited. -Declaring Variables Outside a SUB or FUNCTION +In this case, the original content of the parameter will not be modified by the FUNCTION since it only gets the value and not the parameter itself. + +Scope of Variables +A variable defined within a SUB or FUNCTION, only remains valid until the procedure is exited. This is known as a "local" variable. In many cases, you need a variable to be valid in all procedures, in every module of all libraries, or after a SUB or FUNCTION is exited. + +Declaring Variables Outside a SUB or FUNCTION -Global VarName As TYPENAME +Global VarName As TYPENAME -The variable is valid as long as the $[officename] session lasts. +The variable is valid as long as the $[officename] session lasts. -Public VarName As TYPENAME +Public VarName As TYPENAME -The variable is valid in all modules. +The variable is valid in all modules. -Private VarName As TYPENAME +Private VarName As TYPENAME -The variable is only valid in this module. +The variable is only valid in this module. -Dim VarName As TYPENAME +Dim VarName As TYPENAME -The variable is only valid in this module. -Example for private variables -Enforce private variables to be private across modules by setting CompatibilityMode(true).from i17948, see i54894 +The variable is only valid in this module. + +Example for private variables +Enforce private variables to be private across modules by setting CompatibilityMode(true).from i17948, see i54894 -' ***** Module1 ***** -Private myText As String -Sub initMyText - myText = "Hello" - Print "In module1 : ", myText -End Sub - -' ***** Module2 ***** -'Option Explicit -Sub demoBug - CompatibilityMode( true ) - initMyText - ' Now returns empty string - ' (or rises error for Option Explicit) - Print "Now in module2 : ", myText -End Sub +' ***** Module1 ***** +Private myText As String +Sub initMyText + myText = "Hello" + Print "In module1 : ", myText +End Sub + +' ***** Module2 ***** +'Option Explicit +Sub demoBug + CompatibilityMode( true ) + initMyText + ' Now returns empty string + ' (or rises error for Option Explicit) + Print "Now in module2 : ", myText +End Sub -Saving Variable Content after Exiting a SUB or FUNCTION + +Saving Variable Content after Exiting a SUB or FUNCTION -Static VarName As TYPENAME +Static VarName As TYPENAME -The variable retains its value until the next time the FUNCTION or SUB is entered. The declaration must exist inside a SUB or a FUNCTION. -Specifying the Return Value Type of a FUNCTION -As with variables, include a type-declaration character after the function name, or the type indicated by "As" and the corresponding key word at the end of the parameter list to define the type of the function's return value, for example: +The variable retains its value until the next time the FUNCTION or SUB is entered. The declaration must exist inside a SUB or a FUNCTION. + +Specifying the Return Value Type of a FUNCTION +As with variables, include a type-declaration character after the function name, or the type indicated by "As" and the corresponding key word at the end of the parameter list to define the type of the function's return value, for example: -Function WordCount(WordText As String) As Integer +Function WordCount(WordText As String) As Integer -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010101.xhp b/source/text/sbasic/shared/03010101.xhp index 4abe46d6b3..b4aa9f9ed3 100644 --- a/source/text/sbasic/shared/03010101.xhp +++ b/source/text/sbasic/shared/03010101.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -MsgBox Statement [Runtime] -/text/sbasic/shared/03010101.xhp - - -Sun Microsystems, Inc. - + + MsgBox Statement [Runtime] + /text/sbasic/shared/03010101.xhp + + + +
-MsgBox statement + + MsgBox statement -MsgBox Statement [Runtime] -Displays a dialog box containing a message. + + +MsgBox Statement [Runtime] +Displays a dialog box containing a message.
-Syntax: + +Syntax: -MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) or MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function) +MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) or MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function) -Parameter: - -Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). - -DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application. - -Type: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. Type represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values: -0 : Display OK button only. -1 : Display OK and Cancel buttons. -2 : Display Abort, Retry, and Ignore buttons. -3 : Display Yes, No and Cancel buttons. -4 : Display Yes and No buttons. -5 : Display Retry and Cancel buttons. -16 : Add the Stop icon to the dialog. -32 : Add the Question icon to the dialog. -48 : Add the Exclamation icon to the dialog. -64 : Add the Information icon to the dialog. -128 : First button in the dialog as default button. -256 : Second button in the dialog as default button. -512 : Third button in the dialog as default button. + +Parameter: + Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). + DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application. + Type: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. Type represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values: +0 : Display OK button only. +1 : Display OK and Cancel buttons. +2 : Display Abort, Retry, and Ignore buttons. +3 : Display Yes, No and Cancel buttons. +4 : Display Yes and No buttons. +5 : Display Retry and Cancel buttons. +16 : Add the Stop icon to the dialog. +32 : Add the Question icon to the dialog. +48 : Add the Exclamation icon to the dialog. +64 : Add the Information icon to the dialog. +128 : First button in the dialog as default button. +256 : Second button in the dialog as default button. +512 : Third button in the dialog as default button. -Example: + +Example: -Sub ExampleMsgBox - Const sText1 = "An unexpected error occurred." - Const sText2 = "The program execution will continue, however." - Const sText3 = "Error" - MsgBox(sText1 + Chr(13) + sText2,16,sText3) -End Sub +Sub ExampleMsgBox + Const sText1 = "An unexpected error occurred." + Const sText2 = "The program execution will continue, however." + Const sText3 = "Error" + MsgBox(sText1 + Chr(13) + sText2,16,sText3) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010102.xhp b/source/text/sbasic/shared/03010102.xhp index 9bfa303642..731a744536 100644 --- a/source/text/sbasic/shared/03010102.xhp +++ b/source/text/sbasic/shared/03010102.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -MsgBox Function [Runtime] -/text/sbasic/shared/03010102.xhp - - -Sun Microsystems, Inc. - + + MsgBox Function [Runtime] + /text/sbasic/shared/03010102.xhp + + + +
-MsgBox function + + MsgBox function -MsgBox Function [Runtime] -Displays a dialog box containing a message and returns a value. + + +MsgBox Function [Runtime] +Displays a dialog box containing a message and returns a value.
-Syntax: + +Syntax: -MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) +MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) -Return value: -Integer -Parameter: - -Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). - -DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the name of the respective application is displayed. - -Type: Any integer expression that specifies the dialog type and defines the number and type of buttons or icons displayed. Type represents a combination of bit patterns (dialog elements defined by adding the respective values): - -Values - -0 : Display OK button only. -1 : Display OK and Cancel buttons. -2 : Display Abort, Retry, and Ignore buttons. -3 : Display Yes, No, and Cancel buttons. -4 : Display Yes and No buttons. -5 : Display Retry and Cancel buttons. -16 : Add the Stop icon to the dialog. -32 : Add the Question icon to the dialog. -48 : Add the Exclamation Point icon to the dialog. -64 : Add the Information icon to the dialog. -128 : First button in the dialog as default button. -256 : Second button in the dialog as default button. -512 : Third button in the dialog as default button. - -Return value: - -1 : OK -2 : Cancel -3 : Abort -4 : Retry -5 : Ignore -6 : Yes -7 : No + +Return value: +Integer + +Parameter: + Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). + DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the name of the respective application is displayed. + Type: Any integer expression that specifies the dialog type and defines the number and type of buttons or icons displayed. Type represents a combination of bit patterns (dialog elements defined by adding the respective values): + Values +0 : Display OK button only. +1 : Display OK and Cancel buttons. +2 : Display Abort, Retry, and Ignore buttons. +3 : Display Yes, No, and Cancel buttons. +4 : Display Yes and No buttons. +5 : Display Retry and Cancel buttons. +16 : Add the Stop icon to the dialog. +32 : Add the Question icon to the dialog. +48 : Add the Exclamation Point icon to the dialog. +64 : Add the Information icon to the dialog. +128 : First button in the dialog as default button. +256 : Second button in the dialog as default button. +512 : Third button in the dialog as default button. + Return value: +1 : OK +2 : Cancel +3 : Abort +4 : Retry +5 : Ignore +6 : Yes +7 : No -Example: + +Example: -Sub ExampleMsgBox -Dim sVar As Integer - sVar = MsgBox("Las Vegas") - sVar = MsgBox("Las Vegas",1) - sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title") -End Sub +Sub ExampleMsgBox +Dim sVar As Integer + sVar = MsgBox("Las Vegas") + sVar = MsgBox("Las Vegas",1) + sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010103.xhp b/source/text/sbasic/shared/03010103.xhp index bc304250d5..610cf8ab16 100644 --- a/source/text/sbasic/shared/03010103.xhp +++ b/source/text/sbasic/shared/03010103.xhp @@ -1,7 +1,5 @@ - - - + - +--> - - -Print Statement [Runtime] -/text/sbasic/shared/03010103.xhp - + + Print Statement [Runtime] + /text/sbasic/shared/03010103.xhp + + + +
-Print statement + + Print statement -Print Statement [Runtime] -Outputs the specified strings or numeric expressions to a dialog or to a file. + + +Print Statement [Runtime] +Outputs the specified strings or numeric expressions to a dialog or to a file.
-Syntax: + +Syntax: -Print [#FileName,] Expression1[{;|,} [Spc(Number As Integer);] [Tab(pos As Integer);] [Expression2[...]] +Print [#FileName,] Expression1[{;|,} [Spc(Number As Integer);] [Tab(pos As Integer);] [Expression2[...]] -Parameter: - -FileName: Any numeric expression that contains the file number that was set by the Open statement for the respective file.see i61758 - -Expression: Any numeric or string expression to be printed. Multiple expressions can be separated by a semicolon. If separated by a comma, the expressions are indented to the next tab stop. The tab stops cannot be adjusted. - -Number: Number of spaces to be inserted by the Spc function. - -Pos: Spaces are inserted until the specified position. -If a semicolon or comma appears after the last expression to be printed, $[officename] Basic stores the text in an internal buffer and continues program execution without printing. When another Print statement without a semicolon or comma at the end is encountered, all text to be printed is printed at once. -Positive numeric expressions are printed with a leading space. Negative expressions are printed with a leading minus sign. If a certain range is exceeded for floating-point values, the respective numeric expression is printed in exponential notation. -If the expression to be printed exceeds a certain length, the display will automatically wrap to the next line. -You can insert the Tab function, enclosed by semicolons, between arguments to indent the output to a specific position, or you can use the Spc function to insert a specified number of spaces. -Example: + +Parameter: + FileName: Any numeric expression that contains the file number that was set by the Open statement for the respective file.see i61758 + Expression: Any numeric or string expression to be printed. Multiple expressions can be separated by a semicolon. If separated by a comma, the expressions are indented to the next tab stop. The tab stops cannot be adjusted. + Number: Number of spaces to be inserted by the Spc function. + Pos: Spaces are inserted until the specified position. +If a semicolon or comma appears after the last expression to be printed, $[officename] Basic stores the text in an internal buffer and continues program execution without printing. When another Print statement without a semicolon or comma at the end is encountered, all text to be printed is printed at once. +Positive numeric expressions are printed with a leading space. Negative expressions are printed with a leading minus sign. If a certain range is exceeded for floating-point values, the respective numeric expression is printed in exponential notation. +If the expression to be printed exceeds a certain length, the display will automatically wrap to the next line. +You can insert the Tab function, enclosed by semicolons, between arguments to indent the output to a specific position, or you can use the Spc function to insert a specified number of spaces. + +Example: -Sub ExamplePrint - Print "ABC" - Print "ABC","123" - i = FreeFile() - Open "C:\Temp.txt" For Output As i - Print #i, "ABC" - Close #i -End Sub +Sub ExamplePrint + Print "ABC" + Print "ABC","123" + i = FreeFile() + Open "C:\Temp.txt" For Output As i + Print #i, "ABC" + Close #i +End Sub -Sub ExamplePrint - Print "ABC" - Print "ABC","123" - i = FreeFile() - Open "~/temp.txt" For Output As i - Print #i, "ABC" - Close #i -End Sub +Sub ExamplePrint + Print "ABC" + Print "ABC","123" + i = FreeFile() + Open "~/temp.txt" For Output As i + Print #i, "ABC" + Close #i +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010201.xhp b/source/text/sbasic/shared/03010201.xhp index ba58ddd097..fbf49414ec 100644 --- a/source/text/sbasic/shared/03010201.xhp +++ b/source/text/sbasic/shared/03010201.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -InputBox Function [Runtime] -/text/sbasic/shared/03010201.xhp - - -Sun Microsystems, Inc. - + + InputBox Function [Runtime] + /text/sbasic/shared/03010201.xhp + + + +
-InputBox function + + InputBox function -InputBox Function [Runtime] -Displays a prompt in a dialog at which the user can input text. The input is assigned to a variable. + + +InputBox Function [Runtime] +Displays a prompt in a dialog at which the user can input text. The input is assigned to a variable.
-The InputBox statement is a convenient method of entering text through a dialog. Confirm the input by clicking OK or pressing Return. The input is returned as the function return value. If you close the dialog with Cancel, InputBox returns a zero-length string (""). -Syntax: +The InputBox statement is a convenient method of entering text through a dialog. Confirm the input by clicking OK or pressing Return. The input is returned as the function return value. If you close the dialog with Cancel, InputBox returns a zero-length string (""). + +Syntax: -InputBox (Msg As String[, Title As String[, Default As String[, x_pos As Integer, y_pos As Integer]]]]) +InputBox (Msg As String[, Title As String[, Default As String[, x_pos As Integer, y_pos As Integer]]]]) -Return value: -String -Parameter: - -Msg: String expression displayed as the message in the dialog box. - -Title: String expression displayed in the title bar of the dialog box. - -Default: String expression displayed in the text box as default if no other input is given. - -x_pos: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application. - -y_pos: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application. -If x_pos and y_pos are omitted, the dialog is centered on the screen. The position is specified in twips. -Example: + +Return value: +String + +Parameter: + Msg: String expression displayed as the message in the dialog box. + Title: String expression displayed in the title bar of the dialog box. + Default: String expression displayed in the text box as default if no other input is given. + x_pos: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application. + y_pos: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application. +If x_pos and y_pos are omitted, the dialog is centered on the screen. The position is specified in twips. + +Example: -Sub ExampleInputBox -Dim sText As String - sText = InputBox ("Please enter a phrase:","Dear User") - MsgBox ( sText , 64, "Confirmation of phrase") -End Sub +Sub ExampleInputBox +Dim sText As String + sText = InputBox ("Please enter a phrase:","Dear User") + MsgBox ( sText , 64, "Confirmation of phrase") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010301.xhp b/source/text/sbasic/shared/03010301.xhp index adcce6619a..c18b4af8cc 100644 --- a/source/text/sbasic/shared/03010301.xhp +++ b/source/text/sbasic/shared/03010301.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Blue Function [Runtime] -/text/sbasic/shared/03010301.xhp - - -Sun Microsystems, Inc. - + + Blue Function [Runtime] + /text/sbasic/shared/03010301.xhp + + + +
-Blue function + + Blue function -Blue Function [Runtime] -Returns the blue component of the specified color code. + + +Blue Function [Runtime] +Returns the blue component of the specified color code.
-Syntax: + +Syntax: -Blue (Color As Long) +Blue (Color As Long) -Return value: -Integer -Parameter: - -Color value: Long integer expression that specifies any color code for which to return the blue component. + +Return value: +Integer + +Parameter: + Color value: Long integer expression that specifies any color code for which to return the blue component. -Example: + +Example: -Sub ExampleColor -Dim lVar As Long - lVar = rgb(128,0,200) - MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ - "red= " & Red(lVar) & Chr(13)&_ - "green= " & Green(lVar) & Chr(13)&_ - "blue= " & Blue(lVar) & Chr(13) , 64,"colors" -End Sub +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ + "red= " & Red(lVar) & Chr(13)&_ + "green= " & Green(lVar) & Chr(13)&_ + "blue= " & Blue(lVar) & Chr(13) , 64,"colors" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010302.xhp b/source/text/sbasic/shared/03010302.xhp index cc18f6b5f3..72eb956206 100644 --- a/source/text/sbasic/shared/03010302.xhp +++ b/source/text/sbasic/shared/03010302.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Green Function [Runtime] -/text/sbasic/shared/03010302.xhp - - -Sun Microsystems, Inc. - + + Green Function [Runtime] + /text/sbasic/shared/03010302.xhp + + + +
-Green function + + Green function -Green Function [Runtime] -Returns the Green component of the given color code. + + +Green Function [Runtime] +Returns the Green component of the given color code.
-Syntax: + +Syntax: -Green (Color As Long) +Green (Color As Long) -Return value: -Integer -Parameter: - -Color: Long integer expression that specifies a color code for which to return the Green component. + +Return value: +Integer + +Parameter: + Color: Long integer expression that specifies a color code for which to return the Green component. -Example: + +Example: -Sub ExampleColor -Dim lVar As Long - lVar = rgb(128,0,200) - MsgBox "The color " & lVar & " contains the components:" & Chr(13) &_ - "red = " & red(lVar) & Chr(13)&_ - "green = " & green(lVar) & Chr(13)&_ - "blue = " & blue(lVar) & Chr(13) , 64,"colors" -End Sub +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " contains the components:" & Chr(13) &_ + "red = " & red(lVar) & Chr(13)&_ + "green = " & green(lVar) & Chr(13)&_ + "blue = " & blue(lVar) & Chr(13) , 64,"colors" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010303.xhp b/source/text/sbasic/shared/03010303.xhp index 2cb3f33eaf..1efae60876 100644 --- a/source/text/sbasic/shared/03010303.xhp +++ b/source/text/sbasic/shared/03010303.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Red Function [Runtime] -/text/sbasic/shared/03010303.xhp - - -Sun Microsystems, Inc. - + + Red Function [Runtime] + /text/sbasic/shared/03010303.xhp + + + +
-Red function + + Red function -Red Function [Runtime] -Returns the Red component of the specified color code. + + +Red Function [Runtime] +Returns the Red component of the specified color code.
-Syntax: + +Syntax: -Red (ColorNumber As Long) +Red (ColorNumber As Long) -Return value: -Integer -Parameter: - -ColorNumber: Long integer expression that specifies any color code for which to return the Red component. + +Return value: +Integer + +Parameter: + ColorNumber: Long integer expression that specifies any color code for which to return the Red component. -Example: + +Example: -Sub ExampleColor -Dim lVar As Long - lVar = rgb(128,0,200) - MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ - "red= " & red(lVar) & Chr(13)&_ - "green= " & green(lVar) & Chr(13)&_ - "blue= " & blue(lVar) & Chr(13) , 64,"colors" -End Sub +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ + "red= " & red(lVar) & Chr(13)&_ + "green= " & green(lVar) & Chr(13)&_ + "blue= " & blue(lVar) & Chr(13) , 64,"colors" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010304.xhp b/source/text/sbasic/shared/03010304.xhp index e03d94a896..bf9c0eba0d 100644 --- a/source/text/sbasic/shared/03010304.xhp +++ b/source/text/sbasic/shared/03010304.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -QBColor Function [Runtime] -/text/sbasic/shared/03010304.xhp - - -Sun Microsystems, Inc. - + + QBColor Function [Runtime] + /text/sbasic/shared/03010304.xhp + + + +
-QBColor Function [Runtime] -Returns the RGB color code of the color passed as a color value through an older MS-DOS based programming system. + +QBColor Function [Runtime] +Returns the RGB color code of the color passed as a color value through an older MS-DOS based programming system.
-Syntax: + +Syntax: -QBColor (ColorNumber As Integer) +QBColor (ColorNumber As Integer) -Return value: -Long -Parameter: - -ColorNumber: Any integer expression that specifies the color value of the color passed from an older MS-DOS based programming system. - -ColorNumber can be assigned the following values: -0 : Black -1 : Blue -2 : Green -3 : Cyan -4 : Red -5 : Magenta -6 : Yellow -7 : White -8 : Gray -9 : Light Blue -10 : Light Green -11 : Light Cyan -12 : Light Red -13 : Light Magenta -14 : Light Yellow -15 : Bright White -This function is used only to convert from older MS-DOS based BASIC applications that use the above color codes. The function returns a long integer value indicating the color to be used in the $[officename] IDE. + +Return value: +Long + +Parameter: + ColorNumber: Any integer expression that specifies the color value of the color passed from an older MS-DOS based programming system. + ColorNumber can be assigned the following values: +0 : Black +1 : Blue +2 : Green +3 : Cyan +4 : Red +5 : Magenta +6 : Yellow +7 : White +8 : Gray +9 : Light Blue +10 : Light Green +11 : Light Cyan +12 : Light Red +13 : Light Magenta +14 : Light Yellow +15 : Bright White +This function is used only to convert from older MS-DOS based BASIC applications that use the above color codes. The function returns a long integer value indicating the color to be used in the $[officename] IDE. -Example: + +Example: -Sub ExampleQBColor -Dim iColor As Integer -Dim sText As String - iColor = 7 - sText = "RGB= " & Red(QBColor( iColor) ) & ":" & Blue(QBColor( iColor) ) & ":" & Green(QBColor( iColor) ) - MsgBox stext,0,"Color " & iColor -End Sub +Sub ExampleQBColor +Dim iColor As Integer +Dim sText As String + iColor = 7 + sText = "RGB= " & Red(QBColor( iColor) ) & ":" & Blue(QBColor( iColor) ) & ":" & Green(QBColor( iColor) ) + MsgBox stext,0,"Color " & iColor +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03010305.xhp b/source/text/sbasic/shared/03010305.xhp index 0d8af3cda7..56971d27fa 100644 --- a/source/text/sbasic/shared/03010305.xhp +++ b/source/text/sbasic/shared/03010305.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -RGB Function [Runtime] -/text/sbasic/shared/03010305.xhp - - -Sun Microsystems, Inc. - + + RGB Function [Runtime] + /text/sbasic/shared/03010305.xhp + + + +
-RGB Function [Runtime] -Returns a long integer color value consisting of red, green, and blue components. + +RGB Function [Runtime] +Returns a long integer color value consisting of red, green, and blue components.
-Syntax: + +Syntax: -RGB (Red, Green, Blue) +RGB (Red, Green, Blue) -Return value: -Long -Parameter: - -Red: Any integer expression that represents the red component (0-255) of the composite color. - -Green: Any integer expression that represents the green component (0-255) of the composite color. - -Blue: Any integer expression that represents the blue component (0-255) of the composite color. + +Return value: +Long + +Parameter: + Red: Any integer expression that represents the red component (0-255) of the composite color. + Green: Any integer expression that represents the green component (0-255) of the composite color. + Blue: Any integer expression that represents the blue component (0-255) of the composite color. -Example: + +Example: -Sub ExampleColor -Dim lVar As Long - lVar = rgb(128,0,200) - MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ - "red= " & red(lVar) & Chr(13)&_ - "green= " & green(lVar) & Chr(13)&_ - "blue= " & blue(lVar) & Chr(13) , 64,"colors" -End Sub +Sub ExampleColor +Dim lVar As Long + lVar = rgb(128,0,200) + MsgBox "The color " & lVar & " consists of:" & Chr(13) &_ + "red= " & red(lVar) & Chr(13)&_ + "green= " & green(lVar) & Chr(13)&_ + "blue= " & blue(lVar) & Chr(13) , 64,"colors" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020101.xhp b/source/text/sbasic/shared/03020101.xhp index e221274e24..699a141b57 100644 --- a/source/text/sbasic/shared/03020101.xhp +++ b/source/text/sbasic/shared/03020101.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Close Statement [Runtime] -/text/sbasic/shared/03020101.xhp - - -Sun Microsystems, Inc. - + + Close Statement [Runtime] + /text/sbasic/shared/03020101.xhp + + + +
-Close statement + + Close statement -Close Statement [Runtime] -Closes a specified file that was opened with the Open statement. + + +Close Statement [Runtime] +Closes a specified file that was opened with the Open statement.
-Syntax: + +Syntax: -Close FileNumber As Integer[, FileNumber2 As Integer[,...]] +Close FileNumber As Integer[, FileNumber2 As Integer[,...]] -Parameters: - -FileNumber: Any integer expression that specifies the number of the data channel that was opened with the Open statement. -Example: + +Parameters: + FileNumber: Any integer expression that specifies the number of the data channel that was opened with the Open statement. + +Example: -Sub ExampleWorkWithAFile -Dim iNumber As Integer -Dim sLine As String -Dim aFile As String -Dim sMsg As String - aFile = "c:\data.txt" - sMsg = "" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "First line of text" - Print #iNumber, "Another line of text" - Close #iNumber - iNumber = Freefile - Open aFile For Input As iNumber - While Not eof(iNumber) - Line Input #iNumber, sLine - If sLine <>"" Then - sMsg = sMsg & sLine & chr(13) - End If - Wend - Close #iNumber - MsgBox sMsg -End Sub +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + sMsg = "" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "First line of text" + Print #iNumber, "Another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not eof(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020102.xhp b/source/text/sbasic/shared/03020102.xhp index d4918a5ef9..ee262afed8 100644 --- a/source/text/sbasic/shared/03020102.xhp +++ b/source/text/sbasic/shared/03020102.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -FreeFile Function[Runtime] -/text/sbasic/shared/03020102.xhp - - -Sun Microsystems, Inc. - + + FreeFile Function[Runtime] + /text/sbasic/shared/03020102.xhp + + + +
-FreeFile function + + FreeFile function -FreeFile Function[Runtime] -Returns the next available file number for opening a file. Use this function to open a file using a file number that is not already in use by a currently open file. + + +FreeFile Function[Runtime] +Returns the next available file number for opening a file. Use this function to open a file using a file number that is not already in use by a currently open file.
-Syntax: + +Syntax: -FreeFile +FreeFile -Return value: -Integer -Parameters: -This function can only be used immediately in front of an Open statement. FreeFile returns the next available file number, but does not reserve it. + +Return value: +Integer + +Parameters: +This function can only be used immediately in front of an Open statement. FreeFile returns the next available file number, but does not reserve it. -Example: + +Example: -Sub ExampleWorkWithAFile -Dim iNumber As Integer -Dim sLine As String -Dim aFile As String -Dim sMsg As String - aFile = "c:\data.txt" - sMsg = "" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "First line of text" - Print #iNumber, "Another line of text" - Close #iNumber - iNumber = Freefile - Open aFile For Input As #iNumber - While Not eof(#iNumber) - Line Input #iNumber, sLine - If sLine <>"" Then - sMsg = sMsg & sLine & chr(13) - End If - Wend - Close #iNumber - MsgBox sMsg -End Sub +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + sMsg = "" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "First line of text" + Print #iNumber, "Another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As #iNumber + While Not eof(#iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020103.xhp b/source/text/sbasic/shared/03020103.xhp index 11c04ca4c6..a15be220d9 100644 --- a/source/text/sbasic/shared/03020103.xhp +++ b/source/text/sbasic/shared/03020103.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Open Statement [Runtime] -/text/sbasic/shared/03020103.xhp - - -Sun Microsystems, Inc. - + + Open Statement [Runtime] + /text/sbasic/shared/03020103.xhp + + + +
-Open statement + + Open statement -Open Statement [Runtime] -Opens a data channel. + + +Open Statement [Runtime] +Opens a data channel.
-Syntax: + +Syntax: -Open FileName As String [For Mode] [Access IOMode] [Protected] As [#]FileNumber As Integer [Len = DatasetLength]i37502 +Open FileName As String [For Mode] [Access IOMode] [Protected] As [#]FileNumber As Integer [Len = DatasetLength]i37502 -Parameters: - -FileName: Name and path of the file that you wan to open. If you try to read a file that does not exist (Access = Read), an error message appears. If you try to write to a file that does not exist (Access = Write), a new file is created. - -Mode: Keyword that specifies the file mode. Valid values: Append (append to sequential file), Binary (data can be accessed by bytes using Get and Put), Input (opens data channel for reading), Output (opens data channel for writing), and Random (edits relative files). - -IOMode: Keyword that defines the access type. Valid values: Read (read-only), Write (write-only), Read Write (both). - -Protected: Keyword that defines the security status of a file after opening. Valid values: Shared (file may be opened by other applications), Lock Read (file is protected against reading), Lock Write (file is protected against writing), Lock Read Write (denies file access). - -FileNumber: Any integer expression from 0 to 511 to indicate the number of a free data channel. You can then pass commands through the data channel to access the file. The file number must be determined by the FreeFile function immediately before the Open statement. - -DatasetLength: For random access files, set the length of the records.#61736 -You can only modify the contents of a file that was opened with the Open statement. If you try to open a file that is already open, an error message appears. -Example: + +Parameters: + FileName: Name and path of the file that you wan to open. If you try to read a file that does not exist (Access = Read), an error message appears. If you try to write to a file that does not exist (Access = Write), a new file is created. + Mode: Keyword that specifies the file mode. Valid values: Append (append to sequential file), Binary (data can be accessed by bytes using Get and Put), Input (opens data channel for reading), Output (opens data channel for writing), and Random (edits relative files). + IOMode: Keyword that defines the access type. Valid values: Read (read-only), Write (write-only), Read Write (both). + Protected: Keyword that defines the security status of a file after opening. Valid values: Shared (file may be opened by other applications), Lock Read (file is protected against reading), Lock Write (file is protected against writing), Lock Read Write (denies file access). + FileNumber: Any integer expression from 0 to 511 to indicate the number of a free data channel. You can then pass commands through the data channel to access the file. The file number must be determined by the FreeFile function immediately before the Open statement. + DatasetLength: For random access files, set the length of the records.#61736 +You can only modify the contents of a file that was opened with the Open statement. If you try to open a file that is already open, an error message appears. + +Example: -Sub ExampleWorkWithAFile -Dim iNumber As Integer -Dim sLine As String -Dim aFile As String -Dim sMsg As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "This is a line of text" - Print #iNumber, "This is another line of text" - Close #iNumber - iNumber = Freefile - Open aFile For Input As iNumber - While Not eof(iNumber) - Line Input #iNumber, sLine - If sLine <>"" Then - sMsg = sMsg & sLine & chr(13) - End If - Wend - Close #iNumber - MsgBox sMsg -End Sub +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + Print #iNumber, "This is another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not eof(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020104.xhp b/source/text/sbasic/shared/03020104.xhp index ff035f42df..3948940d0d 100644 --- a/source/text/sbasic/shared/03020104.xhp +++ b/source/text/sbasic/shared/03020104.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Reset Statement [Runtime] -/text/sbasic/shared/03020104.xhp - - -Sun Microsystems, Inc. - + + Reset Statement [Runtime] + /text/sbasic/shared/03020104.xhp + + + +
-Reset statement + + Reset statement -Reset Statement [Runtime] -Closes all open files and writes the contents of all file buffers to the harddisk. + + +Reset Statement [Runtime] +Closes all open files and writes the contents of all file buffers to the harddisk.
-Syntax: + +Syntax: -Reset +Reset -Example: + +Example: -Sub ExampleReset -On Error GoTo ErrorHandler -Dim iNumber As Integer -Dim iCount As Integer -Dim sLine As String -Dim aFile As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "This is a new line of text" - Close #iNumber - iNumber = Freefile - Open aFile For Input As iNumber - For iCount = 1 To 5 - Line Input #iNumber, sLine - If sLine <>"" Then - Rem - End If - Next iCount - Close #iNumber - Exit Sub -ErrorHandler: - Reset - MsgBox "All files will be closed",0,"Error" -End Sub +Sub ExampleReset +On Error GoTo ErrorHandler +Dim iNumber As Integer +Dim iCount As Integer +Dim sLine As String +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a new line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + For iCount = 1 To 5 + Line Input #iNumber, sLine + If sLine <>"" Then + Rem + End If + Next iCount + Close #iNumber + Exit Sub +ErrorHandler: + Reset + MsgBox "All files will be closed",0,"Error" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020201.xhp b/source/text/sbasic/shared/03020201.xhp index 8a4848f16b..cd67c75d60 100644 --- a/source/text/sbasic/shared/03020201.xhp +++ b/source/text/sbasic/shared/03020201.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Get Statement [Runtime] -/text/sbasic/shared/03020201.xhp - - -Sun Microsystems, Inc. - + + Get Statement [Runtime] + /text/sbasic/shared/03020201.xhp + + + +
-Get statement + + Get statement -Get Statement [Runtime] -Reads a record from a relative file, or a sequence of bytes from a binary file, into a variable. + + +Get Statement [Runtime] +Reads a record from a relative file, or a sequence of bytes from a binary file, into a variable.
-See also: PUT Statement -Syntax: +See also: PUT Statement + +Syntax: -Get [#] FileNumber As Integer, [Position], Variable +Get [#] FileNumber As Integer, [Position], Variable -Parameters: - -FileNumber: Any integer expression that determines the file number. - -Position: For files opened in Random mode, Position is the number of the record that you want to read. -For files opened in Binary mode, Position is the byte position in the file where the reading starts. -If Position is omitted, the current position or the current data record of the file is used. -Variable: Name of the variable to be read. With the exception of object variables, you can use any variable type. -Example: + +Parameters: + FileNumber: Any integer expression that determines the file number. + Position: For files opened in Random mode, Position is the number of the record that you want to read. +For files opened in Binary mode, Position is the byte position in the file where the reading starts. +If Position is omitted, the current position or the current data record of the file is used. +Variable: Name of the variable to be read. With the exception of object variables, you can use any variable type. + +Example: -Sub ExampleRandomAccess -Dim iNumber As Integer -Dim sText As Variant ' Must be a variant -Dim aFile As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Random As #iNumber Len=32 - Seek #iNumber,1 ' Position at beginning - Put #iNumber,, "This is the first line of text" ' Fill line with text - Put #iNumber,, "This is the second line of text" - Put #iNumber,, "This is the third line of text" - Seek #iNumber,2 - Get #iNumber,,sText - Print sText - Close #iNumber - iNumber = Freefile - Open aFile For Random As #iNumber Len=32 - Get #iNumber,2,sText - Put #iNumber,,"This is a new text" - Get #iNumber,1,sText - Get #iNumber,2,sText - Put #iNumber,20,"This is the text in record 20" - Print Lof(#iNumber) - Close #iNumber -End Sub +Sub ExampleRandomAccess +Dim iNumber As Integer +Dim sText As Variant ' Must be a variant +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Seek #iNumber,1 ' Position at beginning + Put #iNumber,, "This is the first line of text" ' Fill line with text + Put #iNumber,, "This is the second line of text" + Put #iNumber,, "This is the third line of text" + Seek #iNumber,2 + Get #iNumber,,sText + Print sText + Close #iNumber + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Get #iNumber,2,sText + Put #iNumber,,"This is a new text" + Get #iNumber,1,sText + Get #iNumber,2,sText + Put #iNumber,20,"This is the text in record 20" + Print Lof(#iNumber) + Close #iNumber +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020202.xhp b/source/text/sbasic/shared/03020202.xhp index 2916663096..f61d142d23 100644 --- a/source/text/sbasic/shared/03020202.xhp +++ b/source/text/sbasic/shared/03020202.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Input# Statement [Runtime] -/text/sbasic/shared/03020202.xhp - - -Sun Microsystems, Inc. - + + Input# Statement [Runtime] + /text/sbasic/shared/03020202.xhp + + + +
-Input statement + + Input statement -Input# Statement [Runtime] -Reads data from an open sequential file. + + +Input# Statement [Runtime] +Reads data from an open sequential file.
-Syntax: -Input #FileNumber As Integer; var1[, var2[, var3[,...]]] -Parameters: - -FileNumber: Number of the file that contains the data that you want to read. The file must be opened with the Open statement using the key word INPUT. - -var: A numeric or string variable that you assign the values read from the opened file to. -The Input# statement reads numeric values or strings from an open file and assigns the data to one or more variables. A numeric variable is read up to the first carriage return (Asc=13), line feed (Asc=10), space, or comma. String variables are read to up to the first carriage return (Asc=13), line feed (Asc=10), or comma. -Data and data types in the opened file must appear in the same order as the variables that are passed in the "var" parameter. If you assign non-numeric values to a numeric variable, "var" is assigned a value of "0". -Records that are separated by commas cannot be assigned to a string variable. Quotation marks (") in the file are disregarded as well. If you want to read these characters from the file, use the Line Input# statement to read pure text files (files containing only printable characters) line by line. -If the end of the file is reached while reading a data element, an error occurs and the process is aborted. -Example: + +Syntax: +Input #FileNumber As Integer; var1[, var2[, var3[,...]]] + +Parameters: + FileNumber: Number of the file that contains the data that you want to read. The file must be opened with the Open statement using the key word INPUT. + var: A numeric or string variable that you assign the values read from the opened file to. +The Input# statement reads numeric values or strings from an open file and assigns the data to one or more variables. A numeric variable is read up to the first carriage return (Asc=13), line feed (Asc=10), space, or comma. String variables are read to up to the first carriage return (Asc=13), line feed (Asc=10), or comma. +Data and data types in the opened file must appear in the same order as the variables that are passed in the "var" parameter. If you assign non-numeric values to a numeric variable, "var" is assigned a value of "0". +Records that are separated by commas cannot be assigned to a string variable. Quotation marks (") in the file are disregarded as well. If you want to read these characters from the file, use the Line Input# statement to read pure text files (files containing only printable characters) line by line. +If the end of the file is reached while reading a data element, an error occurs and the process is aborted. + +Example: -Sub ExampleWorkWithAFile -Dim iCount As Integer -Dim sName As String -Dim sValue As Integer -Dim sFileName As String - -sFileName = "c:\data.txt" -iCount = Freefile - -' Write data ( which we will read later with Input ) to file -Open sFileName For Output As iCount -sName = "Hamburg" -sValue = 200 -Write #iCount, sName, sValue -sName = "New York" -sValue = 300 -Write #iCount, sName, sValue -sName = "Miami" -sValue = 459 -Write #iCount, sName, sValue -Close #iCount - -iCount = Freefile -' Read data file using Input -Open sFileName For Input As iCount -Input #iCount; sName, sValue -MsgBox sName & " " & sValue -Input #iCount; sName, sValue -MsgBox sName & " " & sValue -Input #iCount; sName, sValue -MsgBox sName & " " & sValue -Close #iCount -End Sub +Sub ExampleWorkWithAFile +Dim iCount As Integer +Dim sName As String +Dim sValue As Integer +Dim sFileName As String + +sFileName = "c:\data.txt" +iCount = Freefile + +' Write data ( which we will read later with Input ) to file +Open sFileName For Output As iCount +sName = "Hamburg" +sValue = 200 +Write #iCount, sName, sValue +sName = "New York" +sValue = 300 +Write #iCount, sName, sValue +sName = "Miami" +sValue = 459 +Write #iCount, sName, sValue +Close #iCount + +iCount = Freefile +' Read data file using Input +Open sFileName For Input As iCount +Input #iCount; sName, sValue +MsgBox sName & " " & sValue +Input #iCount; sName, sValue +MsgBox sName & " " & sValue +Input #iCount; sName, sValue +MsgBox sName & " " & sValue +Close #iCount +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020203.xhp b/source/text/sbasic/shared/03020203.xhp index 99c4a2c0df..1be787fe0c 100644 --- a/source/text/sbasic/shared/03020203.xhp +++ b/source/text/sbasic/shared/03020203.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Line Input # Statement [Runtime] -/text/sbasic/shared/03020203.xhp - - -Sun Microsystems, Inc. - + + Line Input # Statement [Runtime] + /text/sbasic/shared/03020203.xhp + + + +
-Line Input statement + + Line Input statement -Line Input # Statement [Runtime] -Reads strings from a sequential file into a variable. + + +Line Input # Statement [Runtime] +Reads strings from a sequential file into a variable.
-Syntax: + +Syntax: -Line Input #FileNumber As Integer, Var As String +Line Input #FileNumber As Integer, Var As String -Parameters: - -FileNumber: Number of the file that contains the data that you want to read. The file must have been opened in advance with the Open statement using the key word INPUT. - -var: The name of the variable that stores the result. -With the Line Input# statement, you can read strings from an open file into a variable. String variables are read line-by-line up to the first carriage return (Asc=13) or linefeed (Asc=10). Line end marks are not included in the resulting string. -Example: + +Parameters: + FileNumber: Number of the file that contains the data that you want to read. The file must have been opened in advance with the Open statement using the key word INPUT. + var: The name of the variable that stores the result. +With the Line Input# statement, you can read strings from an open file into a variable. String variables are read line-by-line up to the first carriage return (Asc=13) or linefeed (Asc=10). Line end marks are not included in the resulting string. + +Example: -Sub ExampleWorkWithAFile -Dim iNumber As Integer -Dim sLine As String -Dim aFile As String -Dim sMsg As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "This is a line of text" - Print #iNumber, "This is another line of text" - Close #iNumber - iNumber = Freefile - Open aFile For Input As iNumber - While Not EOF(iNumber) - Line Input #iNumber, sLine - If sLine <>"" Then - sMsg = sMsg & sLine & chr(13) - End If - Wend - Close #iNumber - MsgBox sMsg -End Sub +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + Print #iNumber, "This is another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not EOF(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020204.xhp b/source/text/sbasic/shared/03020204.xhp index 354c057092..4f7be26a62 100644 --- a/source/text/sbasic/shared/03020204.xhp +++ b/source/text/sbasic/shared/03020204.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Put Statement [Runtime] -/text/sbasic/shared/03020204.xhp - - -Sun Microsystems, Inc. - + + Put Statement [Runtime] + /text/sbasic/shared/03020204.xhp + + + +
-Put statement + + Put statement -Put Statement [Runtime] -Writes a record to a relative file or a sequence of bytes to a binary file. + + +Put Statement [Runtime] +Writes a record to a relative file or a sequence of bytes to a binary file.
-See also: Get statement -Syntax: +See also: Get statement + +Syntax: -Put [#] FileNumber As Integer, [position], Variable +Put [#] FileNumber As Integer, [position], Variable -Parameters: - -FileNumber: Any integer expression that defines the file that you want to write to. - -Position: For relative files (random access files), the number of the record that you want to write. -For binary files (binary access), the position of the byte in the file where you want to start writing. - -Variable: Name of the variable that you want to write to the file. -Note for relative files: If the contents of this variable does not match the length of the record that is specified in the Len clause of the Open statement, the space between the end of the newly written record and the next record is padded with existing data from the file that you are writing to. -Note for binary files: The contents of the variables are written to the specified position, and the file pointer is inserted directly after the last byte. No space is left between the records. -Example: + +Parameters: + FileNumber: Any integer expression that defines the file that you want to write to. + Position: For relative files (random access files), the number of the record that you want to write. +For binary files (binary access), the position of the byte in the file where you want to start writing. + Variable: Name of the variable that you want to write to the file. +Note for relative files: If the contents of this variable does not match the length of the record that is specified in the Len clause of the Open statement, the space between the end of the newly written record and the next record is padded with existing data from the file that you are writing to. +Note for binary files: The contents of the variables are written to the specified position, and the file pointer is inserted directly after the last byte. No space is left between the records. + +Example: -Sub ExampleRandomAccess -Dim iNumber As Integer -Dim sText As Variant ' Must be a variant type -Dim aFile As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Random As #iNumber Len=32 - Seek #iNumber,1 ' Position To start writing - Put #iNumber,, "This is the first line of text" ' Fill line with text - Put #iNumber,, "This is the second line of text" - Put #iNumber,, "This is the third line of text" - Seek #iNumber,2 - Get #iNumber,,sText - Print sText - Close #iNumber - iNumber = Freefile - Open aFile For Random As #iNumber Len=32 - Get #iNumber,2,sText - Put #iNumber,,"This is new text" - Get #iNumber,1,sText - Get #iNumber,2,sText - Put #iNumber,20,"This is the text in record 20" - Print Lof(#iNumber) - Close #iNumber -End Sub +Sub ExampleRandomAccess +Dim iNumber As Integer +Dim sText As Variant ' Must be a variant type +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Seek #iNumber,1 ' Position To start writing + Put #iNumber,, "This is the first line of text" ' Fill line with text + Put #iNumber,, "This is the second line of text" + Put #iNumber,, "This is the third line of text" + Seek #iNumber,2 + Get #iNumber,,sText + Print sText + Close #iNumber + iNumber = Freefile + Open aFile For Random As #iNumber Len=32 + Get #iNumber,2,sText + Put #iNumber,,"This is new text" + Get #iNumber,1,sText + Get #iNumber,2,sText + Put #iNumber,20,"This is the text in record 20" + Print Lof(#iNumber) + Close #iNumber +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020205.xhp b/source/text/sbasic/shared/03020205.xhp index c1123eaacc..725c040f09 100644 --- a/source/text/sbasic/shared/03020205.xhp +++ b/source/text/sbasic/shared/03020205.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Write Statement [Runtime] -/text/sbasic/shared/03020205.xhp - - -Sun Microsystems, Inc. - + + Write Statement [Runtime] + /text/sbasic/shared/03020205.xhp + + + +
-Write statement + + Write statement -Write Statement [Runtime] -Writes data to a sequential file. + + +Write Statement [Runtime] +Writes data to a sequential file.
-Syntax: + +Syntax: -Write [#FileName], [Expressionlist]see i61248 +Write [#FileName], [Expressionlist]see i61248 -Parameters: - -FileName: Any numeric expression that contains the file number that was set by the Open statement for the respective file. - -Expressionlist: Variables or expressions that you want to enter in a file, separated by commas. -If the expression list is omitted, the Write statement appends an empty line to the file. -To add an expression list to a new or an existing file, the file must be opened in the Output or Append mode. -Strings that you write are enclosed by quotation marks and separated by commas. You do not need to enter these delimiters in the expression list. -Each Write statement outputs a line end symbol as last entry. -Numbers with decimal delimiters are converted according to the locale settings. -Example: + +Parameters: + FileName: Any numeric expression that contains the file number that was set by the Open statement for the respective file. + Expressionlist: Variables or expressions that you want to enter in a file, separated by commas. +If the expression list is omitted, the Write statement appends an empty line to the file. +To add an expression list to a new or an existing file, the file must be opened in the Output or Append mode. +Strings that you write are enclosed by quotation marks and separated by commas. You do not need to enter these delimiters in the expression list. +Each Write statement outputs a line end symbol as last entry. +Numbers with decimal delimiters are converted according to the locale settings. + +Example: -Sub ExampleWrite -Dim iCount As Integer -Dim sValue As String - iCount = Freefile - Open "C:\data.txt" For Output As iCount - sValue = "Hamburg" - Write #iCount,sValue,200 - sValue = "New York" - Write #iCount,sValue,300 - sValue = "Miami" - Write #iCount,sValue,450 - Close #iCount -End Sub +Sub ExampleWrite +Dim iCount As Integer +Dim sValue As String + iCount = Freefile + Open "C:\data.txt" For Output As iCount + sValue = "Hamburg" + Write #iCount,sValue,200 + sValue = "New York" + Write #iCount,sValue,300 + sValue = "Miami" + Write #iCount,sValue,450 + Close #iCount +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020301.xhp b/source/text/sbasic/shared/03020301.xhp index fa36edd10f..04dc154d87 100644 --- a/source/text/sbasic/shared/03020301.xhp +++ b/source/text/sbasic/shared/03020301.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Eof Function [Runtime] -/text/sbasic/shared/03020301.xhp - - -Sun Microsystems, Inc. - + + Eof Function [Runtime] + /text/sbasic/shared/03020301.xhp + + + +
-Eof function + + Eof function -Eof Function [Runtime] -Determines if the file pointer has reached the end of a file. + + +Eof Function [Runtime] +Determines if the file pointer has reached the end of a file.
-Syntax: + +Syntax: -Eof (intexpression As Integer) +Eof (intexpression As Integer) -Return value: -Bool -Parameters: - -Intexpression: Any integer expression that evaluates to the number of an open file. -Use EOF to avoid errors when you attempt to get input past the end of a file. When you use the Input or Get statement to read from a file, the file pointer is advanced by the number of bytes read. When the end of a file is reached, EOF returns the value "True" (-1). + +Return value: +Bool + +Parameters: + Intexpression: Any integer expression that evaluates to the number of an open file. +Use EOF to avoid errors when you attempt to get input past the end of a file. When you use the Input or Get statement to read from a file, the file pointer is advanced by the number of bytes read. When the end of a file is reached, EOF returns the value "True" (-1). -Example: + +Example: -Sub ExampleWorkWithAFile -Dim iNumber As Integer -Dim sLine As String -Dim aFile As String -Dim sMsg As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "First line of text" - Print #iNumber, "Another line of text" - Close #iNumber - iNumber = Freefile - Open aFile For Input As iNumber - While Not eof(iNumber) - Line Input #iNumber, sLine - If sLine <>"" Then - sMsg = sMsg & sLine & chr(13) - End If - Wend - Close #iNumber - MsgBox sMsg -End Sub +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "First line of text" + Print #iNumber, "Another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not eof(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020401.xhp b/source/text/sbasic/shared/03020401.xhp index e732187854..9df35db2ec 100644 --- a/source/text/sbasic/shared/03020401.xhp +++ b/source/text/sbasic/shared/03020401.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -ChDir Statement [Runtime] -/text/sbasic/shared/03020401.xhp - - -Sun Microsystems, Inc. - + + ChDir Statement [Runtime] + /text/sbasic/shared/03020401.xhp + + + +
-ChDir statement + + ChDir statement -ChDir Statement [Runtime] -Changes the current directory or drive. + + +ChDir Statement [Runtime] +Changes the current directory or drive.
+
-This runtime statement currently does not work as documented. See this issue for more information. +This runtime statement currently does not work as documented. See this issue for more information.
-Syntax: + +Syntax: -ChDir Text As String +ChDir Text As String -Parameters: - -Text: Any string expression that specifies the directory path or drive. -If you only want to change the current drive, enter the drive letter followed by a colon. + +Parameters: + Text: Any string expression that specifies the directory path or drive. +If you only want to change the current drive, enter the drive letter followed by a colon. -Example: + +Example: -Sub ExampleChDir -Dim sDir1 As String , sDir2 As String - sDir1 = "c:\Test" - sDir2 = "d:\Private" - ChDir( sDir1 ) - MsgBox CurDir - ChDir( sDir2 ) - MsgBox CurDir -End Sub +Sub ExampleChDir +Dim sDir1 As String , sDir2 As String + sDir1 = "c:\Test" + sDir2 = "d:\Private" + ChDir( sDir1 ) + MsgBox CurDir + ChDir( sDir2 ) + MsgBox CurDir +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020402.xhp b/source/text/sbasic/shared/03020402.xhp index 582986f8da..77f4178ccd 100644 --- a/source/text/sbasic/shared/03020402.xhp +++ b/source/text/sbasic/shared/03020402.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -ChDrive Statement [Runtime] -/text/sbasic/shared/03020402.xhp - - -Sun Microsystems, Inc. - + + ChDrive Statement [Runtime] + /text/sbasic/shared/03020402.xhp + + + +
-ChDrive statement + + ChDrive statement -ChDrive Statement [Runtime] -Changes the current drive. + + +ChDrive Statement [Runtime] +Changes the current drive.
-Syntax: + +Syntax: -ChDrive Text As String +ChDrive Text As String -Parameters: - -Text: Any string expression that contains the drive letter of the new drive. If you want, you can use URL notation. -The drive must be assigned a capital letter. Under Windows, the letter that you assign the drive is restricted by the settings in LASTDRV. If the drive argument is a multiple-character string, only the first letter is relevant. If you attempt to access a non-existent drive, an error occurs that you can respond to with the OnError statement. + +Parameters: + Text: Any string expression that contains the drive letter of the new drive. If you want, you can use URL notation. +The drive must be assigned a capital letter. Under Windows, the letter that you assign the drive is restricted by the settings in LASTDRV. If the drive argument is a multiple-character string, only the first letter is relevant. If you attempt to access a non-existent drive, an error occurs that you can respond to with the OnError statement. -Example: + +Example: -Sub ExampleChDrive - ChDrive "D" ' Only possible if a drive 'D' exists. -End Sub +Sub ExampleChDrive + ChDrive "D" ' Only possible if a drive 'D' exists. +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020403.xhp b/source/text/sbasic/shared/03020403.xhp index 5147bb5581..650422801c 100644 --- a/source/text/sbasic/shared/03020403.xhp +++ b/source/text/sbasic/shared/03020403.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CurDir Function [Runtime] -/text/sbasic/shared/03020403.xhp - - -Sun Microsystems, Inc. - + + CurDir Function [Runtime] + /text/sbasic/shared/03020403.xhp + + + +
-CurDir function + + CurDir function -CurDir Function [Runtime] -Returns a variant string that represents the current path of the specified drive. + + +CurDir Function [Runtime] +Returns a variant string that represents the current path of the specified drive.
-Syntax: + +Syntax: -CurDir [(Text As String)] +CurDir [(Text As String)] -Return value: -String -Parameters: - -Text: Any string expression that specifies an existing drive (for example, "C" for the first partition of the first hard drive). -If no drive is specified or if the drive is a zero-length string (""), CurDir returns the path for the current drive. $[officename] Basic reports an error if the syntax of the drive description is incorrect, the drive does not exist, or if the drive letter occurs after the letter defined in the CONFIG.SYS with the Lastdrive statement. -This function is not case-sensitive. + +Return value: +String + +Parameters: + Text: Any string expression that specifies an existing drive (for example, "C" for the first partition of the first hard drive). +If no drive is specified or if the drive is a zero-length string (""), CurDir returns the path for the current drive. $[officename] Basic reports an error if the syntax of the drive description is incorrect, the drive does not exist, or if the drive letter occurs after the letter defined in the CONFIG.SYS with the Lastdrive statement. +This function is not case-sensitive. -Example: + +Example: -Sub ExampleCurDir -Dim sDir1 As String , sDir2 As String - sDir1 = "c:\Test" - sDir2 = "d:\Private" - ChDir( sDir1 ) - MsgBox CurDir - ChDir( sDir2 ) - MsgBox CurDir -End Sub +Sub ExampleCurDir +Dim sDir1 As String , sDir2 As String + sDir1 = "c:\Test" + sDir2 = "d:\Private" + ChDir( sDir1 ) + MsgBox CurDir + ChDir( sDir2 ) + MsgBox CurDir +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020404.xhp b/source/text/sbasic/shared/03020404.xhp index 00cfea33fc..b386b29182 100644 --- a/source/text/sbasic/shared/03020404.xhp +++ b/source/text/sbasic/shared/03020404.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Dir Function [Runtime] -/text/sbasic/shared/03020404.xhp - - -Sun Microsystems, Inc. - + + Dir Function [Runtime] + /text/sbasic/shared/03020404.xhp + + + +
-Dir function + + Dir function -Dir Function [Runtime] -Returns the name of a file, a directory, or all of the files and the directories on a drive or in a directory that match the specified search path. + + +Dir Function [Runtime] +Returns the name of a file, a directory, or all of the files and the directories on a drive or in a directory that match the specified search path.
-Syntax: + +Syntax: -Dir [(Text As String) [, Attrib As Integer]] +Dir [(Text As String) [, Attrib As Integer]] -Return value: -String -Parameters: - -Text: Any string expression that specifies the search path, directory or file. This argument can only be specified the first time that you call the Dir function. If you want, you can enter the path in URL notation. - -Attrib: Any integer expression that specifies bitwise file attributes. The Dir function only returns files or directories that match the specified attributes. You can combine several attributes by adding the attribute values: -0 : Normal files. -16 : Returns the name of the directory only. -Use this attribute to check if a file or directory exists, or to determine all files and folders in a specific directory. -To check if a file exists, enter the complete path and name of the file. If the file or directory name does not exist, the Dir function returns a zero-length string (""). -To generate a list of all existing files in a specific directory, proceed as follows: The first time you call the Dir function, specify the complete search path for the files, for example, "D:\Files\*.sxw". If the path is correct and the search finds at least one file, the Dir function returns the name of the first file that matches the search path. To return additional file names that match the path, call Dir again, but with no arguments. -To return directories only, use the attribute parameter. The same applies if you want to determine the name of a volume (for example, a hard drive partition) + +Return value: +String + +Parameters: + Text: Any string expression that specifies the search path, directory or file. This argument can only be specified the first time that you call the Dir function. If you want, you can enter the path in URL notation. + Attrib: Any integer expression that specifies bitwise file attributes. The Dir function only returns files or directories that match the specified attributes. You can combine several attributes by adding the attribute values: +0 : Normal files. +16 : Returns the name of the directory only. +Use this attribute to check if a file or directory exists, or to determine all files and folders in a specific directory. +To check if a file exists, enter the complete path and name of the file. If the file or directory name does not exist, the Dir function returns a zero-length string (""). +To generate a list of all existing files in a specific directory, proceed as follows: The first time you call the Dir function, specify the complete search path for the files, for example, "D:\Files\*.sxw". If the path is correct and the search finds at least one file, the Dir function returns the name of the first file that matches the search path. To return additional file names that match the path, call Dir again, but with no arguments. +To return directories only, use the attribute parameter. The same applies if you want to determine the name of a volume (for example, a hard drive partition) -Example: + +Example: -Sub ExampleDir -' Displays all files and directories -Dim sPath As String -Dim sDir As String, sValue As String - sDir="Directories:" - sPath = CurDir - sValue = Dir$(sPath + getPathSeparator + "*",16) - Do - If sValue <> "." And sValue <> ".." Then - If (GetAttr( sPath + getPathSeparator + sValue) And 16) >0 Then - ' Get the directories - sDir = sDir & chr(13) & sValue - End If - End If - sValue = Dir$ - Loop Until sValue = "" - MsgBox sDir,0,sPath -End Sub +Sub ExampleDir +' Displays all files and directories +Dim sPath As String +Dim sDir As String, sValue As String + sDir="Directories:" + sPath = CurDir + sValue = Dir$(sPath + getPathSeparator + "*",16) + Do + If sValue <> "." And sValue <> ".." Then + If (GetAttr( sPath + getPathSeparator + sValue) And 16) >0 Then + ' Get the directories + sDir = sDir & chr(13) & sValue + End If + End If + sValue = Dir$ + Loop Until sValue = "" + MsgBox sDir,0,sPath +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020405.xhp b/source/text/sbasic/shared/03020405.xhp index 5926120ab3..7ba12d5fb2 100644 --- a/source/text/sbasic/shared/03020405.xhp +++ b/source/text/sbasic/shared/03020405.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -FileAttr-Function [Runtime] -/text/sbasic/shared/03020405.xhp - - -Sun Microsystems, Inc. - + + FileAttr-Function [Runtime] + /text/sbasic/shared/03020405.xhp + + + +
-FileAttr function + + FileAttr function -FileAttr Function [Runtime] -Returns the access mode or the file access number of a file that was opened with the Open statement. The file access number is dependent on the operating system (OSH = Operating System Handle). + + +FileAttr Function [Runtime] +Returns the access mode or the file access number of a file that was opened with the Open statement. The file access number is dependent on the operating system (OSH = Operating System Handle).
-If you use a 32-Bit operating system, you cannot use the FileAttr-Function to determine the file access number. -See also: Open -Syntax: +If you use a 32-Bit operating system, you cannot use the FileAttr-Function to determine the file access number. +See also: Open + +Syntax: -FileAttr (FileNumber As Integer, Attribute As Integer) +FileAttr (FileNumber As Integer, Attribute As Integer) -Return value: -Integer -Parameters: - -FileNumber: The number of the file that was opened with the Open statement. - -Attribute: Integer expression that indicates the type of file information that you want to return. The following values are possible: -1: The FileAttr-Function indicates the access mode of the file. -2: The FileAttr-Function returns the file access number of the operating system. -If you specify a parameter attribute with a value of 1, the following return values apply: -1 - INPUT (file open for input) -2 - OUTPUT (file open for output) -4 - RANDOM (file open for random access) -8 - APPEND (file open for appending) -32 - BINARY (file open in binary mode). + +Return value: +Integer + +Parameters: + FileNumber: The number of the file that was opened with the Open statement. + Attribute: Integer expression that indicates the type of file information that you want to return. The following values are possible: +1: The FileAttr-Function indicates the access mode of the file. +2: The FileAttr-Function returns the file access number of the operating system. +If you specify a parameter attribute with a value of 1, the following return values apply: +1 - INPUT (file open for input) +2 - OUTPUT (file open for output) +4 - RANDOM (file open for random access) +8 - APPEND (file open for appending) +32 - BINARY (file open in binary mode). -Example: + +Example: -Sub ExampleFileAttr -Dim iNumber As Integer -Dim sLine As String -Dim aFile As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "This is a line of text" - MsgBox FileAttr(#iNumber, 1 ),0,"Access mode" - MsgBox FileAttr(#iNumber, 2 ),0,"File attribute" - Close #iNumber -End Sub +Sub ExampleFileAttr +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + MsgBox FileAttr(#iNumber, 1 ),0,"Access mode" + MsgBox FileAttr(#iNumber, 2 ),0,"File attribute" + Close #iNumber +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020406.xhp b/source/text/sbasic/shared/03020406.xhp index 02f1d01be8..2eed4e72ed 100644 --- a/source/text/sbasic/shared/03020406.xhp +++ b/source/text/sbasic/shared/03020406.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -FileCopy Statement [Runtime] -/text/sbasic/shared/03020406.xhp - - -Sun Microsystems, Inc. - + + FileCopy Statement [Runtime] + /text/sbasic/shared/03020406.xhp + + + +
-FileCopy statement + + FileCopy statement -FileCopy Statement [Runtime] -Copies a file. + + +FileCopy Statement [Runtime] +Copies a file.
-Syntax: + +Syntax: -FileCopy TextFrom As String, TextTo As String +FileCopy TextFrom As String, TextTo As String -Parameters: - -TextFrom: Any string expression that specifies the name of the file that you want to copy. The expression can contain optional path and drive information. If you want, you can enter a path in URL notation. - -TextTo: Any string expression that specifies where you want to copy the source file to. The expression can contain the destination drive, the path, and file name, or the path in URL notation. -You can only use the FileCopy statement to copy files that are not opened. + +Parameters: + TextFrom: Any string expression that specifies the name of the file that you want to copy. The expression can contain optional path and drive information. If you want, you can enter a path in URL notation. + TextTo: Any string expression that specifies where you want to copy the source file to. The expression can contain the destination drive, the path, and file name, or the path in URL notation. +You can only use the FileCopy statement to copy files that are not opened. -Example: + +Example: -Sub ExampleFileCopy - FileCopy "c:\autoexec.bat", "c:\Temp\Autoexec.sav" -End Sub +Sub ExampleFileCopy + FileCopy "c:\autoexec.bat", "c:\Temp\Autoexec.sav" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020407.xhp b/source/text/sbasic/shared/03020407.xhp index f998bbb288..006526e88e 100644 --- a/source/text/sbasic/shared/03020407.xhp +++ b/source/text/sbasic/shared/03020407.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -FileDateTime Function [Runtime] -/text/sbasic/shared/03020407.xhp - - -Sun Microsystems, Inc. - + + FileDateTime Function [Runtime] + /text/sbasic/shared/03020407.xhp + + + +
-FileDateTime function + + FileDateTime function -FileDateTime Function [Runtime] -Returns a string that contains the date and the time that a file was created or last modified. + + +FileDateTime Function [Runtime] +Returns a string that contains the date and the time that a file was created or last modified.
-Syntax: + +Syntax: -FileDateTime (Text As String) +FileDateTime (Text As String) -Parameters: - -Text: Any string expression that contains an unambiguous (no wildcards) file specification. You can also use URL notation. -This function determines the exact time of creation or last modification of a file, returned in the format "MM.DD.YYYY HH.MM.SS". + +Parameters: + Text: Any string expression that contains an unambiguous (no wildcards) file specification. You can also use URL notation. +This function determines the exact time of creation or last modification of a file, returned in the format "MM.DD.YYYY HH.MM.SS". -Example: + +Example: -Sub ExampleFileDateTime - MsgBox FileDateTime("C:\autoexec.bat") -End Sub +Sub ExampleFileDateTime + MsgBox FileDateTime("C:\autoexec.bat") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020408.xhp b/source/text/sbasic/shared/03020408.xhp index 182fef49c7..19bbe70e0f 100644 --- a/source/text/sbasic/shared/03020408.xhp +++ b/source/text/sbasic/shared/03020408.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -FileLen-Function [Runtime] -/text/sbasic/shared/03020408.xhp - - -Sun Microsystems, Inc. - + + FileLen-Function [Runtime] + /text/sbasic/shared/03020408.xhp + + + +
-FileLen function + + FileLen function -FileLen Function [Runtime] -Returns the length of a file in bytes. + + +FileLen Function [Runtime] +Returns the length of a file in bytes.
-Syntax: + +Syntax: -FileLen (Text As String) +FileLen (Text As String) -Return value: -Long -Parameters: - -Text: Any string expression that contains an unambiguous file specification. You can also use URL notation. -This function determines the length of a file. If the FileLen function is called for an open file, it returns the file length before it was opened. To determine the current file length of an open file, use the Lof function. + +Return value: +Long + +Parameters: + Text: Any string expression that contains an unambiguous file specification. You can also use URL notation. +This function determines the length of a file. If the FileLen function is called for an open file, it returns the file length before it was opened. To determine the current file length of an open file, use the Lof function. -Example: + +Example: -Sub ExampleFileLen - MsgBox FileLen("C:\autoexec.bat") -End Sub +Sub ExampleFileLen + MsgBox FileLen("C:\autoexec.bat") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020409.xhp b/source/text/sbasic/shared/03020409.xhp index 2e7d55d3b9..2c964198af 100644 --- a/source/text/sbasic/shared/03020409.xhp +++ b/source/text/sbasic/shared/03020409.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -GetAttr Function [Runtime] -/text/sbasic/shared/03020409.xhp - - -Sun Microsystems, Inc. - + + GetAttr Function [Runtime] + /text/sbasic/shared/03020409.xhp + + + +
-GetAttr function + + GetAttr function -GetAttr Function [Runtime] -Returns a bit pattern that identifies the file type or the name of a volume or a directory. + + +GetAttr Function [Runtime] +Returns a bit pattern that identifies the file type or the name of a volume or a directory.
-Syntax: + +Syntax: -GetAttr (Text As String) +GetAttr (Text As String) -Return value: -Integer -Parameters: - -Text: Any string expression that contains an unambiguous file specification. You can also use URL notation. -This function determines the attributes for a specified file and returns the bit pattern that can help you to identify the following file attributes: + +Return value: +Integer + +Parameters: + Text: Any string expression that contains an unambiguous file specification. You can also use URL notation. +This function determines the attributes for a specified file and returns the bit pattern that can help you to identify the following file attributes: -Value -0 : Normal files. -1 : Read-only files. -8 : Returns the name of the volume -16 : Returns the name of the directory only. -32 : File was changed since last backup (Archive bit). -If you want to know if a bit of the attribute byte is set, use the following query method: -Example: + +Value +0 : Normal files. +1 : Read-only files. +8 : Returns the name of the volume +16 : Returns the name of the directory only. +32 : File was changed since last backup (Archive bit). +If you want to know if a bit of the attribute byte is set, use the following query method: + +Example: -Sub ExampleSetGetAttr -On Error GoTo ErrorHandler ' Define target for error handler - If Dir("C:\test",16)="" Then MkDir "C:\test" - If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" - SetAttr "c:\test\autoexec.sav" ,0 - FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" - SetAttr "c:\test\autoexec.sav" ,1 - Print GetAttr( "c:\test\autoexec.sav" ) - End -ErrorHandler: - Print Error - End -End Sub +Sub ExampleSetGetAttr +On Error GoTo ErrorHandler ' Define target for error handler + If Dir("C:\test",16)="" Then MkDir "C:\test" + If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,0 + FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,1 + Print GetAttr( "c:\test\autoexec.sav" ) + End +ErrorHandler: + Print Error + End +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020410.xhp b/source/text/sbasic/shared/03020410.xhp index ba150337a0..4619a07365 100644 --- a/source/text/sbasic/shared/03020410.xhp +++ b/source/text/sbasic/shared/03020410.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Kill Statement [Runtime] -/text/sbasic/shared/03020410.xhp - - -Sun Microsystems, Inc. - + + Kill Statement [Runtime] + /text/sbasic/shared/03020410.xhp + + + +
-Kill statement + + Kill statement -Kill Statement [Runtime] -Deletes a file from a disk. + + +Kill Statement [Runtime] +Deletes a file from a disk.
-Syntax: + +Syntax: -Kill File As String +Kill File As String -Parameters: - -File: Any string expression that contains an unambiguous file specification. You can also use URL notation. + +Parameters: + File: Any string expression that contains an unambiguous file specification. You can also use URL notation. -Example: + +Example: -Sub ExampleKill - Kill "C:\datafile.dat" ' File must be created in advance -End Sub +Sub ExampleKill + Kill "C:\datafile.dat" ' File must be created in advance +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020411.xhp b/source/text/sbasic/shared/03020411.xhp index 14f97896e3..a4f7879087 100644 --- a/source/text/sbasic/shared/03020411.xhp +++ b/source/text/sbasic/shared/03020411.xhp @@ -1,7 +1,5 @@ - - - + - +--> - - -MkDir Statement [Runtime] -/text/sbasic/shared/03020411.xhp - + + MkDir Statement [Runtime] + /text/sbasic/shared/03020411.xhp + + + +
-MkDir statement + + MkDir statement -MkDir Statement [Runtime] -Creates a new directory on a data medium. + + +MkDir Statement [Runtime] +Creates a new directory on a data medium.
-Syntax: + +Syntax: -MkDir Text As String +MkDir Text As String -Parameters: - -Text: Any string expression that specifies the name and path of the directory to be created. You can also use URL notation. -If the path is not determined, the directory is created in the current directory. + +Parameters: + Text: Any string expression that specifies the name and path of the directory to be created. You can also use URL notation. +If the path is not determined, the directory is created in the current directory. -Example: + +Example: -Sub ExampleFileIO -' Example for functions of the file organization -Const sFile1 As String = "file://c|/autoexec.bat" -Const sDir1 As String = "file://c|/Temp" -Const sSubDir1 As String ="Test" -Const sFile2 As String = "Copied.tmp" -Const sFile3 As String = "Renamed.tmp" -Dim sFile As String - sFile = sDir1 + "/" + sSubDir1 - ChDir( sDir1 ) - If Dir(sSubDir1,16)="" Then ' Does the directory exist? - MkDir sSubDir1 - MsgBox sFile,0,"Create directory" - End If - sFile = sFile + "/" + sFile2 - FileCopy sFile1 , sFile - MsgBox fSysURL(CurDir()),0,"Current directory" - MsgBox sFile & Chr(13) & FileDateTime( sFile ),0,"Creation time" - MsgBox sFile & Chr(13)& FileLen( sFile ),0,"File length" - MsgBox sFile & Chr(13)& GetAttr( sFile ),0,"File attributes" - Name sFile As sDir1 + "/" + sSubDir1 + "/" + sFile3 - ' Rename in the same directory - sFile = sDir1 + "/" + sSubDir1 + "/" + sFile3 - SetAttr( sFile, 0 ) 'Delete all attributes - MsgBox sFile & Chr(13) & GetAttr( sFile ),0,"New file attributes" - Kill sFile - RmDir sDir1 + "/" + sSubDir1 -End Sub - -' Converts a system path in URL -Function fSysURL( fSysFp As String ) As String -Dim iPos As String - iPos = 1 - iPos = Instr(iPos,fSysFp, getPathSeparator()) - Do While iPos > 0 - Mid( fSysFp, iPos , 1,"/") - iPos = Instr(iPos+1,fSysFp, getPathSeparator()) - Loop - ' the colon with DOS - iPos = Instr(1,fSysFp,":") - If iPos > 0 Then Mid( fSysFp, iPos , 1,"|") - fSysURL = "file://" & fSysFp -End Function +Sub ExampleFileIO +' Example for functions of the file organization +Const sFile1 As String = "file://c|/autoexec.bat" +Const sDir1 As String = "file://c|/Temp" +Const sSubDir1 As String ="Test" +Const sFile2 As String = "Copied.tmp" +Const sFile3 As String = "Renamed.tmp" +Dim sFile As String + sFile = sDir1 + "/" + sSubDir1 + ChDir( sDir1 ) + If Dir(sSubDir1,16)="" Then ' Does the directory exist? + MkDir sSubDir1 + MsgBox sFile,0,"Create directory" + End If + sFile = sFile + "/" + sFile2 + FileCopy sFile1 , sFile + MsgBox fSysURL(CurDir()),0,"Current directory" + MsgBox sFile & Chr(13) & FileDateTime( sFile ),0,"Creation time" + MsgBox sFile & Chr(13)& FileLen( sFile ),0,"File length" + MsgBox sFile & Chr(13)& GetAttr( sFile ),0,"File attributes" + Name sFile As sDir1 + "/" + sSubDir1 + "/" + sFile3 + ' Rename in the same directory + sFile = sDir1 + "/" + sSubDir1 + "/" + sFile3 + SetAttr( sFile, 0 ) 'Delete all attributes + MsgBox sFile & Chr(13) & GetAttr( sFile ),0,"New file attributes" + Kill sFile + RmDir sDir1 + "/" + sSubDir1 +End Sub + +' Converts a system path in URL +Function fSysURL( fSysFp As String ) As String +Dim iPos As String + iPos = 1 + iPos = Instr(iPos,fSysFp, getPathSeparator()) + Do While iPos > 0 + Mid( fSysFp, iPos , 1,"/") + iPos = Instr(iPos+1,fSysFp, getPathSeparator()) + Loop + ' the colon with DOS + iPos = Instr(1,fSysFp,":") + If iPos > 0 Then Mid( fSysFp, iPos , 1,"|") + fSysURL = "file://" & fSysFp +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020412.xhp b/source/text/sbasic/shared/03020412.xhp index e3d50f467c..1d5f6eeb47 100644 --- a/source/text/sbasic/shared/03020412.xhp +++ b/source/text/sbasic/shared/03020412.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Name Statement [Runtime] -/text/sbasic/shared/03020412.xhp - - -Sun Microsystems, Inc. - + + Name Statement [Runtime] + /text/sbasic/shared/03020412.xhp + + + +
-Name statement + + Name statement -Name Statement [Runtime] -Renames an existing file or directory. + + +Name Statement [Runtime] +Renames an existing file or directory.
-Syntax: + +Syntax: -Name OldName As String As NewName As String +Name OldName As String As NewName As String -Parameters: - -OldName, NewName: Any string expression that specifies the file name, including the path. You can also use URL notation.see #i61074 -Example: + +Parameters: + OldName, NewName: Any string expression that specifies the file name, including the path. You can also use URL notation.see #i61074 + +Example: -Sub ExampleReName -On Error GoTo Error -FileCopy "c:\autoexec.bat", "c:\temp\autoexec.sav" -Name "c:\temp\autoexec.sav" As "c:\temp\autoexec.bat" -End -Error: -If err = 58 Then - MsgBox "File already exists" -End If -End -End Sub +Sub ExampleReName +On Error GoTo Error +FileCopy "c:\autoexec.bat", "c:\temp\autoexec.sav" +Name "c:\temp\autoexec.sav" As "c:\temp\autoexec.bat" +End +Error: +If err = 58 Then + MsgBox "File already exists" +End If +End +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020413.xhp b/source/text/sbasic/shared/03020413.xhp index 21c53fa3e7..13005273ed 100644 --- a/source/text/sbasic/shared/03020413.xhp +++ b/source/text/sbasic/shared/03020413.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -RmDir Statement [Runtime] -/text/sbasic/shared/03020413.xhp - - -Sun Microsystems, Inc. - + + RmDir Statement [Runtime] + /text/sbasic/shared/03020413.xhp + + + +
-RmDir statement + + RmDir statement -RmDir Statement [Runtime] -Deletes an existing directory from a data medium. + + +RmDir Statement [Runtime] +Deletes an existing directory from a data medium.
-Syntax: + +Syntax: -RmDir Text As String +RmDir Text As String -Parameters: - -Text: Any string expression that specifies the name and path of the directory that you want to delete. You can also use URL notation. -If the path is not determined, the RmDir Statement searches for the directory that you want to delete in the current path. If it is not found there, an error message appears. + +Parameters: + Text: Any string expression that specifies the name and path of the directory that you want to delete. You can also use URL notation. +If the path is not determined, the RmDir Statement searches for the directory that you want to delete in the current path. If it is not found there, an error message appears. -Example: + +Example: -Sub ExampleRmDir - MkDir "C:\Test2" - ChDir "C:\test2" - MsgBox Curdir - ChDir "\" - RmDir "C:\test2" -End Sub +Sub ExampleRmDir + MkDir "C:\Test2" + ChDir "C:\test2" + MsgBox Curdir + ChDir "\" + RmDir "C:\test2" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020414.xhp b/source/text/sbasic/shared/03020414.xhp index b986dae9b4..5c2af47a09 100644 --- a/source/text/sbasic/shared/03020414.xhp +++ b/source/text/sbasic/shared/03020414.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -SetAttr Statement [Runtime] -/text/sbasic/shared/03020414.xhp - - -Sun Microsystems, Inc. - + + SetAttr Statement [Runtime] + /text/sbasic/shared/03020414.xhp + + + +
-SetAttr statement + + SetAttr statement -SetAttr Statement [Runtime] -Sets the attribute information for a specified file. + + +SetAttr Statement [Runtime] +Sets the attribute information for a specified file.
-Syntax: + +Syntax: -SetAttr FileName As String, Attribute As Integer +SetAttr FileName As String, Attribute As Integer -Parameters: -FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, SetAttr searches for the file in the current directory. You can also use URL notation. - -Attribute: Bit pattern defining the attributes that you want to set or to clear: - -Value - -0 : Normal files. -1 : Read-only files. -32 : File was changed since last backup (Archive bit). -You can set multiple attributes by combining the respective values with a logic OR statement. + +Parameters: +FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, SetAttr searches for the file in the current directory. You can also use URL notation. + Attribute: Bit pattern defining the attributes that you want to set or to clear: + Value +0 : Normal files. +1 : Read-only files. +32 : File was changed since last backup (Archive bit). +You can set multiple attributes by combining the respective values with a logic OR statement. -Example: + +Example: -Sub ExampleSetGetAttr - On Error GoTo ErrorHandler ' Define target for error handler - If Dir("C:\test",16)="" Then MkDir "C:\test" - If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" - SetAttr "c:\test\autoexec.sav" ,0 - FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" - SetAttr "c:\test\autoexec.sav" ,1 - Print GetAttr( "c:\test\autoexec.sav" ) - End -ErrorHandler: - Print Error - End -End Sub +Sub ExampleSetGetAttr + On Error GoTo ErrorHandler ' Define target for error handler + If Dir("C:\test",16)="" Then MkDir "C:\test" + If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,0 + FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,1 + Print GetAttr( "c:\test\autoexec.sav" ) + End +ErrorHandler: + Print Error + End +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03020415.xhp b/source/text/sbasic/shared/03020415.xhp index fd4ae6a1cc..7cf25dbcf8 100644 --- a/source/text/sbasic/shared/03020415.xhp +++ b/source/text/sbasic/shared/03020415.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -FileExists Function [Runtime] -/text/sbasic/shared/03020415.xhp - - -Sun Microsystems, Inc. - + + FileExists Function [Runtime] + /text/sbasic/shared/03020415.xhp + + + +
-FileExists function + + FileExists function -FileExists Function [Runtime] -Determines if a file or a directory is available on the data medium. + + +FileExists Function [Runtime] +Determines if a file or a directory is available on the data medium.
-Syntax: + +Syntax: -FileExists(FileName As String | DirectoryName As String) +FileExists(FileName As String | DirectoryName As String) -Return value: -Bool -Parameters: -FileName | DirectoryName: Any string expression that contains an unambiguous file specification. You can also use URL notation. + +Return value: +Bool + +Parameters: +FileName | DirectoryName: Any string expression that contains an unambiguous file specification. You can also use URL notation. -Example: + +Example: -Sub ExampleFileExists - MsgBox FileExists("C:\autoexec.bat") - MsgBox FileExists("file:///d|/bookmark.htm") - MsgBox FileExists("file:///d|/Private") -End Sub +Sub ExampleFileExists + MsgBox FileExists("C:\autoexec.bat") + MsgBox FileExists("file:///d|/bookmark.htm") + MsgBox FileExists("file:///d|/Private") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030107.xhp b/source/text/sbasic/shared/03030107.xhp index be23e86a75..2250e9c7b9 100644 --- a/source/text/sbasic/shared/03030107.xhp +++ b/source/text/sbasic/shared/03030107.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CDateToIso Function [Runtime] -/text/sbasic/shared/03030107.xhp - - -Sun Microsystems, Inc. - + + CDateToIso Function [Runtime] + /text/sbasic/shared/03030107.xhp + + + +
-CdateToIso function + + CdateToIso function -CDateToIso Function [Runtime] -Returns the date in ISO format from a serial date number that is generated by the DateSerial or the DateValue function. + + +CDateToIso Function [Runtime] +Returns the date in ISO format from a serial date number that is generated by the DateSerial or the DateValue function.
-Syntax: - -CDateToIso(Number) + +Syntax: + +CDateToIso(Number) -Return value: -String -Parameters: - -Number: Integer that contains the serial date number. + +Return value: +String + +Parameters: + Number: Integer that contains the serial date number. -Example: + +Example: -Sub ExampleCDateToIso - MsgBox "" & CDateToIso(Now) ,64,"ISO Date" -End Sub +Sub ExampleCDateToIso + MsgBox "" & CDateToIso(Now) ,64,"ISO Date" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030110.xhp b/source/text/sbasic/shared/03030110.xhp index 6b0d67535d..0c8eb26a5c 100644 --- a/source/text/sbasic/shared/03030110.xhp +++ b/source/text/sbasic/shared/03030110.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DateAdd Function [Runtime] -/text/sbasic/shared/03030110.xhp - - -DateAdd - + + DateAdd Function [Runtime] + /text/sbasic/shared/03030110.xhp + + + +
-DateAdd function + + DateAdd function -DateAdd Function [Runtime] -Adds a date interval to a given date a number of times and returns the resulting date. + + +DateAdd Function [Runtime] +Adds a date interval to a given date a number of times and returns the resulting date.
-Syntax: - -DateAdd (Add, Count, Date) + +Syntax: + +DateAdd (Add, Count, Date) -Return value: -A Variant containing a date. -Parameters: -Add - A string expression from the following table, specifying the date interval. + +Return value: +A Variant containing a date. + +Parameters: +Add - A string expression from the following table, specifying the date interval. +
+ - - -Add (string value) - - -Explanation - - - - -yyyy - - -Year - - - - -q - - -Quarter - - - - -m - - -Month - - - - -y - - -Day of year - - - - -w - - -Weekday - - - - -ww - - -Week of year - - - - -d - - -Day - - - - -h - - -Hour - - - - -n - - -Minute - - - - -s - - -Second - - + + + Add (string value) + + + Explanation + + + + + yyyy + + + Year + + + + + q + + + Quarter + + + + + m + + + Month + + + + + y + + + Day of year + + + + + w + + + Weekday + + + + + ww + + + Week of year + + + + + d + + + Day + + + + + h + + + Hour + + + + + n + + + Minute + + + + + s + + + Second + +
-Count - A numerical expression specifying how often the Add interval will be added (Count is positive) or subtracted (Count is negative). -Date - A given date or the name of a Variant variable containing a date. The Add value will be added Count times to this value. -Example: +Count - A numerical expression specifying how often the Add interval will be added (Count is positive) or subtracted (Count is negative). +Date - A given date or the name of a Variant variable containing a date. The Add value will be added Count times to this value. + +Example: -Sub example_dateadd - MsgBox DateAdd("m", 1, "1/31/2004") &" - "& DateAdd("m", 1, "1/31/2005") -End Sub +Sub example_dateadd + MsgBox DateAdd("m", 1, "1/31/2004") &" - "& DateAdd("m", 1, "1/31/2005") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030111.xhp b/source/text/sbasic/shared/03030111.xhp index 2a3322861c..c3a41d2e03 100644 --- a/source/text/sbasic/shared/03030111.xhp +++ b/source/text/sbasic/shared/03030111.xhp @@ -1,6 +1,5 @@ - - + +--> - - - - CDateToUnoDate Function [Runtime] - /text/sbasic/shared/03030111.xhp - - - Lionel Elie Mamane - - - -
- CDateToUnoDate function - CDateToUnoDate Function [Runtime] - Returns the date as a UNO com.sun.star.util.Date struct. -
- Syntax: - - CDateToUnoDate(aDate) - - Return value: - com.sun.star.util.Date - Parameters: - - aDate: Date to convert - - - Example: - - Sub ExampleCDateToUnoDate - aDatabaseRow.updateDate(3, CDateToUnoDate(Now)) - aDateControl.Date = CDateToUnoDate(Now) - End Sub - + + + CDateToUnoDate Function [Runtime] + /text/sbasic/shared/03030111.xhp + + + + + + +
+ + CDateToUnoDate function + + + +CDateToUnoDate Function [Runtime] +Returns the date as a UNO com.sun.star.util.Date struct. +
+ +Syntax: + +CDateToUnoDate(aDate) + + +Return value: +com.sun.star.util.Date + +Parameters: + aDate: Date to convert + + + +Example: + +Sub ExampleCDateToUnoDate + aDatabaseRow.updateDate(3, CDateToUnoDate(Now)) + aDateControl.Date = CDateToUnoDate(Now) +End Sub + -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030112.xhp b/source/text/sbasic/shared/03030112.xhp index f157bd1fcc..2f7ab2b0c0 100644 --- a/source/text/sbasic/shared/03030112.xhp +++ b/source/text/sbasic/shared/03030112.xhp @@ -1,6 +1,5 @@ - - + +--> - - - - CDateFromUnoDate Function [Runtime] - /text/sbasic/shared/03030112.xhp - - - Lionel Elie Mamane - - - -
- CDateFromUnoDate function - CDateFromUnoDate Function [Runtime] - Converts a UNO com.sun.star.util.Date struct to a Date value. -
- Syntax: - - CDateFromUnoDate(aDate) - - Return value: - Date - Parameters: - - aDate: Date to convert - - - Example: - - Sub ExampleCDateFromUnoDate - MsgBox(CDateFromUnoDate(aDatabaseRow.getDate(3))) - MsgBox(CDateFromUnoDate(aDateControl.Date)) - End Sub - + + + CDateFromUnoDate Function [Runtime] + /text/sbasic/shared/03030112.xhp + + + + + + +
+ + CDateFromUnoDate function + + + +CDateFromUnoDate Function [Runtime] +Converts a UNO com.sun.star.util.Date struct to a Date value. +
+ +Syntax: + +CDateFromUnoDate(aDate) + + +Return value: +Date + +Parameters: + aDate: Date to convert + + + +Example: + +Sub ExampleCDateFromUnoDate + MsgBox(CDateFromUnoDate(aDatabaseRow.getDate(3))) + MsgBox(CDateFromUnoDate(aDateControl.Date)) +End Sub + -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030113.xhp b/source/text/sbasic/shared/03030113.xhp index eac7de66cc..01fb7f6cfc 100644 --- a/source/text/sbasic/shared/03030113.xhp +++ b/source/text/sbasic/shared/03030113.xhp @@ -1,6 +1,5 @@ - - + +--> - - - - CDateToUnoTime Function [Runtime] - /text/sbasic/shared/03030113.xhp - - - Lionel Elie Mamane - - - -
- CDateToUnoTime function - CDateToUnoTime Function [Runtime] - Returns the time part of the date as a UNO com.sun.star.util.Time struct. -
- Syntax: - - CDateToUnoTime(aDate) - - Return value: - com.sun.star.util.Time - Parameters: - - aDate: Date value to convert - - - Example: - - Sub ExampleCDateToUnoTime - aDatabaseRow.updateTime(3, CDateToUnoTime(Now)) - aTimeControl.Time = CDateToUnoTime(Now) - End Sub - + + + CDateToUnoTime Function [Runtime] + /text/sbasic/shared/03030113.xhp + + + + + + +
+ + CDateToUnoTime function + + + +CDateToUnoTime Function [Runtime] +Returns the time part of the date as a UNO com.sun.star.util.Time struct. +
+ +Syntax: + +CDateToUnoTime(aDate) + + +Return value: +com.sun.star.util.Time + +Parameters: + aDate: Date value to convert + + + +Example: + +Sub ExampleCDateToUnoTime + aDatabaseRow.updateTime(3, CDateToUnoTime(Now)) + aTimeControl.Time = CDateToUnoTime(Now) +End Sub + -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030114.xhp b/source/text/sbasic/shared/03030114.xhp index 08191cf87f..4ead4152ca 100644 --- a/source/text/sbasic/shared/03030114.xhp +++ b/source/text/sbasic/shared/03030114.xhp @@ -1,6 +1,5 @@ - - + +--> - - - - CDateFromUnoTime Function [Runtime] - /text/sbasic/shared/03030114.xhp - - - Lionel Elie Mamane - - - -
- CDateFromUnoTime function - CDateFromUnoTime Function [Runtime] - Converts a UNO com.sun.star.util.Time struct to a Date value. -
- Syntax: - - CDateFromUnoTime(aTime) - - Return value: - Date - Parameters: - - aTime: Time to convert - - - Example: - - Sub ExampleCDateFromUnoTime - MsgBox(CDateFromUnoTime(aDatabaseRow.getTime(3))) - MsgBox(CDateFromUnoTime(aTimeControl.Time)) - End Sub - + + + CDateFromUnoTime Function [Runtime] + /text/sbasic/shared/03030114.xhp + + + + + + +
+ + CDateFromUnoTime function + + + +CDateFromUnoTime Function [Runtime] +Converts a UNO com.sun.star.util.Time struct to a Date value. +
+ +Syntax: + +CDateFromUnoTime(aTime) + + +Return value: +Date + +Parameters: + aTime: Time to convert + + + +Example: + +Sub ExampleCDateFromUnoTime + MsgBox(CDateFromUnoTime(aDatabaseRow.getTime(3))) + MsgBox(CDateFromUnoTime(aTimeControl.Time)) +End Sub + -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030115.xhp b/source/text/sbasic/shared/03030115.xhp index 1f54b947ec..d6f515272a 100644 --- a/source/text/sbasic/shared/03030115.xhp +++ b/source/text/sbasic/shared/03030115.xhp @@ -1,6 +1,5 @@ - - + +--> - - - - CDateToUnoDateTime Function [Runtime] - /text/sbasic/shared/03030115.xhp - - - Lionel Elie Mamane - - - -
- CDateToUnoDateTime function - CDateToUnoDateTime Function [Runtime] - Returns the time part of the date as a UNO com.sun.star.util.DateTime struct. -
- Syntax: - - CDateToUnoDateTime(aDate) - - Return value: - com.sun.star.util.DateTime - Parameters: - - aDate: Date value to convert - - - Example: - - Sub ExampleCDateToUnoDateTime - aDatabaseRow.updateTimestamp(3, CDateToUnoDateTime(Now)) - End Sub - + + + CDateToUnoDateTime Function [Runtime] + /text/sbasic/shared/03030115.xhp + + + + + + +
+ + CDateToUnoDateTime function + + + +CDateToUnoDateTime Function [Runtime] +Returns the time part of the date as a UNO com.sun.star.util.DateTime struct. +
+ +Syntax: + +CDateToUnoDateTime(aDate) + + +Return value: +com.sun.star.util.DateTime + +Parameters: + aDate: Date value to convert + + + +Example: + +Sub ExampleCDateToUnoDateTime + aDatabaseRow.updateTimestamp(3, CDateToUnoDateTime(Now)) +End Sub + -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030116.xhp b/source/text/sbasic/shared/03030116.xhp index 353f9270a0..2b7034b1ef 100644 --- a/source/text/sbasic/shared/03030116.xhp +++ b/source/text/sbasic/shared/03030116.xhp @@ -1,6 +1,5 @@ - - + +--> - - - - CDateFromUnoDateTime Function [Runtime] - /text/sbasic/shared/03030116.xhp - - - Lionel Elie Mamane - - - -
- CDateFromUnoDateTime function - CDateFromUnoDateTime Function [Runtime] - Converts a UNO com.sun.star.util.DateTime struct to a Date value. -
- Syntax: - - CDateFromUnoDateTime(aDateTime) - - Return value: - Date - Parameters: - - aDateTime: DateTime to convert - - - Example: - - Sub ExampleCDateFromUnoDateTime - MsgBox(CDateFromUnoDateTime(aDatabaseRow.getTimestamp(3))) - End Sub - + + + CDateFromUnoDateTime Function [Runtime] + /text/sbasic/shared/03030116.xhp + + + + + + +
+ + CDateFromUnoDateTime function + + + +CDateFromUnoDateTime Function [Runtime] +Converts a UNO com.sun.star.util.DateTime struct to a Date value. +
+ +Syntax: + +CDateFromUnoDateTime(aDateTime) + + +Return value: +Date + +Parameters: + aDateTime: DateTime to convert + + + +Example: + +Sub ExampleCDateFromUnoDateTime + MsgBox(CDateFromUnoDateTime(aDatabaseRow.getTimestamp(3))) +End Sub + -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030120.xhp b/source/text/sbasic/shared/03030120.xhp index e19a3a8ff1..a5370e9c7c 100644 --- a/source/text/sbasic/shared/03030120.xhp +++ b/source/text/sbasic/shared/03030120.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DateDiff Function [Runtime] -/text/sbasic/shared/03030120.xhp - - -DateDiff - + + DateDiff Function [Runtime] + /text/sbasic/shared/03030120.xhp + + + +
-DateDiff function + + DateDiff function -DateDiff Function [Runtime] -Returns the number of date intervals between two given date values. + + +DateDiff Function [Runtime] +Returns the number of date intervals between two given date values.
-Syntax: - -DateDiff (Add, Date1, Date2 [, Week_start [, Year_start]]) + +Syntax: + +DateDiff (Add, Date1, Date2 [, Week_start [, Year_start]]) -Return value: -A number. -Parameters: - -Add - A string expression from the following table, specifying the date interval. + +Return value: +A number. + +Parameters: + Add - A string expression from the following table, specifying the date interval. - -Date1, Date2 - The two date values to be compared. + Date1, Date2 - The two date values to be compared. +
- -Week_start - An optional parameter that specifies the starting day of a week. + Week_start - An optional parameter that specifies the starting day of a week. + - - -Week_start value - - -Explanation - - - - -0 - - -Use system default value - - - - -1 - - -Sunday (default) - - - - -2 - - -Monday - - - - -3 - - -Tuesday - - - - -4 - - -Wednesday - - - - -5 - - -Thursday - - - - -6 - - -Friday - - - - -7 - - -Saturday - - + + + Week_start value + + + Explanation + + + + + 0 + + + Use system default value + + + + + 1 + + + Sunday (default) + + + + + 2 + + + Monday + + + + + 3 + + + Tuesday + + + + + 4 + + + Wednesday + + + + + 5 + + + Thursday + + + + + 6 + + + Friday + + + + + 7 + + + Saturday + +
- -Year_start - An optional parameter that specifies the starting week of a year. + Year_start - An optional parameter that specifies the starting week of a year. + - - -Year_start value - - -Explanation - - - - -0 - - -Use system default value - - - - -1 - - -Week 1 is the week with January, 1st (default) - - - - -2 - - -Week 1 is the first week containing four or more days of that year - - - - -3 - - -Week 1 is the first week containing only days of the new year - - + + + Year_start value + + + Explanation + + + + + 0 + + + Use system default value + + + + + 1 + + + Week 1 is the week with January, 1st (default) + + + + + 2 + + + Week 1 is the first week containing four or more days of that year + + + + + 3 + + + Week 1 is the first week containing only days of the new year + +
-Example: + +Example: -Sub example_datediff - MsgBox DateDiff("d", "1/1/2005", "12/31/2005") -End Sub +Sub example_datediff + MsgBox DateDiff("d", "1/1/2005", "12/31/2005") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030130.xhp b/source/text/sbasic/shared/03030130.xhp index 4a9c88586f..ce2fe07685 100644 --- a/source/text/sbasic/shared/03030130.xhp +++ b/source/text/sbasic/shared/03030130.xhp @@ -1,6 +1,5 @@ - - + - +--> - - - -DatePart Function [Runtime] -/text/sbasic/shared/03030130.xhp - - -DatePart - + + DatePart Function [Runtime] + /text/sbasic/shared/03030130.xhp + + + +
-DatePart function + + DatePart function -DatePart Function [Runtime] -The DatePart function returns a specified part of a date. + + +DatePart Function [Runtime] +The DatePart function returns a specified part of a date.
-Syntax: - -DatePart (Add, Date [, Week_start [, Year_start]]) + +Syntax: + +DatePart (Add, Date [, Week_start [, Year_start]]) -Return value: -A Variant containing a date. -Parameters: - -Add - A string expression from the following table, specifying the date interval. + +Return value: +A Variant containing a date. + +Parameters: + Add - A string expression from the following table, specifying the date interval. - -Date - The date from which the result is calculated. + Date - The date from which the result is calculated. -Example: + +Example: -Sub example_datepart - MsgBox DatePart("ww", "12/31/2005") -End Sub +Sub example_datepart + MsgBox DatePart("ww", "12/31/2005") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030203.xhp b/source/text/sbasic/shared/03030203.xhp index 7de5c0cbc4..08d7d1518d 100644 --- a/source/text/sbasic/shared/03030203.xhp +++ b/source/text/sbasic/shared/03030203.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Now Function [Runtime] -/text/sbasic/shared/03030203.xhp - - -Sun Microsystems, Inc. - + + Now Function [Runtime] + /text/sbasic/shared/03030203.xhp + + + +
-Now function + + Now function -Now Function [Runtime] -Returns the current system date and time as a Date value. + + +Now Function [Runtime] +Returns the current system date and time as a Date value.
-Syntax: - -Now + +Syntax: + +Now -Return value: -Date -Example: + +Return value: +Date + +Example: -Sub ExampleNow - MsgBox "It is now " & Now -End Sub +Sub ExampleNow + MsgBox "It is now " & Now +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030204.xhp b/source/text/sbasic/shared/03030204.xhp index d5d6d7d073..c29e5e4223 100644 --- a/source/text/sbasic/shared/03030204.xhp +++ b/source/text/sbasic/shared/03030204.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Second Function [Runtime] -/text/sbasic/shared/03030204.xhp - - -Sun Microsystems, Inc. - + + Second Function [Runtime] + /text/sbasic/shared/03030204.xhp + + + +
-Second function + + Second function -Second Function [Runtime] -Returns an integer that represents the seconds of the serial time number that is generated by the TimeSerial or the TimeValue function. + + +Second Function [Runtime] +Returns an integer that represents the seconds of the serial time number that is generated by the TimeSerial or the TimeValue function.
-Syntax: - -Second (Number) + +Syntax: + +Second (Number) -Return value: -Integer -Parameters: - -Number: Numeric expression that contains the serial time number that is used to calculate the number of seconds. -This function is the opposite of the TimeSerial function. It returns the seconds of a serial time value that is generated by the TimeSerial or TimeValue functions. For example, the expression: -Print Second(TimeSerial(12,30,41)) -returns the value 41. + +Return value: +Integer + +Parameters: + Number: Numeric expression that contains the serial time number that is used to calculate the number of seconds. +This function is the opposite of the TimeSerial function. It returns the seconds of a serial time value that is generated by the TimeSerial or TimeValue functions. For example, the expression: +Print Second(TimeSerial(12,30,41)) +returns the value 41. -Example: + +Example: -Sub ExampleSecond - MsgBox "The exact second of the current time is "& Second( Now ) -End Sub +Sub ExampleSecond + MsgBox "The exact second of the current time is "& Second( Now ) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030205.xhp b/source/text/sbasic/shared/03030205.xhp index d4cc90bd6d..b6bfd54da2 100644 --- a/source/text/sbasic/shared/03030205.xhp +++ b/source/text/sbasic/shared/03030205.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -TimeSerial Function [Runtime] -/text/sbasic/shared/03030205.xhp - - -Sun Microsystems, Inc. - + + TimeSerial Function [Runtime] + /text/sbasic/shared/03030205.xhp + + + +
-TimeSerial function + + TimeSerial function -TimeSerial Function [Runtime] -Calculates a serial time value for the specified hour, minute, and second parameters that are passed as numeric value. You can then use this value to calculate the difference between times. + + +TimeSerial Function [Runtime] +Calculates a serial time value for the specified hour, minute, and second parameters that are passed as numeric value. You can then use this value to calculate the difference between times.
-Syntax: - -TimeSerial (hour, minute, second) + +Syntax: + +TimeSerial (hour, minute, second) -Return value: -Date -Parameters: - -hour: Any integer expression that indicates the hour of the time that is used to determine the serial time value. Valid values: 0-23. - -minute: Any integer expression that indicates the minute of the time that is used to determine the serial time value. In general, use values between 0 and 59. However, you can also use values that lie outside of this range, where the number of minutes influence the hour value. - -second: Any integer expression that indicates the second of the time that is used to determine the serial time value. In general, you can use values between 0 and 59. However, you can also use values that lie outside of this range, where the number seconds influences the minute value. - -Examples: - -12, -5, 45 corresponds to 11, 55, 45 -12, 61, 45 corresponds to 13, 2, 45 -12, 20, -2 corresponds to 12, 19, 58 -12, 20, 63 corresponds to 12, 21, 4 -You can use the TimeSerial function to convert any time into a single value that you can use to calculate time differences. -The TimeSerial function returns the type Variant with VarType 7 (Date). This value is stored internally as a double-precision number between 0 and 0.9999999999. As opposed to the DateSerial or DateValue function, where the serial date values are calculated as days relative to a fixed date, you can calculate with values returned by the TimeSerial function, but you cannot evaluate them. -In the TimeValue function, you can pass a string as a parameter containing the time. For the TimeSerial function, however, you can pass the individual parameters (hour, minute, second) as separate numeric expressions. + +Return value: +Date + +Parameters: + hour: Any integer expression that indicates the hour of the time that is used to determine the serial time value. Valid values: 0-23. + minute: Any integer expression that indicates the minute of the time that is used to determine the serial time value. In general, use values between 0 and 59. However, you can also use values that lie outside of this range, where the number of minutes influence the hour value. + second: Any integer expression that indicates the second of the time that is used to determine the serial time value. In general, you can use values between 0 and 59. However, you can also use values that lie outside of this range, where the number seconds influences the minute value. + Examples: +12, -5, 45 corresponds to 11, 55, 45 +12, 61, 45 corresponds to 13, 2, 45 +12, 20, -2 corresponds to 12, 19, 58 +12, 20, 63 corresponds to 12, 21, 4 +You can use the TimeSerial function to convert any time into a single value that you can use to calculate time differences. +The TimeSerial function returns the type Variant with VarType 7 (Date). This value is stored internally as a double-precision number between 0 and 0.9999999999. As opposed to the DateSerial or DateValue function, where the serial date values are calculated as days relative to a fixed date, you can calculate with values returned by the TimeSerial function, but you cannot evaluate them. +In the TimeValue function, you can pass a string as a parameter containing the time. For the TimeSerial function, however, you can pass the individual parameters (hour, minute, second) as separate numeric expressions. -Example: + +Example: -Sub ExampleTimeSerial -Dim dDate As Double, sDate As String - dDate = TimeSerial(8,30,15) - sDate = TimeSerial(8,30,15) - MsgBox dDate,64,"Time as a number" - MsgBox sDate,64,"Formatted time" -End Sub +Sub ExampleTimeSerial +Dim dDate As Double, sDate As String + dDate = TimeSerial(8,30,15) + sDate = TimeSerial(8,30,15) + MsgBox dDate,64,"Time as a number" + MsgBox sDate,64,"Formatted time" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030206.xhp b/source/text/sbasic/shared/03030206.xhp index 9263da20f1..b0702c59c4 100644 --- a/source/text/sbasic/shared/03030206.xhp +++ b/source/text/sbasic/shared/03030206.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -TimeValue Function [Runtime] -/text/sbasic/shared/03030206.xhp - - -Sun Microsystems, Inc. - + + TimeValue Function [Runtime] + /text/sbasic/shared/03030206.xhp + + + +
-TimeValue function + + TimeValue function -TimeValue Function [Runtime] -Calculates a serial time value from the specified hour, minute, and second - parameters passed as strings - that represents the time in a single numeric value. This value can be used to calculate the difference between times. + + +TimeValue Function [Runtime] +Calculates a serial time value from the specified hour, minute, and second - parameters passed as strings - that represents the time in a single numeric value. This value can be used to calculate the difference between times.
-Syntax: - -TimeValue (Text As String) + +Syntax: + +TimeValue (Text As String) -Return value: -Date -Parameters: - -Text: Any string expression that contains the time that you want to calculate in the format "HH:MM:SS". -Use the TimeValue function to convert any time into a single value, so that you can calculate time differences. -This TimeValue function returns the type Variant with VarType 7 (Date), and stores this value internally as a double-precision number between 0 and 0.9999999999. -As opposed to the DateSerial or the DateValue function, where serial date values result in days relative to a fixed date, you can calculate with the values that are returned by the TimeValue function, but you cannot evaluate them. -In the TimeSerial function, you can pass individual parameters (hour, minute, second) as separate numeric expressions. For the TimeValue function, however, you can pass a string as a parameter containing the time. + +Return value: +Date + +Parameters: + Text: Any string expression that contains the time that you want to calculate in the format "HH:MM:SS". +Use the TimeValue function to convert any time into a single value, so that you can calculate time differences. +This TimeValue function returns the type Variant with VarType 7 (Date), and stores this value internally as a double-precision number between 0 and 0.9999999999. +As opposed to the DateSerial or the DateValue function, where serial date values result in days relative to a fixed date, you can calculate with the values that are returned by the TimeValue function, but you cannot evaluate them. +In the TimeSerial function, you can pass individual parameters (hour, minute, second) as separate numeric expressions. For the TimeValue function, however, you can pass a string as a parameter containing the time. -Example: + +Example: -Sub ExampleTimerValue -Dim daDT As Date -Dim a1, b1, c1, a2, b2, c2 As String - a1 = "start time" - b1 = "end time" - c1 = "total time" - a2 = "8:34" - b2 = "18:12" - daDT = TimeValue(b2) - TimeValue(a2) - c2 = a1 & ": " & a2 & chr(13) - c2 = c2 & b1 & ": " & b2 & chr(13) - c2 = c2 & c1 & ": " & trim(Str(Hour(daDT))) & ":" & trim(Str(Minute(daDT))) & ":" & trim(Str(Second(daDT))) - MsgBox c2 -End Sub +Sub ExampleTimerValue +Dim daDT As Date +Dim a1, b1, c1, a2, b2, c2 As String + a1 = "start time" + b1 = "end time" + c1 = "total time" + a2 = "8:34" + b2 = "18:12" + daDT = TimeValue(b2) - TimeValue(a2) + c2 = a1 & ": " & a2 & chr(13) + c2 = c2 & b1 & ": " & b2 & chr(13) + c2 = c2 & c1 & ": " & trim(Str(Hour(daDT))) & ":" & trim(Str(Minute(daDT))) & ":" & trim(Str(Second(daDT))) + MsgBox c2 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030301.xhp b/source/text/sbasic/shared/03030301.xhp index 13bbf09f23..5cae236ba6 100644 --- a/source/text/sbasic/shared/03030301.xhp +++ b/source/text/sbasic/shared/03030301.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Date Statement [Runtime] -/text/sbasic/shared/03030301.xhp - - -Sun Microsystems, Inc. - + + Date Statement [Runtime] + /text/sbasic/shared/03030301.xhp + + + +
-Date statement + + Date statement -Date Statement [Runtime] -Returns the current system date as a string, or resets the date. The date format depends on your local system settings. + + +Date Statement [Runtime] +Returns the current system date as a string, or resets the date. The date format depends on your local system settings.
-Syntax: - -Date ; Date = Text As String + +Syntax: + +Date ; Date = Text As String -Parameters: - -Text: Only required in order to reset the system date. In this case, the string expression must correspond to the date format defined in your local settings. -Example: + +Parameters: + Text: Only required in order to reset the system date. In this case, the string expression must correspond to the date format defined in your local settings. + +Example: -Sub ExampleDate - MsgBox "The date is " & Date -End Sub +Sub ExampleDate + MsgBox "The date is " & Date +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030302.xhp b/source/text/sbasic/shared/03030302.xhp index a7fed6af84..01aed5d830 100644 --- a/source/text/sbasic/shared/03030302.xhp +++ b/source/text/sbasic/shared/03030302.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Time Statement [Runtime] -/text/sbasic/shared/03030302.xhp - - -Sun Microsystems, Inc. - + + Time Statement [Runtime] + /text/sbasic/shared/03030302.xhp + + + +
-Time statement + + Time statement -Time Statement [Runtime] -This function returns the current system time as a string in the format "HH:MM:SS". + + +Time Statement [Runtime] +This function returns the current system time as a string in the format "HH:MM:SS".
-Syntax: - -Time + +Syntax: + +Time -Parameters: - -Text: Any string expression that specifies the new time in the format "HH:MM:SS". -Example: + +Parameters: + Text: Any string expression that specifies the new time in the format "HH:MM:SS". + +Example: -Sub ExampleTime - MsgBox Time,0,"The time is" -End Sub +Sub ExampleTime + MsgBox Time,0,"The time is" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03030303.xhp b/source/text/sbasic/shared/03030303.xhp index c5147c814e..9c87d2f0cf 100644 --- a/source/text/sbasic/shared/03030303.xhp +++ b/source/text/sbasic/shared/03030303.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Timer Function [Runtime] -/text/sbasic/shared/03030303.xhp - - -Sun Microsystems, Inc. - + + Timer Function [Runtime] + /text/sbasic/shared/03030303.xhp + + + +
-Timer function + + Timer function -Timer Function [Runtime] -Returns a value that specifies the number of seconds that have elapsed since midnight. + + +Timer Function [Runtime] +Returns a value that specifies the number of seconds that have elapsed since midnight.
-You must first declare a variable to call the Timer function and assign it the "Long " data type, otherwise a Date value is returned. -Syntax: - -Timer +You must first declare a variable to call the Timer function and assign it the "Long " data type, otherwise a Date value is returned. + +Syntax: + +Timer -Return value: -Date -Example: + +Return value: +Date + +Example: -Sub ExampleTimer -Dim lSec As Long,lMin As Long,lHour As Long - lSec = Timer - MsgBox lSec,0,"Seconds since midnight" - lMin = lSec / 60 - lSec = lSec Mod 60 - lHour = lMin / 60 - lMin = lMin Mod 60 - MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2) ,0,"The time is" -End Sub +Sub ExampleTimer +Dim lSec As Long,lMin As Long,lHour As Long + lSec = Timer + MsgBox lSec,0,"Seconds since midnight" + lMin = lSec / 60 + lSec = lSec Mod 60 + lHour = lMin / 60 + lMin = lMin Mod 60 + MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2) ,0,"The time is" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03050100.xhp b/source/text/sbasic/shared/03050100.xhp index 22846d7c08..e8784b6fb3 100644 --- a/source/text/sbasic/shared/03050100.xhp +++ b/source/text/sbasic/shared/03050100.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Erl Function [Runtime] -/text/sbasic/shared/03050100.xhp - - -Sun Microsystems, Inc. - + + Erl Function [Runtime] + /text/sbasic/shared/03050100.xhp + + + +
-Erl function + + Erl function -Erl Function [Runtime] -Returns the line number where an error occurred during program execution. + + +Erl Function [Runtime] +Returns the line number where an error occurred during program execution.
-Syntax: - -Erl + +Syntax: + +Erl -Return value: -Integer -Parameters: -The Erl function only returns a line number, and not a line label. -Example: + +Return value: +Integer + +Parameters: +The Erl function only returns a line number, and not a line label. + +Example: -Sub ExampleError -On Error GoTo ErrorHandler ' Set up error handler -Dim iVar As Integer -Dim sVar As String -' Error caused by non-existent file - iVar = Freefile - Open "\file9879.txt" For Input As #iVar - Line Input #iVar, sVar - Close #iVar - Exit Sub -ErrorHandler: - MsgBox "Error " & err & ": " & Error$ + chr(13) + "In Line : " + Erl + chr(13) + Now , 16 ,"An error occurred" -End Sub +Sub ExampleError +On Error GoTo ErrorHandler ' Set up error handler +Dim iVar As Integer +Dim sVar As String +' Error caused by non-existent file + iVar = Freefile + Open "\file9879.txt" For Input As #iVar + Line Input #iVar, sVar + Close #iVar + Exit Sub +ErrorHandler: + MsgBox "Error " & err & ": " & Error$ + chr(13) + "In Line : " + Erl + chr(13) + Now , 16 ,"An error occurred" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03050500.xhp b/source/text/sbasic/shared/03050500.xhp index 00325eb676..1b1c216b5e 100644 --- a/source/text/sbasic/shared/03050500.xhp +++ b/source/text/sbasic/shared/03050500.xhp @@ -1,6 +1,5 @@ - - + +--> - - -On Error GoTo ... Resume Statement [Runtime] -/text/sbasic/shared/03050500.xhp - + + On Error GoTo ... Resume Statement [Runtime] + /text/sbasic/shared/03050500.xhp + + + +
-Resume Next parameter -On Error GoTo ... Resume statement + + Resume Next parameter + On Error GoTo ... Resume statement -On Error GoTo ... Resume Statement [Runtime] -Enables an error-handling routine after an error occurs, or resumes program execution. + + +On Error GoTo ... Resume Statement [Runtime] +Enables an error-handling routine after an error occurs, or resumes program execution.
-Syntax: - -On {[Local] Error GoTo Labelname | GoTo 0 | Resume Next} + +Syntax: + +On {[Local] Error GoTo Labelname | GoTo 0 | Resume Next} -Parameters: -GoTo Labelname: If an error occurs, enables the error-handling routine that starts at the line "Labelname". -Resume Next: If an error occurs, program execution continues with the statement that follows the statement in which the error occurred. -GoTo 0: Disables the error handler in the current procedure. -Local: "On error" is global in scope, and remains active until canceled by another "On error" statement. "On Local error" is local to the routine which invokes it. Local error handling overrides any previous global setting. When the invoking routine exits, the local error handling is canceled automatically, and any previous global setting is restored. +Parameters: +GoTo Labelname: If an error occurs, enables the error-handling routine that starts at the line "Labelname". +Resume Next: If an error occurs, program execution continues with the statement that follows the statement in which the error occurred. +GoTo 0: Disables the error handler in the current procedure. +Local: "On error" is global in scope, and remains active until canceled by another "On error" statement. "On Local error" is local to the routine which invokes it. Local error handling overrides any previous global setting. When the invoking routine exits, the local error handling is canceled automatically, and any previous global setting is restored. +The On Error GoTo statement is used to react to errors that occur in a macro.see i112231: The statement must be inserted at the start of a procedure (in a local error-handling routine) or at the start of a module. -The On Error GoTo statement is used to react to errors that occur in a macro.see i112231: The statement must be inserted at the start of a procedure (in a local error-handling routine) or at the start of a module. -Example: +Example: -Sub ExampleReset -On Error GoTo ErrorHandler -Dim iNumber As Integer -Dim iCount As Integer -Dim sLine As String -Dim aFile As String - aFile = "c:\data.txt" - iNumber = Freefile - Open aFile For Output As #iNumber - Print #iNumber, "This is a line of text" - Close #iNumber - iNumber = Freefile - Open aFile For Input As iNumber - For iCount = 1 To 5 - Line Input #iNumber, sLine - If sLine <>"" Then - Rem - End If - Next iCount - Close #iNumber - Exit Sub -ErrorHandler: - Reset - MsgBox "All files will be closed",0,"Error" -End Sub +Sub ExampleReset +On Error GoTo ErrorHandler +Dim iNumber As Integer +Dim iCount As Integer +Dim sLine As String +Dim aFile As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + For iCount = 1 To 5 + Line Input #iNumber, sLine + If sLine <>"" Then + Rem + End If + Next iCount + Close #iNumber + Exit Sub +ErrorHandler: + Reset + MsgBox "All files will be closed",0,"Error" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03060100.xhp b/source/text/sbasic/shared/03060100.xhp index f645f31a69..b0ff824db4 100644 --- a/source/text/sbasic/shared/03060100.xhp +++ b/source/text/sbasic/shared/03060100.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -AND Operator [Runtime] -/text/sbasic/shared/03060100.xhp - - -Sun Microsystems, Inc. - + + AND Operator [Runtime] + /text/sbasic/shared/03060100.xhp + + + +
-AND operator (logical) + + AND operator (logical) -AND Operator [Runtime] -Logically combines two expressions. + + +AND Operator [Runtime] +Logically combines two expressions.
-Syntax: - -Result = Expression1 And Expression2 + +Syntax: + +Result = Expression1 And Expression2 -Parameters: - -Result: Any numeric variable that records the result of the combination. - -Expression1, Expression2: Any expressions that you want to combine. -Boolean expressions combined with AND only return the value True if both expressions evaluate to True: - -True AND True returns True; for all other combinations the result is False. -The AND operator also performs a bitwise comparison of identically positioned bits in two numeric expressions. -Example: + +Parameters: + Result: Any numeric variable that records the result of the combination. + Expression1, Expression2: Any expressions that you want to combine. +Boolean expressions combined with AND only return the value True if both expressions evaluate to True: + True AND True returns True; for all other combinations the result is False. +The AND operator also performs a bitwise comparison of identically positioned bits in two numeric expressions. + +Example: -Sub ExampleAnd -Dim A As Variant, B As Variant, C As Variant, D As Variant -Dim vVarOut As Variant - A = 10: B = 8: C = 6: D = Null - vVarOut = A > B And B > C ' returns -1 - vVarOut = B > A And B > C ' returns 0 - vVarOut = A > B And B > D ' returns 0 - vVarOut = (B > D And B > A) ' returns 0 - vVarOut = B And A ' returns 8 due to the bitwise And combination of both arguments -End Sub +Sub ExampleAnd +Dim A As Variant, B As Variant, C As Variant, D As Variant +Dim vVarOut As Variant + A = 10: B = 8: C = 6: D = Null + vVarOut = A > B And B > C ' returns -1 + vVarOut = B > A And B > C ' returns 0 + vVarOut = A > B And B > D ' returns 0 + vVarOut = (B > D And B > A) ' returns 0 + vVarOut = B And A ' returns 8 due to the bitwise And combination of both arguments +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03060200.xhp b/source/text/sbasic/shared/03060200.xhp index 2d62476f3b..bdfeb0bfad 100644 --- a/source/text/sbasic/shared/03060200.xhp +++ b/source/text/sbasic/shared/03060200.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Eqv Operator [Runtime] -/text/sbasic/shared/03060200.xhp - - -Sun Microsystems, Inc. - + + Eqv Operator [Runtime] + /text/sbasic/shared/03060200.xhp + + + +
-Eqv operator (logical) + + Eqv operator (logical) -Eqv Operator [Runtime] -Calculates the logical equivalence of two expressions. + + +Eqv Operator [Runtime] +Calculates the logical equivalence of two expressions.
-Syntax: - -Result = Expression1 Eqv Expression2 + +Syntax: + +Result = Expression1 Eqv Expression2 -Parameters: - -Result: Any numeric variable that contains the result of the comparison. - -Expression1, Expression2: Any expressions that you want to compare. -When testing for equivalence between Boolean expressions, the result is True if both expressions are either True or False. -In a bit-wise comparison, the Eqv operator only sets the corresponding bit in the result if a bit is set in both expressions, or in neither expression. -Example: + +Parameters: + Result: Any numeric variable that contains the result of the comparison. + Expression1, Expression2: Any expressions that you want to compare. +When testing for equivalence between Boolean expressions, the result is True if both expressions are either True or False. +In a bit-wise comparison, the Eqv operator only sets the corresponding bit in the result if a bit is set in both expressions, or in neither expression. + +Example: -Sub ExampleEqv -Dim A As Variant, B As Variant, C As Variant, D As Variantsee #i38265 -Dim vOut As Variant - A = 10: B = 8: C = 6: D = Null - vOut = A > B Eqv B > C ' returns -1 - vOut = B > A Eqv B > C ' returns 0 - vOut = A > B Eqv B > D ' returns 0 - vOut = (B > D Eqv B > A) ' returns -1 - vOut = B Eqv A ' returns -3 -End Sub +Sub ExampleEqv +Dim A As Variant, B As Variant, C As Variant, D As Variantsee #i38265 +Dim vOut As Variant + A = 10: B = 8: C = 6: D = Null + vOut = A > B Eqv B > C ' returns -1 + vOut = B > A Eqv B > C ' returns 0 + vOut = A > B Eqv B > D ' returns 0 + vOut = (B > D Eqv B > A) ' returns -1 + vOut = B Eqv A ' returns -3 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03060300.xhp b/source/text/sbasic/shared/03060300.xhp index 6a9d7e1fe8..33ade16895 100644 --- a/source/text/sbasic/shared/03060300.xhp +++ b/source/text/sbasic/shared/03060300.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Imp-Operator [Runtime] -/text/sbasic/shared/03060300.xhp - - -Sun Microsystems, Inc. - + + Imp-Operator [Runtime] + /text/sbasic/shared/03060300.xhp + + + +
-Imp operator (logical) + + Imp operator (logical) -Imp Operator [Runtime] -Performs a logical implication on two expressions. + + +Imp Operator [Runtime] +Performs a logical implication on two expressions.
-Syntax: - -Result = Expression1 Imp Expression2 + +Syntax: + +Result = Expression1 Imp Expression2 -Parameters: - -Result: Any numeric variable that contains the result of the implication. - -Expression1, Expression2: Any expressions that you want to evaluate with the Imp operator. -If you use the Imp operator in Boolean expressions, False is only returned if the first expression evaluates to True and the second expression to False. -If you use the Imp operator in bit expressions, a bit is deleted from the result if the corresponding bit is set in the first expression and the corresponding bit is deleted in the second expression. -Example: + +Parameters: + Result: Any numeric variable that contains the result of the implication. + Expression1, Expression2: Any expressions that you want to evaluate with the Imp operator. +If you use the Imp operator in Boolean expressions, False is only returned if the first expression evaluates to True and the second expression to False. +If you use the Imp operator in bit expressions, a bit is deleted from the result if the corresponding bit is set in the first expression and the corresponding bit is deleted in the second expression. + +Example: -Sub ExampleImp -Dim A As Variant, B As Variant, C As Variant, D As Variant -Dim vOut As Variant - A = 10: B = 8: C = 6: D = Null - vOut = A > B Imp B > C ' returns -1 - vOut = B > A Imp B > C ' returns -1 - vOut = A > B Imp B > D ' returns 0 - vOut = (B > D Imp B > A) ' returns -1 - vOut = B Imp A ' returns -1 -End Sub +Sub ExampleImp +Dim A As Variant, B As Variant, C As Variant, D As Variant +Dim vOut As Variant + A = 10: B = 8: C = 6: D = Null + vOut = A > B Imp B > C ' returns -1 + vOut = B > A Imp B > C ' returns -1 + vOut = A > B Imp B > D ' returns 0 + vOut = (B > D Imp B > A) ' returns -1 + vOut = B Imp A ' returns -1 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03060400.xhp b/source/text/sbasic/shared/03060400.xhp index b970ad211d..224c75213d 100644 --- a/source/text/sbasic/shared/03060400.xhp +++ b/source/text/sbasic/shared/03060400.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Not-Operator [Runtime] -/text/sbasic/shared/03060400.xhp - - -Sun Microsystems, Inc. - + + Not-Operator [Runtime] + /text/sbasic/shared/03060400.xhp + + + +
-Not operator (logical) + + Not operator (logical) -Not-Operator [Runtime] -Negates an expression by inverting the bit values. + + +Not-Operator [Runtime] +Negates an expression by inverting the bit values.
-Syntax: - -Result = Not Expression + +Syntax: + +Result = Not Expression -Parameters: - -Result: Any numeric variable that contains the result of the negation. - -Expression: Any expression that you want to negate. -When a Boolean expression is negated, the value True changes to False, and the value False changes to True. -In a bitwise negation each individual bit is inverted. -Example: + +Parameters: + Result: Any numeric variable that contains the result of the negation. + Expression: Any expression that you want to negate. +When a Boolean expression is negated, the value True changes to False, and the value False changes to True. +In a bitwise negation each individual bit is inverted. + +Example: -Sub ExampleNot -Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant -Dim vOut As Variant - vA = 10: vB = 8: vC = 6: vD = Null - vOut = Not vA ' Returns -11 - vOut = Not(vC > vD) ' Returns -1 - vOut = Not(vB > vA) ' Returns -1 - vOut = Not(vA > vB) ' Returns 0 -End Sub +Sub ExampleNot +Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant +Dim vOut As Variant + vA = 10: vB = 8: vC = 6: vD = Null + vOut = Not vA ' Returns -11 + vOut = Not(vC > vD) ' Returns -1 + vOut = Not(vB > vA) ' Returns -1 + vOut = Not(vA > vB) ' Returns 0 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03060500.xhp b/source/text/sbasic/shared/03060500.xhp index 7a0883f2b6..7d4b7e685e 100644 --- a/source/text/sbasic/shared/03060500.xhp +++ b/source/text/sbasic/shared/03060500.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Or-Operator [Runtime] -/text/sbasic/shared/03060500.xhp - - -Sun Microsystems, Inc. - + + Or-Operator [Runtime] + /text/sbasic/shared/03060500.xhp + + + +
-Or operator (logical) + + Or operator (logical) -Or Operator [Runtime] -Performs a logical OR disjunction on two expressions. + + +Or Operator [Runtime] +Performs a logical OR disjunction on two expressions.
-Syntax: - -Result = Expression1 Or Expression2 + +Syntax: + +Result = Expression1 Or Expression2 -Parameters: - -Result: Any numeric variable that contains the result of the disjunction. - -Expression1, Expression2: Any numeric expressions that you want to compare. -A logical OR disjunction of two Boolean expressions returns the value True if at least one comparison expression is True. -A bit-wise comparison sets a bit in the result if the corresponding bit is set in at least one of the two expressions. -Example: + +Parameters: + Result: Any numeric variable that contains the result of the disjunction. + Expression1, Expression2: Any numeric expressions that you want to compare. +A logical OR disjunction of two Boolean expressions returns the value True if at least one comparison expression is True. +A bit-wise comparison sets a bit in the result if the corresponding bit is set in at least one of the two expressions. + +Example: -Sub ExampleOr -Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant -Dim vOut As Variant - vA = 10: vB = 8: vC = 6: vD = Null - vOut = vA > vB Or vB > vC ' -1 - vOut = vB > vA Or vB > vC ' -1 - vOut = vA > vB Or vB > vD ' -1 - vOut = (vB > vD Or vB > vA) ' 0 - vOut = vB Or vA ' 10 -End Sub +Sub ExampleOr +Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant +Dim vOut As Variant + vA = 10: vB = 8: vC = 6: vD = Null + vOut = vA > vB Or vB > vC ' -1 + vOut = vB > vA Or vB > vC ' -1 + vOut = vA > vB Or vB > vD ' -1 + vOut = (vB > vD Or vB > vA) ' 0 + vOut = vB Or vA ' 10 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03060600.xhp b/source/text/sbasic/shared/03060600.xhp index eab19bb28b..5cae45ea68 100644 --- a/source/text/sbasic/shared/03060600.xhp +++ b/source/text/sbasic/shared/03060600.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Xor-Operator [Runtime] -/text/sbasic/shared/03060600.xhp - - -Sun Microsystems, Inc. - + + Xor-Operator [Runtime] + /text/sbasic/shared/03060600.xhp + + + +
-Xor operator (logical) + + Xor operator (logical) -Xor-Operator [Runtime] -Performs a logical Exclusive-Or combination of two expressions. + + +Xor-Operator [Runtime] +Performs a logical Exclusive-Or combination of two expressions.
-Syntax: - -Result = Expression1 Xor Expression2 + +Syntax: + +Result = Expression1 Xor Expression2 -Parameters: - -Result: Any numeric variable that contains the result of the combination. - -Expression1, Expression2: Any numeric expressions that you want to combine. -A logical Exclusive-Or conjunction of two Boolean expressions returns the value True only if both expressions are different from each other. -A bitwise Exclusive-Or conjunction returns a bit if the corresponding bit is set in only one of the two expressions. -Example: + +Parameters: + Result: Any numeric variable that contains the result of the combination. + Expression1, Expression2: Any numeric expressions that you want to combine. +A logical Exclusive-Or conjunction of two Boolean expressions returns the value True only if both expressions are different from each other. +A bitwise Exclusive-Or conjunction returns a bit if the corresponding bit is set in only one of the two expressions. + +Example: -Sub ExampleXor -Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant -Dim vOut As Variant - vA = 10: vB = 8: vC = 6: vD = Null - vOut = vA > vB Xor vB > vC ' returns 0 - vOut = vB > vA Xor vB > vC ' returns -1 - vOut = vA > vB Xor vB > vD ' returns -1 - vOut = (vB > vD Xor vB > vA) ' returns 0 - vOut = vB Xor vA ' returns 2 -End Sub +Sub ExampleXor +Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant +Dim vOut As Variant + vA = 10: vB = 8: vC = 6: vD = Null + vOut = vA > vB Xor vB > vC ' returns 0 + vOut = vB > vA Xor vB > vC ' returns -1 + vOut = vA > vB Xor vB > vD ' returns -1 + vOut = (vB > vD Xor vB > vA) ' returns 0 + vOut = vB Xor vA ' returns 2 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03070100.xhp b/source/text/sbasic/shared/03070100.xhp index e28e73ea27..9b3245034b 100644 --- a/source/text/sbasic/shared/03070100.xhp +++ b/source/text/sbasic/shared/03070100.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -"-" Operator [Runtime] -/text/sbasic/shared/03070100.xhp - - -Sun Microsystems, Inc. - + + "-" Operator [Runtime] + /text/sbasic/shared/03070100.xhp + + + +
-"-" operator (mathematical) + + "-" operator (mathematical) -"-" Operator [Runtime] -Subtracts two values. + + +"-" Operator [Runtime] +Subtracts two values.
-Syntax: - -Result = Expression1 - Expression2 + +Syntax: + +Result = Expression1 - Expression2 -Parameters: - -Result: Any numerical expression that contains the result of the subtraction. - -Expression1, Expression2: Any numerical expressions that you want to subtract. -Example: + +Parameters: + Result: Any numerical expression that contains the result of the subtraction. + Expression1, Expression2: Any numerical expressions that you want to subtract. + +Example: -Sub ExampleSubtraction1 - Print 5 - 5 -End Sub - -Sub ExampleSubtraction2 -Dim iValue1 As Integer -Dim iValue2 As Integer - iValue1 = 5 - iValue2 = 10 - Print iValue1 - iValue2 -End Sub +Sub ExampleSubtraction1 + Print 5 - 5 +End Sub + +Sub ExampleSubtraction2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 - iValue2 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03070200.xhp b/source/text/sbasic/shared/03070200.xhp index edd7486642..b26623a564 100644 --- a/source/text/sbasic/shared/03070200.xhp +++ b/source/text/sbasic/shared/03070200.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -"*" Operator [Runtime] -/text/sbasic/shared/03070200.xhp - - -Sun Microsystems, Inc. - + + "*" Operator [Runtime] + /text/sbasic/shared/03070200.xhp + + + +
-"*" operator (mathematical) + + "*" operator (mathematical) -"*" Operator [Runtime] -Multiplies two values. + + +"*" Operator [Runtime] +Multiplies two values.
-Syntax: - -Result = Expression1 * Expression2 + +Syntax: + +Result = Expression1 * Expression2 -Parameters: - -Result: Any numeric expression that records the result of a multiplication. - -Expression1, Expression2: Any numeric expressions that you want to multiply. -Example: + +Parameters: + Result: Any numeric expression that records the result of a multiplication. + Expression1, Expression2: Any numeric expressions that you want to multiply. + +Example: -Sub ExampleMultiplication1 - Print 5 * 5 -End Sub - -Sub ExampleMultiplication2 -Dim iValue1 As Integer -Dim iValue2 As Integer - iValue1 = 5 - iValue2 = 10 - Print iValue1 * iValue2 -End Sub +Sub ExampleMultiplication1 + Print 5 * 5 +End Sub + +Sub ExampleMultiplication2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 * iValue2 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03070300.xhp b/source/text/sbasic/shared/03070300.xhp index 792f0f7dae..0d2e722bc9 100644 --- a/source/text/sbasic/shared/03070300.xhp +++ b/source/text/sbasic/shared/03070300.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -"+" Operator [Runtime] -/text/sbasic/shared/03070300.xhp - - -Sun Microsystems, Inc. - + + "+" Operator [Runtime] + /text/sbasic/shared/03070300.xhp + + + +
-"+" operator (mathematical) + + "+" operator (mathematical) -"+" Operator [Runtime] -Adds or combines two expressions. + + +"+" Operator [Runtime] +Adds or combines two expressions.
-Syntax: - -Result = Expression1 + Expression2 + +Syntax: + +Result = Expression1 + Expression2 -Parameters: - -Result: Any numerical expression that contains the result of the addition. - -Expression1, Expression2: Any numerical expressions that you want to combine or to add. -Example: + +Parameters: + Result: Any numerical expression that contains the result of the addition. + Expression1, Expression2: Any numerical expressions that you want to combine or to add. + +Example: -Sub ExampleAddition1 - Print 5 + 5 -End Sub - -Sub ExampleAddition2 -Dim iValue1 As Integer -Dim iValue2 As Integer - iValue1 = 5 - iValue2 = 10 - Print iValue1 + iValue2 -End Sub +Sub ExampleAddition1 + Print 5 + 5 +End Sub + +Sub ExampleAddition2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 + iValue2 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03070400.xhp b/source/text/sbasic/shared/03070400.xhp index fdc7db6bbf..308aee3d74 100644 --- a/source/text/sbasic/shared/03070400.xhp +++ b/source/text/sbasic/shared/03070400.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -"/" Operator [Runtime] -/text/sbasic/shared/03070400.xhp - - -Sun Microsystems, Inc. - + + "/" Operator [Runtime] + /text/sbasic/shared/03070400.xhp + + + +
-"/" operator (mathematical) + + "/" operator (mathematical) -"/" Operator [Runtime] -Divides two values. + + +"/" Operator [Runtime] +Divides two values.
-Syntax: - -Result = Expression1 / Expression2 + +Syntax: + +Result = Expression1 / Expression2 -Parameters: - -Result: Any numerical value that contains the result of the division. - -Expression1, Expression2: Any numerical expressions that you want to divide. -Example: + +Parameters: + Result: Any numerical value that contains the result of the division. + Expression1, Expression2: Any numerical expressions that you want to divide. + +Example: -Sub ExampleDivision1 - Print 5 / 5 -End Sub - -Sub ExampleDivision2 -Dim iValue1 As Integer -Dim iValue2 As Integer - iValue1 = 5 - iValue2 = 10 - Print iValue1 / iValue2 -End Sub +Sub ExampleDivision1 + Print 5 / 5 +End Sub + +Sub ExampleDivision2 +Dim iValue1 As Integer +Dim iValue2 As Integer + iValue1 = 5 + iValue2 = 10 + Print iValue1 / iValue2 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03070500.xhp b/source/text/sbasic/shared/03070500.xhp index 829fd4fce7..a5d5c753bf 100644 --- a/source/text/sbasic/shared/03070500.xhp +++ b/source/text/sbasic/shared/03070500.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -"^" Operator [Runtime] -/text/sbasic/shared/03070500.xhp - - -Sun Microsystems, Inc. - + + "^" Operator [Runtime] + /text/sbasic/shared/03070500.xhp + + + +
-"^" operator (mathematical) + + "^" operator (mathematical) -"^" Operator [Runtime] -Raises a number to a power. + + +"^" Operator [Runtime] +Raises a number to a power.
-Syntax: - -Result = Expression ^ Exponent + +Syntax: + +Result = Expression ^ Exponent -Parameters: - -Result: Any numerical expression that contains the result of the number raised to a power. - -Expression: Numerical value that you want to raise to a power. - -Exponent: The value of the power that you want to raise the expression to. -Example: + +Parameters: + Result: Any numerical expression that contains the result of the number raised to a power. + Expression: Numerical value that you want to raise to a power. + Exponent: The value of the power that you want to raise the expression to. + +Example: -Sub Example - Print ( 12.345 ^ 23 ) - Print Exp ( 23 * Log( 12.345 ) ) ' Raises by forming a logarithm -End Sub +Sub Example + Print ( 12.345 ^ 23 ) + Print Exp ( 23 * Log( 12.345 ) ) ' Raises by forming a logarithm +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03070600.xhp b/source/text/sbasic/shared/03070600.xhp index 3149bc129d..d7b0bbe26b 100644 --- a/source/text/sbasic/shared/03070600.xhp +++ b/source/text/sbasic/shared/03070600.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Mod-Operator [Runtime] -/text/sbasic/shared/03070600.xhp - - -Sun Microsystems, Inc. - + + Mod-Operator [Runtime] + /text/sbasic/shared/03070600.xhp + + + +
-MOD operator (mathematical) + + MOD operator (mathematical) -Mod Operator [Runtime] -Returns the integer remainder of a division. + + +Mod Operator [Runtime] +Returns the integer remainder of a division.
-Syntax: - -Result = Expression1 MOD Expression2 + +Syntax: + +Result = Expression1 MOD Expression2 -Return value: -Integer -Parameters: - -Result: Any numeric variable that contains the result of the MOD operation. - -Expression1, Expression2: Any numeric expressions that you want to divide. -Example: + +Return value: +Integer + +Parameters: + Result: Any numeric variable that contains the result of the MOD operation. + Expression1, Expression2: Any numeric expressions that you want to divide. + +Example: -Sub ExampleMod - Print 10 Mod 2.5 ' returns 0 - Print 10 / 2.5 ' returns 4 - Print 10 Mod 5 ' returns 0 - Print 10 / 5 ' returns 2 - Print 5 Mod 10 ' returns 5 - Print 5 / 10 ' returns 0.5 -End Sub +Sub ExampleMod + Print 10 Mod 2.5 ' returns 0 + Print 10 / 2.5 ' returns 4 + Print 10 Mod 5 ' returns 0 + Print 10 / 5 ' returns 2 + Print 5 Mod 10 ' returns 5 + Print 5 / 10 ' returns 0.5 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080101.xhp b/source/text/sbasic/shared/03080101.xhp index 155812fb7f..d09f59bea3 100644 --- a/source/text/sbasic/shared/03080101.xhp +++ b/source/text/sbasic/shared/03080101.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Atn Function [Runtime] -/text/sbasic/shared/03080101.xhp - - -Sun Microsystems, Inc. - + + Atn Function [Runtime] + /text/sbasic/shared/03080101.xhp + + + +
-Atn function + + Atn function -Atn Function [Runtime] -Trigonometric function that returns the arctangent of a numeric expression. The return value is in the range -Pi/2 to +Pi/2. + + +Atn Function [Runtime] +Trigonometric function that returns the arctangent of a numeric expression. The return value is in the range -Pi/2 to +Pi/2.
-The arctangent is the inverse of the tangent function. The Atn Function returns the angle "Alpha", expressed in radians, using the tangent of this angle. The function can also return the angle "Alpha" by comparing the ratio of the length of the side that is opposite of the angle to the length of the side that is adjacent to the angle in a right-angled triangle. -Atn(side opposite the angle/side adjacent to angle)= Alpha -Syntax: - -Atn (Number) +The arctangent is the inverse of the tangent function. The Atn Function returns the angle "Alpha", expressed in radians, using the tangent of this angle. The function can also return the angle "Alpha" by comparing the ratio of the length of the side that is opposite of the angle to the length of the side that is adjacent to the angle in a right-angled triangle. +Atn(side opposite the angle/side adjacent to angle)= Alpha + +Syntax: + +Atn (Number) -Return value: -Double -Parameters: - -Number: Any numerical expression that represents the ratio of two sides of a right triangle. The Atn function returns the corresponding angle in radians (arctangent). -To convert radians to degrees, multiply radians by 180/pi. -degree=(radian*180)/pi -radian=(degree*pi)/180 -Pi is here the fixed circle constant with the rounded value 3.14159. + +Return value: +Double + +Parameters: + Number: Any numerical expression that represents the ratio of two sides of a right triangle. The Atn function returns the corresponding angle in radians (arctangent). +To convert radians to degrees, multiply radians by 180/pi. +degree=(radian*180)/pi +radian=(degree*pi)/180 +Pi is here the fixed circle constant with the rounded value 3.14159. -Example: + +Example: -' The following example calculates for a right-angled triangle -' the angle Alpha from the tangent of the angle Alpha: -Sub ExampleAtn -' rounded Pi = 3.14159 Is a predefined constant -Dim d1 As Double -Dim d2 As Double - d1 = InputBox("Enter the length of the side adjacent to the angle: ","Adjacent") - d2 = InputBox("Enter the length of the side opposite the angle: ","Opposite") - Print "The Alpha angle is"; (atn (d2/d1) * 180 / Pi); " degrees" -End Sub +' The following example calculates for a right-angled triangle +' the angle Alpha from the tangent of the angle Alpha: +Sub ExampleAtn +' rounded Pi = 3.14159 Is a predefined constant +Dim d1 As Double +Dim d2 As Double + d1 = InputBox("Enter the length of the side adjacent to the angle: ","Adjacent") + d2 = InputBox("Enter the length of the side opposite the angle: ","Opposite") + Print "The Alpha angle is"; (atn (d2/d1) * 180 / Pi); " degrees" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080102.xhp b/source/text/sbasic/shared/03080102.xhp index 9aea5d9add..db293cfcbe 100644 --- a/source/text/sbasic/shared/03080102.xhp +++ b/source/text/sbasic/shared/03080102.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Cos Function [Runtime] -/text/sbasic/shared/03080102.xhp - - -Sun Microsystems, Inc. - + + Cos Function [Runtime] + /text/sbasic/shared/03080102.xhp + + + +
-Cos function + + Cos function -Cos Function [Runtime] -Calculates the cosine of an angle. The angle is specified in radians. The result lies between -1 and 1. + + +Cos Function [Runtime] +Calculates the cosine of an angle. The angle is specified in radians. The result lies between -1 and 1.
-Using the angle Alpha, the Cos-Function calculates the ratio of the length of the side that is adjacent to the angle, divided by the length of the hypotenuse in a right-angled triangle. -Cos(Alpha) = Adjacent/Hypotenuse -Syntax: - -Cos (Number) +Using the angle Alpha, the Cos-Function calculates the ratio of the length of the side that is adjacent to the angle, divided by the length of the hypotenuse in a right-angled triangle. +Cos(Alpha) = Adjacent/Hypotenuse + +Syntax: + +Cos (Number) -Return value: -Double -Parameters: - -Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for. -To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi. -degree=(radian*180)/pi -radian=(degree*pi)/180 -Pi is here the fixed circle constant with the rounded value 3.14159... + +Return value: +Double + +Parameters: + Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for. +To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi. +degree=(radian*180)/pi +radian=(degree*pi)/180 +Pi is here the fixed circle constant with the rounded value 3.14159... -Example: + +Example: -' The following example allows for a right-angled triangle the input of -' secant and angle (in degrees) and calculates the length of the hypotenuse: -Sub ExampleCosinus -' rounded Pi = 3.14159 -Dim d1 As Double, dAngle As Double - d1 = InputBox("Enter the length of the adjacent side: ","Adjacent") - dAngle = InputBox("Enter the angle Alpha (in degrees): ","Alpha") - Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180)) -End Sub +' The following example allows for a right-angled triangle the input of +' secant and angle (in degrees) and calculates the length of the hypotenuse: +Sub ExampleCosinus +' rounded Pi = 3.14159 +Dim d1 As Double, dAngle As Double + d1 = InputBox("Enter the length of the adjacent side: ","Adjacent") + dAngle = InputBox("Enter the angle Alpha (in degrees): ","Alpha") + Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180)) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080103.xhp b/source/text/sbasic/shared/03080103.xhp index 59118cf3c8..8115b56240 100644 --- a/source/text/sbasic/shared/03080103.xhp +++ b/source/text/sbasic/shared/03080103.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Sin Function [Runtime] -/text/sbasic/shared/03080103.xhp - - -Sun Microsystems, Inc. - + + Sin Function [Runtime] + /text/sbasic/shared/03080103.xhp + + + +
-Sin function + + Sin function -Sin Function [Runtime] -Returns the sine of an angle. The angle is specified in radians. The result lies between -1 and 1. + + +Sin Function [Runtime] +Returns the sine of an angle. The angle is specified in radians. The result lies between -1 and 1.
-Using the angle Alpha, the Sin Function returns the ratio of the length of the opposite side of an angle to the length of the hypotenuse in a right-angled triangle. -Sin(Alpha) = side opposite the angle/hypotenuse -Syntax: - -Sin (Number) +Using the angle Alpha, the Sin Function returns the ratio of the length of the opposite side of an angle to the length of the hypotenuse in a right-angled triangle. +Sin(Alpha) = side opposite the angle/hypotenuse + +Syntax: + +Sin (Number) -Return value: -Double -Parameters: - -Number: Numeric expression that defines the angle in radians that you want to calculate the sine for. -To convert degrees to radians, multiply degrees by Pi/180, and to convert radians to degrees, multiply radians by 180/Pi. -grad=(radiant*180)/pi -radiant=(grad*pi)/180 -Pi is approximately 3.141593. + +Return value: +Double + +Parameters: + Number: Numeric expression that defines the angle in radians that you want to calculate the sine for. +To convert degrees to radians, multiply degrees by Pi/180, and to convert radians to degrees, multiply radians by 180/Pi. +grad=(radiant*180)/pi +radiant=(grad*pi)/180 +Pi is approximately 3.141593. -Example: + +Example: -' In this example, the following entry is possible for a right-angled triangle: -' The side opposite the angle and the angle (in degrees) to calculate the length of the hypotenuse: -Sub ExampleSine -' Pi = 3.1415926 is a predefined variable -Dim d1 As Double -Dim dAlpha As Double - d1 = InputBox("Enter the length of the opposite side: ","Opposite Side") - dAlpha = InputBox("Enter the angle Alpha (in degrees): ","Alpha") - Print "The length of the hypotenuse is"; (d1 / sin (dAlpha * Pi / 180)) -End Sub +' In this example, the following entry is possible for a right-angled triangle: +' The side opposite the angle and the angle (in degrees) to calculate the length of the hypotenuse: +Sub ExampleSine +' Pi = 3.1415926 is a predefined variable +Dim d1 As Double +Dim dAlpha As Double + d1 = InputBox("Enter the length of the opposite side: ","Opposite Side") + dAlpha = InputBox("Enter the angle Alpha (in degrees): ","Alpha") + Print "The length of the hypotenuse is"; (d1 / sin (dAlpha * Pi / 180)) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080104.xhp b/source/text/sbasic/shared/03080104.xhp index 7d2c25b25c..bb5688964f 100644 --- a/source/text/sbasic/shared/03080104.xhp +++ b/source/text/sbasic/shared/03080104.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Tan Function [Runtime] -/text/sbasic/shared/03080104.xhp - - -Sun Microsystems, Inc. - + + Tan Function [Runtime] + /text/sbasic/shared/03080104.xhp + + + +
-Tan function + + Tan function -Tan Function [Runtime] -Determines the tangent of an angle. The angle is specified in radians.i71396 + + +Tan Function [Runtime] +Determines the tangent of an angle. The angle is specified in radians.i71396
-Using the angle Alpha, the Tan Function calculates the ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in a right-angled triangle. -Tan(Alpha) = side opposite the angle/side adjacent to angle -Syntax: - -Tan (Number) +Using the angle Alpha, the Tan Function calculates the ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in a right-angled triangle. +Tan(Alpha) = side opposite the angle/side adjacent to angle + +Syntax: + +Tan (Number) -Return value: -Double -Parameters: - -Number: Any numeric expression that you want to calculate the tangent for (in radians). -To convert degrees to radians, multiply by Pi/180. To convert radians to degrees, multiply by 180/Pi. -degrees=(radiant*180)/Pi -radiant=(degrees*Pi)/180 -Pi is approximately 3.141593. + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to calculate the tangent for (in radians). +To convert degrees to radians, multiply by Pi/180. To convert radians to degrees, multiply by 180/Pi. +degrees=(radiant*180)/Pi +radiant=(degrees*Pi)/180 +Pi is approximately 3.141593. -Example: + +Example: -' In this example, the following entry is possible for a right-angled triangle: -' The side opposite the angle and the angle (in degrees) to calculate the length of the side adjacent to the angle: -Sub ExampleTangens -' Pi = 3.1415926 is a pre-defined variable -Dim d1 As Double -Dim dAlpha As Double - d1 = InputBox("Enter the length of the side opposite the angle: ","opposite") - dAlpha = InputBox("Enter the Alpha angle (in degrees): ","Alpha") - Print "the length of the side adjacent the angle is"; (d1 / tan (dAlpha * Pi / 180)) -End Sub +' In this example, the following entry is possible for a right-angled triangle: +' The side opposite the angle and the angle (in degrees) to calculate the length of the side adjacent to the angle: +Sub ExampleTangens +' Pi = 3.1415926 is a pre-defined variable +Dim d1 As Double +Dim dAlpha As Double + d1 = InputBox("Enter the length of the side opposite the angle: ","opposite") + dAlpha = InputBox("Enter the Alpha angle (in degrees): ","Alpha") + Print "the length of the side adjacent the angle is"; (d1 / tan (dAlpha * Pi / 180)) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080201.xhp b/source/text/sbasic/shared/03080201.xhp index f8dab54fa1..1e58b3f761 100644 --- a/source/text/sbasic/shared/03080201.xhp +++ b/source/text/sbasic/shared/03080201.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Exp Function [Runtime] -/text/sbasic/shared/03080201.xhp - - -Sun Microsystems, Inc. - + + Exp Function [Runtime] + /text/sbasic/shared/03080201.xhp + + + +
-Exp function + + Exp function -Exp Function [Runtime] -Returns the base of the natural logarithm (e = 2.718282) raised to a power. + + +Exp Function [Runtime] +Returns the base of the natural logarithm (e = 2.718282) raised to a power.
-Syntax: - -Exp (Number) + +Syntax: + +Exp (Number) -Return value: -Double -Parameters: - -Number: Any numeric expression that specifies the power that you want to raise "e" to (the base of natural logarithms). The power must be for both single-precision numbers less than or equal to 88.02969 and double-precision numbers less than or equal to 709.782712893, since $[officename] Basic returns an Overflow error for numbers exceeding these values. + +Return value: +Double + +Parameters: + Number: Any numeric expression that specifies the power that you want to raise "e" to (the base of natural logarithms). The power must be for both single-precision numbers less than or equal to 88.02969 and double-precision numbers less than or equal to 709.782712893, since $[officename] Basic returns an Overflow error for numbers exceeding these values. -Example: + +Example: -Sub ExampleLogExp -Dim dValue As Double - Const b1=12.345e12 -Const b2=1.345e34 - dValue=Exp( Log(b1)+Log(b2) ) - MsgBox "" & dValue & chr(13) & (b1*b2) ,0,"Multiplication by logarithm" -End Sub +Sub ExampleLogExp +Dim dValue As Double + Const b1=12.345e12 +Const b2=1.345e34 + dValue=Exp( Log(b1)+Log(b2) ) + MsgBox "" & dValue & chr(13) & (b1*b2) ,0,"Multiplication by logarithm" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080202.xhp b/source/text/sbasic/shared/03080202.xhp index d05c7a076f..ff3872cdb9 100644 --- a/source/text/sbasic/shared/03080202.xhp +++ b/source/text/sbasic/shared/03080202.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Log Function [Runtime] -/text/sbasic/shared/03080202.xhp - - -Sun Microsystems, Inc. - + + Log Function [Runtime] + /text/sbasic/shared/03080202.xhp + + + +
-Log function + + Log function -Log Function [Runtime] -Returns the natural logarithm of a number. + + +Log Function [Runtime] +Returns the natural logarithm of a number.
-Syntax: - -Log (Number) + +Syntax: + +Log (Number) -Return value: -Double -Parameters: - -Number: Any numeric expression that you want to calculate the natural logarithm for. -The natural logarithm is the logarithm to the base e. Base e is a constant with an approximate value of 2.718282... -You can calculate logarithms to any base (n) for any number (x) by dividing the natural logarithm of x by the natural logarithm of n, as follows: -Log n(x) = Log(x) / Log(n) + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to calculate the natural logarithm for. +The natural logarithm is the logarithm to the base e. Base e is a constant with an approximate value of 2.718282... +You can calculate logarithms to any base (n) for any number (x) by dividing the natural logarithm of x by the natural logarithm of n, as follows: +Log n(x) = Log(x) / Log(n) -Example: + +Example: -Sub ExampleLogExp -Dim a As Double -Dim Const b1=12.345e12 -Dim Const b2=1.345e34 - a=Exp( Log(b1)+Log(b2) ) - MsgBox "" & a & chr(13) & (b1*b2) ,0,"Multiplication by logarithm function" -End Sub +Sub ExampleLogExp +Dim a As Double +Dim Const b1=12.345e12 +Dim Const b2=1.345e34 + a=Exp( Log(b1)+Log(b2) ) + MsgBox "" & a & chr(13) & (b1*b2) ,0,"Multiplication by logarithm function" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080301.xhp b/source/text/sbasic/shared/03080301.xhp index 3ecb711df2..51fb84f207 100644 --- a/source/text/sbasic/shared/03080301.xhp +++ b/source/text/sbasic/shared/03080301.xhp @@ -1,6 +1,5 @@ - - + +--> - - -Randomize Statement [Runtime] -/text/sbasic/shared/03080301.xhp - + + Randomize Statement [Runtime] + /text/sbasic/shared/03080301.xhp + + + +
-Randomize statement + + Randomize statement -Randomize Statement [Runtime] -Initializes the random-number generator. + + +Randomize Statement [Runtime] +Initializes the random-number generator.
-Syntax: - -Randomize [Number] + +Syntax: + +Randomize [Number] -Parameters: - -Number: Any integer value that initializes the random-number generator. + +Parameters: + Number: Any integer value that initializes the random-number generator. -Example: + +Example: -Sub ExampleRandomize -Dim iVar As Integer, sText As String -Dim iSpectral(10) As Integer - Randomize 2^14-1 - For iCount = 1 To 1000 - iVar = Int((10 * Rnd) ) ' Range from 0 To 9 - iSpectral(iVar) = iSpectral(iVar) +1 - Next iCount - sText = " | " - For iCount = 0 To 9 - sText = sText & iSpectral(iCount) & " | " - Next iCount - MsgBox sText,0,"Spectral Distribution" -End Sub +Sub ExampleRandomize +Dim iVar As Integer, sText As String +Dim iSpectral(10) As Integer + Randomize 2^14-1 + For iCount = 1 To 1000 + iVar = Int((10 * Rnd) ) ' Range from 0 To 9 + iSpectral(iVar) = iSpectral(iVar) +1 + Next iCount + sText = " | " + For iCount = 0 To 9 + sText = sText & iSpectral(iCount) & " | " + Next iCount + MsgBox sText,0,"Spectral Distribution" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080302.xhp b/source/text/sbasic/shared/03080302.xhp index 39d37fd0f3..ef378256e3 100644 --- a/source/text/sbasic/shared/03080302.xhp +++ b/source/text/sbasic/shared/03080302.xhp @@ -1,6 +1,5 @@ - - + +--> - - -Rnd Function [Runtime] -/text/sbasic/shared/03080302.xhp - + + Rnd Function [Runtime] + /text/sbasic/shared/03080302.xhp + + + +
-Rnd function + + Rnd function -Rnd Function [Runtime] -Returns a random number between 0 and 1. + + +Rnd Function [Runtime] +Returns a random number between 0 and 1.
-Syntax: - -Rnd [(Expression)] + +Syntax: + +Rnd [(Expression)] -Return value: -Double -Parameters: - -Expression: Any numeric expression. - -Omitted: Returns the next random number in the sequence. -The Rnd function only returns values ranging from 0 to 1. To generate random integers in a given range, use the formula in the following example: + +Return value: +Double + +Parameters: + Expression: Any numeric expression. + Omitted: Returns the next random number in the sequence. +The Rnd function only returns values ranging from 0 to 1. To generate random integers in a given range, use the formula in the following example: -Example: + +Example: -Sub ExampleRandomSelect -Dim iVar As Integer - iVar = Int((15 * Rnd) -2) - Select Case iVar - Case 1 To 5 - Print "Number from 1 to 5" - Case 6, 7, 8 - Print "Number from 6 to 8" - Case Is > 8 And iVar < 11 - Print "Greater than 8" - Case Else - Print "Outside range 1 to 10" - End Select -End Sub +Sub ExampleRandomSelect +Dim iVar As Integer + iVar = Int((15 * Rnd) -2) + Select Case iVar + Case 1 To 5 + Print "Number from 1 to 5" + Case 6, 7, 8 + Print "Number from 6 to 8" + Case Is > 8 And iVar < 11 + Print "Greater than 8" + Case Else + Print "Outside range 1 to 10" + End Select +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080401.xhp b/source/text/sbasic/shared/03080401.xhp index c95486b7ee..2dd53e2272 100644 --- a/source/text/sbasic/shared/03080401.xhp +++ b/source/text/sbasic/shared/03080401.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Sqr Function [Runtime] -/text/sbasic/shared/03080401.xhp - - -Sun Microsystems, Inc. - + + Sqr Function [Runtime] + /text/sbasic/shared/03080401.xhp + + + +
-Sqr function + + Sqr function -Sqr Function [Runtime] -Calculates the square root of a numeric expression. + + +Sqr Function [Runtime] +Calculates the square root of a numeric expression.
-Syntax: - -Sqr (Number) + +Syntax: + +Sqr (Number) -Return value: -Double -Parameters: - -Number: Any numeric expression that you want to calculate the square root for. -A square root is the number that you multiply by itself to produce another number, for example, the square root of 36 is 6. + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to calculate the square root for. +A square root is the number that you multiply by itself to produce another number, for example, the square root of 36 is 6. -Example: + +Example: -Sub ExampleSqr -Dim iVar As Single - iVar = 36 - MsgBox Sqr(iVar) -End Sub +Sub ExampleSqr +Dim iVar As Single + iVar = 36 + MsgBox Sqr(iVar) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080501.xhp b/source/text/sbasic/shared/03080501.xhp index a382ec0456..986454b855 100644 --- a/source/text/sbasic/shared/03080501.xhp +++ b/source/text/sbasic/shared/03080501.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Fix Function [Runtime] -/text/sbasic/shared/03080501.xhp - - -Sun Microsystems, Inc. - + + Fix Function [Runtime] + /text/sbasic/shared/03080501.xhp + + + +
-Fix function + + Fix function -Fix Function [Runtime] -Returns the integer value of a numeric expression by removing the fractional part of the number. + + +Fix Function [Runtime] +Returns the integer value of a numeric expression by removing the fractional part of the number.
-Syntax: - -Fix (Expression) + +Syntax: + +Fix (Expression) -Return value: -Double -Parameters: - -Expression: Numeric expression that you want to return the integer value for. + +Return value: +Double + +Parameters: + Expression: Numeric expression that you want to return the integer value for. -Example: + +Example: -Sub ExampleFix - Print Fix(3.14159) ' returns 3. - Print Fix(0) ' returns 0. - Print Fix(-3.14159) ' returns -3. -End Sub +Sub ExampleFix + Print Fix(3.14159) ' returns 3. + Print Fix(0) ' returns 0. + Print Fix(-3.14159) ' returns -3. +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080502.xhp b/source/text/sbasic/shared/03080502.xhp index 2717771e76..d3fd643bbe 100644 --- a/source/text/sbasic/shared/03080502.xhp +++ b/source/text/sbasic/shared/03080502.xhp @@ -1,7 +1,5 @@ - - - + - +--> - - -Int Function [Runtime] -/text/sbasic/shared/03080502.xhp - + + Int Function [Runtime] + /text/sbasic/shared/03080502.xhp + + + +
-Int function + + Int function -Int Function [Runtime] -Returns the integer portion of a number. + + +Int Function [Runtime] +Returns the integer portion of a number.
-Syntax: - -Int (Number) + +Syntax: + +Int (Number) -Return value: -Double -Parameters: - -Number: Any valid numeric expression. + +Return value: +Double + +Parameters: + Number: Any valid numeric expression. -Example: + +Example: -Sub ExampleInt - Print Int(3.99) ' returns the value 3 - Print Int(0) ' returns the value 0 - Print Int(-3.14159) ' returns the value -4 -End Sub +Sub ExampleInt + Print Int(3.99) ' returns the value 3 + Print Int(0) ' returns the value 0 + Print Int(-3.14159) ' returns the value -4 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080601.xhp b/source/text/sbasic/shared/03080601.xhp index 0ffbedf370..4df563df40 100644 --- a/source/text/sbasic/shared/03080601.xhp +++ b/source/text/sbasic/shared/03080601.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Abs Function [Runtime] -/text/sbasic/shared/03080601.xhp - - -Sun Microsystems, Inc. - + + Abs Function [Runtime] + /text/sbasic/shared/03080601.xhp + + + +
-Abs function + + Abs function -Abs Function [Runtime] -Returns the absolute value of a numeric expression. + + +Abs Function [Runtime] +Returns the absolute value of a numeric expression.
-Syntax: - -Abs (Number) + +Syntax: + +Abs (Number) -Return value: -Double -Parameters: - -Number: Any numeric expression that you want to return the absolute value for. Positive numbers, including 0, are returned unchanged, whereas negative numbers are converted to positive numbers. -The following example uses the Abs function to calculate the difference between two values. It does not matter which value you enter first. + +Return value: +Double + +Parameters: + Number: Any numeric expression that you want to return the absolute value for. Positive numbers, including 0, are returned unchanged, whereas negative numbers are converted to positive numbers. +The following example uses the Abs function to calculate the difference between two values. It does not matter which value you enter first. -Example: + +Example: -Sub ExampleDifference -Dim siW1 As Single -Dim siW2 As Single - siW1 = Int(InputBox("Please enter the first amount","Value Input")) - siW2 = Int(InputBox("Please enter the second amount","Value Input")) - Print "The difference is "; Abs(siW1 - siW2) -End Sub +Sub ExampleDifference +Dim siW1 As Single +Dim siW2 As Single + siW1 = Int(InputBox("Please enter the first amount","Value Input")) + siW2 = Int(InputBox("Please enter the second amount","Value Input")) + Print "The difference is "; Abs(siW1 - siW2) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080701.xhp b/source/text/sbasic/shared/03080701.xhp index 082db53d71..fa36e9ec5d 100644 --- a/source/text/sbasic/shared/03080701.xhp +++ b/source/text/sbasic/shared/03080701.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Sgn Function [Runtime] -/text/sbasic/shared/03080701.xhp - - -Sun Microsystems, Inc. - + + Sgn Function [Runtime] + /text/sbasic/shared/03080701.xhp + + + +
-Sgn function + + Sgn function -Sgn Function [Runtime] -Returns an integer number between -1 and 1 that indicates if the number that is passed to the function is positive, negative, or zero. + + +Sgn Function [Runtime] +Returns an integer number between -1 and 1 that indicates if the number that is passed to the function is positive, negative, or zero.
-Syntax: - -Sgn (Number) + +Syntax: + +Sgn (Number) -Return value: -Integer -Parameters: - -Number: Numeric expression that determines the value that is returned by the function. + +Return value: +Integer + +Parameters: + Number: Numeric expression that determines the value that is returned by the function. + - - -NumExpression - - -Return value - - - - -negative - - -Sgn returns -1. - - - - -0 - - -Sgn returns 0. - - - - -positive - - -Sgn returns 1. - - + + + NumExpression + + + Return value + + + + + negative + + + Sgn returns -1. + + + + + 0 + + + Sgn returns 0. + + + + + positive + + + Sgn returns 1. + +
+ -Example: + +Example: -Sub ExampleSgn - Print sgn(-10) ' returns -1 - Print sgn(0) ' returns 0 - Print sgn(10) ' returns 1 -End Sub +Sub ExampleSgn + Print sgn(-10) ' returns -1 + Print sgn(0) ' returns 0 + Print sgn(10) ' returns 1 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080801.xhp b/source/text/sbasic/shared/03080801.xhp index 24443d69ce..bc602c791c 100644 --- a/source/text/sbasic/shared/03080801.xhp +++ b/source/text/sbasic/shared/03080801.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Hex Function [Runtime] -/text/sbasic/shared/03080801.xhp - - -Sun Microsystems, Inc. - + + Hex Function [Runtime] + /text/sbasic/shared/03080801.xhp + + + +
-Hex function + + Hex function -Hex Function [Runtime] -Returns a string that represents the hexadecimal value of a number. + + +Hex Function [Runtime] +Returns a string that represents the hexadecimal value of a number.
-Syntax: - -Hex (Number) + +Syntax: + +Hex (Number) -Return value: -String -Parameters: - -Number: Any numeric expression that you want to convert to a hexadecimal number. + +Return value: +String + +Parameters: + Number: Any numeric expression that you want to convert to a hexadecimal number. -Example: + +Example: -Sub ExampleHex -' uses BasicFormulas in $[officename] Calc -Dim a2, b2, c2 As String - a2 = "&H3E8" - b2 = Hex2Int(a2) - MsgBox b2 - c2 = Int2Hex(b2) - MsgBox c2 -End Sub - -Function Hex2Int( sHex As String ) As Long -' Returns a long integer from a hexadecimal value. - Hex2Int = clng( sHex ) -End Function - -Function Int2Hex( iLong As Long) As String -' Calculates a hexadecimal value in integer. - Int2Hex = "&H" & Hex( iLong ) -End Function +Sub ExampleHex +' uses BasicFormulas in $[officename] Calc +Dim a2, b2, c2 As String + a2 = "&H3E8" + b2 = Hex2Int(a2) + MsgBox b2 + c2 = Int2Hex(b2) + MsgBox c2 +End Sub + +Function Hex2Int( sHex As String ) As Long +' Returns a long integer from a hexadecimal value. + Hex2Int = clng( sHex ) +End Function + +Function Int2Hex( iLong As Long) As String +' Calculates a hexadecimal value in integer. + Int2Hex = "&H" & Hex( iLong ) +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03080802.xhp b/source/text/sbasic/shared/03080802.xhp index 9d3976f3fc..b495ef3054 100644 --- a/source/text/sbasic/shared/03080802.xhp +++ b/source/text/sbasic/shared/03080802.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Oct Function [Runtime] -/text/sbasic/shared/03080802.xhp - - -Sun Microsystems, Inc. - + + Oct Function [Runtime] + /text/sbasic/shared/03080802.xhp + + + +
-Oct function + + Oct function -Oct Function [Runtime] -Returns the octal value of a number. + + +Oct Function [Runtime] +Returns the octal value of a number.
-Syntax: - -Oct (Number) + +Syntax: + +Oct (Number) -Return value: -String -Parameters: - -Number: Any numeric expression that you want to convert to an octal value. + +Return value: +String + +Parameters: + Number: Any numeric expression that you want to convert to an octal value. -Example: + +Example: -Sub ExampleOct - MsgBox Oct(255) -End Sub +Sub ExampleOct + MsgBox Oct(255) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090101.xhp b/source/text/sbasic/shared/03090101.xhp index 145285f5cf..c7f458d6d9 100644 --- a/source/text/sbasic/shared/03090101.xhp +++ b/source/text/sbasic/shared/03090101.xhp @@ -1,7 +1,5 @@ - - - + +--> - - - -If...Then...Else Statement [Runtime] -/text/sbasic/shared/03090101.xhp - + + If...Then...Else Statement [Runtime] + /text/sbasic/shared/03090101.xhp + + + +
-If statement + + If statement -If...Then...Else Statement [Runtime] -Defines one or more statement blocks that you only want to execute if a given condition is True. + + +If...Then...Else Statement [Runtime] +Defines one or more statement blocks that you only want to execute if a given condition is True.
-Syntax: + +Syntax: -If condition=true Then Statement block [ElseIf condition=true Then] Statement block [Else] Statement block EndIf +If condition=true Then Statement block [ElseIf condition=true Then] Statement block [Else] Statement block EndIf -Instead of Else If you can write ElseIf, instead of End If you can write EndIf. -Parameters: -The If...Then statement executes program blocks depending on given conditions. When $[officename] Basic encounters an If statement, the condition is tested. If the condition is True, all subsequent statements up to the next Else or ElseIf statement are executed. If the condition is False, and an ElseIf statement follows, $[officename] Basic tests the next condition and executes the following statements if the condition is True. If False, the program continues either with the next ElseIf or Else statement. Statements following Else are executed only if none of the previously tested conditions were True. After all conditions are evaluated, and the corresponding statements executed, the program continues with the statement following EndIf. -You can nest multiple If...Then statements. - -Else and ElseIf statements are optional. -You can use GoTo and GoSub to jump out of an If...Then block, but not to jump into an If...Then structure. -The following example enables you to enter the expiration date of a product, and determines if the expiration date has passed. -Example: +Instead of Else If you can write ElseIf, instead of End If you can write EndIf. + +Parameters: +The If...Then statement executes program blocks depending on given conditions. When $[officename] Basic encounters an If statement, the condition is tested. If the condition is True, all subsequent statements up to the next Else or ElseIf statement are executed. If the condition is False, and an ElseIf statement follows, $[officename] Basic tests the next condition and executes the following statements if the condition is True. If False, the program continues either with the next ElseIf or Else statement. Statements following Else are executed only if none of the previously tested conditions were True. After all conditions are evaluated, and the corresponding statements executed, the program continues with the statement following EndIf. +You can nest multiple If...Then statements. + Else and ElseIf statements are optional. +You can use GoTo and GoSub to jump out of an If...Then block, but not to jump into an If...Then structure. +The following example enables you to enter the expiration date of a product, and determines if the expiration date has passed. + +Example: -Sub ExampleIfThenDate -Dim sDate As String -Dim sToday As String - sDate = InputBox("Enter the expiration date (MM.DD.YYYY)") - sDate = Right$(sDate, 4) + Mid$(sDate, 4, 2) + Left$(sDate, 2) - sToday = Date$ - sToday = Right$(sToday, 4)+ Mid$(sToday, 4, 2) + Left$(sToday, 2) - If sDate < sToday Then - MsgBox "The expiration date has passed" - ElseIf sDate > sToday Then - MsgBox "The expiration date has not yet passed" - Else - MsgBox "The expiration date is today" - End If -End Sub +Sub ExampleIfThenDate +Dim sDate As String +Dim sToday As String + sDate = InputBox("Enter the expiration date (MM.DD.YYYY)") + sDate = Right$(sDate, 4) + Mid$(sDate, 4, 2) + Left$(sDate, 2) + sToday = Date$ + sToday = Right$(sToday, 4)+ Mid$(sToday, 4, 2) + Left$(sToday, 2) + If sDate < sToday Then + MsgBox "The expiration date has passed" + ElseIf sDate > sToday Then + MsgBox "The expiration date has not yet passed" + Else + MsgBox "The expiration date is today" + End If +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090102.xhp b/source/text/sbasic/shared/03090102.xhp index df2af98709..8819dcf1bf 100644 --- a/source/text/sbasic/shared/03090102.xhp +++ b/source/text/sbasic/shared/03090102.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Select...Case Statement [Runtime] -/text/sbasic/shared/03090102.xhp - - -Sun Microsystems, Inc. - + + Select...Case Statement [Runtime] + /text/sbasic/shared/03090102.xhp + + + +
-Select...Case statement -Case statement + + Select...Case statement + Case statement -Select...Case Statement [Runtime] -Defines one or more statement blocks depending on the value of an expression. + + +Select...Case Statement [Runtime] +Defines one or more statement blocks depending on the value of an expression.
-Syntax: - -Select Case condition Case expression Statement Block [Case expression2 Statement Block][Case Else] Statement Block End Select + +Syntax: + +Select Case condition Case expression Statement Block [Case expression2 Statement Block][Case Else] Statement Block End Select -Parameters: - -Condition: Any expression that controls if the statement block that follows the respective Case clause is executed. - -Expression: Any expression that is compatible with the Condition type expression. The statement block that follows the Case clause is executed if Condition matches Expression. -Example: + +Parameters: + Condition: Any expression that controls if the statement block that follows the respective Case clause is executed. + Expression: Any expression that is compatible with the Condition type expression. The statement block that follows the Case clause is executed if Condition matches Expression. + +Example: -Sub ExampleRandomSelect -Dim iVar As Integer - iVar = Int((15 * Rnd) -2) - Select Case iVar - Case 1 To 5 - Print "Number from 1 to 5" - Case 6, 7, 8 - Print "Number from 6 to 8" - Case 8 To 10 - Print "Greater than 8" - Case Else - Print "Out of range 1 to 10" - End Select -End Sub +Sub ExampleRandomSelect +Dim iVar As Integer + iVar = Int((15 * Rnd) -2) + Select Case iVar + Case 1 To 5 + Print "Number from 1 to 5" + Case 6, 7, 8 + Print "Number from 6 to 8" + Case 8 To 10 + Print "Greater than 8" + Case Else + Print "Out of range 1 to 10" + End Select +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090201.xhp b/source/text/sbasic/shared/03090201.xhp index 3d457f65ba..bb2ef774e0 100644 --- a/source/text/sbasic/shared/03090201.xhp +++ b/source/text/sbasic/shared/03090201.xhp @@ -1,6 +1,5 @@ - - + +--> - - -Do...Loop Statement [Runtime] -/text/sbasic/shared/03090201.xhp - - -Sun Microsystems, Inc. - + + Do...Loop Statement [Runtime] + /text/sbasic/shared/03090201.xhp + + + +
-Do...Loop statement -While; Do loop -Until -loops + + Do...Loop statement + While; Do loop + Until + loops -Do...Loop Statement [Runtime] -Repeats the statements between the Do and the Loop statement while the condition is True or until the condition becomes True. + + +Do...Loop Statement [Runtime] +Repeats the statements between the Do and the Loop statement while the condition is True or until the condition becomes True.
-Syntax -Do [{While | Until} condition = True] -statement block -[Exit Do] -statement block -Loop -or -Do -statement block -[Exit Do] -statement block -Loop [{While | Until} condition = True] -Parameters/Elements - -Condition: A comparison, numeric or string expression, that evaluates either True or False. - -Statement block: Statements that you want to repeat while or until the condition is True. -The Do...Loop statement executes a loop as long as, or until, a certain condition is True. The condition for exiting the loop must be entered following either the Do or the Loop statement. The following examples are valid combinations: -Syntax -Do While condition = True -...statement block -Loop -The statement block between the Do While and the Loop statements is repeated so long as the condition is true. -Do Until condition = True -...statement block -Loop -The statement block between the Do Until and the Loop statements is repeated if the condition so long as the condition is false. -Do -...statement block -Loop While condition = True -The statement block between the Do and the Loop statements repeats so long as the condition is true. -Do -...statement block -Loop Until condition = True -The statement block between the Do and the Loop statements repeats until the condition is true. -Use the Exit Do statement to unconditionally end the loop. You can add this statement anywhere in a Do...Loop statement. You can also define an exit condition using the If...Then structure as follows: -Do... -statements -If condition = True Then Exit Do -statements -Loop... -Example + +Syntax +Do [{While | Until} condition = True] +statement block +[Exit Do] +statement block +Loop +or +Do +statement block +[Exit Do] +statement block +Loop [{While | Until} condition = True] + +Parameters/Elements + Condition: A comparison, numeric or string expression, that evaluates either True or False. + Statement block: Statements that you want to repeat while or until the condition is True. +The Do...Loop statement executes a loop as long as, or until, a certain condition is True. The condition for exiting the loop must be entered following either the Do or the Loop statement. The following examples are valid combinations: + +Syntax +Do While condition = True +...statement block +Loop +The statement block between the Do While and the Loop statements is repeated so long as the condition is true. +Do Until condition = True +...statement block +Loop +The statement block between the Do Until and the Loop statements is repeated if the condition so long as the condition is false. +Do +...statement block +Loop While condition = True +The statement block between the Do and the Loop statements repeats so long as the condition is true. +Do +...statement block +Loop Until condition = True +The statement block between the Do and the Loop statements repeats until the condition is true. +Use the Exit Do statement to unconditionally end the loop. You can add this statement anywhere in a Do...Loop statement. You can also define an exit condition using the If...Then structure as follows: +Do... +statements +If condition = True Then Exit Do +statements +Loop... + +Example -Sub ExampleDoLoop -Dim sFile As String -Dim sPath As String - sPath = "c:\" - sFile = Dir$( sPath ,22) - If sFile <> "" Then - Do - MsgBox sFile - sFile = Dir$ - Loop Until sFile = "" - End If -End Sub +Sub ExampleDoLoop +Dim sFile As String +Dim sPath As String + sPath = "c:\" + sFile = Dir$( sPath ,22) + If sFile <> "" Then + Do + MsgBox sFile + sFile = Dir$ + Loop Until sFile = "" + End If +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090202.xhp b/source/text/sbasic/shared/03090202.xhp index fb9945697a..4ac247a567 100644 --- a/source/text/sbasic/shared/03090202.xhp +++ b/source/text/sbasic/shared/03090202.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -For...Next Statement [Runtime] -/text/sbasic/shared/03090202.xhp - - -Sun Microsystems, Inc. - + + For...Next Statement [Runtime] + /text/sbasic/shared/03090202.xhp + + + +
-For statement -To statement -Step statement -Next statement + + For statement + To statement + Step statement + Next statement -For...Next Statement [Runtime] -Repeats the statements between the For...Next block a specified number of times. + + +For...Next Statement [Runtime] +Repeats the statements between the For...Next block a specified number of times.
-Syntax: - -For counter=start To end [Step step] -statement block -[Exit For] -statement block -Next [counter] + +Syntax: + +For counter=start To end [Step step] +statement block +[Exit For] +statement block +Next [counter] -Variables: - -Counter: Loop counter initially assigned the value to the right of the equal sign (start). Only numeric variables are valid. The loop counter increases or decreases according to the variable Step until End is passed. - -Start: Numeric variable that defines the initial value at the beginning of the loop. - -End: Numeric variable that defines the final value at the end of the loop. - -Step: Sets the value by which to increase or decrease the loop counter. If Step is not specified, the loop counter is incremented by 1. In this case, End must be greater than Start. If you want to decrease Counter, End must be less than Start, and Step must be assigned a negative value. -The For...Next loop repeats all of the statements in the loop for the number of times that is specified by the parameters. -As the counter variable is decreased, $[officename] Basic checks if the end value has been reached. As soon as the counter passes the end value, the loop automatically ends. -It is possible to nest For...Next statements. If you do not specify a variable following the Next statement, Next automatically refers to the most recent For statement. -If you specify an increment of 0, the statements between For and Next are repeated continuously. -When counting down the counter variable, $[officename] Basic checks for overflow or underflow. The loop ends when Counter exceeds End (positive Step value) or is less than End (negative Step value). -Use the Exit For statement to exit the loop unconditionally. This statement must be within a For...Next loop. Use the If...Then statement to test the exit condition as follows: -For... -statements -If condition = True Then Exit For -statements -Next -Note: In nested For...Next loops, if you exit a loop unconditionally with Exit For, only one loop is exited. -Example -The following example uses two nested loops to sort a string array with 10 elements ( sEntry() ), that are first filled with various contents: + +Variables: + Counter: Loop counter initially assigned the value to the right of the equal sign (start). Only numeric variables are valid. The loop counter increases or decreases according to the variable Step until End is passed. + Start: Numeric variable that defines the initial value at the beginning of the loop. + End: Numeric variable that defines the final value at the end of the loop. + Step: Sets the value by which to increase or decrease the loop counter. If Step is not specified, the loop counter is incremented by 1. In this case, End must be greater than Start. If you want to decrease Counter, End must be less than Start, and Step must be assigned a negative value. +The For...Next loop repeats all of the statements in the loop for the number of times that is specified by the parameters. +As the counter variable is decreased, $[officename] Basic checks if the end value has been reached. As soon as the counter passes the end value, the loop automatically ends. +It is possible to nest For...Next statements. If you do not specify a variable following the Next statement, Next automatically refers to the most recent For statement. +If you specify an increment of 0, the statements between For and Next are repeated continuously. +When counting down the counter variable, $[officename] Basic checks for overflow or underflow. The loop ends when Counter exceeds End (positive Step value) or is less than End (negative Step value). +Use the Exit For statement to exit the loop unconditionally. This statement must be within a For...Next loop. Use the If...Then statement to test the exit condition as follows: +For... +statements +If condition = True Then Exit For +statements +Next +Note: In nested For...Next loops, if you exit a loop unconditionally with Exit For, only one loop is exited. + +Example +The following example uses two nested loops to sort a string array with 10 elements ( sEntry() ), that are first filled with various contents: -Sub ExampleSort -Dim sEntry(9) As String -Dim iCount As Integer -Dim iCount2 As Integer -Dim sTemp As String - sEntry(0) = "Jerry" - sEntry(1) = "Patty" - sEntry(2) = "Kurt" - sEntry(3) = "Thomas" - sEntry(4) = "Michael" - sEntry(5) = "David" - sEntry(6) = "Cathy" - sEntry(7) = "Susie" - sEntry(8) = "Edward" - sEntry(9) = "Christine" - For iCount = 0 To 9 - For iCount2 = iCount + 1 To 9 - If sEntry(iCount) > sEntry(iCount2) Then - sTemp = sEntry(iCount) - sEntry(iCount) = sEntry(iCount2) - sEntry(iCount2) = sTemp - End If - Next iCount2 - Next iCount - For iCount = 0 To 9 - Print sEntry(iCount) - Next iCount -End Sub +Sub ExampleSort +Dim sEntry(9) As String +Dim iCount As Integer +Dim iCount2 As Integer +Dim sTemp As String + sEntry(0) = "Jerry" + sEntry(1) = "Patty" + sEntry(2) = "Kurt" + sEntry(3) = "Thomas" + sEntry(4) = "Michael" + sEntry(5) = "David" + sEntry(6) = "Cathy" + sEntry(7) = "Susie" + sEntry(8) = "Edward" + sEntry(9) = "Christine" + For iCount = 0 To 9 + For iCount2 = iCount + 1 To 9 + If sEntry(iCount) > sEntry(iCount2) Then + sTemp = sEntry(iCount) + sEntry(iCount) = sEntry(iCount2) + sEntry(iCount2) = sTemp + End If + Next iCount2 + Next iCount + For iCount = 0 To 9 + Print sEntry(iCount) + Next iCount +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090301.xhp b/source/text/sbasic/shared/03090301.xhp index 3b902076b8..11b229731b 100644 --- a/source/text/sbasic/shared/03090301.xhp +++ b/source/text/sbasic/shared/03090301.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -GoSub...Return Statement [Runtime] -/text/sbasic/shared/03090301.xhp - - -Sun Microsystems, Inc. - + + GoSub...Return Statement [Runtime] + /text/sbasic/shared/03090301.xhp + + + +
-GoSub...Return statement + + GoSub...Return statement -GoSub...Return Statement [Runtime] -Calls a subroutine that is indicated by a label from a subroutine or a function. The statements following the label are executed until the next Return statement. Afterwards, the program continues with the statement that follows the GoSub statement. + + +GoSub...Return Statement [Runtime] +Calls a subroutine that is indicated by a label from a subroutine or a function. The statements following the label are executed until the next Return statement. Afterwards, the program continues with the statement that follows the GoSub statement.
-Syntax: - -see Parameters + +Syntax: + +see Parameters -Parameters: -Sub/Function -statement block - Label -statement block -GoSub Label -Exit Sub/Function -Label: -statement block -Return -End Sub/Function -The GoSub statement calls a local subroutine indicated by a label from within a subroutine or a function. The name of the label must end with a colon (":"). -If the program encounters a Return statement not preceded by GoSub, $[officename] Basic returns an error message. Use Exit Sub or Exit Function to ensure that the program leaves a Sub or Function before reaching the next Return statement. -The following example demonstrates the use of GoSub and Return. By executing a program section twice, the program calculates the square root of two numbers that are entered by the user. -Example: + +Parameters: +Sub/Function +statement block + Label +statement block +GoSub Label +Exit Sub/Function +Label: +statement block +Return +End Sub/Function +The GoSub statement calls a local subroutine indicated by a label from within a subroutine or a function. The name of the label must end with a colon (":"). +If the program encounters a Return statement not preceded by GoSub, $[officename] Basic returns an error message. Use Exit Sub or Exit Function to ensure that the program leaves a Sub or Function before reaching the next Return statement. +The following example demonstrates the use of GoSub and Return. By executing a program section twice, the program calculates the square root of two numbers that are entered by the user. + +Example: -Sub ExampleGoSub -Dim iInputa As Single -Dim iInputb As Single -Dim iInputc As Single - iInputa = Int(InputBox("Enter the first number: ","NumberInput")) - iInputb = Int(InputBox("Enter the second number: ","NumberInput")) - iInputc=iInputa - GoSub SquareRoot - Print "The square root of";iInputa;" is";iInputc - iInputc=iInputb - GoSub SquareRoot - Print "The square root of";iInputb;" is";iInputc - Exit Sub -SquareRoot: - iInputc=sqr(iInputc) - Return -End Sub +Sub ExampleGoSub +Dim iInputa As Single +Dim iInputb As Single +Dim iInputc As Single + iInputa = Int(InputBox("Enter the first number: ","NumberInput")) + iInputb = Int(InputBox("Enter the second number: ","NumberInput")) + iInputc=iInputa + GoSub SquareRoot + Print "The square root of";iInputa;" is";iInputc + iInputc=iInputb + GoSub SquareRoot + Print "The square root of";iInputb;" is";iInputc + Exit Sub +SquareRoot: + iInputc=sqr(iInputc) + Return +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090303.xhp b/source/text/sbasic/shared/03090303.xhp index 7443690064..d64d0afdb7 100644 --- a/source/text/sbasic/shared/03090303.xhp +++ b/source/text/sbasic/shared/03090303.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -On...GoSub Statement; On...GoTo Statement [Runtime] -/text/sbasic/shared/03090303.xhp - - -Sun Microsystems, Inc. - + + On...GoSub Statement; On...GoTo Statement [Runtime] + /text/sbasic/shared/03090303.xhp + + + +
-On...GoSub statement -On...GoTo statement + + On...GoSub statement + On...GoTo statement -On...GoSub Statement; On...GoTo Statement [Runtime] -Branches to one of several specified lines in the program code, depending on the value of a numeric expression. + + +On...GoSub Statement; On...GoTo Statement [Runtime] +Branches to one of several specified lines in the program code, depending on the value of a numeric expression.
-Syntax: - -On N GoSub Label1[, Label2[, Label3[,...]]] -On NumExpression GoTo Label1[, Label2[, Label3[,...]]] + +Syntax: + +On N GoSub Label1[, Label2[, Label3[,...]]] +On NumExpression GoTo Label1[, Label2[, Label3[,...]]] -Parameters: - -NumExpression: Any numeric expression between 0 and 255 that determines which of the lines the program branches to. If NumExpression is 0, the statement is not executed. If NumExpression is greater than 0, the program jumps to the label that has a position number that corresponds to the expression (1 = First label; 2 = Second label) - -Label: Target line according to GoTo or GoSub structure. -The GoTo or GoSub conventions are valid. -Example: + +Parameters: + NumExpression: Any numeric expression between 0 and 255 that determines which of the lines the program branches to. If NumExpression is 0, the statement is not executed. If NumExpression is greater than 0, the program jumps to the label that has a position number that corresponds to the expression (1 = First label; 2 = Second label) + Label: Target line according to GoTo or GoSub structure. +The GoTo or GoSub conventions are valid. + +Example: -Sub ExampleOnGosub -Dim iVar As Integer -Dim sVar As String - iVar = 2 - sVar ="" - On iVar GoSub Sub1, Sub2 - On iVar GoTo Line1, Line2 - Exit Sub -Sub1: - sVar =sVar & " From Sub 1 to" : Return -Sub2: - sVar =sVar & " From Sub 2 to" : Return -Line1: - sVar =sVar & " Label 1" : GoTo Ende -Line2: - sVar =sVar & " Label 2" -Ende: - MsgBox sVar,0,"On...GoSub" -End Sub +Sub ExampleOnGosub +Dim iVar As Integer +Dim sVar As String + iVar = 2 + sVar ="" + On iVar GoSub Sub1, Sub2 + On iVar GoTo Line1, Line2 + Exit Sub +Sub1: + sVar =sVar & " From Sub 1 to" : Return +Sub2: + sVar =sVar & " From Sub 2 to" : Return +Line1: + sVar =sVar & " Label 1" : GoTo Ende +Line2: + sVar =sVar & " Label 2" +Ende: + MsgBox sVar,0,"On...GoSub" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090402.xhp b/source/text/sbasic/shared/03090402.xhp index 2d66f30ad2..8cec6a9e38 100644 --- a/source/text/sbasic/shared/03090402.xhp +++ b/source/text/sbasic/shared/03090402.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Choose Function [Runtime] -/text/sbasic/shared/03090402.xhp - - -Sun Microsystems, Inc. - + + Choose Function [Runtime] + /text/sbasic/shared/03090402.xhp + + + +
-Choose function + + Choose function -Choose Function [Runtime] -Returns a selected value from a list of arguments. + + +Choose Function [Runtime] +Returns a selected value from a list of arguments.
-Syntax: - -Choose (Index, Selection1[, Selection2, ... [,Selection_n]]) + +Syntax: + +Choose (Index, Selection1[, Selection2, ... [,Selection_n]]) -Parameters: - -Index: A numeric expression that specifies the value to return. - -Selection1: Any expression that contains one of the possible choices. -The Choose function returns a value from the list of expressions based on the index value. If Index = 1, the function returns the first expression in the list, if index i= 2, it returns the second expression, and so on. -If the index value is less than 1 or greater than the number of expressions listed, the function returns a Null value. -The following example uses the Choose function to select a string from several strings that form a menu: + +Parameters: + Index: A numeric expression that specifies the value to return. + Selection1: Any expression that contains one of the possible choices. +The Choose function returns a value from the list of expressions based on the index value. If Index = 1, the function returns the first expression in the list, if index i= 2, it returns the second expression, and so on. +If the index value is less than 1 or greater than the number of expressions listed, the function returns a Null value. +The following example uses the Choose function to select a string from several strings that form a menu: -Example: + +Example: -Sub ExampleChoose -Dim sReturn As String - sReturn = ChooseMenu(2) - Print sReturn -End Sub - -Function ChooseMenu(Index As Integer) - ChooseMenu = Choose(Index, "Quick Format", "Save Format", "System Format") -End Function +Sub ExampleChoose +Dim sReturn As String + sReturn = ChooseMenu(2) + Print sReturn +End Sub + +Function ChooseMenu(Index As Integer) + ChooseMenu = Choose(Index, "Quick Format", "Save Format", "System Format") +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090403.xhp b/source/text/sbasic/shared/03090403.xhp index 2d0d53704f..d7f6ff0db9 100644 --- a/source/text/sbasic/shared/03090403.xhp +++ b/source/text/sbasic/shared/03090403.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Declare Statement [Runtime] -/text/sbasic/shared/03090403.xhp - - -Sun Microsystems, Inc. - + + Declare Statement [Runtime] + /text/sbasic/shared/03090403.xhp + + + +
-Declare statement + + Declare statement -Declare Statement [Runtime] -DLL (Dynamic Link Library) + + +Declare Statement [Runtime] + + DLL (Dynamic Link Library) -Declares and defines a subroutine in a DLL file that you want to execute from $[officename] Basic. + +Declares and defines a subroutine in a DLL file that you want to execute from $[officename] Basic.
-See also: FreeLibrary -Syntax: - -Declare {Sub | Function} Name Lib "Libname" [Alias "Aliasname"] [Parameter] [As Type] +See also: FreeLibrary + +Syntax: + +Declare {Sub | Function} Name Lib "Libname" [Alias "Aliasname"] [Parameter] [As Type] -Parameters: - -Name: A different name than defined in the DLL, to call the subroutine from $[officename] Basic. - -Aliasname: Name of the subroutine as defined in the DLL. - -Libname: File or system name of the DLL. This library is automatically loaded the first time the function is used. - -Argumentlist: List of parameters representing arguments that are passed to the procedure when it is called. The type and number of parameters is dependent on the executed procedure. - -Type: Defines the data type of the value that is returned by a function procedure. You can exclude this parameter if a type-declaration character is entered after the name. -To pass a parameter to a subroutine as a value instead of as a reference, the parameter must be indicated by the keyword ByVal. -Example: + +Parameters: + Name: A different name than defined in the DLL, to call the subroutine from $[officename] Basic. + Aliasname: Name of the subroutine as defined in the DLL. + Libname: File or system name of the DLL. This library is automatically loaded the first time the function is used. + Argumentlist: List of parameters representing arguments that are passed to the procedure when it is called. The type and number of parameters is dependent on the executed procedure. + Type: Defines the data type of the value that is returned by a function procedure. You can exclude this parameter if a type-declaration character is entered after the name. +To pass a parameter to a subroutine as a value instead of as a reference, the parameter must be indicated by the keyword ByVal. + +Example: -Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long ) -Sub ExampleDeclare -Dim lValue As Long - lValue = 5000 - MyMessageBeep( lValue ) - FreeLibrary("user32.dll" ) -End Sub +Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long ) +Sub ExampleDeclare +Dim lValue As Long + lValue = 5000 + MyMessageBeep( lValue ) + FreeLibrary("user32.dll" ) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090404.xhp b/source/text/sbasic/shared/03090404.xhp index c8538e8a63..a85296ab0d 100644 --- a/source/text/sbasic/shared/03090404.xhp +++ b/source/text/sbasic/shared/03090404.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -End Statement [Runtime] -/text/sbasic/shared/03090404.xhp - - -Sun Microsystems, Inc. - + + End Statement [Runtime] + /text/sbasic/shared/03090404.xhp + + + +
-End statement + + End statement -End Statement [Runtime] -Ends a procedure or block. + + +End Statement [Runtime] +Ends a procedure or block.
-Syntax: - -End, End Function, End If, End Select, End Sub + +Syntax: + +End, End Function, End If, End Select, End Sub -Parameters: -Use the End statement as follows: -Statement -End: Is not required, but can be entered anywhere within a procedure to end the program execution. -End Function: Ends a Function statement. -End If: Marks the end of a If...Then...Else block. -End Select: Marks the end of a Select Case block. -End Sub: Ends a Sub statement. -Example: + +Parameters: +Use the End statement as follows: + +Statement +End: Is not required, but can be entered anywhere within a procedure to end the program execution. +End Function: Ends a Function statement. +End If: Marks the end of a If...Then...Else block. +End Select: Marks the end of a Select Case block. +End Sub: Ends a Sub statement. + +Example: -Sub ExampleRandomSelect -Dim iVar As Integer - iVar = Int((15 * Rnd) -2) - Select Case iVar - Case 1 To 5 - Print "Number from 1 to 5" - Case 6, 7, 8 - Print "Number from 6 to 8" - Case Is > 8 And iVar < 11 - Print "Greater than 8" - Case Else - Print "Outside range 1 to 10" - End Select -End Sub +Sub ExampleRandomSelect +Dim iVar As Integer + iVar = Int((15 * Rnd) -2) + Select Case iVar + Case 1 To 5 + Print "Number from 1 to 5" + Case 6, 7, 8 + Print "Number from 6 to 8" + Case Is > 8 And iVar < 11 + Print "Greater than 8" + Case Else + Print "Outside range 1 to 10" + End Select +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090405.xhp b/source/text/sbasic/shared/03090405.xhp index eb2b030bd5..954d084e31 100644 --- a/source/text/sbasic/shared/03090405.xhp +++ b/source/text/sbasic/shared/03090405.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -FreeLibrary Function [Runtime] -/text/sbasic/shared/03090405.xhp - - -Sun Microsystems, Inc. - + + FreeLibrary Function [Runtime] + /text/sbasic/shared/03090405.xhp + + + +
-FreeLibrary function + + FreeLibrary function -FreeLibrary Function [Runtime] -Releases DLLs that were loaded by a Declare statement. A released DLL is automatically reloaded if one of its functions is called. See also: Declare + + +FreeLibrary Function [Runtime] +Releases DLLs that were loaded by a Declare statement. A released DLL is automatically reloaded if one of its functions is called. See also: Declare
-Syntax: - -FreeLibrary (LibName As String) + +Syntax: + +FreeLibrary (LibName As String) -Parameters: - -LibName: String expression that specifies the name of the DLL. -FreeLibrary can only release DLLs that are loaded during Basic runtime. + +Parameters: + LibName: String expression that specifies the name of the DLL. +FreeLibrary can only release DLLs that are loaded during Basic runtime. -Example: + +Example: -Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long ) -Sub ExampleDeclare -Dim lValue As Long - lValue = 5000 - MyMessageBeep( lValue ) - FreeLibrary("user32.dll" ) -End Sub +Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long ) +Sub ExampleDeclare +Dim lValue As Long + lValue = 5000 + MyMessageBeep( lValue ) + FreeLibrary("user32.dll" ) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090406.xhp b/source/text/sbasic/shared/03090406.xhp index 4e4d9878f4..019383516f 100644 --- a/source/text/sbasic/shared/03090406.xhp +++ b/source/text/sbasic/shared/03090406.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Function Statement [Runtime] -/text/sbasic/shared/03090406.xhp - - -Sun Microsystems, Inc. - + + Function Statement [Runtime] + /text/sbasic/shared/03090406.xhp + + + +
-Function statement + + Function statement -Function Statement [Runtime] -Defines a subroutine that can be used as an expression to determine a return type. + + +Function Statement [Runtime] +Defines a subroutine that can be used as an expression to determine a return type.
-Syntax -see Parameter -Parameters: -Syntax -Function Name[(VarName1 [As Type][, VarName2 [As Type][,...]]]) [As Type] -statement block -[Exit Function] -statement block -End Function -Parameter - -Name: Name of the subroutine to contain the value returned by the function. - -VarName: Parameter to be passed to the subroutine. - -Type: Type-declaration keyword. -Example: + +Syntax +see Parameter + +Parameters: +Syntax +Function Name[(VarName1 [As Type][, VarName2 [As Type][,...]]]) [As Type] +statement block +[Exit Function] +statement block +End Function +Parameter + Name: Name of the subroutine to contain the value returned by the function. + VarName: Parameter to be passed to the subroutine. + Type: Type-declaration keyword. + +Example: -Sub ExampleExit -Dim sReturn As String -Dim sListArray(10) As String -Dim siStep As Single - For siStep = 0 To 10 ' Fill array with test data - sListArray(siStep) = chr$(siStep + 65) - MsgBox sListArray(siStep) - Next siStep - sReturn = LinSearch(sListArray(), "B") - Print sReturn -End Sub - -Function LinSearch( sList(), sItem As String ) As Integer -Dim iCount As Integer -' Linsearch searches a TextArray:sList() for a TextEntry: -' Return value Is the index of the entry Or 0 (Null) - For iCount=1 To Ubound( sList() ) - If sList( iCount ) = sItem Then - Exit For ' sItem found - End If - Next iCount - If iCount = Ubound( sList() ) Then iCount = 0 - LinSearch = iCount -End Function +Sub ExampleExit +Dim sReturn As String +Dim sListArray(10) As String +Dim siStep As Single + For siStep = 0 To 10 ' Fill array with test data + sListArray(siStep) = chr$(siStep + 65) + MsgBox sListArray(siStep) + Next siStep + sReturn = LinSearch(sListArray(), "B") + Print sReturn +End Sub + +Function LinSearch( sList(), sItem As String ) As Integer +Dim iCount As Integer +' Linsearch searches a TextArray:sList() for a TextEntry: +' Return value Is the index of the entry Or 0 (Null) + For iCount=1 To Ubound( sList() ) + If sList( iCount ) = sItem Then + Exit For ' sItem found + End If + Next iCount + If iCount = Ubound( sList() ) Then iCount = 0 + LinSearch = iCount +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090407.xhp b/source/text/sbasic/shared/03090407.xhp index 9562d8e0f9..c3bd9e84fe 100644 --- a/source/text/sbasic/shared/03090407.xhp +++ b/source/text/sbasic/shared/03090407.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Rem Statement [Runtime] -/text/sbasic/shared/03090407.xhp - - -Sun Microsystems, Inc. - + + Rem Statement [Runtime] + /text/sbasic/shared/03090407.xhp + + + +
-Rem statement -comments;Rem statement + + Rem statement + comments;Rem statement -Rem Statement [Runtime] -Specifies that a program line is a comment. + + +Rem Statement [Runtime] +Specifies that a program line is a comment.
-Syntax: - -Rem Text + +Syntax: + +Rem Text -Parameters: - -Text: Any text that serves as a comment. -You can use the single quotation mark instead of the Rem keyword to indicate that the text on a line is comments. This symbol can be inserted directly to the right of the program code, followed by a comment. -You can use a space followed by the underline character _ as the last two characters of a line to continue the logical line on the next line. To continue comment lines, you must enter "Option Compatible" in the same Basic module. -Example: + +Parameters: + Text: Any text that serves as a comment. +You can use the single quotation mark instead of the Rem keyword to indicate that the text on a line is comments. This symbol can be inserted directly to the right of the program code, followed by a comment. +You can use a space followed by the underline character _ as the last two characters of a line to continue the logical line on the next line. To continue comment lines, you must enter "Option Compatible" in the same Basic module. + +Example: -Sub ExampleMid -Dim sVar As String - sVar = "Las Vegas" - Print Mid(sVar,3,5) ' Returns "s Veg" - ' Nothing occurs here -End Sub +Sub ExampleMid +Dim sVar As String + sVar = "Las Vegas" + Print Mid(sVar,3,5) ' Returns "s Veg" + ' Nothing occurs here +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090408.xhp b/source/text/sbasic/shared/03090408.xhp index a533e7c91d..1cb284a6a7 100644 --- a/source/text/sbasic/shared/03090408.xhp +++ b/source/text/sbasic/shared/03090408.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Stop Statement [Runtime] -/text/sbasic/shared/03090408.xhp - - -Sun Microsystems, Inc. - + + Stop Statement [Runtime] + /text/sbasic/shared/03090408.xhp + + + +
-Stop statement + + Stop statement -Stop Statement [Runtime] -Stops the execution of the Basic program. + + +Stop Statement [Runtime] +Stops the execution of the Basic program.
-Syntax: - -Stop + +Syntax: + +Stop -Example: + +Example: -Sub ExampleStop -Dim iVar As Single - iVar = 36 - Stop - MsgBox Sqr(iVar) -End Sub +Sub ExampleStop +Dim iVar As Single + iVar = 36 + Stop + MsgBox Sqr(iVar) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090409.xhp b/source/text/sbasic/shared/03090409.xhp index 4516be6a20..a1aac7bfc5 100644 --- a/source/text/sbasic/shared/03090409.xhp +++ b/source/text/sbasic/shared/03090409.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Sub Statement [Runtime] -/text/sbasic/shared/03090409.xhp - - -Sun Microsystems, Inc. - + + Sub Statement [Runtime] + /text/sbasic/shared/03090409.xhp + + + +
-Sub statement + + Sub statement -Sub Statement [Runtime] -Defines a subroutine. + + +Sub Statement [Runtime] +Defines a subroutine.
-Syntax + +Syntax -Sub Name[(VarName1 [As Type][, VarName2 [As Type][,...]])] -statement block -End Sub +Sub Name[(VarName1 [As Type][, VarName2 [As Type][,...]])] +statement block +End Sub -Parameters: - -Name: Name of the subroutine . - -VarName: Parameter that you want to pass to the subroutine. - -Type: Type-declaration key word. -Example: + +Parameters: + Name: Name of the subroutine . + VarName: Parameter that you want to pass to the subroutine. + Type: Type-declaration key word. + +Example: -Sub Example - ' some statements -End Sub +Sub Example + ' some statements +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090410.xhp b/source/text/sbasic/shared/03090410.xhp index da9e03fb35..fa48227a15 100644 --- a/source/text/sbasic/shared/03090410.xhp +++ b/source/text/sbasic/shared/03090410.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Switch Function [Runtime] -/text/sbasic/shared/03090410.xhp - - -Sun Microsystems, Inc. - + + Switch Function [Runtime] + /text/sbasic/shared/03090410.xhp + + + +
-Switch function + + Switch function -Switch Function [Runtime] -Evaluates a list of arguments, consisting of an expression followed by a value. The Switch function returns a value that is associated with the expression that is passed by this function. + + +Switch Function [Runtime] +Evaluates a list of arguments, consisting of an expression followed by a value. The Switch function returns a value that is associated with the expression that is passed by this function.
-Syntax: - -Switch (Expression1, Value1[, Expression2, Value2[..., Expression_n, Value_n]]) + +Syntax: + +Switch (Expression1, Value1[, Expression2, Value2[..., Expression_n, Value_n]]) -Parameters: -The Switch function evaluates the expressions from left to right, and then returns the value that is assigned to the function expression. If expression and value are not given as a pair, a runtime error occurs. - -Expression: The expression that you want to evaluate. - -Value: The value that you want to return if the expression is True. -In the following example, the Switch function assigns the appropriate gender to the name that is passed to the function: + +Parameters: +The Switch function evaluates the expressions from left to right, and then returns the value that is assigned to the function expression. If expression and value are not given as a pair, a runtime error occurs. + Expression: The expression that you want to evaluate. + Value: The value that you want to return if the expression is True. +In the following example, the Switch function assigns the appropriate gender to the name that is passed to the function: -Example: + +Example: -Sub ExampleSwitch -Dim sGender As String - sGender = GetGenderIndex( "John" ) - MsgBox sGender -End Sub - -Function GetGenderIndex (sName As String) As String - GetGenderIndex = Switch(sName = "Jane", "female", sName = "John", "male") -End Function +Sub ExampleSwitch +Dim sGender As String + sGender = GetGenderIndex( "John" ) + MsgBox sGender +End Sub + +Function GetGenderIndex (sName As String) As String + GetGenderIndex = Switch(sName = "Jane", "female", sName = "John", "male") +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03090412.xhp b/source/text/sbasic/shared/03090412.xhp index 382baf1de9..087f5c54b7 100644 --- a/source/text/sbasic/shared/03090412.xhp +++ b/source/text/sbasic/shared/03090412.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Exit Statement [Runtime] -/text/sbasic/shared/03090412.xhp - - -Sun Microsystems, Inc. - + + Exit Statement [Runtime] + /text/sbasic/shared/03090412.xhp + + + +
-Exit statement + + Exit statement -Exit Statement [Runtime] -Exits a Do...Loop, For...Next, a function, or a subroutine. + + +Exit Statement [Runtime] +Exits a Do...Loop, For...Next, a function, or a subroutine.
-Syntax: - -see Parameters + +Syntax: + +see Parameters -Parameters: - -Exit Do - -Only valid within a Do...Loop statement to exit the loop. Program execution continues with the statement that follows the Loop statement. If Do...Loop statements are nested, the control is transferred to the loop in the next higher level. - -Exit For - -Only valid within a For...Next loop to exit the loop. Program execution continues with the first statement that follows the Next statement. In nested statements, the control is transferred to the loop in the next higher level. - -Exit Function - -Exits the Function procedure immediately. Program execution continues with the statement that follows the Function call. - -Exit Sub - -Exits the subroutine immediately. Program execution continues with the statement that follows the Sub call. -The Exit statement does not define the end of a structure, and must not be confused with the End statement. -Example: + +Parameters: + Exit Do +Only valid within a Do...Loop statement to exit the loop. Program execution continues with the statement that follows the Loop statement. If Do...Loop statements are nested, the control is transferred to the loop in the next higher level. + Exit For +Only valid within a For...Next loop to exit the loop. Program execution continues with the first statement that follows the Next statement. In nested statements, the control is transferred to the loop in the next higher level. + Exit Function +Exits the Function procedure immediately. Program execution continues with the statement that follows the Function call. + Exit Sub +Exits the subroutine immediately. Program execution continues with the statement that follows the Sub call. +The Exit statement does not define the end of a structure, and must not be confused with the End statement. + +Example: -Sub ExampleExit -Dim sReturn As String -Dim sListArray(10) As String -Dim siStep As Single - For siStep = 0 To 10 ' Fill array with test data - sListArray(siStep) = chr(siStep + 65) - MsgBox sListArray(siStep) - Next siStep - sReturn = LinSearch(sListArray(), "B") - Print sReturn -End Sub - -Function LinSearch( sList(), sItem As String ) As Integer -Dim iCount As Integer -' LinSearch searches a TextArray:sList() for a TextEntry: -' Returns the index of the entry or 0 (Null) - For iCount=1 To Ubound( sList() ) - If sList( iCount ) = sItem Then - Exit For ' sItem found - End If - Next iCount - If iCount = Ubound( sList() ) Then iCount = 0 - LinSearch = iCount -End Function +Sub ExampleExit +Dim sReturn As String +Dim sListArray(10) As String +Dim siStep As Single + For siStep = 0 To 10 ' Fill array with test data + sListArray(siStep) = chr(siStep + 65) + MsgBox sListArray(siStep) + Next siStep + sReturn = LinSearch(sListArray(), "B") + Print sReturn +End Sub + +Function LinSearch( sList(), sItem As String ) As Integer +Dim iCount As Integer +' LinSearch searches a TextArray:sList() for a TextEntry: +' Returns the index of the entry or 0 (Null) + For iCount=1 To Ubound( sList() ) + If sList( iCount ) = sItem Then + Exit For ' sItem found + End If + Next iCount + If iCount = Ubound( sList() ) Then iCount = 0 + LinSearch = iCount +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03100100.xhp b/source/text/sbasic/shared/03100100.xhp index acd93cad43..d8fb8357ea 100644 --- a/source/text/sbasic/shared/03100100.xhp +++ b/source/text/sbasic/shared/03100100.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CBool Function [Runtime] -/text/sbasic/shared/03100100.xhp - - -Sun Microsystems, Inc. - + + CBool Function [Runtime] + /text/sbasic/shared/03100100.xhp + + + +
-CBool function + + CBool function -CBool Function [Runtime] -Converts a string comparison or numeric comparison to a Boolean expression, or converts a single numeric expression to a Boolean expression. + + +CBool Function [Runtime] +Converts a string comparison or numeric comparison to a Boolean expression, or converts a single numeric expression to a Boolean expression.
-Syntax: - -CBool (Expression1 {= | <> | < | > | <= | >=} Expression2) or CBool (Number) + +Syntax: + +CBool (Expression1 {= | <> | < | > | <= | >=} Expression2) or CBool (Number) -Return value: -Bool -Parameters: - -Expression1, Expression2: Any string or numeric expressions that you want to compare. If the expressions match, the CBool function returns True, otherwise False is returned. - -Number: Any numeric expression that you want to convert. If the expression equals 0, False is returned, otherwise True is returned. -The following example uses the CBool function to evaluate the value that is returned by the Instr function. The function checks if the word "and" is found in the sentence that was entered by the user. + +Return value: +Bool + +Parameters: + Expression1, Expression2: Any string or numeric expressions that you want to compare. If the expressions match, the CBool function returns True, otherwise False is returned. + Number: Any numeric expression that you want to convert. If the expression equals 0, False is returned, otherwise True is returned. +The following example uses the CBool function to evaluate the value that is returned by the Instr function. The function checks if the word "and" is found in the sentence that was entered by the user. -Example: + +Example: -Sub ExampleCBool -Dim sText As String - sText = InputBox("Please enter a short sentence:") - ' Proof if the word »and« appears in the sentence. - ' Instead of the command line - ' If Instr(Input, "and")<>0 Then... - ' the CBool function is applied as follows: - If CBool(Instr(sText, "and")) Then - MsgBox "The word »and« appears in the sentence you entered!" - EndIf -End Sub +Sub ExampleCBool +Dim sText As String + sText = InputBox("Please enter a short sentence:") + ' Proof if the word »and« appears in the sentence. + ' Instead of the command line + ' If Instr(Input, "and")<>0 Then... + ' the CBool function is applied as follows: + If CBool(Instr(sText, "and")) Then + MsgBox "The word »and« appears in the sentence you entered!" + EndIf +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03100300.xhp b/source/text/sbasic/shared/03100300.xhp index 339e9a4e9b..67e80eb4a6 100644 --- a/source/text/sbasic/shared/03100300.xhp +++ b/source/text/sbasic/shared/03100300.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CDate Function [Runtime] -/text/sbasic/shared/03100300.xhp - - -Sun Microsystems, Inc. - + + CDate Function [Runtime] + /text/sbasic/shared/03100300.xhp + + + +
-CDate function + + CDate function -CDate Function [Runtime] -Converts any string or numeric expression to a date value. + + +CDate Function [Runtime] +Converts any string or numeric expression to a date value.
-Syntax: - -CDate (Expression) + +Syntax: + +CDate (Expression) -Return value: -Date -Parameters: - -Expression: Any string or numeric expression that you want to convert. -When you convert a string expression, the date and time must be entered in the format MM.DD.YYYY HH.MM.SS, as defined by the DateValue and TimeValue function conventions. In numeric expressions, values to the left of the decimal represent the date, beginning from December 31, 1899. Values to the right of the decimal represent the time. + +Return value: +Date + +Parameters: + Expression: Any string or numeric expression that you want to convert. +When you convert a string expression, the date and time must be entered in the format MM.DD.YYYY HH.MM.SS, as defined by the DateValue and TimeValue function conventions. In numeric expressions, values to the left of the decimal represent the date, beginning from December 31, 1899. Values to the right of the decimal represent the time. -Example: + +Example: -Sub ExampleCDate - MsgBox cDate(1000.25) ' 09.26.1902 06:00:00 - MsgBox cDate(1001.26) ' 09.27.1902 06:14:24 -End Sub +Sub ExampleCDate + MsgBox cDate(1000.25) ' 09.26.1902 06:00:00 + MsgBox cDate(1001.26) ' 09.27.1902 06:14:24 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03100400.xhp b/source/text/sbasic/shared/03100400.xhp index 5295571cd5..970cb5648f 100644 --- a/source/text/sbasic/shared/03100400.xhp +++ b/source/text/sbasic/shared/03100400.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CDbl Function [Runtime] -/text/sbasic/shared/03100400.xhp - - -Sun Microsystems, Inc. - + + CDbl Function [Runtime] + /text/sbasic/shared/03100400.xhp + + + +
-CDbl function + + CDbl function -CDbl Function [Runtime] -Converts any numerical expression or string expression to a double type. + + +CDbl Function [Runtime] +Converts any numerical expression or string expression to a double type.
-Syntax -CDbl (Expression) -Return value -Double -Parameters: - -Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. + +Syntax +CDbl (Expression) + +Return value +Double + +Parameters: + Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. -Example: + +Example: -Sub ExampleCountryConvert - MsgBox CDbl(1234.5678) - MsgBox CInt(1234.5678) - MsgBox CLng(1234.5678) -End Sub +Sub ExampleCountryConvert + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03100500.xhp b/source/text/sbasic/shared/03100500.xhp index e1f3dbb7f1..32e3c57661 100644 --- a/source/text/sbasic/shared/03100500.xhp +++ b/source/text/sbasic/shared/03100500.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CInt Function [Runtime] -/text/sbasic/shared/03100500.xhp - - -Sun Microsystems, Inc. - + + CInt Function [Runtime] + /text/sbasic/shared/03100500.xhp + + + +
-CInt function + + CInt function -CInt Function [Runtime] -Converts any string or numeric expression to an integer. + + +CInt Function [Runtime] +Converts any string or numeric expression to an integer.
-Syntax: - -CInt (Expression) + +Syntax: + +CInt (Expression) -Return value: -Integer -Parameters: - -Expression: Any numeric expression that you want to convert. If the Expression exceeds the value range between -32768 and 32767, $[officename] Basic reports an overflow error. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. -This function always rounds the fractional part of a number to the nearest integer. + +Return value: +Integer + +Parameters: + Expression: Any numeric expression that you want to convert. If the Expression exceeds the value range between -32768 and 32767, $[officename] Basic reports an overflow error. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. +This function always rounds the fractional part of a number to the nearest integer. -Example: + +Example: -Sub ExampleCountryConvert - MsgBox CDbl(1234.5678) - MsgBox CInt(1234.5678) - MsgBox CLng(1234.5678) -End Sub +Sub ExampleCountryConvert + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03100600.xhp b/source/text/sbasic/shared/03100600.xhp index ac83331707..a391d1d432 100644 --- a/source/text/sbasic/shared/03100600.xhp +++ b/source/text/sbasic/shared/03100600.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CLng Function [Runtime] -/text/sbasic/shared/03100600.xhp - - -Sun Microsystems, Inc. - + + CLng Function [Runtime] + /text/sbasic/shared/03100600.xhp + + + +
-CLng function + + CLng function -CLng Function [Runtime] -Converts any string or numeric expression to a long integer. + + +CLng Function [Runtime] +Converts any string or numeric expression to a long integer.
-Syntax: - -CLng (Expression) + +Syntax: + +CLng (Expression) -Return value: -Long -Parameters: - -Expression: Any numerical expression that you want to convert. If the Expression lies outside the valid long integer range between -2.147.483.648 and 2.147.483.647, $[officename] Basic returns an overflow error. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. -This function always rounds the fractional part of a number to the nearest integer. + +Return value: +Long + +Parameters: + Expression: Any numerical expression that you want to convert. If the Expression lies outside the valid long integer range between -2.147.483.648 and 2.147.483.647, $[officename] Basic returns an overflow error. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. +This function always rounds the fractional part of a number to the nearest integer. -Example: + +Example: -Sub ExampleCountryConvert - MsgBox CDbl(1234.5678) - MsgBox CInt(1234.5678) - MsgBox CLng(1234.5678) -End Sub +Sub ExampleCountryConvert + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03100700.xhp b/source/text/sbasic/shared/03100700.xhp index 1d8c32e7b6..ba3bc9d51e 100644 --- a/source/text/sbasic/shared/03100700.xhp +++ b/source/text/sbasic/shared/03100700.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Const Statement [Runtime] -/text/sbasic/shared/03100700.xhp - - -Sun Microsystems, Inc. - + + Const Statement [Runtime] + /text/sbasic/shared/03100700.xhp + + + +
-Const statement + + Const statement -Const Statement [Runtime] -Defines a string as a constant. + + +Const Statement [Runtime] +Defines a string as a constant.
-Syntax: - -Const Text = Expression + +Syntax: + +Const Text = Expression -Parameters: - -Text: Any constant name that follows the standard variable naming conventions. -A constant is a variable that helps to improve the readability of a program. Constants are not defined as a specific type of variable, but rather are used as placeholders in the code. You can only define a constant once and it cannot be modified. Use the following statement to define a constant: -CONST ConstName=Expression -The type of expression is irrelevant. If a program is started, $[officename] Basic converts the program code internally so that each time a constant is used, the defined expression replaces it. -Example: + +Parameters: + Text: Any constant name that follows the standard variable naming conventions. +A constant is a variable that helps to improve the readability of a program. Constants are not defined as a specific type of variable, but rather are used as placeholders in the code. You can only define a constant once and it cannot be modified. Use the following statement to define a constant: +CONST ConstName=Expression +The type of expression is irrelevant. If a program is started, $[officename] Basic converts the program code internally so that each time a constant is used, the defined expression replaces it. + +Example: -Sub ExampleConst - Const iVar = 1964 - MsgBox iVar - Const sVar = "Program", dVar As Double = 1.00 - MsgBox sVar & " " & dVar -End Sub +Sub ExampleConst + Const iVar = 1964 + MsgBox iVar + Const sVar = "Program", dVar As Double = 1.00 + MsgBox sVar & " " & dVar +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03100900.xhp b/source/text/sbasic/shared/03100900.xhp index 32adc71445..79fecee834 100644 --- a/source/text/sbasic/shared/03100900.xhp +++ b/source/text/sbasic/shared/03100900.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CSng Function[Runtime] -/text/sbasic/shared/03100900.xhp - - -Sun Microsystems, Inc. - + + CSng Function[Runtime] + /text/sbasic/shared/03100900.xhp + + + +
-CSng function + + CSng function -CSng Function[Runtime] -Converts any string or numeric expression to data type Single. + + +CSng Function[Runtime] +Converts any string or numeric expression to data type Single.
-Syntax: - -CSng (Expression) + +Syntax: + +CSng (Expression) -Return value: -Single -Parameters: - -Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. + +Return value: +Single + +Parameters: + Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system. -Example: + +Example: -Sub ExampleCSNG - MsgBox CDbl(1234.5678) - MsgBox CInt(1234.5678) - MsgBox CLng(1234.5678) - MsgBox CSng(1234.5678) -End Sub +Sub ExampleCSNG + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) + MsgBox CSng(1234.5678) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101000.xhp b/source/text/sbasic/shared/03101000.xhp index 812f0c2226..248f4b2e54 100644 --- a/source/text/sbasic/shared/03101000.xhp +++ b/source/text/sbasic/shared/03101000.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CStr Function [Runtime] -/text/sbasic/shared/03101000.xhp - - -Sun Microsystems, Inc. - + + CStr Function [Runtime] + /text/sbasic/shared/03101000.xhp + + + +
-CStr function + + CStr function -CStr Function [Runtime] -Converts any numeric expression to a string expression. + + +CStr Function [Runtime] +Converts any numeric expression to a string expression.
-Syntax: - -CStr (Expression) + +Syntax: + +CStr (Expression) -Return value: -String -Parameters: - -Expression: Any valid string or numeric expression that you want to convert. -Expression Types and Conversion Returns + +Return value: +String + +Parameters: + Expression: Any valid string or numeric expression that you want to convert. + +Expression Types and Conversion Returns + - - -Boolean : - - -String that evaluates to either True or False. - - - - -Date : - - -String that contains the date and time. - - - - -Null : - - -Run-time error. - - - - -Empty : - - -String without any characters. - - - - -Any : - - -Corresponding number as string. - - + + + Boolean : + + + String that evaluates to either True or False. + + + + + Date : + + + String that contains the date and time. + + + + + Null : + + + Run-time error. + + + + + Empty : + + + String without any characters. + + + + + Any : + + + Corresponding number as string. + +
-Zeros at the end of a floating-point number are not included in the returned string. +Zeros at the end of a floating-point number are not included in the returned string. -Example: + +Example: -Sub ExampleCSTR -Dim sVar As String - MsgBox CDbl(1234.5678) - MsgBox CInt(1234.5678) - MsgBox CLng(1234.5678) - MsgBox CSng(1234.5678) - sVar = CStr(1234.5678) - MsgBox sVar -End Sub +Sub ExampleCSTR +Dim sVar As String + MsgBox CDbl(1234.5678) + MsgBox CInt(1234.5678) + MsgBox CLng(1234.5678) + MsgBox CSng(1234.5678) + sVar = CStr(1234.5678) + MsgBox sVar +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101100.xhp b/source/text/sbasic/shared/03101100.xhp index 5d5dc099b7..237378858a 100644 --- a/source/text/sbasic/shared/03101100.xhp +++ b/source/text/sbasic/shared/03101100.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefBool Statement [Runtime] -/text/sbasic/shared/03101100.xhp - - -Sun Microsystems, Inc. - + + DefBool Statement [Runtime] + /text/sbasic/shared/03101100.xhp + + + +
-DefBool statement + + DefBool statement -DefBool Statement [Runtime] -If no type-declaration character or keyword is specified, the DefBool statement sets the default data type for variables, according to a letter range. + + +DefBool Statement [Runtime] +If no type-declaration character or keyword is specified, the DefBool statement sets the default data type for variables, according to a letter range.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set the default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefBool: Boolean -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set the default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefBool: Boolean + +Example: -' Prefix definition for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -Sub ExampleDefBool - bOK=TRUE ' bOK is an implicit boolean variable -End Sub +' Prefix definition for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +Sub ExampleDefBool + bOK=TRUE ' bOK is an implicit boolean variable +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101120.xhp b/source/text/sbasic/shared/03101120.xhp index 5e137c6fc3..e8e7b648cb 100644 --- a/source/text/sbasic/shared/03101120.xhp +++ b/source/text/sbasic/shared/03101120.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefErr Statement [Runtime] -/text/sbasic/shared/03101120.xhp - - -DefErr - + + DefErr Statement [Runtime] + /text/sbasic/shared/03101120.xhp + + + +
-DefErr statement + + DefErr statement -DefErr Statement [Runtime] -If no type-declaration character or keyword is specified, the DefErr statement sets the default variable type, according to a letter range. + + +DefErr Statement [Runtime] +If no type-declaration character or keyword is specified, the DefErr statement sets the default variable type, according to a letter range.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set a default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefErr: Error -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set a default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefErr: Error + +Example: -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -DefErr e -Sub ExampleDefErr - eErr=Error ' eErr is an implicit error variable -End Sub +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +DefErr e +Sub ExampleDefErr + eErr=Error ' eErr is an implicit error variable +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101130.xhp b/source/text/sbasic/shared/03101130.xhp index ceabcaf4f2..0ddb8a93b1 100644 --- a/source/text/sbasic/shared/03101130.xhp +++ b/source/text/sbasic/shared/03101130.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefSng Statement [Runtime] -/text/sbasic/shared/03101130.xhp - - -DefSng - + + DefSng Statement [Runtime] + /text/sbasic/shared/03101130.xhp + + + +
-DefSng statement + + DefSng statement -DefSng Statement [Runtime] -If no type-declaration character or keyword is specified, the DefSng statement sets the default variable type, according to a letter range. + + +DefSng Statement [Runtime] +If no type-declaration character or keyword is specified, the DefSng statement sets the default variable type, according to a letter range.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set a default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefSng: Single -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set a default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefSng: Single + +Example: -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -DefSng s -Sub ExampleDefSng - sSng=Single ' sSng is an implicit single variable -End Sub +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +DefSng s +Sub ExampleDefSng + sSng=Single ' sSng is an implicit single variable +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101140.xhp b/source/text/sbasic/shared/03101140.xhp index da3e412494..86b0ef5d16 100644 --- a/source/text/sbasic/shared/03101140.xhp +++ b/source/text/sbasic/shared/03101140.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefStr Statement [Runtime] -/text/sbasic/shared/03101140.xhp - - -DefStr - + + DefStr Statement [Runtime] + /text/sbasic/shared/03101140.xhp + + + +
-DefStr statement + + DefStr statement -DefStr Statement [Runtime] -If no type-declaration character or keyword is specified, the DefStr statement sets the default variable type, according to a letter range. + + +DefStr Statement [Runtime] +If no type-declaration character or keyword is specified, the DefStr statement sets the default variable type, according to a letter range.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set a default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefStr: String -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set a default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefStr: String + +Example: -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -DefStr s -Sub ExampleDefStr - sStr=String ' sStr is an implicit string variable -End Sub +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +DefStr s +Sub ExampleDefStr + sStr=String ' sStr is an implicit string variable +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101300.xhp b/source/text/sbasic/shared/03101300.xhp index bec653e481..5f0f2ca25d 100644 --- a/source/text/sbasic/shared/03101300.xhp +++ b/source/text/sbasic/shared/03101300.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefDate Statement [Runtime] -/text/sbasic/shared/03101300.xhp - - -Sun Microsystems, Inc. - + + DefDate Statement [Runtime] + /text/sbasic/shared/03101300.xhp + + + +
-DefDate statement + + DefDate statement -DefDate Statement [Runtime] -If no type-declaration character or keyword is specified, the DefDate statement sets the default variable type, according to a letter range. + + +DefDate Statement [Runtime] +If no type-declaration character or keyword is specified, the DefDate statement sets the default variable type, according to a letter range.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set a default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefDate: Date -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set a default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefDate: Date + +Example: -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -Sub ExampleDefDate - tDate=Date ' tDate is an implicit date variable -End Sub +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +Sub ExampleDefDate + tDate=Date ' tDate is an implicit date variable +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101400.xhp b/source/text/sbasic/shared/03101400.xhp index c7cc96dd54..6537219472 100644 --- a/source/text/sbasic/shared/03101400.xhp +++ b/source/text/sbasic/shared/03101400.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefDbl Statement [Runtime] -/text/sbasic/shared/03101400.xhp - - -Sun Microsystems, Inc. - + + DefDbl Statement [Runtime] + /text/sbasic/shared/03101400.xhp + + + +
-DefDbl statement + + DefDbl statement -DefDbl Statement [Runtime] -Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. + + +DefDbl Statement [Runtime] +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set the default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefDbl: Double -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set the default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefDbl: Double + +Example: -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -Sub ExampleDefDBL - dValue=1.23e43 ' dValue is an implicit double variable type -End Sub +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +Sub ExampleDefDBL + dValue=1.23e43 ' dValue is an implicit double variable type +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101500.xhp b/source/text/sbasic/shared/03101500.xhp index 53f1c21bc4..1b15623a5d 100644 --- a/source/text/sbasic/shared/03101500.xhp +++ b/source/text/sbasic/shared/03101500.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefInt Statement [Runtime] -/text/sbasic/shared/03101500.xhp - - -Sun Microsystems, Inc. - + + DefInt Statement [Runtime] + /text/sbasic/shared/03101500.xhp + + + +
-DefInt statement + + DefInt statement -DefInt Statement [Runtime] -Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. + + +DefInt Statement [Runtime] +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set a default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefInt: Integer -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set a default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefInt: Integer + +Example: -' Prefix definitions for variable types -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -Sub ExampleDefInt - iCount=200 ' iCount is an implicit integer variable -End Sub +' Prefix definitions for variable types +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +Sub ExampleDefInt + iCount=200 ' iCount is an implicit integer variable +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101600.xhp b/source/text/sbasic/shared/03101600.xhp index 04242b5633..8d9fde95f7 100644 --- a/source/text/sbasic/shared/03101600.xhp +++ b/source/text/sbasic/shared/03101600.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefLng Statement [Runtime] -/text/sbasic/shared/03101600.xhp - - -Sun Microsystems, Inc. - + + DefLng Statement [Runtime] + /text/sbasic/shared/03101600.xhp + + + +
-DefLng statement + + DefLng statement -DefLng Statement [Runtime] -Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. + + +DefLng Statement [Runtime] +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set the default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefLng: Long -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set the default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefLng: Long + +Example: -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -Sub ExampleDefLng - lCount=123456789 ' lCount is an implicit long integer variable -End Sub +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +Sub ExampleDefLng + lCount=123456789 ' lCount is an implicit long integer variable +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102000.xhp b/source/text/sbasic/shared/03102000.xhp index eb42d9ec38..3f5f21c44e 100644 --- a/source/text/sbasic/shared/03102000.xhp +++ b/source/text/sbasic/shared/03102000.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -DefVar Statement [Runtime] -/text/sbasic/shared/03102000.xhp - - -Sun Microsystems, Inc. - + + DefVar Statement [Runtime] + /text/sbasic/shared/03102000.xhp + + + +
-DefVar statement + + DefVar statement -DefVar Statement [Runtime] -Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified. + + +DefVar Statement [Runtime] +Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.
-Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] + +Syntax: + +Defxxx Characterrange1[, Characterrange2[,...]] -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set the default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type - -DefVar: Variant -Example: + +Parameters: + Characterrange: Letters that specify the range of variables that you want to set the default data type for. + xxx: Keyword that defines the default variable type: + Keyword: Default variable type + DefVar: Variant + +Example: -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v -Sub ExampleDefVar - vDiv=99 ' vDiv is an implicit variant - vDiv="Hello world" -End Sub +' Prefix definitions for variable types: +DefBool b +DefDate t +DefDbl d +DefInt i +DefLng l +DefObj o +DefVar v +Sub ExampleDefVar + vDiv=99 ' vDiv is an implicit variant + vDiv="Hello world" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102100.xhp b/source/text/sbasic/shared/03102100.xhp index ccef583971..3b8531ca28 100644 --- a/source/text/sbasic/shared/03102100.xhp +++ b/source/text/sbasic/shared/03102100.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Dim Statement [Runtime] -/text/sbasic/shared/03102100.xhp - - -Sun Microsystems, Inc. - + + Dim Statement [Runtime] + /text/sbasic/shared/03102100.xhp + + + +
-Dim statement -arrays; dimensioning -dimensioning arrays + + Dim statement + arrays; dimensioning + dimensioning arrays -Dim Statement [Runtime] -Declares a variable or an array. + + +Dim Statement [Runtime] +Declares a variable or an array.
-If the variables are separated by commas (for example, DIM sPar1, sPar2, sPar3 AS STRING), only Variant variables can be defined. Use a separate definition line for each variable. +If the variables are separated by commas (for example, DIM sPar1, sPar2, sPar3 AS STRING), only Variant variables can be defined. Use a separate definition line for each variable. -Dim sPar1 As String -Dim sPar2 As String -Dim sPar3 As String +Dim sPar1 As String +Dim sPar2 As String +Dim sPar3 As String -Dim declares local variables within subroutines. Global variables are declared with the PUBLIC or the PRIVATE statement. -Syntax: - -[ReDim]Dim VarName [(start To end)] [As VarType][, VarName2 [(start To end)] [As VarType][,...]] +Dim declares local variables within subroutines. Global variables are declared with the PUBLIC or the PRIVATE statement. + +Syntax: + +[ReDim]Dim VarName [(start To end)] [As VarType][, VarName2 [(start To end)] [As VarType][,...]] -Parameters: - -VarName: Any variable or array name. - -Start, End: Numerical values or constants that define the number of elements (NumberElements=(end-start)+1) and the index range.see #i36558 -Start and End can be numerical expressions if ReDim is applied at the procedure level. - -VarType: Key word that declares the data type of a variable. - -Keyword: Variable type - -Bool: Boolean variable (True, False) - -Currency: Currency-Variable (Currency with 4 Decimal places) - -Date: Date variable - -Double: Double-precision floating-point variable (1,79769313486232 x 10E308 - 4,94065645841247 x 10E-324) - -Integer: Integer variable (-32768 - 32767) - -Long: Long integer variable (-2.147.483.648 - 2.147.483.647) - -Object: Object variable (Note: this variable can only subsequently be defined with Set!) - -Single: Single-precision floating-point variable (3,402823 x 10E38 - 1,401298 x 10E-45). - -String: String variable consisting of a maximum of 64,000 ASCII characters. - -[Variant]: Variant variable type (contains all types, specified by definition). If a key word is not specified, variables are automatically defined as Variant Type, unless a statement from DefBool to DefVar is used. -In $[officename] Basic, you do not need to declare variables explicitly. However, you need to declare an array before you can use them. You can declare a variable with the Dim statement, using commas to separate multiple declarations. To declare a variable type, enter a type-declaration character following the name or use a corresponding key word. -$[officename] Basic supports single or multi-dimensional arrays that are defined by a specified variable type. Arrays are suitable if the program contains lists or tables that you want to edit. The advantage of arrays is that it is possible to address individual elements according to indexes, which can be formulated as numeric expressions or variables. -Arrays are declared with the Dim statement. There are two methods to define the index range: -DIM text(20) as String REM 21 elements numbered from 0 to 20 -DIM text(5 to 25) as String REM 21 elements numbered from 5 to 25 -DIM text(-15 to 5) as String REM 21 elements (including 0) -REM numbered from -15 to 5 -Two-dimensional data field -DIM text(20,2) as String REM 63 elements; form 0 to 20 level 1, from 0 to 20 level 2 and from 0 to 20 level 3. -You can declare an array types as dynamic if a ReDim statement defines the number of dimensions in the subroutine or the function that contains the array. Generally, you can only define an array dimension once, and you cannot modify it. Within a subroutine, you can declare an array with ReDim. You can only define dimensions with numeric expressions. This ensures that the fields are only as large as necessary. -Example: + +Parameters: + VarName: Any variable or array name. + Start, End: Numerical values or constants that define the number of elements (NumberElements=(end-start)+1) and the index range.see #i36558 +Start and End can be numerical expressions if ReDim is applied at the procedure level. + VarType: Key word that declares the data type of a variable. + Keyword: Variable type + Bool: Boolean variable (True, False) + Currency: Currency-Variable (Currency with 4 Decimal places) + Date: Date variable + Double: Double-precision floating-point variable (1,79769313486232 x 10E308 - 4,94065645841247 x 10E-324) + Integer: Integer variable (-32768 - 32767) + Long: Long integer variable (-2.147.483.648 - 2.147.483.647) + Object: Object variable (Note: this variable can only subsequently be defined with Set!) + Single: Single-precision floating-point variable (3,402823 x 10E38 - 1,401298 x 10E-45). + String: String variable consisting of a maximum of 64,000 ASCII characters. + [Variant]: Variant variable type (contains all types, specified by definition). If a key word is not specified, variables are automatically defined as Variant Type, unless a statement from DefBool to DefVar is used. +In $[officename] Basic, you do not need to declare variables explicitly. However, you need to declare an array before you can use them. You can declare a variable with the Dim statement, using commas to separate multiple declarations. To declare a variable type, enter a type-declaration character following the name or use a corresponding key word. +$[officename] Basic supports single or multi-dimensional arrays that are defined by a specified variable type. Arrays are suitable if the program contains lists or tables that you want to edit. The advantage of arrays is that it is possible to address individual elements according to indexes, which can be formulated as numeric expressions or variables. +Arrays are declared with the Dim statement. There are two methods to define the index range: +DIM text(20) as String REM 21 elements numbered from 0 to 20 +DIM text(5 to 25) as String REM 21 elements numbered from 5 to 25 +DIM text(-15 to 5) as String REM 21 elements (including 0) +REM numbered from -15 to 5 +Two-dimensional data field +DIM text(20,2) as String REM 63 elements; form 0 to 20 level 1, from 0 to 20 level 2 and from 0 to 20 level 3. +You can declare an array types as dynamic if a ReDim statement defines the number of dimensions in the subroutine or the function that contains the array. Generally, you can only define an array dimension once, and you cannot modify it. Within a subroutine, you can declare an array with ReDim. You can only define dimensions with numeric expressions. This ensures that the fields are only as large as necessary. + +Example: -Sub ExampleDim1 -Dim sVar As String -Dim iVar As Integer - sVar = "Office" -End Sub - -Sub ExampleDim2 -' Two-dimensional data field -Dim stext(20,2) As String -Const sDim As String = " Dimension:" -For i = 0 To 20 - For ii = 0 To 2 - stext(i,ii) = str(i) & sDim & str(ii) - Next ii -Next i -For i = 0 To 20 - For ii = 0 To 2 - MsgBox stext(i,ii) - Next ii -Next i -End Sub +Sub ExampleDim1 +Dim sVar As String +Dim iVar As Integer + sVar = "Office" +End Sub + +Sub ExampleDim2 +' Two-dimensional data field +Dim stext(20,2) As String +Const sDim As String = " Dimension:" +For i = 0 To 20 + For ii = 0 To 2 + stext(i,ii) = str(i) & sDim & str(ii) + Next ii +Next i +For i = 0 To 20 + For ii = 0 To 2 + MsgBox stext(i,ii) + Next ii +Next i +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102101.xhp b/source/text/sbasic/shared/03102101.xhp index 39b732b777..6804d8d068 100644 --- a/source/text/sbasic/shared/03102101.xhp +++ b/source/text/sbasic/shared/03102101.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -ReDim Statement [Runtime] -/text/sbasic/shared/03102101.xhp - - -Sun Microsystems, Inc. - + + ReDim Statement [Runtime] + /text/sbasic/shared/03102101.xhp + + + +
-ReDim statement + + ReDim statement -ReDim Statement [Runtime] -Declares a variable or an array. + + +ReDim Statement [Runtime] +Declares a variable or an array.
-Syntax: - -[ReDim]Dim VarName [(start To end)] [As VarType][, VarName2 [(start To end)] [As VarType][,...]] + +Syntax: + +[ReDim]Dim VarName [(start To end)] [As VarType][, VarName2 [(start To end)] [As VarType][,...]] -Optionally, you can add the Preserve keyword as a parameter to preserve the contents of the array that is redimensioned. -Parameters: - -VarName: Any variable or array name. - -Start, End: Numerical values or constants that define the number of elements (NumberElements=(end-start)+1) and the index range. -Start and End can be numeric expressions if ReDim is used at the procedure level. - -VarType: Keyword that declares the data type of a variable. - -Keyword: Variable type - -Bool: Boolean variable (True, False) - -Date: Date variable - -Double: Double floating point variable (1.79769313486232x10E308 - 4.94065645841247x10E-324) - -Integer: Integer variable (-32768 - 32767) - -Long: Long integer variable (-2,147,483,648 - 2,147,483,647) - -Object: Object variable (can only be subsequently defined by Set!) - -[Single]: Single floating-point variable (3.402823x10E38 - 1.401298x10E-45). If no key word is specified, a variable is defined as Single, unless a statement from DefBool to DefVar is used. - -String: String variable containing a maximum of 64,000 ASCII characters. - -Variant: Variant variable type (can contain all types and is set by definition). -In $[officename] Basic, you do not need to declare variables explicitly. However, you need to declare an array before you can use them. You can declare a variable with the Dim statement, using commas to separate multiple declarations. To declare a variable type, enter a type-declaration character following the name or use a corresponding key word. -$[officename] Basic supports single or multi-dimensional arrays that are defined by a specified variable type. Arrays are suitable if the program contains lists or tables that you want to edit. The advantage of arrays is that it is possible to address individual elements according to indexes, which can be formulated as numeric expressions or variables. -There are two ways to set the range of indices for arrays declared with the Dim statement: -DIM text(20) As String REM 21 elements numbered from 0 to 20 -DIM text(5 to 25) As String REM 21 elements numbered from 5 to 25 -DIM text$(-15 to 5) As String REM 21 elements (0 inclusive), -rem numbered from -15 to 5 -Variable fields, regardless of type, can be made dynamic if they are dimensioned by ReDim at the procedure level in subroutines or functions. Normally, you can only set the range of an array once and you cannot modify it. Within a procedure, you can declare an array using the ReDim statement with numeric expressions to define the range of the field sizes. -Example: +Optionally, you can add the Preserve keyword as a parameter to preserve the contents of the array that is redimensioned. + +Parameters: + VarName: Any variable or array name. + Start, End: Numerical values or constants that define the number of elements (NumberElements=(end-start)+1) and the index range. +Start and End can be numeric expressions if ReDim is used at the procedure level. + VarType: Keyword that declares the data type of a variable. + Keyword: Variable type + Bool: Boolean variable (True, False) + Date: Date variable + Double: Double floating point variable (1.79769313486232x10E308 - 4.94065645841247x10E-324) + Integer: Integer variable (-32768 - 32767) + Long: Long integer variable (-2,147,483,648 - 2,147,483,647) + Object: Object variable (can only be subsequently defined by Set!) + [Single]: Single floating-point variable (3.402823x10E38 - 1.401298x10E-45). If no key word is specified, a variable is defined as Single, unless a statement from DefBool to DefVar is used. + String: String variable containing a maximum of 64,000 ASCII characters. + Variant: Variant variable type (can contain all types and is set by definition). +In $[officename] Basic, you do not need to declare variables explicitly. However, you need to declare an array before you can use them. You can declare a variable with the Dim statement, using commas to separate multiple declarations. To declare a variable type, enter a type-declaration character following the name or use a corresponding key word. +$[officename] Basic supports single or multi-dimensional arrays that are defined by a specified variable type. Arrays are suitable if the program contains lists or tables that you want to edit. The advantage of arrays is that it is possible to address individual elements according to indexes, which can be formulated as numeric expressions or variables. +There are two ways to set the range of indices for arrays declared with the Dim statement: +DIM text(20) As String REM 21 elements numbered from 0 to 20 +DIM text(5 to 25) As String REM 21 elements numbered from 5 to 25 +DIM text$(-15 to 5) As String REM 21 elements (0 inclusive), +rem numbered from -15 to 5 +Variable fields, regardless of type, can be made dynamic if they are dimensioned by ReDim at the procedure level in subroutines or functions. Normally, you can only set the range of an array once and you cannot modify it. Within a procedure, you can declare an array using the ReDim statement with numeric expressions to define the range of the field sizes. + +Example: -Sub ExampleRedim -Dim iVar() As Integer, iCount As Integer -ReDim iVar(5) As Integer -For iCount = 1 To 5 - iVar(iCount) = iCount -Next iCount -ReDim iVar(10) As Integer -For iCount = 1 To 10 - iVar(iCount) = iCount -Next iCount -End Sub +Sub ExampleRedim +Dim iVar() As Integer, iCount As Integer +ReDim iVar(5) As Integer +For iCount = 1 To 5 + iVar(iCount) = iCount +Next iCount +ReDim iVar(10) As Integer +For iCount = 1 To 10 + iVar(iCount) = iCount +Next iCount +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102200.xhp b/source/text/sbasic/shared/03102200.xhp index f30426e53b..dc8d71e1c7 100644 --- a/source/text/sbasic/shared/03102200.xhp +++ b/source/text/sbasic/shared/03102200.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -IsArray Function [Runtime] -/text/sbasic/shared/03102200.xhp - - -Sun Microsystems, Inc. - + + IsArray Function [Runtime] + /text/sbasic/shared/03102200.xhp + + + +
-IsArray function + + IsArray function -IsArray Function [Runtime] -Determines if a variable is a data field in an array. + + +IsArray Function [Runtime] +Determines if a variable is a data field in an array.
-Syntax: - -IsArray (Var) + +Syntax: + +IsArray (Var) -Return value: -Bool -Parameters: - -Var: Any variable that you want to test if it is declared as an array. If the variable is an array, then the function returns True, otherwise False is returned. + +Return value: +Bool + +Parameters: + Var: Any variable that you want to test if it is declared as an array. If the variable is an array, then the function returns True, otherwise False is returned. -Example: + +Example: -Sub ExampleIsArray -Dim sDatf(10) As String - Print isarray(sdatf()) -End Sub +Sub ExampleIsArray +Dim sDatf(10) As String + Print isarray(sdatf()) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102300.xhp b/source/text/sbasic/shared/03102300.xhp index 78aeadf751..31ea25fbf2 100644 --- a/source/text/sbasic/shared/03102300.xhp +++ b/source/text/sbasic/shared/03102300.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -IsDate Function [Runtime] -/text/sbasic/shared/03102300.xhp - - -Sun Microsystems, Inc. - + + IsDate Function [Runtime] + /text/sbasic/shared/03102300.xhp + + + +
-IsDate function + + IsDate function -IsDate Function [Runtime] -Tests if a numeric or string expression can be converted to a Date variable. + + +IsDate Function [Runtime] +Tests if a numeric or string expression can be converted to a Date variable.
-Syntax: - -IsDate (Expression) + +Syntax: + +IsDate (Expression) -Return value: -Bool -Parameters: - -Expression: Any numeric or string expression that you want to test. If the expression can be converted to a date, the function returns True, otherwise the function returns False. + +Return value: +Bool + +Parameters: + Expression: Any numeric or string expression that you want to test. If the expression can be converted to a date, the function returns True, otherwise the function returns False. -Example: + +Example: -Sub ExampleIsDate -Dim sDateVar As String - sDateVar = "12.12.1997" - Print IsDate(sDateVar) ' Returns True - sDateVar = "12121997" - Print IsDate(sDateVar) ' Returns False -End Sub +Sub ExampleIsDate +Dim sDateVar As String + sDateVar = "12.12.1997" + Print IsDate(sDateVar) ' Returns True + sDateVar = "12121997" + Print IsDate(sDateVar) ' Returns False +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102400.xhp b/source/text/sbasic/shared/03102400.xhp index 710299ce58..80e57244e5 100644 --- a/source/text/sbasic/shared/03102400.xhp +++ b/source/text/sbasic/shared/03102400.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -IsEmpty Function [Runtime] -/text/sbasic/shared/03102400.xhp - - -Sun Microsystems, Inc. - + + IsEmpty Function [Runtime] + /text/sbasic/shared/03102400.xhp + + + +
-IsEmpty function + + IsEmpty function -IsEmpty Function [Runtime] -Tests if a Variant variable contains the Empty value. The Empty value indicates that the variable is not initialized. + + +IsEmpty Function [Runtime] +Tests if a Variant variable contains the Empty value. The Empty value indicates that the variable is not initialized.
-Syntax: - -IsEmpty (Var) + +Syntax: + +IsEmpty (Var) -Return value: -Bool -Parameters: - -Var: Any variable that you want to test. If the Variant contains the Empty value, the function returns True, otherwise the function returns False. + +Return value: +Bool + +Parameters: + Var: Any variable that you want to test. If the Variant contains the Empty value, the function returns True, otherwise the function returns False. -Example: + +Example: -Sub ExampleIsEmpty -Dim sVar As Variant - sVar = Empty - Print IsEmpty(sVar) ' Returns True -End Sub +Sub ExampleIsEmpty +Dim sVar As Variant + sVar = Empty + Print IsEmpty(sVar) ' Returns True +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102600.xhp b/source/text/sbasic/shared/03102600.xhp index 4482eaedda..9476e4e3b9 100644 --- a/source/text/sbasic/shared/03102600.xhp +++ b/source/text/sbasic/shared/03102600.xhp @@ -1,6 +1,5 @@ - - - +--> + - -IsNull Function [Runtime] -/text/sbasic/shared/03102600.xhp - + + IsNull Function [Runtime] + /text/sbasic/shared/03102600.xhp + + + +
-IsNull function -Null value + + IsNull function + Null value -IsNull Function [Runtime] -Tests if a Variant contains the special Null value, indicating that the variable does not contain data. + + +IsNull Function [Runtime] +Tests if a Variant contains the special Null value, indicating that the variable does not contain data.
-Syntax: - -IsNull (Var) + +Syntax: + +IsNull (Var) -Return value: -Bool -Parameters: - -Var: Any variable that you want to test. This function returns True if the Variant contains the Null value, or False if the Variant does not contain the Null value. - -Null - This value is used for a variant data sub type without valid contents. + +Return value: +Bool + +Parameters: + Var: Any variable that you want to test. This function returns True if the Variant contains the Null value, or False if the Variant does not contain the Null value. + Null - This value is used for a variant data sub type without valid contents. -Example: + +Example: -Sub ExampleIsNull -Dim vVar As Variant - MsgBox IsNull(vVar) -End Sub +Sub ExampleIsNull +Dim vVar As Variant + MsgBox IsNull(vVar) +End Sub -
+ + \ No newline at end of file diff --git a/source/text/sbasic/shared/03102700.xhp b/source/text/sbasic/shared/03102700.xhp index 00e64ad2c6..0f2728c5b5 100644 --- a/source/text/sbasic/shared/03102700.xhp +++ b/source/text/sbasic/shared/03102700.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -IsNumeric Function [Runtime] -/text/sbasic/shared/03102700.xhp - - -Sun Microsystems, Inc. - + + IsNumeric Function [Runtime] + /text/sbasic/shared/03102700.xhp + + + +
-IsNumeric function + + IsNumeric function -IsNumeric Function [Runtime] -Tests if an expression is a number. If the expression is a number, the function returns True, otherwise the function returns False. + + +IsNumeric Function [Runtime] +Tests if an expression is a number. If the expression is a number, the function returns True, otherwise the function returns False.
-Syntax: - -IsNumeric (Var) + +Syntax: + +IsNumeric (Var) -Return value: -Bool -Parameters: - -Var: Any expression that you want to test. + +Return value: +Bool + +Parameters: + Var: Any expression that you want to test. -Example: + +Example: -Sub ExampleIsNumeric -Dim vVar As Variant - vVar = "ABC" - Print IsNumeric(vVar) ' Returns False - vVar = "123" - Print IsNumeric(vVar) ' Returns True -End Sub +Sub ExampleIsNumeric +Dim vVar As Variant + vVar = "ABC" + Print IsNumeric(vVar) ' Returns False + vVar = "123" + Print IsNumeric(vVar) ' Returns True +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03102900.xhp b/source/text/sbasic/shared/03102900.xhp index c79058c6f9..67700502ad 100644 --- a/source/text/sbasic/shared/03102900.xhp +++ b/source/text/sbasic/shared/03102900.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -LBound Function [Runtime] -/text/sbasic/shared/03102900.xhp - - -Sun Microsystems, Inc. - + + LBound Function [Runtime] + /text/sbasic/shared/03102900.xhp + + + +
-LBound function + + LBound function -LBound Function [Runtime] -Returns the lower boundary of an array. + + +LBound Function [Runtime] +Returns the lower boundary of an array.
-Syntax: - -LBound (ArrayName [, Dimension]) + +Syntax: + +LBound (ArrayName [, Dimension]) -Return value: -Integer -Parameters: - -ArrayName: Name of the array for which you want to return the upper (Ubound) or the lower (LBound) boundary of the array dimension. - -[Dimension]: Integer that specifies which dimension to return the upper (Ubound) or the lower (LBound) boundary for. If a value is not specified, the first dimension is assumed. + +Return value: +Integer + +Parameters: + ArrayName: Name of the array for which you want to return the upper (Ubound) or the lower (LBound) boundary of the array dimension. + [Dimension]: Integer that specifies which dimension to return the upper (Ubound) or the lower (LBound) boundary for. If a value is not specified, the first dimension is assumed. -Example: + +Example: -Sub ExampleUboundLbound -Dim sVar(10 To 20) As String - Print LBound(sVar()) - Print UBound(sVar()) -End Sub - -Sub ExampleUboundLbound2 -Dim sVar(10 To 20,5 To 70) As String - Print LBound(sVar()) ' Returns 10 - Print UBound(sVar()) ' Returns 20 - Print LBound(sVar(),2) ' Returns 5 - Print UBound(sVar(),2) ' Returns 70 -End Sub +Sub ExampleUboundLbound +Dim sVar(10 To 20) As String + Print LBound(sVar()) + Print UBound(sVar()) +End Sub + +Sub ExampleUboundLbound2 +Dim sVar(10 To 20,5 To 70) As String + Print LBound(sVar()) ' Returns 10 + Print UBound(sVar()) ' Returns 20 + Print LBound(sVar(),2) ' Returns 5 + Print UBound(sVar(),2) ' Returns 70 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103000.xhp b/source/text/sbasic/shared/03103000.xhp index b0f0149a79..b70f2ddd7e 100644 --- a/source/text/sbasic/shared/03103000.xhp +++ b/source/text/sbasic/shared/03103000.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -UBound Function [Runtime] -/text/sbasic/shared/03103000.xhp - - -Sun Microsystems, Inc. - + + UBound Function [Runtime] + /text/sbasic/shared/03103000.xhp + + + +
-UBound function + + UBound function -UBound Function [Runtime] -Returns the upper boundary of an array. + + +UBound Function [Runtime] +Returns the upper boundary of an array.
-Syntax: - -UBound (ArrayName [, Dimension]) + +Syntax: + +UBound (ArrayName [, Dimension]) -Return value: -Integer -Parameters: - -ArrayName: Name of the array for which you want to determine the upper (Ubound) or the lower (LBound) boundary. - -[Dimension]: Integer that specifies which dimension to return the upper(Ubound) or lower (LBound) boundary for. If no value is specified, the boundary of the first dimension is returned. + +Return value: +Integer + +Parameters: + ArrayName: Name of the array for which you want to determine the upper (Ubound) or the lower (LBound) boundary. + [Dimension]: Integer that specifies which dimension to return the upper(Ubound) or lower (LBound) boundary for. If no value is specified, the boundary of the first dimension is returned. -Example: + +Example: -Sub ExampleUboundLbound -Dim sVar(10 To 20) As String - Print LBound(sVar()) - Print UBound(sVar()) -End Sub - -Sub ExampleUboundLbound2 -Dim sVar(10 To 20,5 To 70) As String - Print LBound(sVar()) ' Returns 10 - Print UBound(sVar()) ' Returns 20 - Print LBound(sVar(),2) ' Returns 5 - Print UBound(sVar(),2) ' Returns 70 -End Sub +Sub ExampleUboundLbound +Dim sVar(10 To 20) As String + Print LBound(sVar()) + Print UBound(sVar()) +End Sub + +Sub ExampleUboundLbound2 +Dim sVar(10 To 20,5 To 70) As String + Print LBound(sVar()) ' Returns 10 + Print UBound(sVar()) ' Returns 20 + Print LBound(sVar(),2) ' Returns 5 + Print UBound(sVar(),2) ' Returns 70 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103100.xhp b/source/text/sbasic/shared/03103100.xhp index f2d307bb48..8847ae7551 100644 --- a/source/text/sbasic/shared/03103100.xhp +++ b/source/text/sbasic/shared/03103100.xhp @@ -1,6 +1,5 @@ - - + - +--> - - - -Let Statement [Runtime] -/text/sbasic/shared/03103100.xhp - - -Sun Microsystems, Inc. - + + Let Statement [Runtime] + /text/sbasic/shared/03103100.xhp + + + +
-Let statement + + Let statement -Let Statement [Runtime] -Assigns a value to a variable. + + +Let Statement [Runtime] +Assigns a value to a variable.
-Syntax: - -[Let] VarName=Expression + +Syntax: + +[Let] VarName=Expression -Parameters: - -VarName: Variable that you want to assign a value to. Value and variable type must be compatible. -As in most BASIC dialects, the keyword Let is optional. -Example: + +Parameters: + VarName: Variable that you want to assign a value to. Value and variable type must be compatible. +As in most BASIC dialects, the keyword Let is optional. + +Example: -Sub ExampleLet -Dim sText As String - Let sText = "Las Vegas" - MsgBox Len(sText) ' returns 9 -End Sub +Sub ExampleLet +Dim sText As String + Let sText = "Las Vegas" + MsgBox Len(sText) ' returns 9 +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103200.xhp b/source/text/sbasic/shared/03103200.xhp index c80489d8a4..4e9a5ad1a6 100644 --- a/source/text/sbasic/shared/03103200.xhp +++ b/source/text/sbasic/shared/03103200.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Option Base Statement [Runtime] -/text/sbasic/shared/03103200.xhp - - -Sun Microsystems, Inc. - + + Option Base Statement [Runtime] + /text/sbasic/shared/03103200.xhp + + + +
-Option Base statement + + Option Base statement -Option Base Statement [Runtime] -Defines the default lower boundary for arrays as 0 or 1. + + +Option Base Statement [Runtime] +Defines the default lower boundary for arrays as 0 or 1.
-Syntax: - -Option Base { 0 | 1} + +Syntax: + +Option Base { 0 | 1} -Parameters: -This statement must be added before the executable program code in a module. -Example: + +Parameters: +This statement must be added before the executable program code in a module. + +Example: -Option Base 1 -Sub ExampleOptionBase - Dim sVar(20) As String - MsgBox LBound(sVar()) -End Sub +Option Base 1 +Sub ExampleOptionBase + Dim sVar(20) As String + MsgBox LBound(sVar()) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103300.xhp b/source/text/sbasic/shared/03103300.xhp index 46b5092a43..511fea7967 100644 --- a/source/text/sbasic/shared/03103300.xhp +++ b/source/text/sbasic/shared/03103300.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Option Explicit Statement [Runtime] -/text/sbasic/shared/03103300.xhp - - -Sun Microsystems, Inc. - + + Option Explicit Statement [Runtime] + /text/sbasic/shared/03103300.xhp + + + +
-Option Explicit statement + + Option Explicit statement -Option Explicit Statement [Runtime] -Specifies that every variable in the program code must be explicitly declared with the Dim statement. + + +Option Explicit Statement [Runtime] +Specifies that every variable in the program code must be explicitly declared with the Dim statement.
-Syntax: - -Option Explicit + +Syntax: + +Option Explicit -Parameters: -This statement must be added before the executable program code in a module. -Example: + +Parameters: +This statement must be added before the executable program code in a module. + +Example: -Option Explicit -Sub ExampleExplicit -Dim sVar As String - sVar = "Las Vegas" - For i% = 1 To 10 ' This results in a run-time error - Rem - Next i% -End Sub +Option Explicit +Sub ExampleExplicit +Dim sVar As String + sVar = "Las Vegas" + For i% = 1 To 10 ' This results in a run-time error + Rem + Next i% +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103400.xhp b/source/text/sbasic/shared/03103400.xhp index 09e31dbc9c..eb0ae0a4f3 100644 --- a/source/text/sbasic/shared/03103400.xhp +++ b/source/text/sbasic/shared/03103400.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Public Statement [Runtime] -/text/sbasic/shared/03103400.xhp - - -Sun Microsystems, Inc. - + + Public Statement [Runtime] + /text/sbasic/shared/03103400.xhp + + + +
-Public statement + + Public statement -Public Statement [Runtime] -Dimensions a variable or an array at the module level (that is, not within a subroutine or function), so that the variable and the array are valid in all libraries and modules. + + +Public Statement [Runtime] +Dimensions a variable or an array at the module level (that is, not within a subroutine or function), so that the variable and the array are valid in all libraries and modules.
-Syntax: - -Public VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]] + +Syntax: + +Public VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]] -Example: + +Example: -Public iPublicVar As Integer -Sub ExamplePublic - iPublicVar = iPublicVar + 1 - MsgBox iPublicVar -End Sub +Public iPublicVar As Integer +Sub ExamplePublic + iPublicVar = iPublicVar + 1 + MsgBox iPublicVar +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103450.xhp b/source/text/sbasic/shared/03103450.xhp index 850de1b3e4..52ae1eed64 100644 --- a/source/text/sbasic/shared/03103450.xhp +++ b/source/text/sbasic/shared/03103450.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Global Statement [Runtime] -/text/sbasic/shared/03103450.xhp - - -Sun Microsystems, Inc. - + + Global Statement [Runtime] + /text/sbasic/shared/03103450.xhp + + + +
-Global statement + + Global statement -Global Statement [Runtime] -Dimensions a variable or an array at the global level (that is, not within a subroutine or function), so that the variable and the array are valid in all libraries and modules for the current session. + + +Global Statement [Runtime] +Dimensions a variable or an array at the global level (that is, not within a subroutine or function), so that the variable and the array are valid in all libraries and modules for the current session.
-Syntax: - -Global VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]] + +Syntax: + +Global VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]] -Example: + +Example: -Global iGlobalVar As Integer -Sub ExampleGlobal - iGlobalVar = iGlobalVar + 1 - MsgBox iGlobalVar -End Sub +Global iGlobalVar As Integer +Sub ExampleGlobal + iGlobalVar = iGlobalVar + 1 + MsgBox iGlobalVar +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103500.xhp b/source/text/sbasic/shared/03103500.xhp index 172e0daaa6..ee98aca543 100644 --- a/source/text/sbasic/shared/03103500.xhp +++ b/source/text/sbasic/shared/03103500.xhp @@ -1,6 +1,5 @@ - - + - +--> - - - -Static Statement [Runtime] -/text/sbasic/shared/03103500.xhp - - -Sun Microsystems, Inc. - + + Static Statement [Runtime] + /text/sbasic/shared/03103500.xhp + + + +
-Static statement + + Static statement -Static Statement [Runtime] -Declares a variable or an array at the procedure level within a subroutine or a function, so that the values of the variable or the array are retained after exiting the subroutine or function. Dim statement conventions are also valid. + + +Static Statement [Runtime] +Declares a variable or an array at the procedure level within a subroutine or a function, so that the values of the variable or the array are retained after exiting the subroutine or function. Dim statement conventions are also valid.
-The Static statement cannot be used to define variable arrays. Arrays must be specified according to a fixed size. -Syntax: - -Static VarName[(start To end)] [As VarType], VarName2[(start To end)] [As VarType], ... +The Static statement cannot be used to define variable arrays. Arrays must be specified according to a fixed size. + +Syntax: + +Static VarName[(start To end)] [As VarType], VarName2[(start To end)] [As VarType], ... -Example: + +Example: -Sub ExampleStatic -Dim iCount As Integer, iResult As Integer - For iCount = 0 To 2 - iResult = InitVar() - Next iCount - MsgBox iResult,0,"The answer is" -End Sub - -' Function for initialization of the static variable -Function InitVar() As Integer - Static iInit As Integer - Const iMinimum As Integer = 40 ' minimum return value of this function - If iInit = 0 Then ' check if initialized - iInit = iMinimum - Else - iInit = iInit + 1 - End If - InitVar = iInit -End Function +Sub ExampleStatic +Dim iCount As Integer, iResult As Integer + For iCount = 0 To 2 + iResult = InitVar() + Next iCount + MsgBox iResult,0,"The answer is" +End Sub + +' Function for initialization of the static variable +Function InitVar() As Integer + Static iInit As Integer + Const iMinimum As Integer = 40 ' minimum return value of this function + If iInit = 0 Then ' check if initialized + iInit = iMinimum + Else + iInit = iInit + 1 + End If + InitVar = iInit +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103600.xhp b/source/text/sbasic/shared/03103600.xhp index 2e1cc4f93d..ca70574cd2 100644 --- a/source/text/sbasic/shared/03103600.xhp +++ b/source/text/sbasic/shared/03103600.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -TypeName Function; VarType Function[Runtime] -/text/sbasic/shared/03103600.xhp - - -Sun Microsystems, Inc. - + + TypeName Function; VarType Function[Runtime] + /text/sbasic/shared/03103600.xhp + + + +
-TypeName function -VarType function + + TypeName function + VarType function -TypeName Function; VarType Function[Runtime] -Returns a string (TypeName) or a numeric value (VarType) that contains information for a variable. + + +TypeName Function; VarType Function[Runtime] +Returns a string (TypeName) or a numeric value (VarType) that contains information for a variable.
-Syntax: - -TypeName (Variable)VarType (Variable) + +Syntax: + +TypeName (Variable)VarType (Variable) -Return value: -String; Integer -Parameters: - -Variable: The variable that you want to determine the type of. You can use the following values: + +Return value: +String; Integer + +Parameters: + Variable: The variable that you want to determine the type of. You can use the following values: + - - -key word - - -VarType - - -Variable type - - - - -Boolean - - -11 - - -Boolean variable - - - - -Date - - -7 - - -Date variable - - - - -Double - - -5 - - -Double floating point variable - - - - -Integer - - -2 - - -Integer variable - - - - -Long - - -3 - - -Long integer variable - - - - -Object - - -9 - - -Object variable - - - - -Single - - -4 - - -Single floating-point variable - - - - -String - - -8 - - -String variable - - - - -Variant - - -12 - - -Variant variable (can contain all types specified by the definition) - - - - -Empty - - -0 - - -Variable is not initialized - - - - -Null - - -1 - - -No valid data - - + + + key word + + + VarType + + + Variable type + + + + + Boolean + + + 11 + + + Boolean variable + + + + + Date + + + 7 + + + Date variable + + + + + Double + + + 5 + + + Double floating point variable + + + + + Integer + + + 2 + + + Integer variable + + + + + Long + + + 3 + + + Long integer variable + + + + + Object + + + 9 + + + Object variable + + + + + Single + + + 4 + + + Single floating-point variable + + + + + String + + + 8 + + + String variable + + + + + Variant + + + 12 + + + Variant variable (can contain all types specified by the definition) + + + + + Empty + + + 0 + + + Variable is not initialized + + + + + Null + + + 1 + + + No valid data + +
+ -Example: + +Example: -Sub ExampleType -Dim iVar As Integer -Dim sVar As String -Dim siVar As Single -Dim dVar As Double -Dim bVar As Boolean -Dim lVar As Long - MsgBox TypeName(iVar) & " " & VarType(iVar) & Chr(13) &_ - TypeName(sVar) & " " & VarType(sVar) & Chr(13) &_ - TypeName(siVar) & " " & VarType(siVar) & Chr(13) &_ - TypeName(dVar) & " " & VarType(dVar) & Chr(13) &_ - TypeName(bVar) & " " & VarType(bVar) & Chr(13) &_ - TypeName(lVar) & " " & VarType(lVar),0,"Some types In $[officename] Basic" -End Sub +Sub ExampleType +Dim iVar As Integer +Dim sVar As String +Dim siVar As Single +Dim dVar As Double +Dim bVar As Boolean +Dim lVar As Long + MsgBox TypeName(iVar) & " " & VarType(iVar) & Chr(13) &_ + TypeName(sVar) & " " & VarType(sVar) & Chr(13) &_ + TypeName(siVar) & " " & VarType(siVar) & Chr(13) &_ + TypeName(dVar) & " " & VarType(dVar) & Chr(13) &_ + TypeName(bVar) & " " & VarType(bVar) & Chr(13) &_ + TypeName(lVar) & " " & VarType(lVar),0,"Some types In $[officename] Basic" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03103700.xhp b/source/text/sbasic/shared/03103700.xhp index 31554767a5..c571b25765 100644 --- a/source/text/sbasic/shared/03103700.xhp +++ b/source/text/sbasic/shared/03103700.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Set Statement[Runtime] -/text/sbasic/shared/03103700.xhp - - -Sun Microsystems, Inc. - + + Set Statement[Runtime] + /text/sbasic/shared/03103700.xhp + + + +
-Set statement -Nothing object + + Set statement + Nothing object -Set Statement[Runtime] -Sets an object reference on a variable or a Property. + + +Set Statement[Runtime] +Sets an object reference on a variable or a Property.
-Syntax: - -Set ObjectVar = Object + +Syntax: + +Set ObjectVar = Object -Parameters: - -ObjectVar: a variable or a property that requires an object reference. - -Object: Object that the variable or the property refers to. - -Nothing - Assign the Nothing object to a variable to remove a previous assignment. -Example: + +Parameters: + ObjectVar: a variable or a property that requires an object reference. + Object: Object that the variable or the property refers to. + Nothing - Assign the Nothing object to a variable to remove a previous assignment. + +Example: -Sub ExampleSet -Dim oDoc As Object - Set oDoc = ActiveWindow - Print oDoc.Name -End Sub +Sub ExampleSet +Dim oDoc As Object + Set oDoc = ActiveWindow + Print oDoc.Name +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03104500.xhp b/source/text/sbasic/shared/03104500.xhp index cd3c10115f..f97f4668d6 100644 --- a/source/text/sbasic/shared/03104500.xhp +++ b/source/text/sbasic/shared/03104500.xhp @@ -1,6 +1,5 @@ - - + +--> - - -IsUnoStruct Function [Runtime] -/text/sbasic/shared/03104500.xhp - - -Sun Microsystems, Inc. - + + IsUnoStruct Function [Runtime] + /text/sbasic/shared/03104500.xhp + + + +
-IsUnoStruct function + + IsUnoStruct function -IsUnoStruct Function [Runtime] -Returns True if the given object is a Uno struct. + + +IsUnoStruct Function [Runtime] +Returns True if the given object is a Uno struct.
-Syntax: - -IsUnoStruct( Uno type ) + +Syntax: + +IsUnoStruct( Uno type ) -Return value: -Bool -Parameters: -Uno type : A UnoObject -Example: + +Return value: +Bool + +Parameters: +Uno type : A UnoObject + +Example: -Sub Main -Dim bIsStruct -' Instantiate a service -Dim oSimpleFileAccess -oSimpleFileAccess = CreateUnoService( "com.sun.star.ucb.SimpleFileAccess" ) -bIsStruct = IsUnoStruct( oSimpleFileAccess ) -MsgBox bIsStruct ' Displays False because oSimpleFileAccess Is NO struct -' Instantiate a Property struct -Dim aProperty As New com.sun.star.beans.Property -bIsStruct = IsUnoStruct( aProperty ) -MsgBox bIsStruct ' Displays True because aProperty is a struct -bIsStruct = IsUnoStruct( 42 ) -MsgBox bIsStruct ' Displays False because 42 is NO struct -End Sub +Sub Main +Dim bIsStruct +' Instantiate a service +Dim oSimpleFileAccess +oSimpleFileAccess = CreateUnoService( "com.sun.star.ucb.SimpleFileAccess" ) +bIsStruct = IsUnoStruct( oSimpleFileAccess ) +MsgBox bIsStruct ' Displays False because oSimpleFileAccess Is NO struct +' Instantiate a Property struct +Dim aProperty As New com.sun.star.beans.Property +bIsStruct = IsUnoStruct( aProperty ) +MsgBox bIsStruct ' Displays True because aProperty is a struct +bIsStruct = IsUnoStruct( 42 ) +MsgBox bIsStruct ' Displays False because 42 is NO struct +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03110100.xhp b/source/text/sbasic/shared/03110100.xhp index 49ced35bd6..c41b3409e2 100644 --- a/source/text/sbasic/shared/03110100.xhp +++ b/source/text/sbasic/shared/03110100.xhp @@ -1,6 +1,5 @@ - - + - +--> - - - -Comparison Operators [Runtime] -/text/sbasic/shared/03110100.xhp - - -Sun Microsystems, Inc. - + + Comparison Operators [Runtime] + /text/sbasic/shared/03110100.xhp + + + +
-comparison operators;%PRODUCTNAME Basic -operators;comparisons + + comparison operators;%PRODUCTNAME Basic + operators;comparisons -Comparison Operators [Runtime] -Comparison operators compare two expressions. The result is returned as a Boolean expression that determines if the comparison is True (-1) or False (0). + + +Comparison Operators [Runtime] +Comparison operators compare two expressions. The result is returned as a Boolean expression that determines if the comparison is True (-1) or False (0).
-Syntax: - -Result = Expression1 { = | < | > | <= | >= } Expression2 + +Syntax: + +Result = Expression1 { = | < | > | <= | >= } Expression2 -Parameters: - -Result: Boolean expression that specifies the result of the comparison (True, or False) - -Expression1, Expression2: Any numeric values or strings that you want to compare. -Comparison operators -= : Equal to -< : Less than -> : Greater than -<= : Less than or equal to ->= : Greater than or equal to -<> : Not equal to -Example: + +Parameters: + Result: Boolean expression that specifies the result of the comparison (True, or False) + Expression1, Expression2: Any numeric values or strings that you want to compare. + +Comparison operators += : Equal to +< : Less than +> : Greater than +<= : Less than or equal to +>= : Greater than or equal to +<> : Not equal to + +Example: -Sub ExampleUnequal -Dim sFile As String -Dim sRoot As String ' Root directory for file in and output - sRoot = "c:\" - sFile = Dir$( sRoot ,22) - If sFile <> "" Then - Do - MsgBox sFile - sFile = Dir$ - Loop Until sFile = "" - End If -End Sub +Sub ExampleUnequal +Dim sFile As String +Dim sRoot As String ' Root directory for file in and output + sRoot = "c:\" + sFile = Dir$( sRoot ,22) + If sFile <> "" Then + Do + MsgBox sFile + sFile = Dir$ + Loop Until sFile = "" + End If +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120101.xhp b/source/text/sbasic/shared/03120101.xhp index 9663a3396b..628358f2e6 100644 --- a/source/text/sbasic/shared/03120101.xhp +++ b/source/text/sbasic/shared/03120101.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Asc Function [Runtime] -/text/sbasic/shared/03120101.xhp - - -Sun Microsystems, Inc. - + + Asc Function [Runtime] + /text/sbasic/shared/03120101.xhp + + + +
-Asc function + + Asc function -Asc Function [Runtime] -Returns the ASCII (American Standard Code for Information Interchange) value of the first character in a string expression. + + +Asc Function [Runtime] +Returns the ASCII (American Standard Code for Information Interchange) value of the first character in a string expression.
-Syntax: - -Asc (Text As String) + +Syntax: + +Asc (Text As String) -Return value: -Integer -Parameters: - -Text: Any valid string expression. Only the first character in the string is relevant. -Use the Asc function to replace keys with values. If the Asc function encounters a blank string, $[officename] Basic reports a run-time error. In addition to 7 bit ASCII characters (Codes 0-127), the ASCII function can also detect non-printable key codes in ASCII code. This function can also handle 16 bit unicode characters. + +Return value: +Integer + +Parameters: + Text: Any valid string expression. Only the first character in the string is relevant. +Use the Asc function to replace keys with values. If the Asc function encounters a blank string, $[officename] Basic reports a run-time error. In addition to 7 bit ASCII characters (Codes 0-127), the ASCII function can also detect non-printable key codes in ASCII code. This function can also handle 16 bit unicode characters. -Example: + +Example: -Sub ExampleASC - Print ASC("A") ' returns 65 - Print ASC("Z") ' returns 90 - Print ASC("Las Vegas") ' returns 76, since only the first character is taken into account -End Sub +Sub ExampleASC + Print ASC("A") ' returns 65 + Print ASC("Z") ' returns 90 + Print ASC("Las Vegas") ' returns 76, since only the first character is taken into account +End Sub +
-CHR +CHR
-
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120102.xhp b/source/text/sbasic/shared/03120102.xhp index b6db9b7147..38393eb352 100644 --- a/source/text/sbasic/shared/03120102.xhp +++ b/source/text/sbasic/shared/03120102.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Chr Function [Runtime] -/text/sbasic/shared/03120102.xhp - - -Sun Microsystems, Inc. - + + Chr Function [Runtime] + /text/sbasic/shared/03120102.xhp + + + +
-Chr function + + Chr function -Chr Function [Runtime] -Returns the character that corresponds to the specified character code. + + +Chr Function [Runtime] +Returns the character that corresponds to the specified character code.
-Syntax: - -Chr(Expression As Integer) + +Syntax: + +Chr(Expression As Integer) -Return value: -String -Parameters: - -Expression: Numeric variables that represent a valid 8 bit ASCII value (0-255) or a 16 bit Unicode value. -Use the Chr$ function to send special control sequences to a printer or to another output source. You can also use it to insert quotation marks in a string expression. + +Return value: +String + +Parameters: + Expression: Numeric variables that represent a valid 8 bit ASCII value (0-255) or a 16 bit Unicode value. +Use the Chr$ function to send special control sequences to a printer or to another output source. You can also use it to insert quotation marks in a string expression. -Example: + +Example: -Sub ExampleChr - ' This example inserts quotation marks (ASCII value 34) in a string. - MsgBox "A "+ Chr$(34)+"short" + Chr$(34)+" trip." - ' The printout appears in the dialog as: A "short" trip. -End Sub +Sub ExampleChr + ' This example inserts quotation marks (ASCII value 34) in a string. + MsgBox "A "+ Chr$(34)+"short" + Chr$(34)+" trip." + ' The printout appears in the dialog as: A "short" trip. +End Sub +
-ASC +ASC
-
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120103.xhp b/source/text/sbasic/shared/03120103.xhp index d67375d2b0..04723a57de 100644 --- a/source/text/sbasic/shared/03120103.xhp +++ b/source/text/sbasic/shared/03120103.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Str Function [Runtime] -/text/sbasic/shared/03120103.xhp - - -Sun Microsystems, Inc. - + + Str Function [Runtime] + /text/sbasic/shared/03120103.xhp + + + +
-Str function + + Str function -Str Function [Runtime] -Converts a numeric expression into a string. + + +Str Function [Runtime] +Converts a numeric expression into a string.
-Syntax: - -Str (Expression) + +Syntax: + +Str (Expression) -Return value: -String -Parameters: - -Expression: Any numeric expression. -The Str function converts a numeric variable, or the result of a calculation into a string. Negative numbers are preceded by a minus sign. Positive numbers are preceded by a space (instead of the plus sign). + +Return value: +String + +Parameters: + Expression: Any numeric expression. +The Str function converts a numeric variable, or the result of a calculation into a string. Negative numbers are preceded by a minus sign. Positive numbers are preceded by a space (instead of the plus sign). -Example: + +Example: -Sub ExampleStr -Dim iVar As Single -Dim sVar As String - iVar = 123.123 - sVar = LTrim(Str(iVar)) - MsgBox sVar & chr(13) & Str(iVar) -End Sub +Sub ExampleStr +Dim iVar As Single +Dim sVar As String + iVar = 123.123 + sVar = LTrim(Str(iVar)) + MsgBox sVar & chr(13) & Str(iVar) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120104.xhp b/source/text/sbasic/shared/03120104.xhp index e6372c7b3c..72c362fea4 100644 --- a/source/text/sbasic/shared/03120104.xhp +++ b/source/text/sbasic/shared/03120104.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Val Function [Runtime] -/text/sbasic/shared/03120104.xhp - - -Sun Microsystems, Inc. - + + Val Function [Runtime] + /text/sbasic/shared/03120104.xhp + + + +
-Val function + + Val function -Val Function [Runtime] -Converts a string to a numeric expression. + + +Val Function [Runtime] +Converts a string to a numeric expression.
-Syntax: - -Val (Text As String) + +Syntax: + +Val (Text As String) -Return value: -Double -Parameters: - -Text: String that represents a number. -Using the Val function, you can convert a string that represents numbers into numeric expressions. This is the inverse of the Str function. If only part of the string contains numbers, only the first appropriate characters of the string are converted. If the string does not contain any numbers, the Val function returns the value 0. + +Return value: +Double + +Parameters: + Text: String that represents a number. +Using the Val function, you can convert a string that represents numbers into numeric expressions. This is the inverse of the Str function. If only part of the string contains numbers, only the first appropriate characters of the string are converted. If the string does not contain any numbers, the Val function returns the value 0. -Example: + +Example: -Sub ExampleVal - MsgBox Val("123.123") - MsgBox Val("A123.123") -End Sub +Sub ExampleVal + MsgBox Val("123.123") + MsgBox Val("A123.123") +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120201.xhp b/source/text/sbasic/shared/03120201.xhp index b5a86ef4ad..384462fad6 100644 --- a/source/text/sbasic/shared/03120201.xhp +++ b/source/text/sbasic/shared/03120201.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Space Function [Runtime] -/text/sbasic/shared/03120201.xhp - - -Sun Microsystems, Inc. - + + Space Function [Runtime] + /text/sbasic/shared/03120201.xhp + + + +
-Space function + + Space function -Space Function [Runtime] -Returns a string that consists of a specified amount of spaces. + + +Space Function [Runtime] +Returns a string that consists of a specified amount of spaces.
-Syntax: - -Space (n As Long) + +Syntax: + +Space (n As Long) -Return value: -String -Parameters: - -n: Numeric expression that defines the number of spaces in the string. The maximum allowed value of n is 65535. + +Return value: +String + +Parameters: + n: Numeric expression that defines the number of spaces in the string. The maximum allowed value of n is 65535. -Example: + +Example: -Sub ExampleSpace -Dim sText As String,sOut As String -Dim iLen As Integer - iLen = 10 - sText = "Las Vegas" - sOut = sText & Space(iLen) & sText & Chr(13) &_ - sText & Space(iLen*2) & sText & Chr(13) &_ - sText & Space(iLen*4) & sText & Chr(13) - MsgBox sOut,0,"Info:" -End Sub +Sub ExampleSpace +Dim sText As String,sOut As String +Dim iLen As Integer + iLen = 10 + sText = "Las Vegas" + sOut = sText & Space(iLen) & sText & Chr(13) &_ + sText & Space(iLen*2) & sText & Chr(13) &_ + sText & Space(iLen*4) & sText & Chr(13) + MsgBox sOut,0,"Info:" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120202.xhp b/source/text/sbasic/shared/03120202.xhp index 4ce6ffee4e..314956a41c 100644 --- a/source/text/sbasic/shared/03120202.xhp +++ b/source/text/sbasic/shared/03120202.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -String Function [Runtime] -/text/sbasic/shared/03120202.xhp - - -Sun Microsystems, Inc. - + + String Function [Runtime] + /text/sbasic/shared/03120202.xhp + + + +
-String function + + String function -String Function [Runtime] -Creates a string according to the specified character, or the first character of a string expression that is passed to the function. + + +String Function [Runtime] +Creates a string according to the specified character, or the first character of a string expression that is passed to the function.
-Syntax: - -String (n As Long, {expression As Integer | character As String}) + +Syntax: + +String (n As Long, {expression As Integer | character As String}) -Return value: -String -Parameters: - -n: Numeric expression that indicates the number of characters to return in the string. The maximum allowed value of n is 65535. - -Expression: Numeric expression that defines the ASCII code for the character. - -Character: Any single character used to build the return string, or any string of which only the first character will be used. + +Return value: +String + +Parameters: + n: Numeric expression that indicates the number of characters to return in the string. The maximum allowed value of n is 65535. + Expression: Numeric expression that defines the ASCII code for the character. + Character: Any single character used to build the return string, or any string of which only the first character will be used. -Example: + +Example: -Sub ExampleString -Dim sText As String - sText = String(10,"A") - MsgBox sText - sText = String(10,65) - MsgBox sText -End Sub +Sub ExampleString +Dim sText As String + sText = String(10,"A") + MsgBox sText + sText = String(10,65) + MsgBox sText +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120301.xhp b/source/text/sbasic/shared/03120301.xhp index e778debf53..54f40e0058 100644 --- a/source/text/sbasic/shared/03120301.xhp +++ b/source/text/sbasic/shared/03120301.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Format Function [Runtime] -/text/sbasic/shared/03120301.xhp - - -Sun Microsystems, Inc. - + + Format Function [Runtime] + /text/sbasic/shared/03120301.xhp + + + +
-Format function + + Format function -Format Function [Runtime] -Converts a number to a string, and then formats it according to the format that you specify. + + +Format Function [Runtime] +Converts a number to a string, and then formats it according to the format that you specify.
-Syntax: - -Format (Number [, Format As String]) + +Syntax: + +Format (Number [, Format As String]) -Return value: -String -Parameters: - -Number: Numeric expression that you want to convert to a formatted string. - -Format: String that specifies the format code for the number. If Format is omitted, the Format function works like the Str function. -Formatting Codes -The following list describes the codes that you can use for formatting a number: - -0: If Number has a digit at the position of the 0 in the format code, the digit is displayed, otherwise a zero is displayed. -If Number has fewer digits than the number of zeros in the format code, (on either side of the decimal), leading or trailing zeros are displayed. If the number has more digits to the left of the decimal separator than the amount of zeros in the format code, the additional digits are displayed without formatting. -Decimal places in the number are rounded according to the number of zeros that appear after the decimal separator in the Format code. - -#: If Number contains a digit at the position of the # placeholder in the Format code, the digit is displayed, otherwise nothing is displayed at this position. -This symbol works like the 0, except that leading or trailing zeroes are not displayed if there are more # characters in the format code than digits in the number. Only the relevant digits of the number are displayed. - -.: The decimal placeholder determines the number of decimal places to the left and right of the decimal separator. -If the format code contains only # placeholders to the left of this symbol, numbers less than 1 begin with a decimal separator. To always display a leading zero with fractional numbers, use 0 as a placeholder for the first digit to the left of the decimal separator. - -%: Multiplies the number by 100 and inserts the percent sign (%) where the number appears in the format code. - -E- E+ e- e+ : If the format code contains at least one digit placeholder (0 or #) to the right of the symbol E-, E+, e-, or e+, the number is formatted in the scientific or exponential format. The letter E or e is inserted between the number and the exponent. The number of placeholders for digits to the right of the symbol determines the number of digits in the exponent. -If the exponent is negative, a minus sign is displayed directly before an exponent with E-, E+, e-, e+. If the exponent is positive, a plus sign is only displayed before exponents with E+ or e+. -The thousands delimiter is displayed if the format code contains the delimiter enclosed by digit placeholders (0 or #). -The use of a period as a thousands and decimal separator is dependent on the regional setting. When you enter a number directly in Basic source code, always use a period as decimal delimiter. The actual character displayed as a decimal separator depends on the number format in your system settings. - -- + $ ( ) space: A plus (+), minus (-), dollar ($), space, or brackets entered directly in the format code is displayed as a literal character. -To display characters other than the ones listed here, you must precede it by a backslash (\), or enclose it in quotation marks (" "). -\ : The backslash displays the next character in the format code. -Characters in the format code that have a special meaning can only be displayed as literal characters if they are preceded by a backslash. The backslash itself is not displayed, unless you enter a double backslash (\\) in the format code. -Characters that must be preceded by a backslash in the format code in order to be displayed as literal characters are date- and time-formatting characters (a, c, d, h, m, n, p, q, s, t, w, y, /, :), numeric-formatting characters (#, 0, %, E, e, comma, period), and string-formatting characters (@, &, <, >, !). -You can also use the following predefined number formats. Except for "General Number", all of the predefined format codes return the number as a decimal number with two decimal places. -If you use predefined formats, the name of the format must be enclosed in quotation marks. -Predefined format - -General Number: Numbers are displayed as entered. - -Currency: Inserts a dollar sign in front of the number and encloses negative numbers in brackets. - -Fixed: Displays at least one digit in front of the decimal separator. - -Standard: Displays numbers with a thousands separator. - -Percent: Multiplies the number by 100 and appends a percent sign to the number. - -Scientific: Displays numbers in scientific format (for example, 1.00E+03 for 1000). -A format code can be divided into three sections that are separated by semicolons. The first part defines the format for positive values, the second part for negative values, and the third part for zero. If you only specify one format code, it applies to all numbers. + +Return value: +String + +Parameters: + Number: Numeric expression that you want to convert to a formatted string. + Format: String that specifies the format code for the number. If Format is omitted, the Format function works like the Str function. + +Formatting Codes +The following list describes the codes that you can use for formatting a number: + 0: If Number has a digit at the position of the 0 in the format code, the digit is displayed, otherwise a zero is displayed. +If Number has fewer digits than the number of zeros in the format code, (on either side of the decimal), leading or trailing zeros are displayed. If the number has more digits to the left of the decimal separator than the amount of zeros in the format code, the additional digits are displayed without formatting. +Decimal places in the number are rounded according to the number of zeros that appear after the decimal separator in the Format code. + #: If Number contains a digit at the position of the # placeholder in the Format code, the digit is displayed, otherwise nothing is displayed at this position. +This symbol works like the 0, except that leading or trailing zeroes are not displayed if there are more # characters in the format code than digits in the number. Only the relevant digits of the number are displayed. + .: The decimal placeholder determines the number of decimal places to the left and right of the decimal separator. +If the format code contains only # placeholders to the left of this symbol, numbers less than 1 begin with a decimal separator. To always display a leading zero with fractional numbers, use 0 as a placeholder for the first digit to the left of the decimal separator. + %: Multiplies the number by 100 and inserts the percent sign (%) where the number appears in the format code. + E- E+ e- e+ : If the format code contains at least one digit placeholder (0 or #) to the right of the symbol E-, E+, e-, or e+, the number is formatted in the scientific or exponential format. The letter E or e is inserted between the number and the exponent. The number of placeholders for digits to the right of the symbol determines the number of digits in the exponent. +If the exponent is negative, a minus sign is displayed directly before an exponent with E-, E+, e-, e+. If the exponent is positive, a plus sign is only displayed before exponents with E+ or e+. +The thousands delimiter is displayed if the format code contains the delimiter enclosed by digit placeholders (0 or #). +The use of a period as a thousands and decimal separator is dependent on the regional setting. When you enter a number directly in Basic source code, always use a period as decimal delimiter. The actual character displayed as a decimal separator depends on the number format in your system settings. + - + $ ( ) space: A plus (+), minus (-), dollar ($), space, or brackets entered directly in the format code is displayed as a literal character. +To display characters other than the ones listed here, you must precede it by a backslash (\), or enclose it in quotation marks (" "). +\ : The backslash displays the next character in the format code. +Characters in the format code that have a special meaning can only be displayed as literal characters if they are preceded by a backslash. The backslash itself is not displayed, unless you enter a double backslash (\\) in the format code. +Characters that must be preceded by a backslash in the format code in order to be displayed as literal characters are date- and time-formatting characters (a, c, d, h, m, n, p, q, s, t, w, y, /, :), numeric-formatting characters (#, 0, %, E, e, comma, period), and string-formatting characters (@, &, <, >, !). +You can also use the following predefined number formats. Except for "General Number", all of the predefined format codes return the number as a decimal number with two decimal places. +If you use predefined formats, the name of the format must be enclosed in quotation marks. + +Predefined format + General Number: Numbers are displayed as entered. + Currency: Inserts a dollar sign in front of the number and encloses negative numbers in brackets. + Fixed: Displays at least one digit in front of the decimal separator. + Standard: Displays numbers with a thousands separator. + Percent: Multiplies the number by 100 and appends a percent sign to the number. + Scientific: Displays numbers in scientific format (for example, 1.00E+03 for 1000). +A format code can be divided into three sections that are separated by semicolons. The first part defines the format for positive values, the second part for negative values, and the third part for zero. If you only specify one format code, it applies to all numbers. -Example: + +Example: -Sub ExampleFormat - MsgBox Format(6328.2, "##,##0.00") - ' always use a period as decimal delimiter when you enter numbers in Basic source code. - ' displays for example 6,328.20 in English locale, 6.328,20 in German locale. -End Sub +Sub ExampleFormat + MsgBox Format(6328.2, "##,##0.00") + ' always use a period as decimal delimiter when you enter numbers in Basic source code. + ' displays for example 6,328.20 in English locale, 6.328,20 in German locale. +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120302.xhp b/source/text/sbasic/shared/03120302.xhp index 3a1f8e72c3..6e9a4e8cd4 100644 --- a/source/text/sbasic/shared/03120302.xhp +++ b/source/text/sbasic/shared/03120302.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -LCase Function [Runtime] -/text/sbasic/shared/03120302.xhp - - -Sun Microsystems, Inc. - + + LCase Function [Runtime] + /text/sbasic/shared/03120302.xhp + + + +
-LCase function + + LCase function -LCase Function [Runtime] -Converts all uppercase letters in a string to lowercase. + + +LCase Function [Runtime] +Converts all uppercase letters in a string to lowercase.
-See also: UCase Function -Syntax: - -LCase (Text As String) +See also: UCase Function + +Syntax: + +LCase (Text As String) -Return value: -String -Parameters: - -Text: Any string expression that you want to convert. + +Return value: +String + +Parameters: + Text: Any string expression that you want to convert. -Example: + +Example: -Sub ExampleLUCase -Dim sVar As String - sVar = "Las Vegas" - Print LCase(sVar) ' Returns "las vegas" - Print UCase(sVar) ' Returns "LAS VEGAS" -End Sub +Sub ExampleLUCase +Dim sVar As String + sVar = "Las Vegas" + Print LCase(sVar) ' Returns "las vegas" + Print UCase(sVar) ' Returns "LAS VEGAS" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120303.xhp b/source/text/sbasic/shared/03120303.xhp index 387f8db4d1..919aa6b28f 100644 --- a/source/text/sbasic/shared/03120303.xhp +++ b/source/text/sbasic/shared/03120303.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Left Function [Runtime] -/text/sbasic/shared/03120303.xhp - - -Sun Microsystems, Inc. - + + Left Function [Runtime] + /text/sbasic/shared/03120303.xhp + + + +
-Left function + + Left function -Left Function [Runtime] -Returns the number of leftmost characters that you specify of a string expression. + + +Left Function [Runtime] +Returns the number of leftmost characters that you specify of a string expression.
-Syntax: - -Left (Text As String, n As Long) + +Syntax: + +Left (Text As String, n As Long) -Return value: -String -Parameters: - -Text: Any string expression that you want to return the leftmost characters from. - -n: Numeric expression that specifies the number of characters that you want to return. If n = 0, a zero-length string is returned. The maximum allowed value is 65535. -The following example converts a date in YYYY.MM.DD format to MM/DD/YYYY format. + +Return value: +String + +Parameters: + Text: Any string expression that you want to return the leftmost characters from. + n: Numeric expression that specifies the number of characters that you want to return. If n = 0, a zero-length string is returned. The maximum allowed value is 65535. +The following example converts a date in YYYY.MM.DD format to MM/DD/YYYY format. -Example: + +Example: -Sub ExampleUSDate -Dim sInput As String -Dim sUS_date As String - sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") - sUS_date = Mid(sInput, 6, 2) - sUS_date = sUS_date & "/" - sUS_date = sUS_date & Right(sInput, 2) - sUS_date = sUS_date & "/" - sUS_date = sUS_date & Left(sInput, 4) - MsgBox sUS_date -End Sub +Sub ExampleUSDate +Dim sInput As String +Dim sUS_date As String + sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") + sUS_date = Mid(sInput, 6, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Right(sInput, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Left(sInput, 4) + MsgBox sUS_date +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120304.xhp b/source/text/sbasic/shared/03120304.xhp index 6beb039f31..5de4143c63 100644 --- a/source/text/sbasic/shared/03120304.xhp +++ b/source/text/sbasic/shared/03120304.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -LSet Statement [Runtime] -/text/sbasic/shared/03120304.xhp - - -Sun Microsystems, Inc. - + + LSet Statement [Runtime] + /text/sbasic/shared/03120304.xhp + + + +
-LSet statement + + LSet statement -LSet Statement [Runtime] -Aligns a string to the left of a string variable, or copies a variable of a user-defined type to another variable of a different user-defined type. + + +LSet Statement [Runtime] +Aligns a string to the left of a string variable, or copies a variable of a user-defined type to another variable of a different user-defined type.
-Syntax: - -LSet Var As String = Text or LSet Var1 = Var2 + +Syntax: + +LSet Var As String = Text or LSet Var1 = Var2 -Parameters: - -Var: Any String variable that contains the string that you want align to the left. - -Text: String that you want to align to the left of the string variable. - -Var1: Name of the user-defined type variable that you want to copy to. - -Var2: Name of the user-defined type variable that you want to copy from. -If the string is shorter than the string variable, LSet left-aligns the string within the string variable. Any remaining positions in the string variable are replaced by spaces. If the string is longer than the string variable, only the leftmost characters up to the length of the string variable are copied. With the LSet statement, you can also copy a user-defined type variable to another variable of the same type. -Example: + +Parameters: + Var: Any String variable that contains the string that you want align to the left. + Text: String that you want to align to the left of the string variable. + Var1: Name of the user-defined type variable that you want to copy to. + Var2: Name of the user-defined type variable that you want to copy from. +If the string is shorter than the string variable, LSet left-aligns the string within the string variable. Any remaining positions in the string variable are replaced by spaces. If the string is longer than the string variable, only the leftmost characters up to the length of the string variable are copied. With the LSet statement, you can also copy a user-defined type variable to another variable of the same type. + +Example: -Sub ExampleRLSet -Dim sVar As String -Dim sExpr As String - sVar = String(40,"*") - sExpr = "SBX" - ' Align "SBX" within the 40-character reference string - ' Replace asterisks with spaces - RSet sVar = sExpr - Print ">"; sVar; "<" - sVar = String(5,"*") - sExpr = "123457896" - RSet sVar = sExpr - Print ">"; sVar; "<" - sVar = String(40,"*") - sExpr = "SBX" - ' Left-align "SBX" within the 40-character reference string - LSet sVar = sExpr - Print ">"; sVar; "<" - sVar = String(5,"*") - sExpr = "123456789" - LSet sVar = sExpr - Print ">"; sVar; "<" -End Sub +Sub ExampleRLSet +Dim sVar As String +Dim sExpr As String + sVar = String(40,"*") + sExpr = "SBX" + ' Align "SBX" within the 40-character reference string + ' Replace asterisks with spaces + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123457896" + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(40,"*") + sExpr = "SBX" + ' Left-align "SBX" within the 40-character reference string + LSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123456789" + LSet sVar = sExpr + Print ">"; sVar; "<" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120305.xhp b/source/text/sbasic/shared/03120305.xhp index ad1f9f882b..82eb95dac7 100644 --- a/source/text/sbasic/shared/03120305.xhp +++ b/source/text/sbasic/shared/03120305.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -LTrim Function [Runtime] -/text/sbasic/shared/03120305.xhp - - -Sun Microsystems, Inc. - + + LTrim Function [Runtime] + /text/sbasic/shared/03120305.xhp + + + +
-LTrim function + + LTrim function -LTrim Function [Runtime] -Removes all leading spaces at the start of a string expression. + + +LTrim Function [Runtime] +Removes all leading spaces at the start of a string expression.
-Syntax: - -LTrim (Text As String) + +Syntax: + +LTrim (Text As String) -Return value: -String -Parameters: - -Text: Any string expression. -Use this function to remove spaces at the beginning of a string expression. + +Return value: +String + +Parameters: + Text: Any string expression. +Use this function to remove spaces at the beginning of a string expression. -Example: + +Example: -Sub ExampleSpaces -Dim sText2 As String,sText As String,sOut As String - sText2 = " <*Las Vegas*> " - sOut = "'"+sText2 +"'"+ Chr(13) - sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " - sOut = sOut + "'"+sText +"'" + Chr(13) - sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" - sOut = sOut +"'"+ sText +"'" + Chr(13) - sText = Trim(sText2) ' sText = "<*Las Vegas*>" - sOut = sOut +"'"+ sText +"'" - MsgBox sOut -End Sub +Sub ExampleSpaces +Dim sText2 As String,sText As String,sOut As String + sText2 = " <*Las Vegas*> " + sOut = "'"+sText2 +"'"+ Chr(13) + sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " + sOut = sOut + "'"+sText +"'" + Chr(13) + sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + Chr(13) + sText = Trim(sText2) ' sText = "<*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + MsgBox sOut +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120306.xhp b/source/text/sbasic/shared/03120306.xhp index d5817a4087..c79b292e58 100644 --- a/source/text/sbasic/shared/03120306.xhp +++ b/source/text/sbasic/shared/03120306.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Mid Function, Mid Statement [Runtime] -/text/sbasic/shared/03120306.xhp - - -Sun Microsystems, Inc. - + + Mid Function, Mid Statement [Runtime] + /text/sbasic/shared/03120306.xhp + + + +
-Mid function -Mid statement + + Mid function + Mid statement -Mid Function, Mid Statement [Runtime] -Returns the specified portion of a string expression (Mid function), or replaces the portion of a string expression with another string (Mid statement). + + +Mid Function, Mid Statement [Runtime] +Returns the specified portion of a string expression (Mid function), or replaces the portion of a string expression with another string (Mid statement).
-Syntax: - -Mid (Text As String, Start As Long [, Length As Long]) or Mid (Text As String, Start As Long , Length As Long, Text As String) + +Syntax: + +Mid (Text As String, Start As Long [, Length As Long]) or Mid (Text As String, Start As Long , Length As Long, Text As String) -Return value: -String (only by Function) -Parameters: - -Text: Any string expression that you want to modify. - -Start: Numeric expression that indicates the character position within the string where the string portion that you want to replace or to return begins. The maximum allowed value is 65535.see i17928 - -Length: Numeric expression that returns the number of characters that you want to replace or return. The maximum allowed value is 65535. -If the Length parameter in the Mid function is omitted, all characters in the string expression from the start position to the end of the string are returned. -If the Length parameter in the Mid statement is less than the length of the text that you want to replace, the text is reduced to the specified length. - -Text: The string to replace the string expression (Mid statement). + +Return value: +String (only by Function) + +Parameters: + Text: Any string expression that you want to modify. + Start: Numeric expression that indicates the character position within the string where the string portion that you want to replace or to return begins. The maximum allowed value is 65535.see i17928 + Length: Numeric expression that returns the number of characters that you want to replace or return. The maximum allowed value is 65535. +If the Length parameter in the Mid function is omitted, all characters in the string expression from the start position to the end of the string are returned. +If the Length parameter in the Mid statement is less than the length of the text that you want to replace, the text is reduced to the specified length. + Text: The string to replace the string expression (Mid statement). -Example: + +Example: -Sub ExampleUSDate -Dim sInput As String -Dim sUS_date As String - sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") - sUS_date = Mid(sInput, 6, 2) - sUS_date = sUS_date & "/" - sUS_date = sUS_date & Right(sInput, 2) - sUS_date = sUS_date & "/" - sUS_date = sUS_date & Left(sInput, 4) - MsgBox sUS_date -End Sub +Sub ExampleUSDate +Dim sInput As String +Dim sUS_date As String + sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") + sUS_date = Mid(sInput, 6, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Right(sInput, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Left(sInput, 4) + MsgBox sUS_date +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120307.xhp b/source/text/sbasic/shared/03120307.xhp index b1e9eedadd..049ca40a15 100644 --- a/source/text/sbasic/shared/03120307.xhp +++ b/source/text/sbasic/shared/03120307.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Right Function [Runtime] -/text/sbasic/shared/03120307.xhp - - -Sun Microsystems, Inc. - + + Right Function [Runtime] + /text/sbasic/shared/03120307.xhp + + + + -See also: Left Function. -Syntax: - -Right (Text As String, n As Long) +See also: Left Function. + +Syntax: + +Right (Text As String, n As Long) -Return value: -String -Parameters: - -Text: Any string expression that you want to return the rightmost characters of. - -n: Numeric expression that defines the number of characters that you want to return. If n = 0, a zero-length string is returned. The maximum allowed value is 65535. -The following example converts a date in YYYY-MM-DD format to the US date format (MM/DD/YYYY). + +Return value: +String + +Parameters: + Text: Any string expression that you want to return the rightmost characters of. + n: Numeric expression that defines the number of characters that you want to return. If n = 0, a zero-length string is returned. The maximum allowed value is 65535. +The following example converts a date in YYYY-MM-DD format to the US date format (MM/DD/YYYY). -Example: + +Example: -Sub ExampleUSDate -Dim sInput As String -Dim sUS_date As String - sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") - sUS_date = Mid(sInput, 6, 2) - sUS_date = sUS_date & "/" - sUS_date = sUS_date & Right(sInput, 2) - sUS_date = sUS_date & "/" - sUS_date = sUS_date & Left(sInput, 4) - MsgBox sUS_date -End Sub +Sub ExampleUSDate +Dim sInput As String +Dim sUS_date As String + sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'") + sUS_date = Mid(sInput, 6, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Right(sInput, 2) + sUS_date = sUS_date & "/" + sUS_date = sUS_date & Left(sInput, 4) + MsgBox sUS_date +End Sub - + + \ No newline at end of file diff --git a/source/text/sbasic/shared/03120308.xhp b/source/text/sbasic/shared/03120308.xhp index 5bb095c1e5..f5a48cae82 100644 --- a/source/text/sbasic/shared/03120308.xhp +++ b/source/text/sbasic/shared/03120308.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -RSet Statement [Runtime] -/text/sbasic/shared/03120308.xhp - - -Sun Microsystems, Inc. - + + RSet Statement [Runtime] + /text/sbasic/shared/03120308.xhp + + + +
-RSet statement + + RSet statement -RSet Statement [Runtime] -Right-aligns a string within a string variable, or copies a user-defined variable type into another. + + +RSet Statement [Runtime] +Right-aligns a string within a string variable, or copies a user-defined variable type into another.
-Syntax: - -RSet Text As String = Text or RSet Variable1 = Variable2 + +Syntax: + +RSet Text As String = Text or RSet Variable1 = Variable2 -Parameters: - -Text: Any string variable. - -Text: String that you want to right-align in the string variable. - -Variable1: User-defined variable that is the target for the copied variable. - -Variable2: User-defined variable that you want to copy to another variable. -If the string is shorter than the string variable, RSet aligns the string to the right within the string variable. Any remaining characters in the string variable are replaced with spaces. If the string is longer than the string variable, characters exceeding the length of the variable are truncated, and only the remaining characters are right-aligned within the string variable. -You can also use the RSet statement to assign variables of one user-defined type to another. -The following example uses the RSet and LSet statements to modify the left and right alignment of a string. -Example: + +Parameters: + Text: Any string variable. + Text: String that you want to right-align in the string variable. + Variable1: User-defined variable that is the target for the copied variable. + Variable2: User-defined variable that you want to copy to another variable. +If the string is shorter than the string variable, RSet aligns the string to the right within the string variable. Any remaining characters in the string variable are replaced with spaces. If the string is longer than the string variable, characters exceeding the length of the variable are truncated, and only the remaining characters are right-aligned within the string variable. +You can also use the RSet statement to assign variables of one user-defined type to another. +The following example uses the RSet and LSet statements to modify the left and right alignment of a string. + +Example: -Sub ExampleRLSet -Dim sVar As String -Dim sExpr As String - sVar = String(40,"*") - sExpr = "SBX" - ' Right-align "SBX" in a 40-character string - ' Replace asterisks with spaces - RSet sVar = sExpr - Print ">"; sVar; "<" - sVar = String(5,"*") - sExpr = "123457896" - RSet sVar = sExpr - Print ">"; sVar; "<" - sVar = String(40,"*") - sExpr = "SBX" - ' Left-align "SBX" in a 40-character string - LSet sVar = sExpr - Print ">"; sVar; "<" - sVar = String(5,"*") - sExpr = "123456789" - LSet sVar = sExpr - Print ">"; sVar; "<" -End Sub +Sub ExampleRLSet +Dim sVar As String +Dim sExpr As String + sVar = String(40,"*") + sExpr = "SBX" + ' Right-align "SBX" in a 40-character string + ' Replace asterisks with spaces + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123457896" + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(40,"*") + sExpr = "SBX" + ' Left-align "SBX" in a 40-character string + LSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123456789" + LSet sVar = sExpr + Print ">"; sVar; "<" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120309.xhp b/source/text/sbasic/shared/03120309.xhp index 8d96f0a812..9cfc65767e 100644 --- a/source/text/sbasic/shared/03120309.xhp +++ b/source/text/sbasic/shared/03120309.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -RTrim Function [Runtime] -/text/sbasic/shared/03120309.xhp - - -Sun Microsystems, Inc. - + + RTrim Function [Runtime] + /text/sbasic/shared/03120309.xhp + + + +
-RTrim function + + RTrim function -RTrim Function [Runtime] -Deletes the spaces at the end of a string expression. + + +RTrim Function [Runtime] +Deletes the spaces at the end of a string expression.
-See also: LTrim Function -Syntax: - -RTrim (Text As String) +See also: LTrim Function + +Syntax: + +RTrim (Text As String) -Return value: -String -Parameters: - -Text: Any string expression. + +Return value: +String + +Parameters: + Text: Any string expression. -Example: + +Example: -Sub ExampleSpaces -Dim sText2 As String,sText As String,sOut As String - sText2 = " <*Las Vegas*> " - sOut = "'"+sText2 +"'"+ Chr(13) - sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " - sOut = sOut + "'"+sText +"'" + Chr(13) - sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" - sOut = sOut +"'"+ sText +"'" + Chr(13) - sText = Trim(sText2) ' sText = "<*Las Vegas*>" - sOut = sOut +"'"+ sText +"'" - MsgBox sOut -End Sub +Sub ExampleSpaces +Dim sText2 As String,sText As String,sOut As String + sText2 = " <*Las Vegas*> " + sOut = "'"+sText2 +"'"+ Chr(13) + sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " + sOut = sOut + "'"+sText +"'" + Chr(13) + sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + Chr(13) + sText = Trim(sText2) ' sText = "<*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + MsgBox sOut +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120310.xhp b/source/text/sbasic/shared/03120310.xhp index 9adbebc66d..330c0c420b 100644 --- a/source/text/sbasic/shared/03120310.xhp +++ b/source/text/sbasic/shared/03120310.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -UCase Function [Runtime] -/text/sbasic/shared/03120310.xhp - - -Sun Microsystems, Inc. - + + UCase Function [Runtime] + /text/sbasic/shared/03120310.xhp + + + +
-UCase function + + UCase function -UCase Function [Runtime] -Converts lowercase characters in a string to uppercase. + + +UCase Function [Runtime] +Converts lowercase characters in a string to uppercase.
-See also: LCase Function - -Syntax: -UCase (Text As String) - -Return value: -String -Parameters: - -Text: Any string expression that you want to convert. +See also: LCase Function + Syntax: +UCase (Text As String) + Return value: +String + +Parameters: + Text: Any string expression that you want to convert. -Example: + +Example: -Sub ExampleLUCase -Dim sVar As String - sVar = "Las Vegas" - Print LCase(sVar) ' returns "las vegas" - Print UCase(sVar) ' returns "LAS VEGAS" -End Sub +Sub ExampleLUCase +Dim sVar As String + sVar = "Las Vegas" + Print LCase(sVar) ' returns "las vegas" + Print UCase(sVar) ' returns "LAS VEGAS" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120311.xhp b/source/text/sbasic/shared/03120311.xhp index 401f5e577c..a8180acfdb 100644 --- a/source/text/sbasic/shared/03120311.xhp +++ b/source/text/sbasic/shared/03120311.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Trim Function [Runtime] -/text/sbasic/shared/03120311.xhp - - -Sun Microsystems, Inc. - + + Trim Function [Runtime] + /text/sbasic/shared/03120311.xhp + + + +
-Trim function + + Trim function -Trim Function [Runtime] -Removes all leading and trailing spaces from a string expression. + + +Trim Function [Runtime] +Removes all leading and trailing spaces from a string expression.
-Syntax: - -Trim( Text As String ) + +Syntax: + +Trim( Text As String ) -Return value: -String -Parameters: - -Text: Any string expression. + +Return value: +String + +Parameters: + Text: Any string expression. -Example: + +Example: -Sub ExampleSpaces -Dim sText2 As String,sText As String,sOut As String - sText2 = " <*Las Vegas*> " - sOut = "'"+sText2 +"'"+ Chr(13) - sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " - sOut = sOut + "'"+sText +"'" + Chr(13) - sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" - sOut = sOut +"'"+ sText +"'" + Chr(13) - sText = Trim(sText2) ' sText = "<*Las Vegas*>" - sOut = sOut +"'"+ sText +"'" - MsgBox sOut -End Sub +Sub ExampleSpaces +Dim sText2 As String,sText As String,sOut As String + sText2 = " <*Las Vegas*> " + sOut = "'"+sText2 +"'"+ Chr(13) + sText = Ltrim(sText2) ' sText = "<*Las Vegas*> " + sOut = sOut + "'"+sText +"'" + Chr(13) + sText = Rtrim(sText2) ' sText = " <*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + Chr(13) + sText = Trim(sText2) ' sText = "<*Las Vegas*>" + sOut = sOut +"'"+ sText +"'" + MsgBox sOut +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120314.xhp b/source/text/sbasic/shared/03120314.xhp index dc92dd7c8a..40b37617a8 100644 --- a/source/text/sbasic/shared/03120314.xhp +++ b/source/text/sbasic/shared/03120314.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Split Function [Runtime] -/text/sbasic/shared/03120314.xhp - - -Sun Microsystems, Inc. - + + Split Function [Runtime] + /text/sbasic/shared/03120314.xhp + + + +
-Split function + + Split function -Split Function [Runtime] -Returns an array of substrings from a string expression. + + +Split Function [Runtime] +Returns an array of substrings from a string expression.
-Syntax: - -Split (Text As String, delimiter, number) + +Syntax: + +Split (Text As String, delimiter, number) -Return value: -String -Parameters: - -Text: Any string expression. - -delimiter (optional): A string of one or more characters length that is used to delimit the Text. The default is the space character. - -number (optional): The number of substrings that you want to return. -Example: + +Return value: +String + +Parameters: + Text: Any string expression. + delimiter (optional): A string of one or more characters length that is used to delimit the Text. The default is the space character. + number (optional): The number of substrings that you want to return. + +Example: +
-Dim a(3) -Sub main() - a(0) = "ABCDE" - a(1) = 42 - a(2) = "MN" - a(3) = "X Y Z" - JStr = Join1() - Call Show(JStr, Split1(JStr)) - JStr = Join2() - Call Show(JStr, Split1(JStr)) - JStr = Join3() - Call Show(JStr, Split1(JStr)) -End Sub - -Function Join1() - Join1 = Join(a(), "abc") -End Function - -Function Join2() - Join2 = Join(a(), ",") -End Function - -Function Join3() - Join3 = Join(a()) -End Function - -Function Split1(aStr) - Split1 = Split(aStr, "D") -End Function - -Sub Show(JoinStr, TheArray) - l = LBound(TheArray) - u = UBound(TheArray) - total$ = "=============================" + Chr$(13) + JoinStr + Chr$(13) + Chr$(13) - For i = l To u - total$ = total$ + TheArray(i) + Str(Len(TheArray(i))) + Chr$(13) - Next i - MsgBox total$ -End Sub +Dim a(3) +Sub main() + a(0) = "ABCDE" + a(1) = 42 + a(2) = "MN" + a(3) = "X Y Z" + JStr = Join1() + Call Show(JStr, Split1(JStr)) + JStr = Join2() + Call Show(JStr, Split1(JStr)) + JStr = Join3() + Call Show(JStr, Split1(JStr)) +End Sub + +Function Join1() + Join1 = Join(a(), "abc") +End Function + +Function Join2() + Join2 = Join(a(), ",") +End Function + +Function Join3() + Join3 = Join(a()) +End Function + +Function Split1(aStr) + Split1 = Split(aStr, "D") +End Function + +Sub Show(JoinStr, TheArray) + l = LBound(TheArray) + u = UBound(TheArray) + total$ = "=============================" + Chr$(13) + JoinStr + Chr$(13) + Chr$(13) + For i = l To u + total$ = total$ + TheArray(i) + Str(Len(TheArray(i))) + Chr$(13) + Next i + MsgBox total$ +End Sub
-
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120401.xhp b/source/text/sbasic/shared/03120401.xhp index 346b742132..e2007efda9 100644 --- a/source/text/sbasic/shared/03120401.xhp +++ b/source/text/sbasic/shared/03120401.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -InStr Function [Runtime] -/text/sbasic/shared/03120401.xhp - - -Sun Microsystems, Inc. - + + InStr Function [Runtime] + /text/sbasic/shared/03120401.xhp + + + +
-InStr function + + InStr function -InStr Function [Runtime] -Returns the position of a string within another string. + + +InStr Function [Runtime] +Returns the position of a string within another string.
-The Instr function returns the position at which the match was found. If the string was not found, the function returns 0. -Syntax: +The Instr function returns the position at which the match was found. If the string was not found, the function returns 0. + +Syntax: -InStr ([Start As Long,] Text1 As String, Text2 As String[, Compare]) +InStr ([Start As Long,] Text1 As String, Text2 As String[, Compare]) -Return value: -Integer -Parameters: - -Start: A numeric expression that marks the position in a string where the search for the specified substring starts. If you omit this parameter, the search starts at the first character of the string. The maximum allowed value is 65535.see i17928 - -Text1: The string expression that you want to search. - -Text2: The string expression that you want to search for. - -Compare: Optional numeric expression that defines the type of comparison. The value of this parameter can be 0 or 1. The default value of 1 specifies a text comparison that is not case-sensitive. The value of 0 specifies a binary comparison that is case-sensitive.fixes i17929 -To avoid a run-time error, do not set the Compare parameter if the first return parameter is omitted. + +Return value: +Integer + +Parameters: + Start: A numeric expression that marks the position in a string where the search for the specified substring starts. If you omit this parameter, the search starts at the first character of the string. The maximum allowed value is 65535.see i17928 + Text1: The string expression that you want to search. + Text2: The string expression that you want to search for. + Compare: Optional numeric expression that defines the type of comparison. The value of this parameter can be 0 or 1. The default value of 1 specifies a text comparison that is not case-sensitive. The value of 0 specifies a binary comparison that is case-sensitive.fixes i17929 +To avoid a run-time error, do not set the Compare parameter if the first return parameter is omitted. -Example: + +Example: -Sub ExamplePosition -Dim sInput As String -Dim iPos As Integer - sInput = "Office" - iPos = Instr(sInput,"c") - Print iPos -End Sub +Sub ExamplePosition +Dim sInput As String +Dim iPos As Integer + sInput = "Office" + iPos = Instr(sInput,"c") + Print iPos +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03120403.xhp b/source/text/sbasic/shared/03120403.xhp index 3dbb1c08dd..da4702125d 100644 --- a/source/text/sbasic/shared/03120403.xhp +++ b/source/text/sbasic/shared/03120403.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -StrComp Function [Runtime] -/text/sbasic/shared/03120403.xhp - - -Sun Microsystems, Inc. - + + StrComp Function [Runtime] + /text/sbasic/shared/03120403.xhp + + + +
-StrComp function + + StrComp function -StrComp Function [Runtime] -Compares two strings and returns an integer value that represents the result of the comparison. + + +StrComp Function [Runtime] +Compares two strings and returns an integer value that represents the result of the comparison.
-Syntax: - -StrComp (Text1 As String, Text2 As String[, Compare]) + +Syntax: + +StrComp (Text1 As String, Text2 As String[, Compare]) -Return value: -Integer -Parameter: - -Text1: Any string expression - -Text2: Any string expression - -Compare: This optional parameter sets the comparison method. If Compare = 1, the string comparison is case-sensitive. If Compare = 0, no distinction is made between uppercase and lowercase letters. -Return value + +Return value: +Integer + +Parameter: + Text1: Any string expression + Text2: Any string expression + Compare: This optional parameter sets the comparison method. If Compare = 1, the string comparison is case-sensitive. If Compare = 0, no distinction is made between uppercase and lowercase letters. + +Return value + - -If Text1 < Text2 the function returns -1 - - -If Text1 = Text2 the function returns 0 - - -If Text1 > Text2 the function returns 1 - - + + If Text1 < Text2 the function returns -1 + + + If Text1 = Text2 the function returns 0 + + + If Text1 > Text2 the function returns 1 + -Example: + +Example: -Sub ExampleStrComp -Dim iVar As Single -Dim sVar As String - iVar = 123.123 - sVar = Str$(iVar) - MsgBox strcomp(sVar , Str$(iVar),1) -End Sub +Sub ExampleStrComp +Dim iVar As Single +Dim sVar As String + iVar = 123.123 + sVar = Str$(iVar) + MsgBox strcomp(sVar , Str$(iVar),1) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03130500.xhp b/source/text/sbasic/shared/03130500.xhp index 13795a2a74..e6c35138ae 100644 --- a/source/text/sbasic/shared/03130500.xhp +++ b/source/text/sbasic/shared/03130500.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Shell Function [Runtime] -/text/sbasic/shared/03130500.xhp - - -Sun Microsystems, Inc. - + + Shell Function [Runtime] + /text/sbasic/shared/03130500.xhp + + + +
-Shell function + + Shell function -Shell Function [Runtime] -Starts another application and defines the respective window style, if necessary. + + +Shell Function [Runtime] +Starts another application and defines the respective window style, if necessary.
-Syntax -Shell (Pathname As String[, Windowstyle As Integer][, Param As String][, bSync]) -Parameter -Pathname -Complete path and program name of the program that you want to start. -Windowstyle -Optional integer expression that specifies the style of the window that the program is executed in. The following values are possible: + +Syntax +Shell (Pathname As String[, Windowstyle As Integer][, Param As String][, bSync]) + +Parameter + +Pathname +Complete path and program name of the program that you want to start. + +Windowstyle +Optional integer expression that specifies the style of the window that the program is executed in. The following values are possible: + - - -0 - - -The focus is on the hidden program window. - - - - -1 - - -The focus is on the program window in standard size. - - - - -2 - - -The focus is on the minimized program window. - - - - -3 - - -focus is on the maximized program window. - - - - -4 - - -Standard size program window, without focus. - - - - -6 - - -Minimized program window, focus remains on the active window. - - - - -10 - - -Full-screen display. - - + + + 0 + + + The focus is on the hidden program window. + + + + + 1 + + + The focus is on the program window in standard size. + + + + + 2 + + + The focus is on the minimized program window. + + + + + 3 + + + focus is on the maximized program window. + + + + + 4 + + + Standard size program window, without focus. + + + + + 6 + + + Minimized program window, focus remains on the active window. + + + + + 10 + + + Full-screen display. + +
-Param -Any string expression that specifies the command line that want to pass. -bSync -If this value is set to true, the Shell command and all $[officename] tasks wait until the shell process completes. If the value is set to false, the shell returns directly. The default value is false. + +Param +Any string expression that specifies the command line that want to pass. + +bSync +If this value is set to true, the Shell command and all $[officename] tasks wait until the shell process completes. If the value is set to false, the shell returns directly. The default value is false. -Example + +Example -Sub ExampleShellForWin - Shell("c:\windows\calc.exe",2) -End Sub +Sub ExampleShellForWin + Shell("c:\windows\calc.exe",2) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03130700.xhp b/source/text/sbasic/shared/03130700.xhp index 50dc15a01d..1339a01373 100644 --- a/source/text/sbasic/shared/03130700.xhp +++ b/source/text/sbasic/shared/03130700.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -GetSystemTicks Function [Runtime] -/text/sbasic/shared/03130700.xhp - - -Sun Microsystems, Inc. - + + GetSystemTicks Function [Runtime] + /text/sbasic/shared/03130700.xhp + + + +
-GetSystemTicks function + + GetSystemTicks function -GetSystemTicks Function [Runtime] -Returns the number of system ticks provided by the operating system. You can use this function to optimize certain processes. + + +GetSystemTicks Function [Runtime] +Returns the number of system ticks provided by the operating system. You can use this function to optimize certain processes.
-Syntax: - -GetSystemTicks() + +Syntax: + +GetSystemTicks() -Return value: -Long + +Return value: +Long -Example: + +Example: -Sub ExampleWait -Dim lTick As Long - lTick = GetSystemTicks() - Wait 2000 - lTick = (GetSystemTicks() - lTick) - MsgBox "" & lTick & " Ticks" ,0,"The pause lasted" -End Sub +Sub ExampleWait +Dim lTick As Long + lTick = GetSystemTicks() + Wait 2000 + lTick = (GetSystemTicks() - lTick) + MsgBox "" & lTick & " Ticks" ,0,"The pause lasted" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03130800.xhp b/source/text/sbasic/shared/03130800.xhp index 33745f5986..c900cc9e9c 100644 --- a/source/text/sbasic/shared/03130800.xhp +++ b/source/text/sbasic/shared/03130800.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -Environ Function [Runtime] -/text/sbasic/shared/03130800.xhp - - -Sun Microsystems, Inc. - + + Environ Function [Runtime] + /text/sbasic/shared/03130800.xhp + + + +
-Environ function + + Environ function -Environ Function [Runtime] -Returns the value of an environment variable as a string. Environment variables are dependent on the type of operating system that you have. + + +Environ Function [Runtime] +Returns the value of an environment variable as a string. Environment variables are dependent on the type of operating system that you have.
-Syntax: + +Syntax: -Environ (Environment As String) +Environ (Environment As String) -Return value: -String -Parameters: -Environment: Environment variable that you want to return the value for. + +Return value: +String + +Parameters: +Environment: Environment variable that you want to return the value for. -Example: + +Example: -Sub ExampleEnviron -Dim sTemp As String - sTemp=Environ ("TEMP") - If sTemp = "" Then sTemp=Environ("TMP") - MsgBox "'" & sTemp & "'" ,64,"Directory of temporary files:" -End Sub +Sub ExampleEnviron +Dim sTemp As String + sTemp=Environ ("TEMP") + If sTemp = "" Then sTemp=Environ("TMP") + MsgBox "'" & sTemp & "'" ,64,"Directory of temporary files:" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03131000.xhp b/source/text/sbasic/shared/03131000.xhp index 47061a593c..e028470d89 100644 --- a/source/text/sbasic/shared/03131000.xhp +++ b/source/text/sbasic/shared/03131000.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -GetSolarVersion Function [Runtime] -/text/sbasic/shared/03131000.xhp - - -Sun Microsystems, Inc. - + + GetSolarVersion Function [Runtime] + /text/sbasic/shared/03131000.xhp + + + +
-GetSolarVersion function + + GetSolarVersion function -GetSolarVersion Function [Runtime] -Returns the internal number of the current $[officename] version. + + +GetSolarVersion Function [Runtime] +Returns the internal number of the current $[officename] version.
-Syntax: - -s = GetSolarVersion + +Syntax: + +s = GetSolarVersion -Return value: -String -Example: + +Return value: +String + +Example: -Sub ExampleGetSolarVersion -Dim sSep As String - sSep = GetSolarVersion - MsgBox sSep,64,"Version number of the solar technology" -End Sub +Sub ExampleGetSolarVersion +Dim sSep As String + sSep = GetSolarVersion + MsgBox sSep,64,"Version number of the solar technology" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03131300.xhp b/source/text/sbasic/shared/03131300.xhp index a9d3744dd6..cc15202054 100644 --- a/source/text/sbasic/shared/03131300.xhp +++ b/source/text/sbasic/shared/03131300.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -TwipsPerPixelX Function [Runtime] -/text/sbasic/shared/03131300.xhp - - -Sun Microsystems, Inc. - + + TwipsPerPixelX Function [Runtime] + /text/sbasic/shared/03131300.xhp + + + +
-TwipsPerPixelX function + + TwipsPerPixelX function -TwipsPerPixelX Function [Runtime] -Returns the number of twips that represent the width of a pixel. + + +TwipsPerPixelX Function [Runtime] +Returns the number of twips that represent the width of a pixel.
-Syntax: - -n = TwipsPerPixelX + +Syntax: + +n = TwipsPerPixelX -Return value: -Integer -Example: + +Return value: +Integer + +Example: -Sub ExamplePixelTwips - MsgBox "" & TwipsPerPixelX() & " Twips * " & TwipsPerPixelY() & " Twips",0,"Pixel size" -End Sub +Sub ExamplePixelTwips + MsgBox "" & TwipsPerPixelX() & " Twips * " & TwipsPerPixelY() & " Twips",0,"Pixel size" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03131400.xhp b/source/text/sbasic/shared/03131400.xhp index 494e1e0752..b3a8402003 100644 --- a/source/text/sbasic/shared/03131400.xhp +++ b/source/text/sbasic/shared/03131400.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -TwipsPerPixelY Function [Runtime] -/text/sbasic/shared/03131400.xhp - - -Sun Microsystems, Inc. - + + TwipsPerPixelY Function [Runtime] + /text/sbasic/shared/03131400.xhp + + + +
-TwipsPerPixelY function + + TwipsPerPixelY function -TwipsPerPixelY Function [Runtime] -Returns the number of twips that represent the height of a pixel. + + +TwipsPerPixelY Function [Runtime] +Returns the number of twips that represent the height of a pixel.
-Syntax: - -n = TwipsPerPixelY + +Syntax: + +n = TwipsPerPixelY -Return value: -Integer -Example: + +Return value: +Integer + +Example: -Sub ExamplePixelTwips - MsgBox "" & TwipsPerPixelX() & " Twips * " & TwipsPerPixelY() & " Twips",0,"Pixel size" -End Sub +Sub ExamplePixelTwips + MsgBox "" & TwipsPerPixelX() & " Twips * " & TwipsPerPixelY() & " Twips",0,"Pixel size" +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03131600.xhp b/source/text/sbasic/shared/03131600.xhp index f926e0febc..816e879090 100644 --- a/source/text/sbasic/shared/03131600.xhp +++ b/source/text/sbasic/shared/03131600.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CreateUnoService Function [Runtime] -/text/sbasic/shared/03131600.xhp - - -Sun Microsystems, Inc. - + + CreateUnoService Function [Runtime] + /text/sbasic/shared/03131600.xhp + + + +
-CreateUnoService function + + CreateUnoService function -CreateUnoService Function [Runtime] -Instantiates a Uno service with the ProcessServiceManager. + + +CreateUnoService Function [Runtime] +Instantiates a Uno service with the ProcessServiceManager.
-Syntax: - -oService = CreateUnoService( Uno service name ) + +Syntax: + +oService = CreateUnoService( Uno service name ) -For a list of available services, go to: http://api.libreoffice.org/docs/common/ref/com/sun/star/module-ix.html -Examples: -oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" ) -filepicker;API service +For a list of available services, go to: http://api.libreoffice.org/docs/common/ref/com/sun/star/module-ix.html + +Examples: +oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" ) + + filepicker;API service -The following code uses a service to open a file open dialog: + +The following code uses a service to open a file open dialog: -Sub Main - fName = FileOpenDialog ("Please select a file") - Print "file chosen: "+fName -End Sub - -Function FileOpenDialog(title As String) As String - filepicker = createUnoService("com.sun.star.ui.dialogs.FilePicker") - filepicker.Title = title - filepicker.execute() - files = filepicker.getFiles() - FileOpenDialog=files(0) -End Function +Sub Main + fName = FileOpenDialog ("Please select a file") + Print "file chosen: "+fName +End Sub + +Function FileOpenDialog(title As String) As String + filepicker = createUnoService("com.sun.star.ui.dialogs.FilePicker") + filepicker.Title = title + filepicker.execute() + files = filepicker.getFiles() + FileOpenDialog=files(0) +End Function -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03132000.xhp b/source/text/sbasic/shared/03132000.xhp index cf1a178a61..70247182e4 100644 --- a/source/text/sbasic/shared/03132000.xhp +++ b/source/text/sbasic/shared/03132000.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -CreateUnoListener Function [Runtime] -/text/sbasic/shared/03132000.xhp - - -Sun Microsystems, Inc. - + + CreateUnoListener Function [Runtime] + /text/sbasic/shared/03132000.xhp + + + +
-CreateUnoListener function + + CreateUnoListener function -CreateUnoListener Function [Runtime] -Creates a Listener instance. + + +CreateUnoListener Function [Runtime] +Creates a Listener instance.
-Many Uno interfaces let you register listeners on a special listener interface. This allows you to listen for specific events and call up the appropriate listener method. The CreateUnoListener function waits for the called listener interface and then passes the interface an object that the interface supports. This object is then passed to the method to register the listener. -Syntax: - -oListener = CreateUnoListener( Prefixname, ListenerInterfaceName ) +Many Uno interfaces let you register listeners on a special listener interface. This allows you to listen for specific events and call up the appropriate listener method. The CreateUnoListener function waits for the called listener interface and then passes the interface an object that the interface supports. This object is then passed to the method to register the listener. + +Syntax: + +oListener = CreateUnoListener( Prefixname, ListenerInterfaceName ) -Example: -The following example is based on a Basic library object. + +Example: +The following example is based on a Basic library object. -Dim oListener -oListener = CreateUnoListener( "ContListener_","com.sun.star.container.XContainerListener" ) +Dim oListener +oListener = CreateUnoListener( "ContListener_","com.sun.star.container.XContainerListener" ) -The CreateUnoListener method requires two parameters. The first is a prefix and is explained in detail below. The second parameter is the fully qualified name of the Listener interface that you want to use. -The Listener must then be added to the Broadcaster Object. This is done by calling the appropriate method for adding a Listener. These methods always follow the pattern "addFooListener", where "Foo" is the Listener Interface Type, without the 'X'. In this example, the addContainerListener method is called to register the XContainerListener: +The CreateUnoListener method requires two parameters. The first is a prefix and is explained in detail below. The second parameter is the fully qualified name of the Listener interface that you want to use. +The Listener must then be added to the Broadcaster Object. This is done by calling the appropriate method for adding a Listener. These methods always follow the pattern "addFooListener", where "Foo" is the Listener Interface Type, without the 'X'. In this example, the addContainerListener method is called to register the XContainerListener: -Dim oLib -oLib = BasicLibraries.Library1 ' Library1 must exist! -oLib.addContainerListener( oListener ) ' Register the listener +Dim oLib +oLib = BasicLibraries.Library1 ' Library1 must exist! +oLib.addContainerListener( oListener ) ' Register the listener -The Listener is now registered. When an event occurs, the corresponding Listener calls the appropriate method from the com.sun.star.container.XContainerListener Interface. -The prefix calls registered Listeners from Basic-subroutines. The Basic run-time system searches for Basic-subroutines or functions that have the name "PrefixListenerMethode" and calls them when found. Otherwise, a run-time error occurs. -In this example, the Listener-Interface uses the following methods: +The Listener is now registered. When an event occurs, the corresponding Listener calls the appropriate method from the com.sun.star.container.XContainerListener Interface. +The prefix calls registered Listeners from Basic-subroutines. The Basic run-time system searches for Basic-subroutines or functions that have the name "PrefixListenerMethode" and calls them when found. Otherwise, a run-time error occurs. +In this example, the Listener-Interface uses the following methods: + - -disposing: - - -Listener base interface (com.sun.star.lang.XEventListener): base interface for all Listener Interfaces - - -elementInserted: - - -Method of the com.sun.star.container.XContainerListener interface - - -elementRemoved: - - -Method of the com.sun.star.container.XContainerListener interface - - -elementReplaced: - - -Method of the com.sun.star.container.XContainerListener interface - - -In this example, the prefix is ContListener_. The following subroutines must therefore be implemented in Basic: + + disposing: + + + Listener base interface (com.sun.star.lang.XEventListener): base interface for all Listener Interfaces + + + elementInserted: + + + Method of the com.sun.star.container.XContainerListener interface + + + elementRemoved: + + + Method of the com.sun.star.container.XContainerListener interface + + + elementReplaced: + + + Method of the com.sun.star.container.XContainerListener interface + +In this example, the prefix is ContListener_. The following subroutines must therefore be implemented in Basic: + - -ContListener_disposing - - -ContListener_elementInserted - - -ContListener_elementRemoved - - -ContListener_elementReplaced - - -An event structure type that contains information about an event exists for every Listener type. When a Listener method is called, an instance of this event is passed to the method as a parameter. Basic Listener methods can also call these event objects, so long as the appropriate parameter is passed in the Sub declaration. For example: + + ContListener_disposing + + + ContListener_elementInserted + + + ContListener_elementRemoved + + + ContListener_elementReplaced + +An event structure type that contains information about an event exists for every Listener type. When a Listener method is called, an instance of this event is passed to the method as a parameter. Basic Listener methods can also call these event objects, so long as the appropriate parameter is passed in the Sub declaration. For example: -Sub ContListener_disposing( oEvent ) - MsgBox "disposing" - MsgBox oEvent.Dbg_Properties -End Sub - -Sub ContListener_elementInserted( oEvent ) - MsgBox "elementInserted" - MsgBox oEvent.Dbg_Properties -End Sub - -Sub ContListener_elementRemoved( oEvent ) - MsgBox "elementRemoved" - MsgBox oEvent.Dbg_Properties -End Sub - -Sub ContListener_elementReplaced( oEvent ) - MsgBox "elementReplaced" - MsgBox oEvent.Dbg_Properties -End Sub +Sub ContListener_disposing( oEvent ) + MsgBox "disposing" + MsgBox oEvent.Dbg_Properties +End Sub + +Sub ContListener_elementInserted( oEvent ) + MsgBox "elementInserted" + MsgBox oEvent.Dbg_Properties +End Sub + +Sub ContListener_elementRemoved( oEvent ) + MsgBox "elementRemoved" + MsgBox oEvent.Dbg_Properties +End Sub + +Sub ContListener_elementReplaced( oEvent ) + MsgBox "elementReplaced" + MsgBox oEvent.Dbg_Properties +End Sub -You do not need to include the parameter of an event object if the object is not used: +You do not need to include the parameter of an event object if the object is not used: -' Minimal implementation of Sub disposing -Sub ContListener_disposing -End Sub +' Minimal implementation of Sub disposing +Sub ContListener_disposing +End Sub -Listener methods must always be implemented to avoid Basic run-time errors. +Listener methods must always be implemented to avoid Basic run-time errors. -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03132200.xhp b/source/text/sbasic/shared/03132200.xhp index 5f239c1ee9..50bc6007ba 100644 --- a/source/text/sbasic/shared/03132200.xhp +++ b/source/text/sbasic/shared/03132200.xhp @@ -1,6 +1,5 @@ - - + - - +--> + - -ThisComponent Statement [Runtime] -/text/sbasic/shared/03132200.xhp - - -Sun Microsystems, Inc. - + + ThisComponent Statement [Runtime] + /text/sbasic/shared/03132200.xhp + + + +
-ThisComponent property -components;addressing + + ThisComponent property + components;addressing -ThisComponent [Runtime] -Addresses the active component so that its properties can be read and set. ThisComponent is used from document Basic, where it represents the document the Basic belongs to. The type of object accessed by ThisComponent depends on the document type.see i60932 + + +ThisComponent [Runtime] +Addresses the active component so that its properties can be read and set. ThisComponent is used from document Basic, where it represents the document the Basic belongs to. The type of object accessed by ThisComponent depends on the document type.see i60932
-Syntax: - -ThisComponent + +Syntax: + +ThisComponent -Example: + +Example: -Sub Main -' updates the "Table of Contents" in a text doc -Dim allindexes, index As Object - allindexes = ThisComponent.getDocumentIndexes() - index = allindexes.getByName("Table of Contents1") - ' use the default name for Table of Contents and a 1 - index.update() -End Sub +Sub Main +' updates the "Table of Contents" in a text doc +Dim allindexes, index As Object + allindexes = ThisComponent.getDocumentIndexes() + index = allindexes.getByName("Table of Contents1") + ' use the default name for Table of Contents and a 1 + index.update() +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/03132400.xhp b/source/text/sbasic/shared/03132400.xhp index 7a66cfe5f1..d586a65866 100644 --- a/source/text/sbasic/shared/03132400.xhp +++ b/source/text/sbasic/shared/03132400.xhp @@ -1,6 +1,5 @@ - - + +--> - - -CreateObject Function [Runtime] -/text/sbasic/shared/03132400.xhp - + + CreateObject Function [Runtime] + /text/sbasic/shared/03132400.xhp + + + +
-CreateObject function + + CreateObject function -CreateObject Function [Runtime] -Creates a UNO object. On Windows, can also create OLE objects.see i70942 -This method creates instances of the type that is passed as parameter. + + +CreateObject Function [Runtime] +Creates a UNO object. On Windows, can also create OLE objects.see i70942 +This method creates instances of the type that is passed as parameter.
-Syntax: - -oObj = CreateObject( type ) + +Syntax: + +oObj = CreateObject( type ) -Example: + +Example: -Type address - Name1 As String - City As String -End Type - -Sub main - myaddress = CreateObject("address") - MsgBox IsObject(myaddress) -End Sub +Type address + Name1 As String + City As String +End Type + +Sub main + myaddress = CreateObject("address") + MsgBox IsObject(myaddress) +End Sub -
+ +
\ No newline at end of file diff --git a/source/text/scalc/01/02140700.xhp b/source/text/scalc/01/02140700.xhp index 1970ef4572..8ad966827e 100644 --- a/source/text/scalc/01/02140700.xhp +++ b/source/text/scalc/01/02140700.xhp @@ -19,7 +19,7 @@ --> - + Fill Random Numbers text/scalc/01/02140700.xhp diff --git a/source/text/scalc/01/func_averageif.xhp b/source/text/scalc/01/func_averageif.xhp index c41e8e9122..85e19ddcfe 100644 --- a/source/text/scalc/01/func_averageif.xhp +++ b/source/text/scalc/01/func_averageif.xhp @@ -35,7 +35,7 @@ The Criterion needs to be a string expression, in particular, the Criterion needs to be enclosed in quotation marks ("Criterion") with the exception of the names of functions, cell references and an operation of a string concatenation (&). If a cell in a range of values for calculating the mean is empty or contains text, function AVERAGEIF ignores this cell.
If the whole range is empty, contains only text or all values of the range do not satisfy the condition (or any combination of those), the function returns the #DIV/0! error.
- + In all calculations below, range for average calculation contains the row #6, but it is ignored, because it contains text. Simple usage =AVERAGEIF(B2:B6;"<35") diff --git a/source/text/scalc/01/func_averageifs.xhp b/source/text/scalc/01/func_averageifs.xhp index 6fb90925ae..882518086c 100644 --- a/source/text/scalc/01/func_averageifs.xhp +++ b/source/text/scalc/01/func_averageifs.xhp @@ -41,7 +41,7 @@ The function can have up to 255 arguments, meaning that you can specify 127 crit If a cell contains TRUE, it is treated as 1, if a cell contains FALSE – as 0 (zero).
If the whole range is empty, contains only text or all values of the range do not satisfy the condition (or any combination of those), the function returns the #DIV/0! error.
If the range of values for calculating the mean and any range for finding criterion have unequal sizes, the function returns err:502. - + In all examples below, ranges for average calculation contain the row #6, but it is ignored, because it contains text. Simple usage =AVERAGEIFS(B2:B6;B2:B6;">=20") diff --git a/source/text/scalc/01/func_imsinh.xhp b/source/text/scalc/01/func_imsinh.xhp index 8df95b97a5..7c50b2beda 100644 --- a/source/text/scalc/01/func_imsinh.xhp +++ b/source/text/scalc/01/func_imsinh.xhp @@ -64,7 +64,7 @@ returns 3.62686040784702 as a string. -

+
, , diff --git a/source/text/scalc/01/stat_data.xhp b/source/text/scalc/01/stat_data.xhp index edb3c47929..31e5611306 100644 --- a/source/text/scalc/01/stat_data.xhp +++ b/source/text/scalc/01/stat_data.xhp @@ -19,7 +19,7 @@ --> - + Data /text/scalc/01/stat_data.xhp @@ -551,4 +551,4 @@
- \ No newline at end of file + diff --git a/source/text/scalc/01/statistics.xhp b/source/text/scalc/01/statistics.xhp index 3ce9fd8a69..5cdd15940c 100644 --- a/source/text/scalc/01/statistics.xhp +++ b/source/text/scalc/01/statistics.xhp @@ -19,7 +19,7 @@ --> - + Data Statistics in Calc /text/scalc/01/statistics.xhp diff --git a/source/text/scalc/guide/formulas.xhp b/source/text/scalc/guide/formulas.xhp index eef1d19a60..3c87fb15bb 100644 --- a/source/text/scalc/guide/formulas.xhp +++ b/source/text/scalc/guide/formulas.xhp @@ -95,7 +95,6 @@ Calculates the sum of cells B10 to B14 and adds the value to B8. -removed row with old row limit of 65536 It is also possible to nest functions in formulas, as shown in the example. You can also nest functions within functions. The Function Wizard assists you with nested functions.
diff --git a/source/text/shared/01/01010100.xhp b/source/text/shared/01/01010100.xhp index da5c49ab8a..c86793f239 100644 --- a/source/text/shared/01/01010100.xhp +++ b/source/text/shared/01/01010100.xhp @@ -23,9 +23,10 @@ - -Sun Microsystems, Inc. - + + Templates Manager + /text/shared/01/01010100.xhp +
diff --git a/source/text/shared/optionen/01040400.xhp b/source/text/shared/optionen/01040400.xhp index 2c68f0618c..f6147a2bf4 100644 --- a/source/text/shared/optionen/01040400.xhp +++ b/source/text/shared/optionen/01040400.xhp @@ -95,11 +95,9 @@
If you print a document in portrait on a landscape page, two opposing sides in a brochure will be printed next to each other. If you have a printer with double-sided printing capability, you can create an entire brochure from your document without having to collate the pages later. If you have a printer that only has single-sided printing capability, you can achieve this effect by first printing the front pages with the "Front sides / right pages /odd pages" option marked, then re-inserting the entire paper stack in your printer and printing all the back pages with the "Back pages / left pages / even pages" option marked.
- Right to left Check to print the pages of the brochure in the correct order for a right-to-left script. - Comments diff --git a/source/text/simpress/presenter.xhp b/source/text/simpress/presenter.xhp index e69f03fa5e..37a58da391 100644 --- a/source/text/simpress/presenter.xhp +++ b/source/text/simpress/presenter.xhp @@ -20,7 +20,7 @@ - Presenter Console Keyboard Shortcuts + Presenter Console Keyboard Shortcuts /text/simpress/presenter.xhp -- cgit