“Son of man, set your face against Gog, of the land of Magog, the chief prince of Meshek and Tubal; prophesy against him
Jumat, 24 April 2020
Rabu, 22 April 2020
CPP: Structure
Hi, CPP Programmer, welcome.
Structure vs array
Structure are different types value. Array are the same type value.
Structure consist of:
1. Structure variable
2. Structure tag
3. Structure member
Defining structure tag is optional.
Defining member is just like the defining variable.
Basic structure use are below:
#include <iostream>
#include <cstring>
using namespace std;
//1.Create the structure
struct Books{
char title[50];
char author[50];
char subject[50];
int book_id;
};
int main()
{
//2. Declare Book1 of type Books
struct Books Book1;
struct Books Book2;
//3. Define book Book1 specification
strcpy( Book1.title, "Learn C++ Programming");
strcpy( Book1.author, "Chand Miyan");
strcpy( Book1.subject, "C++ Programming");
Book1.book_id = 6495407;
//4. Define book Book2 specification
strcpy( Book1.title, "Telecom Billing");
strcpy( Book2.author, "Yakit Singha");
strcpy( Book2.subject, "Telecom");
Book2.book_id = 6495700;
//5. Print out Book1 info
cout << "Book 1 title: " << Book1.title << endl;
cout << "Book 1 author: " << Book1.author << endl;
cout << "Book 1 subject: " << Book1.subject << endl;
cout << "Book 1 book id: " << Book1.book_id << endl;
//6. Print
cout << "Book 1 title: " << Book1.title << endl;
cout << "Book 1 author: " << Book1.author << endl;
cout << "Book 1 subject: " << Book1.subject << endl;
cout << "Book 1 book id: " << Book1.book_id << endl;
}
Sending structure variable pointer to a function is almost the same as sending the struct variable to the function, the difference is: if you use structure variable pointer you use asterix and you need to declare a structure variable pointer.
Structure vs array
Structure are different types value. Array are the same type value.
Structure consist of:
1. Structure variable
2. Structure tag
3. Structure member
Defining structure tag is optional.
Defining member is just like the defining variable.
Basic structure use are below:
#include <iostream>
#include <cstring>
using namespace std;
//1.Create the structure
struct Books{
char title[50];
char author[50];
char subject[50];
int book_id;
};
int main()
{
//2. Declare Book1 of type Books
struct Books Book1;
struct Books Book2;
//3. Define book Book1 specification
strcpy( Book1.title, "Learn C++ Programming");
strcpy( Book1.author, "Chand Miyan");
strcpy( Book1.subject, "C++ Programming");
Book1.book_id = 6495407;
//4. Define book Book2 specification
strcpy( Book1.title, "Telecom Billing");
strcpy( Book2.author, "Yakit Singha");
strcpy( Book2.subject, "Telecom");
Book2.book_id = 6495700;
//5. Print out Book1 info
cout << "Book 1 title: " << Book1.title << endl;
cout << "Book 1 author: " << Book1.author << endl;
cout << "Book 1 subject: " << Book1.subject << endl;
cout << "Book 1 book id: " << Book1.book_id << endl;
//6. Print
cout << "Book 1 title: " << Book1.title << endl;
cout << "Book 1 author: " << Book1.author << endl;
cout << "Book 1 subject: " << Book1.subject << endl;
cout << "Book 1 book id: " << Book1.book_id << endl;
}
Sending structure variable pointer to a function is almost the same as sending the struct variable to the function, the difference is: if you use structure variable pointer you use asterix and you need to declare a structure variable pointer.
Senin, 20 April 2020
SMALL BASIC: Printing stars
Hi, SMALL BASIC programmer, welcome.
In this tutorial, we will discus about variety of printing stars or asteriks.
1. Incremented stars
num_of_row = 10
For i = 0 To num_of_row
For j = 0 To i
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine("")
EndFor
Output:
2. Reversed incremented (decremented stars)
num_of_row = 10
For i = num_of_row To 0 Step -1
For j = 0 To i
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine("")
EndFor
In this tutorial, we will discus about variety of printing stars or asteriks.
1. Incremented stars
num_of_row = 10
For i = 0 To num_of_row
For j = 0 To i
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine("")
EndFor
Output:
2. Reversed incremented (decremented stars)
num_of_row = 10
For i = num_of_row To 0 Step -1
For j = 0 To i
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine("")
EndFor
Or, you can combine step 1 and step 2 into one program, like below:
num_of_row = 10
For round = 0 To 100
For i = 0 To num_of_row
For j = 0 To i
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine("")
EndFor
'TextWindow.WriteLine("Ok, sukses atas")
Program.delay(1000)
TextWindow.Clear()
For i = num_of_row To 0 Step -1
For j = 0 To i
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine("")
EndFor
Program.Delay(1000)
TextWindow.Clear()
EndFor
3. The decremented space
num_of_row = 10
For i = 1 To num_of_row
For j = 1 To num_of_row - i
TextWindow.Write(" ")
EndFor
For k = 1 To i
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine(" ")
EndFor
Output:
4. The last the increment space
num_of_row = 10
For i = 1 To num_of_row
For j = 1 To i
TextWindow.Write(" ")
EndFor
For k = 1 To num_of_row - i 'the rest of colomn
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine(" ")
EndFor
Output:
5. The last, I don't know what to call this, but I call this cool stars
num_of_row = 10
For i = 1 To num_of_row
For j = 1 To num_of_row - i
TextWindow.Write(" ")
EndFor
For k = 1 To num_of_row - 1
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine(" ")
EndFor
6. I don't know what to call this, but I call this smooky stars
num_of_row = 10
For i = 1 To num_of_row
For j = 1 To num_of_row - i
TextWindow.Write(" ")
EndFor
For k = 1 To j
TextWindow.Write("* ")
EndFor
TextWindow.WriteLine(" ")
EndFor
Minggu, 19 April 2020
SMALL BASIC: Algorithm to download webpage from the internet
Hello, SMALL Basic programmer, welcome.
You know that you can download webpage from the internet using SMALL basic?
This is the algorithm:
1. Ask user about the link of the web page.
2. Download the webpage.
3. Print out the result of the step 2 to the screen, or
4. Ask the user about the folder to save the file to (optionally).
5. Save it to a file on local directory (optionally).
This is the code:
'Ask
TextWindow.WriteLine("1. What page do you like to traverse? Use https:// or http:// ")
wp = TextWindow.Read()
'Get the webpage (wp)
'gwp = Network.GetWebPageContents("www.facebook.com/katakatalelucondanlucu")
'gwp = Network.GetWebPageContents("https://corona.jakarta.go.id/id")
gwp = Network.GetWebPageContents(wp)
TextWindow.Write(gwp)
TextWindow.WriteLine("2. (Optional) Tell me, what is the folder you want the web page saved to, for instance C:\Users\Totzfreelance\mywebpage.html:")
folder = TextWindow.Read()
File.WriteContents(folder,gwp)
You know that you can download webpage from the internet using SMALL basic?
This is the algorithm:
1. Ask user about the link of the web page.
2. Download the webpage.
3. Print out the result of the step 2 to the screen, or
4. Ask the user about the folder to save the file to (optionally).
5. Save it to a file on local directory (optionally).
This is the code:
'Ask
TextWindow.WriteLine("1. What page do you like to traverse? Use https:// or http:// ")
wp = TextWindow.Read()
'Get the webpage (wp)
'gwp = Network.GetWebPageContents("www.facebook.com/katakatalelucondanlucu")
'gwp = Network.GetWebPageContents("https://corona.jakarta.go.id/id")
gwp = Network.GetWebPageContents(wp)
TextWindow.Write(gwp)
TextWindow.WriteLine("2. (Optional) Tell me, what is the folder you want the web page saved to, for instance C:\Users\Totzfreelance\mywebpage.html:")
folder = TextWindow.Read()
File.WriteContents(folder,gwp)
SMALL BASIC: Printing out String a letter by a letter
a = "AAAAAA"
For i = 1 To Text.GetLength(a)
TextWindow.WriteLine(text.GetSubText(a,i,1))
EndFor
For i = 1 To Text.GetLength(a)
TextWindow.WriteLine(text.GetSubText(a,i,1))
EndFor
Journey to find Gog and Magog
Fact
1. Gog and magog mentioned twice in the bible:
2. Ezekiel prophet was born 621 BC. Live in the ancient Israel. 3. Babylonian Kingdom exist in the time Ezekiel mentioned Gog and Magog 4. First world map is from Babylonian 600 B.C. according to Wikipedia: https://en.wikipedia.org/wiki/Early_world_maps
1. Gog and magog mentioned twice in the bible:
and will go out to deceive the nations in the four corners of the earth—Gog and Magog—and to gather them for battle. In number they are like the sand on the seashore.
Jumat, 17 April 2020
IPv4 Activity
Basic:
1. Binary to decimal conversion activity
For example:
Enter the decimal of this binary: 00110111
Decimal is: 55
2. Decimal to binary conversion activity
For example:
Enter the binary of this decimal: 241
The binary is: 11110001
3. Given address/prefix 144.97.144.28/23
Determine:
1. Network address,
1.1. Last octet in binary
1.2 Last octet in decimal
1.3 Enter full address in decimal
2. Broadcast address
2.1 Last octet in binary
2.2 Last octet in decimal
2.3 Enter full address in decimal
3. First usable host address
3.1 Enter last octet in binary
3.2 Enter last octet in decimal
3.3 Enter the full address in decimal
4. Last Usable Host Address
4.1 Enter Last octet in binary
4.2 Enter Last octet in decimal
4.3 Enter full address in decimal
To remember this: NAHAMA.
NA = Network address
HA = Host Address
FHA = First host address
LHA = Last host address
HBA = Host Broadcast Address
SMA = Subnet Mask Address
1. Determining network address in decimal and in binary of a pair host address and mask address.
For example:
Host address: 10.158.30.81
Subnet Mask: 255.255.224.0
Solution: Anding both each host octet and respective subnetmask octet.
You can watch how the solution is in this video:
3. Determining First Usable Host (FUH), Last Usable Host (LUH), Broadcast address in Decimal (BAD), and Next Network in decimal (NND)
First Usable Host (FUH)
1. Get all bit 0 in subnetmask in binary
2. Increment 1 to last octet.
Last Usable Host (LUH)
1. Get all the 0 bits of subnetmask in binary.
2. Make 1 all except the Less Significant bit (LSB).
3. Divide the bits of step 2 per octet.
4. Increment each octet value to each octet of network address in decimal.
Broadcast address in Decimal
1. Get all the 0 bits subnetmask in binary
2. Make 1 all
3. Divide the bits of step 2 per octet
4. Increment each octet value to each octet of network address in decimal.
Next Network in decimal (NND)
1.
2.
3.
1. Binary to decimal conversion activity
For example:
Enter the decimal of this binary: 00110111
Decimal is: 55
2. Decimal to binary conversion activity
For example:
Enter the binary of this decimal: 241
The binary is: 11110001
3. Given address/prefix 144.97.144.28/23
Determine:
1. Network address,
1.1. Last octet in binary
1.2 Last octet in decimal
1.3 Enter full address in decimal
2. Broadcast address
2.1 Last octet in binary
2.2 Last octet in decimal
2.3 Enter full address in decimal
3. First usable host address
3.1 Enter last octet in binary
3.2 Enter last octet in decimal
3.3 Enter the full address in decimal
4. Last Usable Host Address
4.1 Enter Last octet in binary
4.2 Enter Last octet in decimal
4.3 Enter full address in decimal
To remember this: NAHAMA.
NA = Network address
HA = Host Address
FHA = First host address
LHA = Last host address
HBA = Host Broadcast Address
SMA = Subnet Mask Address
1. Determining network address in decimal and in binary of a pair host address and mask address.
For example:
Host address: 10.158.30.81
Subnet Mask: 255.255.224.0
Solution: Anding both each host octet and respective subnetmask octet.
You can watch how the solution is in this video:
2. Determining the number of host
The solution is: (2 ^ number of bit 0 in the subnetmask in binary form) - 2.
You can watch how to solve it easily in this video:
3. Determining First Usable Host (FUH), Last Usable Host (LUH), Broadcast address in Decimal (BAD), and Next Network in decimal (NND)
First Usable Host (FUH)
1. Get all bit 0 in subnetmask in binary
2. Increment 1 to last octet.
Last Usable Host (LUH)
1. Get all the 0 bits of subnetmask in binary.
2. Make 1 all except the Less Significant bit (LSB).
3. Divide the bits of step 2 per octet.
4. Increment each octet value to each octet of network address in decimal.
Broadcast address in Decimal
1. Get all the 0 bits subnetmask in binary
2. Make 1 all
3. Divide the bits of step 2 per octet
4. Increment each octet value to each octet of network address in decimal.
Next Network in decimal (NND)
1.
2.
3.
Kamis, 16 April 2020
SMALL BASIC: File database searcher
Hi, SMALL BASIC programmer, welcome.
In this tutorial we will learned about how we can search multiple occurance of a keyword from a txt database.
'So the solution is read line per line
i = 1
TextWindow.WriteLine("Enter the file that you like to traverse? : ")
'file = TextWindow.Read()
file = "C:\Users\Totardo\Geneacology based on revelation.txt"
contain = File.ReadLine("C:\Users\Totardo\Geneacology based on revelation.txt",i)
While contain <> ""
'TextWindow.WriteLine(contain)
get_result = Text.GetIndexOf(contain,"Henokh")
If get_result <> 0 Then
TextWindow.WriteLine(contain)
EndIf
i = i + 1
contain = File.ReadLine(file,i)
EndWhile
In this tutorial we will learned about how we can search multiple occurance of a keyword from a txt database.
'So the solution is read line per line
i = 1
TextWindow.WriteLine("Enter the file that you like to traverse? : ")
'file = TextWindow.Read()
file = "C:\Users\Totardo\Geneacology based on revelation.txt"
contain = File.ReadLine("C:\Users\Totardo\Geneacology based on revelation.txt",i)
While contain <> ""
'TextWindow.WriteLine(contain)
get_result = Text.GetIndexOf(contain,"Henokh")
If get_result <> 0 Then
TextWindow.WriteLine(contain)
EndIf
i = i + 1
contain = File.ReadLine(file,i)
EndWhile
FFMPEG: extract video
We will use:
- to
- t
- ss
Three of them are can be used as input and output parameter.
All of them use time duration specification https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax
Extract only 1 minute:
ffmpeg -t 00:01:00 -i 2020-04-16 04-36-06.mkv output1.mkv
Extracting only 1 minute and 30 seconds:
ffmpeg -i 2020-04-16 04-36-06.mkv -t 00:01:30 output2.mkv
Extracting using -ss and -t (if you know the start time and stop time that you like):
ffmpeg -i 2020-04-16 04-36-06.mkv -to 00:01:30 output3.mkv
Extracting using -ss and -t
- to
- t
- ss
Three of them are can be used as input and output parameter.
All of them use time duration specification https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax
Extract only 1 minute:
ffmpeg -t 00:01:00 -i 2020-04-16 04-36-06.mkv output1.mkv
Extracting only 1 minute and 30 seconds:
ffmpeg -i 2020-04-16 04-36-06.mkv -t 00:01:30 output2.mkv
Extracting using -ss and -t (if you know the start time and stop time that you like):
ffmpeg -i 2020-04-16 04-36-06.mkv -to 00:01:30 output3.mkv
Extracting using -ss and -t
Senin, 13 April 2020
SMALL BASIC: Factorial Calculator
Hi, SMALL Basic programmer, welcome.
Did you know, we can also make factorial calculator using SMALL BASIC?
We will divide the code as:
1. Code with wrong result of 0!
2. Code that with correct result of 0!
So, you can see the difference.
Below is the code:
1. Code with wrong result of 0!
TextWindow.WriteLine("Welcome to factorial calculator")
TextWindow.WriteLine("Enter the n: " )
n = TextWindow.Read()
res = n
For i = n-1 To 1 Step -1
res = res * i
EndFor
TextWindow.WriteLine(res)
2. Code with correct result of 0!
This below is completed program:
TextWindow.WriteLine("Welcome to factorial calculator.")
TextWindow.WriteLine("Enter the n: " )
n = TextWindow.Read()
res = n
If n = 0 Then
res = 1
Else
For i = n-1 To 1 Step -1
res = res * i
EndFor
EndIf
TextWindow.WriteLine("The result of permutation is: " + res)
Did you know, we can also make factorial calculator using SMALL BASIC?
We will divide the code as:
1. Code with wrong result of 0!
2. Code that with correct result of 0!
So, you can see the difference.
Below is the code:
1. Code with wrong result of 0!
TextWindow.WriteLine("Welcome to factorial calculator")
TextWindow.WriteLine("Enter the n: " )
n = TextWindow.Read()
res = n
For i = n-1 To 1 Step -1
res = res * i
EndFor
TextWindow.WriteLine(res)
2. Code with correct result of 0!
This below is completed program:
TextWindow.WriteLine("Welcome to factorial calculator.")
TextWindow.WriteLine("Enter the n: " )
n = TextWindow.Read()
res = n
If n = 0 Then
res = 1
Else
For i = n-1 To 1 Step -1
res = res * i
EndFor
EndIf
TextWindow.WriteLine("The result of permutation is: " + res)
SMALL BASIC: Programming quiz #3
1. What will be the result or the output of these lines of code?
For i = 0 To 10
g[Array.getitemcount(g)+i] = i
EndFor
TextWindow.WriteLine(g)
2. What will the output of these lines below, do you think its working?
start = 100
For i = (start - 1) To 1
TextWindow.WriteLine(i)
Program.Delay(1000)
EndFor
For i = 0 To 10
g[Array.getitemcount(g)+i] = i
EndFor
TextWindow.WriteLine(g)
2. What will the output of these lines below, do you think its working?
start = 100
For i = (start - 1) To 1
TextWindow.WriteLine(i)
Program.Delay(1000)
EndFor
Selasa, 07 April 2020
SMALL BASIC: For determined start row and col
Hi, SMALL BASIC programmer, welcome.
Did you know that small basic for can be started not only from the beginning or a.k.a line 0 or row 0 and col 0?
Below is the example:
traversed_row = 3
traversed_col = 4
For i = traversed_row To 5
If i = traversed_row Then
For j = traversed_col To 5
TextWindow.WriteLine("i : " + i + ", j: " + j)
EndFor
else
For j = 0 To 5
TextWindow.WriteLine("i : " + i + ", j: "+ j)
EndFor
endif
EndFor
Did you know that small basic for can be started not only from the beginning or a.k.a line 0 or row 0 and col 0?
Below is the example:
traversed_row = 3
traversed_col = 4
For i = traversed_row To 5
If i = traversed_row Then
For j = traversed_col To 5
TextWindow.WriteLine("i : " + i + ", j: " + j)
EndFor
else
For j = 0 To 5
TextWindow.WriteLine("i : " + i + ", j: "+ j)
EndFor
endif
EndFor
SMALL BASIC: File
File take the information match as the Windows file.
There are cases, for instance:
1. Folder can't be accessed or forbidden.
2.
3.
There are cases, for instance:
1. Folder can't be accessed or forbidden.
2.
3.
Minggu, 05 April 2020
FFMPEG: Extracting ce
To study how camera works, you need to study lens.
You need to learn also about: pinhole camera : https://www.google.com/imgres?imgurl=http%3A%2F%2Fwww.funkidslive.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fhow-does-a-pinhole-camera-work-1024x518.png&imgrefurl=https%3A%2F%2Fwww.funkidslive.com%2Fsummer-challenge%2Fwhats-analogue-digital-photography-work%2F&tbnid=bzKHJMBFrjOHYM&vet=10CAsQxiAoAWoXChMI0IbZpt_Q6AIVAAAAAB0AAAAAEAU..i&docid=4bAQZfSgmSydWM&w=1024&h=518&itg=1&q=how%20does%20the%20camera%20works&safe=strict&ved=0CAsQxiAoAWoXChMI0IbZpt_Q6AIVAAAAAB0AAAAAEAU
Remember the pin-hole eyed glasses.
You need to learn how lens work
1. Convex - both side of circle to the center point
2. Concav - both side of circle to the outer point
You need to learn also about: pinhole camera : https://www.google.com/imgres?imgurl=http%3A%2F%2Fwww.funkidslive.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fhow-does-a-pinhole-camera-work-1024x518.png&imgrefurl=https%3A%2F%2Fwww.funkidslive.com%2Fsummer-challenge%2Fwhats-analogue-digital-photography-work%2F&tbnid=bzKHJMBFrjOHYM&vet=10CAsQxiAoAWoXChMI0IbZpt_Q6AIVAAAAAB0AAAAAEAU..i&docid=4bAQZfSgmSydWM&w=1024&h=518&itg=1&q=how%20does%20the%20camera%20works&safe=strict&ved=0CAsQxiAoAWoXChMI0IbZpt_Q6AIVAAAAAB0AAAAAEAU
Remember the pin-hole eyed glasses.
You need to learn how lens work
1. Convex - both side of circle to the center point
2. Concav - both side of circle to the outer point
SMALL BASIC: Folder and subfolder 2
Hi, SMALL BASIC programmer, welcome.
TextWindow.WriteLine("Please enter the start folder: ")
start[0] = TextWindow.Read()
'1. Take the 1st door
'Make start as an array
loop_start = 0
start:
TextWindow.Clear()
loop_start = loop_start + 1
TextWindow.WriteLine("This is start: " + start)
TextWindow.Pause()
TextWindow.WriteLine("This is the level depth: " + loop_start)
TextWindow.pause()
'TextWindow.WriteLine("This is start: " + start)
s_l = Array.GetItemCount(start) - 1
TextWindow.WriteLine("This is start length:" + s_l)
'Take all the 1st doors
'Remember that getdirectories start from 1
nbr_iterator = 0
For i = 0 To s_l
'TextWindow.WriteLine("This is i for s_l: " + i)
'TextWindow.Pause()
fgd = File.GetDirectories(start[i])
If fgd <> "" Or fgd <> "FAILED" Then
''Get fgd length
f_l = Array.GetItemCount(fgd)
'n_l = Array.GetItemCount(nbr) - 1
TextWindow.WriteLine("This is the mother door: " + start[i])
TextWindow.WriteLine("========================")
For j = 1 To f_l
nbr[nbr_iterator] = fgd[j]
TextWindow.WriteLine("this is nbr index: " + nbr_iterator + "this is the son: " + nbr[nbr_iterator])
'Program.Delay(1000)
nbr_iterator = nbr_iterator + 1
'TextWindow.WriteLine("this is nbr_iterator: " + nbr_iterator)
'TextWindow.WriteLine("This is the value of index " + nbr_iterator + ": " + nbr[nbr_iterator])
'Program.Delay(1000)
EndFor
Else
EndIf
EndFor
TextWindow.WriteLine(nbr)
TextWindow.Pause()
'4. Count the length of nbr and route based on the length wether it goes up again or end of program
n_l = Array.GetItemCount(nbr) - 1
If n_l <= 0 Then
TextWindow.WriteLine("End of the program")
Goto eop
Else
'Fill the total array with nbr element so later nbr element will be cleared
'Get the last element of the total array
t_l = Array.GetItemCount(total)
For i = 0 To n_l
total[t_l + i] = nbr[i]
TextWindow.writeline(total[t_l+i])
EndFor
start = nbr
nbr = ""
Goto start
EndIf
eop:
TextWindow.WriteLine(nbr)
TextWindow.WriteLine("Please enter the start folder: ")
start[0] = TextWindow.Read()
'1. Take the 1st door
'Make start as an array
loop_start = 0
start:
TextWindow.Clear()
loop_start = loop_start + 1
TextWindow.WriteLine("This is start: " + start)
TextWindow.Pause()
TextWindow.WriteLine("This is the level depth: " + loop_start)
TextWindow.pause()
'TextWindow.WriteLine("This is start: " + start)
s_l = Array.GetItemCount(start) - 1
TextWindow.WriteLine("This is start length:" + s_l)
'Take all the 1st doors
'Remember that getdirectories start from 1
nbr_iterator = 0
For i = 0 To s_l
'TextWindow.WriteLine("This is i for s_l: " + i)
'TextWindow.Pause()
fgd = File.GetDirectories(start[i])
If fgd <> "" Or fgd <> "FAILED" Then
''Get fgd length
f_l = Array.GetItemCount(fgd)
'n_l = Array.GetItemCount(nbr) - 1
TextWindow.WriteLine("This is the mother door: " + start[i])
TextWindow.WriteLine("========================")
For j = 1 To f_l
nbr[nbr_iterator] = fgd[j]
TextWindow.WriteLine("this is nbr index: " + nbr_iterator + "this is the son: " + nbr[nbr_iterator])
'Program.Delay(1000)
nbr_iterator = nbr_iterator + 1
'TextWindow.WriteLine("this is nbr_iterator: " + nbr_iterator)
'TextWindow.WriteLine("This is the value of index " + nbr_iterator + ": " + nbr[nbr_iterator])
'Program.Delay(1000)
EndFor
Else
EndIf
EndFor
TextWindow.WriteLine(nbr)
TextWindow.Pause()
'4. Count the length of nbr and route based on the length wether it goes up again or end of program
n_l = Array.GetItemCount(nbr) - 1
If n_l <= 0 Then
TextWindow.WriteLine("End of the program")
Goto eop
Else
'Fill the total array with nbr element so later nbr element will be cleared
'Get the last element of the total array
t_l = Array.GetItemCount(total)
For i = 0 To n_l
total[t_l + i] = nbr[i]
TextWindow.writeline(total[t_l+i])
EndFor
start = nbr
nbr = ""
Goto start
EndIf
eop:
TextWindow.WriteLine(nbr)
SMALL BASIC: Permutation calculator
Hi, SMALL BASIC programmer, welcome.
Before we dive in, we need to learn what permutation are.
Permutations are:
1. Different elements.
2. Minus one each range from the number of elements.
3. The same as factorial, if n are r.
So, this is the code:
TextWindow.WriteLine("Welcome to permutation calculator!")
TextWindow.WriteLine("Created by: Jesus Christ, lord and the Messiah!")
TextWindow.WriteLine("Hello enter the n: ")
start = TextWindow.Read()
k = start - 1
'TextWindow.WriteLine("This is k : " + k)
res = start
For i = k To Step -1
res = res * (i)
'TextWindow.WriteLine("This is i: " + i)
'TextWindow.Writeline("This is result: " + res)
'j = j + 1
EndFor
'get the length of result array
'r_l = Array.GetItemCount(result) - 1
TextWindow.WriteLine("The result is: " + res)
Before we dive in, we need to learn what permutation are.
Permutations are:
1. Different elements.
2. Minus one each range from the number of elements.
3. The same as factorial, if n are r.
So, this is the code:
TextWindow.WriteLine("Welcome to permutation calculator!")
TextWindow.WriteLine("Created by: Jesus Christ, lord and the Messiah!")
TextWindow.WriteLine("Hello enter the n: ")
start = TextWindow.Read()
k = start - 1
'TextWindow.WriteLine("This is k : " + k)
res = start
For i = k To Step -1
res = res * (i)
'TextWindow.WriteLine("This is i: " + i)
'TextWindow.Writeline("This is result: " + res)
'j = j + 1
EndFor
'get the length of result array
'r_l = Array.GetItemCount(result) - 1
TextWindow.WriteLine("The result is: " + res)
Jumat, 03 April 2020
SMALL BASIC: Drag-n-drop version 1
Hi, SMALL BASIC programmer, welcome.
Did you know that SMALL BASIC can also make a draag-n-drop program?
Here is the code:
'1. Preparing the graphics windows
GraphicsWindow.Show()
GraphicsWindow.Width = Desktop.Width
GraphicsWindow.Height = Desktop.Height
GraphicsWindow.Top = 0
GraphicsWindow.Left = 0
'2. Define the program header introduction
TextWindow.WriteLine("Hello Welcome to drag and drop program")
TextWindow.WriteLine("Created by Jesus Christ, the Lord and Messiah")
TextWindow.WriteLine("==============================================")
'2. Interactive session with user
TextWindow.WriteLine("1. Enter the url of the background that you like: ")
u_bground = TextWindow.Read()
'u_bground = "C:\Users\Totardo\Downloads\download (6).jpg"
TextWindow.WriteLine("2. Enter the url of the icon to drag-and-drop that you like: ")
u_icon = TextWindow.Read()
'u_icon = "C:\Users\Totardo\Downloads\download.jpg"
TextWindow.WriteLine("3. Enter the the x position of the icon to drag and drop (itdad_x): ")
itdad_x = TextWindow.read()
'itdad_x = 100
TextWindow.WriteLine("4. Enter the y position of the icon to drag and drop (itdad_y): ")
itdad_y = TextWindow.Read()
'itdad_y = 100
TextWindow.WriteLine("5. Enter the width of the itdad (w_itdad): ")
w_itdad = TextWindow.Read()
'w_itdad = 396
TextWindow.WriteLine("6. Enter the height of the itdad (h_itdad): ")
h_itdad = TextWindow.Read()
'h_itdad = 100
'3. Drawing background and icon and place the icon
GraphicsWindow.DrawImage(u_bground,0,0)
s_icon = Shapes.AddImage(u_icon)
Shapes.Move(s_icon,itdad_x,itdad_y)
'4. Define the event handler
GraphicsWindow.MouseDown = md
i = 0
follow_mouse = 0
'5. Define the main loop
loopz:
while follow_mouse <> 0
Shapes.Move(s_icon,GraphicsWindow.mousex,GraphicsWindow.mousey)
TextWindow.WriteLine("This is follow mouse from the main program: " + follow_mouse)
'Program.Delay(1000)
endwhile
Goto loopz
'6. Define the sub procedure md for mouse down
Sub md
'6.1 Toggle the keydown switch on and off
If keydown = 1 Then
keydown = 0
Else
keydown = 1
EndIf
'TextWindow.WriteLine("Key is: " + keydown)
'6.2 do something based on the switch on or off
If keydown = 1 Then
TextWindow.WriteLine("Its down")
'TextWindow.WriteLine("This is follow mouse: "+ follow_mouse)
'mx = Mouse.MouseX
mx = GraphicsWindow.MouseX
my = GraphicsWindow.mousey
'TextWindow.WriteLine("This is mouse x: " + mx)
'TextWindow.WriteLine("This is mouse y: " + my)
'TextWindow.WriteLine("This is total width: " + (itdad_x + w_itdad))
'TextWindow.WriteLine("This is total height: " + (itdad_y + h_itdad))
'TextWindow.WriteLine(GraphicsWindow.width/2+","+GraphicsWindow.Height/2)
'GraphicsWindow.DrawLine(itdad_x,0,itdad_x,GraphicsWindow.Height)
'GraphicsWindow.DrawLine(itdad_x+w_itdad,0,itdad_x+w_itdad, GraphicsWindow.Height)
'GraphicsWindow.DrawLine(0,itdad_y,GraphicsWindow.width,itdad_y)
'GraphicsWindow.DrawLine(0,itdad_y+h_itdad,GraphicsWindow.width,itdad_y+h_itdad)
'If mx lebih besar pojok dan lebih kecil sama dengan w_itdad
itdad_x = Shapes.GetLeft(s_icon)
itdad_y = Shapes.GetTop(s_icon)
If mx >= itdad_x And mx <= itdad_x + w_itdad Then
'TextWindow.WriteLine("Inside the width")
if my >= itdad_y And my <= (itdad_y + h_itdad) Then
'TextWindow.WriteLine("Inside the height")
'TextWindow.WriteLine("Its connect!")
If follow_mouse = 0 Then
follow_mouse = 1
EndIf
EndIf
EndIf
Else
If follow_mouse = 1 Then
follow_mouse = 0
EndIf
EndIf
'TextWindow.WriteLine("This is follow mouse on a sub: " + follow_mouse)
'Shapes.HideShape(s_icon)
'Shapes.ShowShape(s_icon)
EndSub
Did you know that SMALL BASIC can also make a draag-n-drop program?
Here is the code:
'1. Preparing the graphics windows
GraphicsWindow.Show()
GraphicsWindow.Width = Desktop.Width
GraphicsWindow.Height = Desktop.Height
GraphicsWindow.Top = 0
GraphicsWindow.Left = 0
'2. Define the program header introduction
TextWindow.WriteLine("Hello Welcome to drag and drop program")
TextWindow.WriteLine("Created by Jesus Christ, the Lord and Messiah")
TextWindow.WriteLine("==============================================")
'2. Interactive session with user
TextWindow.WriteLine("1. Enter the url of the background that you like: ")
u_bground = TextWindow.Read()
'u_bground = "C:\Users\Totardo\Downloads\download (6).jpg"
TextWindow.WriteLine("2. Enter the url of the icon to drag-and-drop that you like: ")
u_icon = TextWindow.Read()
'u_icon = "C:\Users\Totardo\Downloads\download.jpg"
TextWindow.WriteLine("3. Enter the the x position of the icon to drag and drop (itdad_x): ")
itdad_x = TextWindow.read()
'itdad_x = 100
TextWindow.WriteLine("4. Enter the y position of the icon to drag and drop (itdad_y): ")
itdad_y = TextWindow.Read()
'itdad_y = 100
TextWindow.WriteLine("5. Enter the width of the itdad (w_itdad): ")
w_itdad = TextWindow.Read()
'w_itdad = 396
TextWindow.WriteLine("6. Enter the height of the itdad (h_itdad): ")
h_itdad = TextWindow.Read()
'h_itdad = 100
'3. Drawing background and icon and place the icon
GraphicsWindow.DrawImage(u_bground,0,0)
s_icon = Shapes.AddImage(u_icon)
Shapes.Move(s_icon,itdad_x,itdad_y)
'4. Define the event handler
GraphicsWindow.MouseDown = md
i = 0
follow_mouse = 0
'5. Define the main loop
loopz:
while follow_mouse <> 0
Shapes.Move(s_icon,GraphicsWindow.mousex,GraphicsWindow.mousey)
TextWindow.WriteLine("This is follow mouse from the main program: " + follow_mouse)
'Program.Delay(1000)
endwhile
Goto loopz
'6. Define the sub procedure md for mouse down
Sub md
'6.1 Toggle the keydown switch on and off
If keydown = 1 Then
keydown = 0
Else
keydown = 1
EndIf
'TextWindow.WriteLine("Key is: " + keydown)
'6.2 do something based on the switch on or off
If keydown = 1 Then
TextWindow.WriteLine("Its down")
'TextWindow.WriteLine("This is follow mouse: "+ follow_mouse)
'mx = Mouse.MouseX
mx = GraphicsWindow.MouseX
my = GraphicsWindow.mousey
'TextWindow.WriteLine("This is mouse x: " + mx)
'TextWindow.WriteLine("This is mouse y: " + my)
'TextWindow.WriteLine("This is total width: " + (itdad_x + w_itdad))
'TextWindow.WriteLine("This is total height: " + (itdad_y + h_itdad))
'TextWindow.WriteLine(GraphicsWindow.width/2+","+GraphicsWindow.Height/2)
'GraphicsWindow.DrawLine(itdad_x,0,itdad_x,GraphicsWindow.Height)
'GraphicsWindow.DrawLine(itdad_x+w_itdad,0,itdad_x+w_itdad, GraphicsWindow.Height)
'GraphicsWindow.DrawLine(0,itdad_y,GraphicsWindow.width,itdad_y)
'GraphicsWindow.DrawLine(0,itdad_y+h_itdad,GraphicsWindow.width,itdad_y+h_itdad)
'If mx lebih besar pojok dan lebih kecil sama dengan w_itdad
itdad_x = Shapes.GetLeft(s_icon)
itdad_y = Shapes.GetTop(s_icon)
If mx >= itdad_x And mx <= itdad_x + w_itdad Then
'TextWindow.WriteLine("Inside the width")
if my >= itdad_y And my <= (itdad_y + h_itdad) Then
'TextWindow.WriteLine("Inside the height")
'TextWindow.WriteLine("Its connect!")
If follow_mouse = 0 Then
follow_mouse = 1
EndIf
EndIf
EndIf
Else
If follow_mouse = 1 Then
follow_mouse = 0
EndIf
EndIf
'TextWindow.WriteLine("This is follow mouse on a sub: " + follow_mouse)
'Shapes.HideShape(s_icon)
'Shapes.ShowShape(s_icon)
EndSub
SMALL BASIC: Controlling main program loop from sub
Hi, SMALL BASIC programmer, welcome.
In this tutorial, we will discussed how to control main program's loop from sub.
At first, the loop will be triggered with the click mouse and the stop it with click mouse, on and on.
The code example is below:
GraphicsWindow.Show()
GraphicsWindow.MouseDown = md
x = 0
loopz:
While x <> 0
TextWindow.WriteLine(x)
endwhile
Goto loopz
Sub md
If x = 0 Then
x = 1
Else
x = 0
EndIf
TextWindow.WriteLine(x)
EndSub
In this tutorial, we will discussed how to control main program's loop from sub.
At first, the loop will be triggered with the click mouse and the stop it with click mouse, on and on.
The code example is below:
GraphicsWindow.Show()
GraphicsWindow.MouseDown = md
x = 0
loopz:
While x <> 0
TextWindow.WriteLine(x)
endwhile
Goto loopz
Sub md
If x = 0 Then
x = 1
Else
x = 0
EndIf
TextWindow.WriteLine(x)
EndSub
Kamis, 02 April 2020
SMALL BASIC: Programming question session 2
1. If you have an array like below, what is the length of the array, notice the index 0 of the array is empty or "", i.e. What is the output of textwindow window?
myarr[0] = ""
myarr[1] = "A"
myarr[2] = "B"
TextWindow.WriteLine(Array.GetItemCount(myarr))
A). 1 B). 2 C). 3
2. Still with code from number 1
3. Logic question: Mr. Bono told to record all the room number that are not empty and handed that record to Mr. Bing, because Mr. Bing wants to knock every door's room, meet and invite every room user to have a tea while talk with him/her about the rise of the rent.
But,
4). Look for the code below, I want to add fgd array's element to nbr array's element. Do you think the nbr array elements grows or appended with fgd elements forever?
fgd[0] = "Added"
fgd[1] = "Added"
nbr[0] = 0
nbr[1] = 1
start:
nbr_l = array.GetItemCount(nbr)
TextWindow.WriteLine(nbr_l)
TextWindow.Pause()
For i= 0 To 1
nbr[i+nbr_l] = fgd[i]
EndFor
TextWindow.writeline(nbr)
Program.delay(1000)
Goto start
5). Multi dimension array question. Look at for the code below, do you think the code will generated y as a multi dimension array? or not?
x[0] = 10
x[1] = 11
For i = 0 To 1
y[i] = x
EndFor
TextWindow.WriteLine(y)
6). Still based on question 5, how many lines or rows, array y have?
myarr[0] = ""
myarr[1] = "A"
myarr[2] = "B"
TextWindow.WriteLine(Array.GetItemCount(myarr))
A). 1 B). 2 C). 3
2. Still with code from number 1
3. Logic question: Mr. Bono told to record all the room number that are not empty and handed that record to Mr. Bing, because Mr. Bing wants to knock every door's room, meet and invite every room user to have a tea while talk with him/her about the rise of the rent.
But,
4). Look for the code below, I want to add fgd array's element to nbr array's element. Do you think the nbr array elements grows or appended with fgd elements forever?
fgd[0] = "Added"
fgd[1] = "Added"
nbr[0] = 0
nbr[1] = 1
start:
nbr_l = array.GetItemCount(nbr)
TextWindow.WriteLine(nbr_l)
TextWindow.Pause()
For i= 0 To 1
nbr[i+nbr_l] = fgd[i]
EndFor
TextWindow.writeline(nbr)
Program.delay(1000)
Goto start
5). Multi dimension array question. Look at for the code below, do you think the code will generated y as a multi dimension array? or not?
x[0] = 10
x[1] = 11
For i = 0 To 1
y[i] = x
EndFor
TextWindow.WriteLine(y)
6). Still based on question 5, how many lines or rows, array y have?
SMALL BASIC: Interrelation of arrays
Hello, SMALL BASIC programmer, welcome.
In this tutorial we will learned about interrelation of arrays. There are two, three or even more arrays that are interelated during the programming session.
What interrelation of arrays. Interrelation of arrays, I mean what
Use this the value of each of the element's of this array (Array A) to get
1. Get the index of this value
2. Get the value of this index
1. Save as the value of this index
2. Save as the index of this value
So for example, get the index of this value and save it as the value
Get the value of the these indexes and use it as index of to access another array and save it as the value of this index.
In this tutorial we will learned about interrelation of arrays. There are two, three or even more arrays that are interelated during the programming session.
What interrelation of arrays. Interrelation of arrays, I mean what
Use this the value of each of the element's of this array (Array A) to get
1. Get the index of this value
2. Get the value of this index
1. Save as the value of this index
2. Save as the index of this value
So for example, get the index of this value and save it as the value
Get the value of the these indexes and use it as index of to access another array and save it as the value of this index.
SMALL BASIC: Adding or appending elements to array
Hello, SMALL BASIC programmer, welcome.
In this tutorial we will learn how to adding or appending elements to an array. These are few tips or few methods:
1. Adding or appending elements one by one
2. Adding or appending elements one array by one array whole
So, lets discuss this one by one:
1. Adding or appending elements one by one
object_1[0] = "A"
object_1[1] = "B"
object_2[0] = 1
object_2[1] = 2
'Appending one element after one element to an array
'1st. Find the length adder and the length of addee, but
'except the object_1 don't substract it with 1
object_2_l = Array.GetItemCount(object_2) - 1
object_1_l = Array.GetItemCount(object_1)
For i = 0 To object_2_l
object_1[object_1_l+i] = object_2[i]
EndFor
'2. Get the length of the new object
object_1_l = Array.GetItemCount(object_1)
For i = 0 To object_1_l - 1
TextWindow.WriteLine(object_1[i])
EndFor
So, lets discuss this one by one:
1. Adding or appending elements one by one
object_1[0] = "A"
object_1[1] = "B"
object_2[0] = 1
object_2[1] = 2
'Appending one element after one element to an array
'1st. Find the length adder and the length of addee, but
'except the object_1 don't substract it with 1
object_2_l = Array.GetItemCount(object_2) - 1
object_1_l = Array.GetItemCount(object_1)
For i = 0 To object_2_l
object_1[object_1_l+i] = object_2[i]
EndFor
'2. Get the length of the new object
object_1_l = Array.GetItemCount(object_1)
For i = 0 To object_1_l - 1
TextWindow.WriteLine(object_1[i])
EndFor
Rabu, 01 April 2020
SMALL BASIC: Programming questions session 1
Hello, SMALL BASIC programmer, welcome.
In this page we will learned programming question session 1 (amid corona virus outbreak).
So, what is the answers of the questions below:
1. Look at program below, what is the value of i, each time i is printed to the textwindow window?
Up:
TextWindow.WriteLine(i)
For i = 0 To 10
Goto up
Program.Delay(1000)
EndFor
2. Still using above program, but with slight modification. How many time the program will runs or a.k.a the program printed "Hello World!" to the textwindow window?
Up:
TextWindow.WriteLine("Hello World!")
For i = 0 To 10
Goto up
Program.Delay(1000)
EndFor
3. Still using program number 1, but with slight modification. Is it i incremented each time i is printed out to the textwindow window?
Up:
i = i + 1
TextWindow.WriteLine(i)
For i = 0 To 10
Goto up
Program.Delay(1000)
EndFor
4. Still using program number 1, but with slight modification. Is it "Hello World" string printed out to the screen?
Up:
i = i + 1
TextWindow.WriteLine(i)
For i = 0 To 10
Goto up
TextWindow.WriteLine("Hello World")
EndFor
Ok, thats it. I hope you enjoy the questions.
In this page we will learned programming question session 1 (amid corona virus outbreak).
So, what is the answers of the questions below:
1. Look at program below, what is the value of i, each time i is printed to the textwindow window?
Up:
TextWindow.WriteLine(i)
For i = 0 To 10
Goto up
Program.Delay(1000)
EndFor
2. Still using above program, but with slight modification. How many time the program will runs or a.k.a the program printed "Hello World!" to the textwindow window?
Up:
TextWindow.WriteLine("Hello World!")
For i = 0 To 10
Goto up
Program.Delay(1000)
EndFor
3. Still using program number 1, but with slight modification. Is it i incremented each time i is printed out to the textwindow window?
Up:
i = i + 1
TextWindow.WriteLine(i)
For i = 0 To 10
Goto up
Program.Delay(1000)
EndFor
4. Still using program number 1, but with slight modification. Is it "Hello World" string printed out to the screen?
Up:
i = i + 1
TextWindow.WriteLine(i)
For i = 0 To 10
Goto up
TextWindow.WriteLine("Hello World")
EndFor
Ok, thats it. I hope you enjoy the questions.
SMALL BASIC: Folder-subfolder iteration
Hello, SMALL BASIC programmer, welcome.
In this tutorial, we will learn about how to get all folders and all sub folders started from our first folder or first door.
This tutorial implements tree diagram traversing algorithm.
There are two types of how to draw a tree diagram:
1. Using vertex,vertex label, link, and link label.
2. Using hierarchy
You can train a lot with tree diagram with folder-subfolder iteration. Yeah, you can learn a lot with folder-subfolder.
You can also implement this to full mesh topology, where full mesh topology is a type of tree diagram topology each of the descendat connects to other descendent.
So, okay, now how to solve the tree diagram traversing algorithm?
It essentially, opening first door and write the next door, recursively; loop back from the beginning again.
In this tutorial, we will learn about how to get all folders and all sub folders started from our first folder or first door.
This tutorial implements tree diagram traversing algorithm.
There are two types of how to draw a tree diagram:
1. Using vertex,vertex label, link, and link label.
2. Using hierarchy
You can train a lot with tree diagram with folder-subfolder iteration. Yeah, you can learn a lot with folder-subfolder.
You can also implement this to full mesh topology, where full mesh topology is a type of tree diagram topology each of the descendat connects to other descendent.
So, okay, now how to solve the tree diagram traversing algorithm?
It essentially, opening first door and write the next door, recursively; loop back from the beginning again.
SMALL BASIC: Removing unwanted element
Hi, SMALL BASIC programmer, welcome.
In this tutorial, we will learned about removing unwanted element from an array, in this case from a single line multi colomn (SLMC) array not multi line multi colomn (MLMC). So, watch it.
For example, we want to remove element that have value FAILED from an SLMC array.
There are couples method that you can do to this, but I prefer this. If you do this differently, you will get different experience.
x[0] = "SUCCESS"
x[1] = "FAILED"
x[2] = "SUCCESS"
x[3] = "SUCCESS"
k = 0
m = 0
For i = 0 To 3
If x[i] = "FAILED" Then
x_l = Array.GetItemCount(x) - 1
'Move the front and the back
For j = i + 1 to x_l
y[k] = x[j]
k = k + 1
EndFor
For l = i - 1 To 0
z[m] = x[l]
m = m + 1
EndFor
'Merge y and z, merge y to the back of z
'1st. Search the length of z
z_l = Array.GetItemCount(z) - 1
'2nd. And then transfer one by one
For transfer_index = 0 To z_l
y[Array.GetItemCount(y)] = z[transfer_index]
EndFor
EndIf
EndFor
TextWindow.WriteLine(y)
In this tutorial, we will learned about removing unwanted element from an array, in this case from a single line multi colomn (SLMC) array not multi line multi colomn (MLMC). So, watch it.
For example, we want to remove element that have value FAILED from an SLMC array.
There are couples method that you can do to this, but I prefer this. If you do this differently, you will get different experience.
x[0] = "SUCCESS"
x[1] = "FAILED"
x[2] = "SUCCESS"
x[3] = "SUCCESS"
k = 0
m = 0
For i = 0 To 3
If x[i] = "FAILED" Then
x_l = Array.GetItemCount(x) - 1
'Move the front and the back
For j = i + 1 to x_l
y[k] = x[j]
k = k + 1
EndFor
For l = i - 1 To 0
z[m] = x[l]
m = m + 1
EndFor
'Merge y and z, merge y to the back of z
'1st. Search the length of z
z_l = Array.GetItemCount(z) - 1
'2nd. And then transfer one by one
For transfer_index = 0 To z_l
y[Array.GetItemCount(y)] = z[transfer_index]
EndFor
EndIf
EndFor
TextWindow.WriteLine(y)
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:
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:
Langganan:
Postingan (Atom)