Professional Documents
Culture Documents
Typecasting is the concept of converting the value of one type into another type.
For example, you might have a float that you need to use in a function that requires an
integer.
i. Basic to basic:
float a= 9.5;
cout<<\n”Result:”<<a/2;
cout<<\n”Result:”<<(int)a/2;
In this conversion the float value converts into the integer value by using the
keyword.
ii. Basic to class: The conversion from basic to class type is easily carried out. It
is automatically done by the compiler with the help of in-built routines or by
applying type casting. In this type, the left hand operand of = is always a
class type and the right hand operator is always basic type.
iii. Class to basic: the conversion function should not have any argument. Do not
mention return type. It should be a class member function.
Class emp
{
int basic;
public:
emp()
{
basic=0;
emp(int b)
{
basic= b;
}
operator int()
{
return(basic);
}
void printdata
{
cout<<”basic:”<<basic;
}
};
main()
{
emp e1(12000);
int sal;
sal= e1;
cout<<”\n value of sol is:”<<sal;
cout<<”\n date of e1 is below:”;
e1.printdata();
}
iv. Class to class: when an object of one class assigned to object of another class,
it is necessary to give clear-cut instruction to the compiler about how to make
conversion between these two user-defined data types. There are two ways to
convert using constructor and casting operator.
class product;
class item;
{
public: int a,b;
Item()
{}
Item (product p)
{
a= p.m;
b= p.n;
}
void showdata()
{
cout<<”value of a”<<a;
cout<<”value of b”<<b;
}
};
class product
{
public:
int m,n;
public:
void setdata(int x, int y)
{
m= x;
n= y;
}
};
main()
{
Item i;
product p;
p.setdata(3,4)
i=p;
i.showdata();
}
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
[End Time]>[Start Time]
0
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
0
"Good"
0
"Good"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
[End Time]>[Start Time]
Today()
"Good"
1
0
0
No
[End Time]>[Start Time]
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
[Subtotal]+[Tax]
0
No
[End Date]>[Start Date]
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
0
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
No
"Not Started"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Full-time"
[Unit Price]*[Quantity]*(1-[Discount])
"None"
=Today()
0
[End Time]>[Start Time]
[End Date]>=[Start Date]
"Not Submitted"
=Today()
No
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
[Subtotal]+[Tax]+[Shipping]
0
[Original Contract Sum]+[Change Orders]
[Completed Previously]+[Completed This Period]
0
Today()
"1 - New"
"1 - Critical"
=Today()
[Status]="3 - Resolved"
[Resolution] Is Null
[Resolution] Is Null
Null
[Status]="3 - Resolved"
[Resolution] Is Null
[Resolution] Is Null
Resolution
Null
0
"Good"
0
0
IIf([Returned Date] Is Null,"Checked Out","Returned")
Today()
IIf([Returned Date] Is Null,"Checked Out","Returned")
Today()
IIf([Returned Date] Is Null,"Loaned","Returned")
Today()
[End Time]>[Start Time]
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
0
0
No
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
[Unit Price]*[Quantity]*(1-[Discount])
"None"
IIf([Status]="Completed",No,Yes)
=Today()
"New"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
1
No
0
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
"Open"
0
No
0
IIf([Status] In ("Completed","Deferred"),No,Yes)
"2 - Medium"
"Not Started"
Now()
Changed Date
Now()
0
0
0
=Today()
0
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
0
[Unit Price]*[Quantity]*(1-[Discount])
"None"
IIf([Status]="Completed",No,Yes)
=Today()
"New"
Concat([Budget Year]," - ",[Budget Quarter])
DateDiff(MONTH,[Start Date],[End Date])*[Rental Rate]
0
2
0
[End Time]>[Start Time]
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
0
No
[End Time]>[Start Time]
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
"On Track"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
IIf([Status] In ("Completed","Deferred"),No,Yes)
"2 - Medium"
"Not Started"
This data macro makes sure the Status is set correctly if the Percent
Complete is updated or it makes sure the Percent Complete is set correctly
if the Status is updated.
Percent Complete: 0=0%, 1=100%
[Percent Complete]=0
[Status]="Completed"
Percent Complete
1
[Percent Complete]=1
[Status]
"Completed"
Status
"In Progress"
This data macro makes sure the Status is set correctly if the Percent
Complete is updated or it makes sure the Percent Complete is set correctly
if the Status is updated.
Percent Complete: 0=0%, 1=100%
Update([Percent Complete])
[Percent Complete]=1
[Status]<>"Completed"
Status
"Completed"
[Percent Complete]=0
[Status]="Completed"
Status
"Not Started"
[Status]="Completed" Or [Status]="Not Started"
Status
"In Progress"
Update([Status])
[Status]="Completed"
[Percent Complete]<>1
Percent Complete
[Status]="Not Started"
Percent Complete
[Percent Complete]=1
Percent Complete
0
IIf([Status] In ("Completed","Deferred"),No,Yes)
"Not Started"
This data macro makes sure the Status is set correctly if the Percent
Complete is updated or it makes sure the Percent Complete is set correctly
if the Status is updated.
Percent Complete: 0=0%, 1=100%
Update([Percent Complete])
[Percent Complete]=1
[Status]<>"Completed"
Status
"Completed"
[Percent Complete]=0
[Status]="Completed"
Status
"Not Started"
Status
"In Progress"
Update([Status])
[Status]="Completed"
[Percent Complete]<>1
Percent Complete
[Status]="Not Started"
If Status is changed to Not Started and Percent Complete is
not 0%, set Percent Complete to 0%
[Percent Complete]<>0
Percent Complete
[Percent Complete]=1
Percent Complete
0
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
0
=Today()
[Sunday]+[Monday]+[Tuesday]+[Wednesday]+[Thursday]+[Friday]+[Saturday]
([Sunday]+[Monday]+[Tuesday]+[Wednesday]+[Thursday]+[Friday]+
[Saturday])*[Pay Rate]
0
0
0
0
0
DateDiff(DAY,[Start Date],[End Date])
"Pleasure"
Coalesce([First Name]+" "+[Last Name],[Last Name],[First Name],[Email],
[Company])
Coalesce([Last Name]+" "+[First Name],[Last Name],[First Name],[Email],
[Company])
"Business"
Today()
"Best Way"
0
0
0