Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

pascal programming problem

text pascal

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 rrwe

rrwe

    CC Lurker

  • Member
  • Pip
  • 9 posts

Posted 19 December 2012 - 07:20 AM

Please take a look: https://www.dropbox....14b3/n9TefWkzVD
I've tried many times but still it fails to show the statement 'Sorry! You are under 18 so cannot join this voting event.'

Also, the ID numbers that entered won't save into the text file. The voting record won't be updated if success entering the correct data.

Can anyone help me? urgent! Thanks a lot!

#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 19 December 2012 - 12:30 PM

Do you have a problem statement? Can you state what you expect to happen and what actually happens?

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 rrwe

rrwe

    CC Lurker

  • Member
  • Pip
  • 9 posts

Posted 21 December 2012 - 07:20 AM

I've modified a bit : https://dl.dropbox.c.../76573190/2.pas

https://www.dropbox....wRAoJe83/id.txt
https://www.dropbox....HDV8L/print.txt
https://www.dropbox....N7s1AQ/vote.txt

id.txt is a text file which stores id numbers.
Here's some examples for valid id numbers: F1234567, A2041637
In the program code, the procedure which named "InsertID", is used to insert the ID numbers which satisfy the requirement of ID number.
However, it cannot save any ID numbers after entering the valid ID numbers and quit the program.
How can I fix these problems?
Thanks for your help!

Edited by rrwe, 21 December 2012 - 07:20 AM.


#4 Luthfi

Luthfi

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1320 posts

Posted 21 December 2012 - 10:35 AM

I believe that was caused by you did Rewrite in SaveID procedure without previously calling AssignFile.

Looked like you assumed that the result of prior AssignFile you called in OpenOrCreateDB2 will be maintained after a call to Close - you did this in InputID. But it does not. After you Close a file, the relationship between a file variable and the "real" file will be terminated. So you need to AssignFile again.

Edited by LuthfiHakim, 21 December 2012 - 10:37 AM.





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download