September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
16
Task/Search-a-list/Gambas/search-a-list.gambas
Normal file
16
Task/Search-a-list/Gambas/search-a-list.gambas
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Public Sub Main()
|
||||
Dim sHaystack As String[] = ["Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie", "Bush", "Boz", "Zag"]
|
||||
Dim sNeedle As String = "Charlie"
|
||||
Dim sOutput As String = "No needle found!"
|
||||
Dim siCount As Short
|
||||
|
||||
For siCount = 0 To sHaystack.Max
|
||||
If sNeedle = sHaystack[siCount] Then
|
||||
sOutPut = sNeedle & " found at index " & Str(siCount)
|
||||
Break
|
||||
End If
|
||||
Next
|
||||
|
||||
Print sOutput
|
||||
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue