Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Anyone able to help with text files?????

CraigKSWCraigKSW Member Posts: 1
[b][red]This message was edited by CraigKSW at 2002-10-15 5:4:41[/red][/b][hr]
Hi im a beginner at using Pascal and am required to write a program that reads from a text file and writes invalid records to an error file (also a text file) and valid records to the printer (I have made this a text file so as to see if it works properly first).

I understand that you can use Notepad to write text files but I can't seem to get them to work.

First of all im not sure that im writing my text file properly and if i am i don't know why it isn't writing the invalid and valid details accordingly.

Is there anyone who can possibly help on this matter.

Cheers


Comments

  • ibyiby Member Posts: 323
    : [b][red]This message was edited by CraigKSW at 2002-10-15 5:4:41[/red][/b][hr]
    : Hi im a beginner at using Pascal and am required to write a program that reads from a text file and writes invalid records to an error file (also a text file) and valid records to the printer (I have made this a text file so as to see if it works properly first).
    :
    : I understand that you can use Notepad to write text files but I can't seem to get them to work.
    :
    : First of all im not sure that im writing my text file properly and if i am i don't know why it isn't writing the invalid and valid details accordingly.
    :
    : Is there anyone who can possibly help on this matter.
    :
    : Cheers
    :
    :
    :

    First of all you MUST know what is the difference between
    valid and invalid lines. If you cannot tell the difference,
    you cannot write program that will do it for you.

    Thing you need are all in TP help file (don't know about other
    compilers). Just check for TEXT, RESET, REWRITE etc.
    Help comes with sample programs as well. If you still have
    problems post your code here and someone will help you
    fix it.


    Iby



  • jasonpsagejasonpsage Member Posts: 37
    : : [b][red]This message was edited by CraigKSW at 2002-10-15 5:4:41[/red][/b][hr]
    : : Hi im a beginner at using Pascal and am required to write a program that reads from a text file and writes invalid records to an error file (also a text file) and valid records to the printer (I have made this a text file so as to see if it works properly first).
    : :
    : : I understand that you can use Notepad to write text files but I can't seem to get them to work.
    : :
    : : First of all im not sure that im writing my text file properly and if i am i don't know why it isn't writing the invalid and valid details accordingly.
    : :
    : : Is there anyone who can possibly help on this matter.
    : :
    : : Cheers
    : :
    : :
    : :
    :
    : First of all you MUST know what is the difference between
    : valid and invalid lines. If you cannot tell the difference,
    : you cannot write program that will do it for you.
    :
    : Thing you need are all in TP help file (don't know about other
    : compilers). Just check for TEXT, RESET, REWRITE etc.
    : Help comes with sample programs as well. If you still have
    : problems post your code here and someone will help you
    : fix it.
    :
    :
    : Iby
    :
    :
    :
    :
    And do yourself a favor - forget the whole notepad thing except MAYBE to edit your source code. Iby is right - YOu can do a lot with TEXT, RESET, REWRITE, APPEND, write, writeln, read, readln.
    Jason Sage


  • Mr. EgoMr. Ego Member Posts: 38
    If you want to write text to the printer, use unit [b]Printers[/b]. In this unit is only one variable
    [b]var Lst : text;[/b]
    So you should only write to this "file" for printer output.
    Bye


  • zibadianzibadian Member Posts: 6,349
    : If you want to write text to the printer, use unit [b]Printers[/b]. In this unit is only one variable
    : [b]var Lst : text;[/b]
    : So you should only write to this "file" for printer output.
    : Bye
    :
    :
    :
    You can also use the AssignPrn() function to assign a new textfile variable to the printer.
  • Andre YoungAndre Young USAMember Posts: 0

    _________ | http://forcoder.org | free video tutorials and ebooks about { Perl, Visual Basic .NET, C++, PL/SQL, Delphi, Scratch, Ruby, Java, Go, Swift, MATLAB, Visual Basic, C, Python, Objective-C, C#, R, Assembly, JavaScript, PHP Dart, Erlang, Ada, Clojure, Hack, Apex, Prolog, Rust, SAS, D, LabVIEW, Lua, COBOL, Fortran, Crystal, Kotlin, F#, Awk, Transact-SQL, VBScript, FoxPro, Lisp, ML, Alice, Julia, Scala, ABAP, Logo, Bash, Scheme }

Sign In or Register to comment.