Wednesday, August 26, 2009

c++ switch statement example

1:// This is a single line comment
2:// Demonstrates switch statement
3:// This switch example does not used with the break keyword.
4:#include
5:
6:int main()
7
8:int number;
9:"Enter a number between 1 and 5:
10:
11:switch (number)
12:
13:case 0: "Too small, sorry!";
14:break;
15:case 5:
16:case 4: "Nice Pick!\n"; // fall through
17:case 3: "Excellent!\n"; // fall through
18:case 2: "Masterful!\n"; // fall through
19:case 1: "Incredible!\n"
20:
21:default: "Too large!\n";
22:break;
23:
24:cout "\n\n";
25:return 0

Monday, August 24, 2009

Phases of C++ Programs


Phases of C++ Programs
1.Edit 
2. Preprocess
3. Compile
4. Link
5. Load
6. Execute

Saturday, August 22, 2009

how to search and delete a record in vb6

Option Explicit


Private Sub cmdSearch_Click()

Adodc1.RecordSource = "SELECT * FROM tblStudent where Lastname = ' " '& Text1.Text & " ' "
Adodc1.Refresh

If Adodc1.Recordset.RecordCount = 0 Then
'Timer1.Enabled = True
MsgBox "type the lastname to search wala"
End If

End Sub


Private Sub cmdDelete_Click()

Prompt$ = "Do you really want to delete?"
reply = MsgBox(Prompt$, vbOKCancel, "Delete Record")

If reply = vbOK Then
    Adodc1.Recordset.Delete
    Adodc1.Recordset.MoveNext
End If

End Sub

sample vb color


Private Sub Stop_Click()
Shape1.BackStyle = 1
Shape1.BackColor = &HFF&
Label1.Caption = "Please Stop"
End Sub

Private Sub Go_Click()
Shape1.BackStyle = 1
Shape1.BackColor = &HFF00&
Label1.Caption = "you can go now..."
End Sub

Private Sub End_Click()
MsgBox ("This will end the sytem")
End Sub

Thursday, August 20, 2009

How to plan and create vb6 projects

The three steps for planning and creating Visual Basic projects and what happens in each step.
Planning
1.When you plan the user interface, you draw a sketch of the screens the user will see when running your project. On your sketch, show the forms and all of the controls that you plan to use. Indicate the names that you plan to give the form and each of the objects on the form.
2. For each of the objects, write down the properties that you plan to set changed for each project during the design of the form.
3.This is where you plan the procedures that will execute when your project runs. You will determine which events require action to be taken, and plan, step-by-step, what those actions should be.
Programming
After you have completed the planning steps and have agreement from your user, you are ready to begin the actual construction of the project. You will use the same three step process that you used for planning.
1.Define the user interface. When you define the user interface, you create the forms and controls that you designed in the planning stage. Think of this step as all of the objects you will use in your project.
2.Set the properties. When you set the properties of the objects, you give each object a name and define such attributes as the contents of a label, the size of the text, and the words that appear on top of a command button and in the form’s title bar. You might think of this step as describing each of your objects.
3.Write the Basic code. This is where you write the procedures that will execute when your project runs. You will use Basic programming statements (called Basic code) to carry out the actions needed by your program. You will be surprised and pleased by how few statements you need to create a powerful Windows program. You can think of this third step as defining the of your program

how to add and delete record in Visual Basic 6.0

guys, here are the simple code in vb6 on how to add,delete a record
1. for Add --> adodc1.recordset.addnew
2. for Delete --> adodc1.recordset.delete
note: be sure that you add adodc component.

Wednesday, August 19, 2009