| View previous topic :: View next topic |
| Author |
Message |
joel javish Guest
|
Posted: Wed Feb 15, 2006 6:03 am Post subject: streams in bcb3 and bcb6 |
|
|
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
|
Posted: Wed Feb 15, 2006 6:03 am Post subject: Re: streams in bcb3 and bcb6 |
|
|
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
|
Posted: Thu Feb 16, 2006 9:03 pm Post subject: Re: streams in bcb3 and bcb6 |
|
|
"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
|
Posted: Thu Feb 16, 2006 9:03 pm Post subject: Re: streams in bcb3 and bcb6 |
|
|
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
|
Posted: Fri Feb 17, 2006 10:03 am Post subject: Re: streams in bcb3 and bcb6 |
|
|
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
|
Posted: Sun Feb 19, 2006 12:03 am Post subject: Re: streams in bcb3 and bcb6 |
|
|
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
|
Posted: Sun Feb 19, 2006 10:03 am Post subject: Re: streams in bcb3 and bcb6 |
|
|
"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 |
|
 |
|