Sunday, July 27, 2008

Variable In VB Script

Declaration:
Dim VarName
Use:
VarName=Value
Example:
Dim x
x=10
Declare with Initial Value:
No

Variable In Java Script

Declaration:
var VarName
Use:
VarName=Value
Example:
var x
x=10
Declare with Initial Value:
var x = 10

Variable In VB.Net

Declaration:
Dim VarName As DataType
Use:
VarName=Value
Example:
Dim x As Integer
X=10
Declare with Initial Value:
Dim x As Integer = 10

Variable In VB6/VBA

Declaration:
Dim VarName As DataType
Use:
VarName=Value
Example:
Dim x As Integer
x=10
Declare with Initial Value:
NO

Variable In C++

Declaration:
DataType VarName;
Use:
VarName=Value;
Example :
int x;
x=10;
Declare with Initial Value:
int x=10;

Variable In PL/SQL

Declaration: VarName DataType;
Use: VarName:=Value;
Example:
X number;
X:=10;
Declare with Initial Value:
X number:=10;

Tuesday, July 22, 2008

Stars VB6 , Perl,Java & C++












VB6
Download

Perl
Download

Java
Download

C++
Download

Factorial By Vb6 & VB.Net & VBA

VB6
Download

VB.Net (2008)
Download

VBA (Word Macro)
Download

Factorial By Java Script

<html>

<head>

<script language="JScript" >

function fact()

{

x=0;

s=1

x=eval(prompt("Enter Number"))

if (x>1)

{for(i=1;i<=x;i++)

{s*=i}

alert("Factorial For " + x + "= " + s)

}

else

{

alert("Wrong Value")

}

}

</script>

</head>

<body onload="fact()">

</body>

</html>

Factorial By VB Script

<html>

<head>

<script language="vbscript" >

sub fact

s=1

x=eval(inputbox("Enter Number"))

if x>0 then

for i=1 to x

s=s*i

next

alert("Factorial For " & x & " = " & s)

else

alert ("Wrong Value")

end if

end sub

</script>

</head>

<body onload="fact()">

</body>

</html>

Factorial By Perl

$x=<>;
chop($x);
if ($x>1)
{$s=1;
for($i=1;$i<=$x;$i++)
{$s*=$i;}
print("Factorial for $x = $s");
}
else
{print("Wrong Entry");
}

Factorial By Java

import javax.swing.*;
public class fact
{
public static void main(String w[])
{
int x;
x=Integer.parseInt(JOptionPane.showInputDialog("Enter number"));
int s=1;
if(x>1)
{ for(int i=1;i<=x;i++)
{s*=i;}
System.out.print("Factorial For " + x + " = " + s + "\n");
}
else
{
System.out.print("Wrong Value\n");
}
System.exit(0);
}
}

Sunday, July 20, 2008

C++ factorial

#include<iostream.h>

void main()

{

int x;

long s=1;

cout<<"Enter Number\n";

cin>>x;

for(int i=1;i<=x;i++)

s*=i;

cout<<"The Factorial for "<<x<<" = "<<s<<endl;

}

Constructors and Destructors With VB.Net

Public Class Class1

Public w As Integer

'==== Constructors ====

Public Sub New(ByVal x As Integer)

w = x

MsgBox("this Is The Costructors")

End Sub

'==== Destructors ====

Protected Overrides Sub Finalize()

MsgBox("this Is The Destructors")

End Sub

End Class



To create Object :

Dim x As New Class1(10)


Download Example (Vb.net 2008)

Friday, July 18, 2008




Imports System

Imports System.IO

Public Class Form1

'===== Read File ====='

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If File.Exists("c:\1.txt") = True Then

Dim S As StreamReader = New StreamReader("C:\1.txt")

Dim L As String

L = S.ReadLine

While (Not (L Is Nothing))

TextBox1.Text &= L & vbNewLine

L = S.ReadLine

End While

S.Close()

Else

MsgBox("C:\1.txt is no Exist")

End If

End Sub

'===== Write On File ====='

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim w As StreamWriter = New StreamWriter("C:\1.txt")

w.Write(TextBox1.Text)

w.Close()

End Sub

End Class

*Note: TextBox1 Multiline Property is set to True.