Friday, April 29, 2011

How to make a simple web browser with delphi 7

This tutorial is very simple and easy to use. you can make our own web browser by using delphi software.
first run the delphi software from the windows start menu. and then step by step:
step 1. create a new application. File>New>Application
Now you have a default form that name Form1.
step 2. place one TEdit and TButton. dont forget to place TWebBrowser too. Position at Form1
like this:
step 3. this is the last step to finish our web browser
Double click at Button1 and type the script like this (bold text is the main script) :

procedure TForm1.Button1Click(Sender: TObject);
begin
webbrowser1.Navigate(edit1.Text);
end;

end.

Run our program from green play button or press F9 for fast run.
the program are running, try to write some word to the box.

Example: explore-id.blogspot.com or other site.

after finish the typing press the Button1. then the website will be appear.

Wow that very simple..
Tips: for fast browsing usually after typing we use enter button.
This is the simple tips for you
on the Edit1 Events chose OnKeyPress by double click at the right combo box.
script like this:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (Key=chr(13)) then exit;
Button1Click(Sender);
end;
end;

test again by running the program typing and enter.. make sure connect the internet to test browsing.
Well done.. You have made your own web browser now. very fast and simple.

by ramadhani

Thursday, April 28, 2011

Memahami Array 1 Dimensi dengan C++ /Cpp

Mungkin sudah banyak diantara anda yang telah memahami array 1 dimensi pada cpp/c++. Untuk sekedar refresh otak kita akan saya bagikan source code array 1 dimensi yang sederhana untuk mempermudah pemahaman kita. semoga pembahasan array berikut ini bermanfaat bagi pembaca.

#include <iostream.h>
typedef enum {false=0, true=1} bool;
void main()
{
int x[10]={45,34,23,34,32,12,65,76,34,23};
int i,bil,jumlah;
bool ketemu=false;
jumlah=0;
cout<<"bilangan yang akan dicari:";
cin>>bil;
for(i=0;i<10;i++)
{
if(x[i]==bil)
{
ketemu=true;
cout<<"bil ditemukan di elemen:"<<i<<endl;
jumlah++;
}
}
if(ketemu)
{cout<<"jumlah data :"<<jumlah;
}else
{
cout<<"bil tersebut tidak ditemukan ";
}
}

by widi ramadhani-Indonesia