From 7175bf45cdd40029d33213fe559525b185b6db78 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Mon, 24 Sep 2012 14:02:05 +0200 Subject: format a few Basic code examples Change-Id: I6c1563eb7f1b3d8b353da963ab7521e17c57e24f --- .../source/text/sbasic/shared/03030101.xhp | 18 +++++---- .../source/text/sbasic/shared/03030102.xhp | 8 ++-- .../source/text/sbasic/shared/03030103.xhp | 12 ++++-- .../source/text/sbasic/shared/03030104.xhp | 12 ++++-- .../source/text/sbasic/shared/03030105.xhp | 44 +++++++++++----------- .../source/text/sbasic/shared/03030106.xhp | 12 ++++-- 6 files changed, 62 insertions(+), 44 deletions(-) (limited to 'helpcontent2/source') diff --git a/helpcontent2/source/text/sbasic/shared/03030101.xhp b/helpcontent2/source/text/sbasic/shared/03030101.xhp index 0024d716f..c088a10fb 100644 --- a/helpcontent2/source/text/sbasic/shared/03030101.xhp +++ b/helpcontent2/source/text/sbasic/shared/03030101.xhp @@ -66,13 +66,15 @@ Example: -Sub ExampleDateSerial -Dim lDate as Long -Dim sDate as String -lDate = DateSerial(1964, 4, 9) -sDate = DateSerial(1964, 4, 9) -msgbox lDate REM returns 23476 -msgbox sDate REM returns 04/09/1964 -end sub + +Sub ExampleDateSerial +Dim lDate As Long +Dim sDate As String + lDate = DateSerial(1964, 4, 9) + sDate = DateSerial(1964, 4, 9) + MsgBox lDate ' returns 23476 + MsgBox sDate ' returns 04/09/1964 +End Sub + diff --git a/helpcontent2/source/text/sbasic/shared/03030102.xhp b/helpcontent2/source/text/sbasic/shared/03030102.xhp index 917e95ef2..78b8e8e55 100644 --- a/helpcontent2/source/text/sbasic/shared/03030102.xhp +++ b/helpcontent2/source/text/sbasic/shared/03030102.xhp @@ -61,8 +61,10 @@ Example: -Sub ExampleDateValue -msgbox DateValue("12/02/1997") -end sub + +Sub ExampleDateValue + MsgBox DateValue("12/02/2011") +End Sub + diff --git a/helpcontent2/source/text/sbasic/shared/03030103.xhp b/helpcontent2/source/text/sbasic/shared/03030103.xhp index 045f688bf..38c735eed 100644 --- a/helpcontent2/source/text/sbasic/shared/03030103.xhp +++ b/helpcontent2/source/text/sbasic/shared/03030103.xhp @@ -54,13 +54,17 @@ Number: A numeric expression that contains a serial date number from which you can determine the day of the month. This function is basically the opposite of the DateSerial function, returning the day of the month from a serial date number generated by the DateSerial or the DateValue function. For example, the expression -Print Day (DateSerial(1994, 12, 20)) + +Print Day (DateSerial(1994, 12, 20)) + returns the value 20. Example: -sub ExampleDay -Print "Day " & Day(DateSerial(1994, 12, 20)) & " of the month" -end sub + +Sub ExampleDay + Print "Day " & Day(DateSerial(1994, 12, 20)) & " of the month" +End Sub + diff --git a/helpcontent2/source/text/sbasic/shared/03030104.xhp b/helpcontent2/source/text/sbasic/shared/03030104.xhp index 989f0af76..6addc4672 100644 --- a/helpcontent2/source/text/sbasic/shared/03030104.xhp +++ b/helpcontent2/source/text/sbasic/shared/03030104.xhp @@ -54,13 +54,17 @@ Number: Numeric expression that contains the serial date number that is used to determine the month of the year. This function is the opposite of the DateSerial function. It returns the month in the year that corresponds to the serial date that is generated by DateSerial or DateValue. For example, the expression -Print Month(DateSerial(1994, 12, 20)) + +Print Month(DateSerial(1994, 12, 20)) + returns the value 12. Example: -Sub ExampleMonth -MsgBox "" & Month(Now) ,64,"The current month" -End sub + +Sub ExampleMonth + MsgBox "" & Month(Now) ,64,"The current month" +End Sub + diff --git a/helpcontent2/source/text/sbasic/shared/03030105.xhp b/helpcontent2/source/text/sbasic/shared/03030105.xhp index aa9070caf..10245b344 100644 --- a/helpcontent2/source/text/sbasic/shared/03030105.xhp +++ b/helpcontent2/source/text/sbasic/shared/03030105.xhp @@ -57,26 +57,28 @@ Example: -Sub ExampleWeekDay -Dim sDay As String -REM Return and display the day of the week -Select Case WeekDay( Now ) -case 1 -sDay="Sunday" -case 2 -sDay="Monday" -case 3 -sDay="Tuesday" -case 4 -sDay="Wednesday" -case 5 -sDay="Thursday" -case 6 -sDay="Friday" -case 7 -sDay="Saturday" -End Select -msgbox "" + sDay,64,"Today is" -End Sub + +Sub ExampleWeekDay +Dim sDay As String +' Return And display the day of the week + Select Case WeekDay( Now ) + Case 1 + sDay="Sunday" + Case 2 + sDay="Monday" + Case 3 + sDay="Tuesday" + Case 4 + sDay="Wednesday" + Case 5 + sDay="Thursday" + Case 6 + sDay="Friday" + Case 7 + sDay="Saturday" + End Select + MsgBox "" + sDay,64,"Today Is" +End Sub + diff --git a/helpcontent2/source/text/sbasic/shared/03030106.xhp b/helpcontent2/source/text/sbasic/shared/03030106.xhp index e1690c69b..544c63fdf 100644 --- a/helpcontent2/source/text/sbasic/shared/03030106.xhp +++ b/helpcontent2/source/text/sbasic/shared/03030106.xhp @@ -54,13 +54,17 @@ Number: Integer expression that contains the serial date number that is used to calculate the year. This function is the opposite of the DateSerial function, and returns the year of a serial date. For example, the expression: -Print Year(DateSerial(1994, 12, 20)) + +Print Year(DateSerial(1994, 12, 20)) + returns the value 1994. Example: -Sub ExampleYear -MsgBox "" & Year(Now) ,64,"Current year" -End sub + +Sub ExampleYear + MsgBox "" & Year(Now) ,64,"Current year" +End Sub + -- cgit v1.2.1