Go to Post Sustaining an FRC team is really hard! - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-04-2006, 11:23
Funzo Funzo is offline
Registered User
no team
 
Join Date: Apr 2006
Location: Halzlemere
Posts: 2
Funzo can only hope to improve
coursework, help please.

im uising windows programing language and basically in need to make a booking file print in a human friendly kind of way. Here is the code i am using:

try

readfile := false;
read(bookingFile, Abooking);
readfile := true;
while
readfile
do

memo1summary.lines[1] := Abooking.eventtitle;
memo1summary.lines[2] := Abooking.name;
memo1summary.lines[3] := Abooking.audience;
memo1summary.lines[4] := Abooking.event;
memo1summary.lines[5] := Abooking.time;
until
//end of file
end;

all i need is something that will make it recall each booking until the end of the file. I also need to change tdate into a string. Any help would be much appreciated. thanks.
  #2   Spotlight this post!  
Unread 12-04-2006, 11:27
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: coursework, help please.

you want someone to do your homework for you online?!
  #3   Spotlight this post!  
Unread 12-04-2006, 11:37
Adam Shapiro's Avatar
Adam Shapiro Adam Shapiro is offline
Registered User
FRC #0555 (Montclair Robotics)
Team Role: Alumni
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Montclair, NJ
Posts: 401
Adam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud of
Send a message via AIM to Adam Shapiro
Re: coursework, help please.

What language is that? I can't seem to recognize it as any of the ones I've seen at all.
__________________
Mentor to Teams 555, 1929, and 2070!
Currently working in hardware design at Cisco.
Cornell University DARPA Urban Challenge - http://www.cornellracing.com
Co-Captain Team 555 - 2003,2004,2005
Trust, Love, and Magic
  #4   Spotlight this post!  
Unread 12-04-2006, 11:43
Jack Jones Jack Jones is offline
Retired
no team
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Waterford, MI
Posts: 964
Jack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond repute
Re: coursework, help please.

Been a long time, but looks like Pascal?
  #5   Spotlight this post!  
Unread 12-04-2006, 11:50
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: coursework, help please.

well I know in C++ you can do
while(getline << eventitle)// isnt it great that streams can return a bool
{
//other stuff.

}


I have know idea how to do a End of file test for . . what ever language your useing. but if I were you I would read the documentation on the read(), and readfile functions.

edit ok Ive read up on this . .

if the readfile function has an error(like the file has no more info in it) it will return a 0
so I would suguest that you use that for your else(its not a fancy way of doing it but it will get it working)

as for changeing the date to a string. . . thats something that you can figure out
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.

Last edited by Stuart : 12-04-2006 at 11:59.
  #6   Spotlight this post!  
Unread 12-04-2006, 11:52
Funzo Funzo is offline
Registered User
no team
 
Join Date: Apr 2006
Location: Halzlemere
Posts: 2
Funzo can only hope to improve
Re: coursework, help please.

Yes i do want you to do my homewok for me and i thought you guy were surposed to be nerds. Im using delphi.
  #7   Spotlight this post!  
Unread 12-04-2006, 12:17
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: coursework, help please.

we are nerds. Some of us have PHDs in nerdology

but you are on the wrong forum. We are robot nerds, not Delphi language nerds:

http://www.chiefdelphi.com/forums/sh...ad.php?t=29944

Last edited by KenWittlief : 12-04-2006 at 12:39.
  #8   Spotlight this post!  
Unread 12-04-2006, 12:40
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: coursework, help please.

Quote:
Originally Posted by Jack Jones
Been a long time, but looks like Pascal?
That's Delphi, (formerly Object Pascal). (Some of us were "Delphi language nerds" in a former life....)

Alright, what's going on here? You want to read from a textfile, and pass the output to a memo box? First of all, if you're using the try structure, you're probably familiar with exception handling. Can I assume that you want to check the status of the file reading operation, and throw an exception on an error?* And further, I'll assume that you're using the built-in textfile routines (check the Delphi help for the code example for AssignFile), and not the binary file routines.

To read until the end of file, try using the EOF function to determine whether you've reached the end of the file (check the documentation; there's surely an example that you can study).

Don't call your variable "readfile". There's a built-in function with that name already. (It won't interfere with your program, unless you use ReadFile, but it's bad style.)

To reiterate, you're in the wrong place for Delphi help; didn't you see the message when you posted that tells you that this forum isn't normally used for the Delphi language?

*This is ugly, from a UI point of view. Try to make a "friendly" error message, rather than let the user see a Windows exception. To do this, you could use try with the except block.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi