473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

TEXT doc prob

please help me
i want to retrieve some data from a text document
im using visual studio 2005 .NET enviroment
my program is done in a windows form application
i used this codin

fstream file_op("data.txt",ios::in);
char JOBID[1];
char DATE[25];
char PRIO[1];
char NAME[30];

while(!file_op.eof())
{

file_op.getline(JOBID,1);
file_op.getline(NAME,30);

file_op.getline(PRIO,1);
file_op.getline(DATE,25);



int JOBID2=System::Convert::ToInt32(JOBID);
int PRIO2=System::Convert::ToInt32(PRIO);

dq.insert(JOBID2,NAME,1,PRIO2,DATE);

}
file_op.close();

but the EOF function doesnt work..it become an infinite loop
PLEASE HELP!!!!
Oct 27 '07 #1
2 1430
weaknessforcats
9,208 Expert Mod 8TB
The eof() fuction will return true only if the rdstate AND the eofbit are both true.

You have four getline functions inside your loop and any one of them could have read the end of file causing the rdstate to be false. Hence your infinite loop.

You need to check every read operation for success befopre proceeding to the next read operation.
Oct 27 '07 #2
thank u very very much

it gave me an idea about the thingy

thanx again
Oct 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Erik Schulp | last post by:
Hi All, I have a bit of a weird problem. The text I have on a webpage is only visible half on initial pageload. When I move the mouse over the area where the text should be with the right...
5
by: Wilhelm Kutting | last post by:
Hi i want to use the following layout: ----------------- | | | | Text line 1 | | | Text line 2 | image.jpg | | ... | | | | | |
4
by: anatushi | last post by:
Hi, im looking for help on how to add a text fader to my website, usually i'm working with css but in this case i need to add java script to make it work, that wasn't the problem but somehow it...
4
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
13
by: so many sites so little time | last post by:
say i want spacing in my text so instead of doing <br> <br> in between the lines or having to do <href = or <a href = for a link what could i do to have php enter to mysql or retrive it formated?
0
Savage
by: Savage | last post by:
I'm making for fun a simple program which format a input file.Input file sustain of person name,lastname and date of birth.Output file si supposed to be forammted as following: NAME ...
2
by: mnacw | last post by:
Can anybody help me to resolve this prob. i have installed Visual Studio 2005 Professional edition. I am working in VB.Net. When I tried to connect to database it is connected but when i make some...
10
by: Milkstr | last post by:
i'm looking to write a textarea that formatted text can be created in, similair to the text area used in here to post new threads, i then am going to store the text in a sql data base. can anyone...
0
by: SantoshKomarraju | last post by:
Help! i am using data grid control to display dynamic data in a windows application. To edit data in data grid cell i place text box dynamically . my prob is when i select edit cell using tab...
4
by: someone28485 | last post by:
hi,i need 2 write code in C#.Net to read a text file with text as 22.13 21.65 25.16 31.22 and so on, i need 2 read this text and then take mean of the 4 values and write that mean result in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.