Runing Text

Do not Click

Animation

Posted by Andi on Tuesday 28 September 2010 , under | komentar (0)



This program almost same with others animation program. The $ character will be printed on the top of the screen.


This program created using C++ editor. Here is the code:

#include
#include
#include
void main()
{
int x,y,ay;
clrscr();
x=random(78)+1;
y=random(4)+1;
ay=random(5)+1;
_setcursortype(_NOCURSOR);
textcolor(random(16));
do{
gotoxy(x,y); cprintf("$");
delay(100);
gotoxy(x,y); cout<<" "; y=y+ay; x=random(78)+1; if (y>=20)
{
gotoxy(x,y); cprintf("$");
x=random(78)+1;
y=random(4)+1;
ay=random(5)+1;
textcolor(random(16));
}
}while(!kbhit());
getch();
}

Goodbye my friend

Posted by Andi on Thursday 21 January 2010 , under | komentar (0)



Dear friend, this might be the last word from me, I apologize for all my mistakes. Each meeting there must be separation, Pray for me, so I was always given the strength and always in His protection. I want to invite you, but I'm sure you will not get. Carving my name in your heart as someone special. GOODBYE MY TRUE FRIENDS, I ALWAYS REMEMBER YOU. I'll go to Japan to help Ultraman, Cosmos and Black Steel Kastria to fight monsters Gorong-gorong and Ulat Bulu. Do not laugh this noble task, you know! .. Miss you-signed Bertopeng Heroes.

Adding and showing data in dynamic arrays

Posted by Andi on , under | komentar (0)



The following discussion is a continuation of the previous postings. To add data, we need to add the following program code:

ReDim Preserve strname(l - 1)
Write("Enter your name: ")
strname(l - 1) = ReadLine()


the results can be seen on the display below:

If we want to see data, it is necessary to add the following program code:

For Each name In strname
Write("Name: " & name)
Next


the results can be seen on the display below:
For advanced stage can be added to the source code of how to edit the wrong data and delete data that is not used anymore.

Simple data entry with an array

Posted by Andi on , under | komentar (0)



This program will demonstrate to us how to process the data by using an array. There are two things that will be made on this program, namely to add data into the array and display the data and the program we made this time using the console application. The following program display:


based on the view above, all we have to do in this program is starting from the bottom. By default, usually at the time of printing characters always starts from the top, but this time we run from the bottom. how to make the source code? Just a simple code shows below:

For i = 1 To 25
WriteLine()
Next


Further discussion will be presented in the next posting.

Trim and strlen function

Posted by Andi on Wednesday 20 January 2010 , under | komentar (0)



After studying the variables, we continued the discussion of the trim and strlen function. The second function is used to manipulate the string.
- Trim (); used to remove the spaces on the right or left a text, examples of program code is as follows:

< ? php
$text=" test trim ";
$text=trim($text);
echo $text.$text;
?>



Output:
test trimtest trim


- Strlen(); used to calculate the text length, examples of program code is as follows:

< ? php
$text1=" test trim ";
$text2=trim($text1);
$lentext1=" Text1 Length = ".strlen($text1);
$lentext1=" Text2 Length = ".strlen($text2);
echo $lentext2."
";
echo $lentext1;
?>


Output:
Text1 Length = 11
Text2 Length = 9

Variable

Posted by Andi on , under | komentar (0)



In making a program, it should not be forgotten is variable. Variable plays an important role in the process of temporary data storage. Writing variables should also be noted. In writing PHP variables are always denoted by sign ($) in front of variable names. Variable names must consist of one syllable, could also be a combination of numbers with letters, but should not be preceded by the numbers.
Example:
$ NumBook = 23;

Note:
PHP is case sensitive, which means writing small and large very influential. To facilitate the writing of program code, it's worth all the code is written in small letters.

To print the value of a variable can be done in the following ways:
$ Number = 23;
echo $ number

Write the name wrong

Posted by Andi on , under | komentar (0)



Two young men decided to go through the graveyard in order to shorten the road. To eliminate the fear, they followed the grave telling stories and laughing. Suddenly they heard the sound of tapping a rock with a chisel. They are silent because of fear and try to listen where the sound came. There was an old man was carving gravestones. "Hey Old man, you made us surprised, we thought a ghost. What did you do at this time of night?" Without turning to the two young men, the old man replied, "Those stupid people ... They were wrong to write my name .."

Basic PHP Programming

Posted by Andi on , under | komentar (0)



Rules in the PHP code, beginning with a <?php and ends with the sign ?> block PHP always flanked by a second sign. For each command will end with a sign; (semicolon). The following example PHP code.

< ? php
echo "Hello World";
? >



To try this code, we need an editor in this case the author uses the editor komodo dragons, and then type the php code. And do not forget to be stored in the folder C: \ Wamp \ www \ testphp \ and the file named hello.php and testphp.kpf project name. Next live run hello.php file via the browser as follows: http://localhost/testphp/hello.php ..

Searching data within the array

Posted by Andi on Saturday 16 January 2010 , under | komentar (0)



The easiest way to search is to check all the array elements from the smallest index to the largest index of searchable data to be found. Example use in an array of data search is shown in the following programs:

Dim data(5) As Integer
Dim x As Integer
Randomize
For i = 0 To 5
data(i) = Rnd() * 10 + 5
Next

x = InputBox("Entry Data: ", "Input")

For j = 0 To 5
If x = data(j) Then
cek = True
Exit For
Else
cek = False
End If
Next
If cek = True Then
MsgBox ("Found")
Else
MsgBox ("Not Found")
End If

Dynamic Array

Posted by Andi on , under | komentar (0)



If the size or the number of array elements is not known, then the array variable can be declared as an array of dynamic arrays. Understanding the dynamic array is a list or set of data with the same data type, stored in a given index variable to distinguish each member of the array where the number of elements or the amount of data stored in the array is dynamic or changing during the program starts. To declare a dynamic array can be written with the following syntax:

Dim SetArray() as DataType



From the above syntax can be seen that the size of the array or the amount of data has not been determined. To provide input data, then the very first thing to do is change the size (resize) with syntax redim (which comes from the word redimension).

Example :

1. Dim arrName() as String
2. Redim arrName(8)


Description:
In the example above; lines used to create a dynamic array with the name arrNama, while the second row using redIm to resize the array to be 9 elements (starting from index 0 to index 8).

Weaknesses using redIm is dipanggial commands every time, all the values in the previous elements will be lost. To overcome this, create a preserve for VB add an array element without deleting the previous value.

Example:

Dim NameArray(5) as Integer
NameArray(3) = 80
Msgbox (NameArray(3)) ‘The program will display the number 80
Redim Preserve NameArray(10)
Msgbox (NameArray(3)) ‘ The program will display the same number 80...

Related Post