Rabu, 01 April 2020

SMALL BASIC: Checking elements are same value or not

Hi, Small Basic programmer, welcome.

In this tutorial we will learned about a program that check whether values of colomn of the same row of an array are same or not same using SMALL Basic.

This is useful sometimes when you program and few situations.

So here is the program:
y[0] = "Failed"
y[1] = "Success"
y[2] = "Failed"

y_l = Array.GetItemCount(y) - 1
For i = 0 To y_l
  If y[i] = "Success" Then
    TextWindow.WriteLine("Not all failed")
    Goto quitloop
  Else
    If i = y_l then
      TextWindow.WriteLine("All failed")
      EndIf
      EndIf
EndFor
  quitloop:




Tidak ada komentar:

Posting Komentar