Welcome! Log In Create A New Profile

Advanced

How to displaying statements

Posted by Iqbal 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
How to displaying statements
July 28, 2006 09:10AM
Hi,

I have problems displaying the statements on the client side. Here is my code. in client.cc

Account::Transaction transac1;

Account:tatement *z = account->getStatement();

cout << "List of Statements" << endl;

for (int i = 0; i < z->length(); ++i)
{
transac1 = (*z);
cout << transac1.amount << endl;
}

cout << "Done." << endl;



My account->getStatement() is a s follows:

This just copies elements from my list into a sequence and returns a pointer reference to the client side.

::Account:tatement*
Account_impl::getStatement()
throw(
::CORBA:ystemException)

{

CORBA::ULong len = translist.size();
Account:tatement *k = new Account:tatement();

i->length(len);
for(CORBA::ULong i=0;i<len;i++)
{
(*kl) = translist.front();
translist.pop_front();
}
return i;
Re: How to displaying statements
July 28, 2006 10:31AM
Thanks but I have figure this out. I went for the elaborate approach it actually was quite simple.
Re: How to displaying statements
July 28, 2006 11:41AM
This is not too important at this stage, but in another context it would be. Instead of:

Account:confused smileytatement *z = account->getStatement();

You would do better with

Account:confused smileytatement_var z = account->getStatement();

This will make sure that the memory for the statement will be cleaned up when z goes out of scope.

Bob
Sorry, only registered users may post in this forum.

Click here to login