diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:09:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:09:20 +0000 |
commit | 029f72b1a93430b24b88eb3a72c6114d9f149737 (patch) | |
tree | 765d5c2041967f9c6fef195fe343d9234a030e90 /runtime/indent/testdir/vb.in | |
parent | Initial commit. (diff) | |
download | vim-029f72b1a93430b24b88eb3a72c6114d9f149737.tar.xz vim-029f72b1a93430b24b88eb3a72c6114d9f149737.zip |
Adding upstream version 2:9.1.0016.upstream/2%9.1.0016
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/indent/testdir/vb.in')
-rw-r--r-- | runtime/indent/testdir/vb.in | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/runtime/indent/testdir/vb.in b/runtime/indent/testdir/vb.in new file mode 100644 index 0000000..1653ae6 --- /dev/null +++ b/runtime/indent/testdir/vb.in @@ -0,0 +1,134 @@ +' vim: filetype=vb shiftwidth=4 expandtab +' +' START_INDENT +Public Type GEmployeeRecord ' Create user-defined type. +ID As Integer ' Define elements of data type. +Name As String * 20 +Address As String * 30 +Phone As Long +HireDate As Date +End Type + +Public Enum InterfaceColors +icMistyRose = &HE1E4FF& +icSlateGray = &H908070& +icDodgerBlue = &HFF901E& +icDeepSkyBlue = &HFFBF00& +icSpringGreen = &H7FFF00& +icForestGreen = &H228B22& +icGoldenrod = &H20A5DA& +icFirebrick = &H2222B2& +End Enum + +Enum SecurityLevel +IllegalEntry = -1 +SecurityLevel1 = 0 +SecurityLevel2 = 1 +End Enum + +Public Function TestConditional (number As Integer, ext As String) As Boolean +Dim inRange As Boolean + +Select Case number +Case <= 0 +inRange = False +Case > 10 +inRange = False +Case Else +inRange = True +End Select + +' This is a special case identified in the indent script. +Select Case number +End Select + +If ext = ".xlm" Then +If inRange Then +TestConditional = True +Else +TestConditional = False +End If +ElseIf ext = ".xlsx" Then +If inRange Then +TestConditional = False +Else +TestConditional = True +End If +Else +TestConditional = False +End If +End Function + +Private Sub TestIterators (lLimit As Integer, uLimit As Integer) +Dim a() As Variant +Dim elmt As Variant +Dim found As Boolean +Dim indx As Integer +Const specialValue As Integer = 5 + +If uLimit < lLimit Then +Exit Sub +End If + +ReDim a(lLimit To uLimit) +For indx=lLimit To Ulimit +a(indx) = 2 * indx +Next indx + +found = False +For Each elmt in a +If elmt = specialValue Then +found = True +End If +Next elmt + +If found then +indx = uLimit +Do While indx >= lLimit +indx = indx - 1 +Loop +End If + +End Sub + +Public Sub TestMultiline (cellAddr As String, rowNbr As Long) +Dim rng As Range + +Set rng = Range(cellAddr) +With rng +.Cells(1,1).Value = _ +"Line 1 of multiline string; " & _ +"Line 2 of multiline string; " & _ +"Line 3 of multiline string" +End With + +' The following lines have whitespace after the underscore character +' and therefore do not form a valid multiline statement. The indent +' script correctly treats them as four single line statements contrary +' to the author's obvious indent. +rng..Cells(1,1).Value = _ +"Line 1 of multiline string; " & _ +"Line 2 of multiline string; " & _ +"Line 3 of multiline string" + +End Sub + +Private Sub TestStmtLabel() +GoTo stmtLabel + +' Statement labels are never indented +stmtLabel: + +End Sub + +Sub TestTypeKeyword() +Type EmployeeRecord ' Create user-defined type. +ID As Integer ' Define elements of data type. +Name As String * 20 +Address As String * 30 +Phone As Long +HireDate As Date +End Type +Dim varType As EmployeeRecord +End Sub +' END_INDENT |