BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

streams in bcb3 and bcb6

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
joel javish
Guest





PostPosted: Wed Feb 15, 2006 6:03 am    Post subject: streams in bcb3 and bcb6 Reply with quote



From what I read, using the same source code, I should be able to
read/write from/to fstream and stringstream in bcb6 as I did in bcb3.

But the program won't compile in bcb6.

What am I missing?
Back to top
Ed Mulroy
Guest





PostPosted: Wed Feb 15, 2006 6:03 am    Post subject: Re: streams in bcb3 and bcb6 Reply with quote



You are missing two things, the code you used and the text of the error
message. Without them the problem could be anything.

.. Ed

Quote:
joel javish wrote in message
news:43f2b509$1 (AT) newsgroups (DOT) borland.com...

From what I read, using the same source code, I should be able to
read/write from/to fstream and stringstream in bcb6 as I did in bcb3.

But the program won't compile in bcb6.

What am I missing?
Back to top
Thomas Maeder [TeamB]
Guest





PostPosted: Thu Feb 16, 2006 9:03 pm    Post subject: Re: streams in bcb3 and bcb6 Reply with quote



"joel javish" <j.javish (AT) worldnet (DOT) att.net> writes:

Quote:
I don't find any recent commentary about read/seekg/curpos and
write/seekp/curpos, are these still used?

Yes.
Back to top
joel javish
Guest





PostPosted: Thu Feb 16, 2006 9:03 pm    Post subject: Re: streams in bcb3 and bcb6 Reply with quote

Thanks Ed for your response.

I don't find any recent commentary about read/seekg/curpos and
write/seekp/curpos, are these still used?
Back to top
Hendrik Schober
Guest





PostPosted: Fri Feb 17, 2006 10:03 am    Post subject: Re: streams in bcb3 and bcb6 Reply with quote

joel javish <j.javish (AT) worldnet (DOT) att.net> wrote:
Quote:
Thanks Ed for your response.

I don't find any recent commentary about read/seekg/curpos and
write/seekp/curpos, are these still used?

Once more:
If you want help, send a few (preferably <20, if must
<50) lines of code reproducing the problem plus the
exact error message you are getting. More often than
never it's a good idea to also post what you're trying
to do with that piece of code (because quite often
posters are shown better ways to achieve that).

Schobi

--
SpamTrap (AT) gmx (DOT) de is never read
I'm Schobi at suespammers dot org

"If you put a large switch in some cave somewhere, with a sign
on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH',
the paint wouldn't even have time to dry."
Terry Pratchett
Back to top
joel javish
Guest





PostPosted: Sun Feb 19, 2006 12:03 am    Post subject: Re: streams in bcb3 and bcb6 Reply with quote

Thanks Tom, Hendrik for your response.

My source code is in c++.

below is in unit2.h:
char* ioStr="ioDsk.dta";
//fstream
DskFyl();//(ioStr,ios::in|ios::out|ios::binary);//|ios::app);.ope//
std::fstream
DskFyl();//(ioStr,ios_base:in|ios::out|ios::binary);//|ios::app);.ope//
// fstream
ioDskFyl("ioDsk.dta",ios::in|ios::out|ios::binary);//|ios::app);.ope//
std::stringstream ioRamfyl();//"ioRam.dta",ios::in|ios::out|ios::binary);

below is in unit1.cpp:
// DskFyl.open();//ioStr,ios::in|ios::out|ios::binary);
DskFyl.seekg(0);//curpos);//
DskFyl.read((
char*)&(*pRandArr),sizeof(SSortArr));//(*pRandArr));//array));//unsigned//pIoDsk->clsArray
ioRamfyl.seekp(curpos);
ioRamfyl.write((
char*)&(*pRandArr),sizeof(randArr));//arrayCls));//array));//unsigned//pIoDsk->clsArray


In bcb3 I had no problem.
But in bcb6, compiler stops after DskFyl, and when I press F1 I get:
Compiler Errors: Object Pascal
Parameters of this type cannot have default values

List of compiler error messages

The default parameter mechanism incorporated into the Pascal compiler allows
only simple types to be initialized in this manner. You have attempted to
use
a type that is not supported.


program Produce;
type
ArrayType = array [0..1] of integer;

procedure p1(proc : ArrayType = [1, 2]);
begin
end;
end.


Default parameters of this type are not supported in Object Pascal.


program solve;
type
ArrayType = array [0..1] of integer;

procedure p1(proc : ArrayType);
begin
end;

end.


The only way to eliminate this error is to remove the offending parameter
assignment or to change the type of the parameter to one that can be
initialized with a default value.
Back to top
Thomas Maeder [TeamB]
Guest





PostPosted: Sun Feb 19, 2006 10:03 am    Post subject: Re: streams in bcb3 and bcb6 Reply with quote

"joel javish" <j.javish (AT) worldnet (DOT) att.net> writes:

Quote:
My source code is in c++.

This is not code I can work with from here.

Please reduce your code to a snippet that your audience can
copy&paste&compile to see what you are seeing.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.