Howdy, Stranger!

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

Categories

who is there to help me?

red3warlordred3warlord Member Posts: 77
hi to all of you....
once again, i need help....
my problem is that, how can i create a program that will print out the result of the inputed elements?

example: when you take a grocery and pay what had you ordered, the computer will print out the reciept.


i know that this case is somehow confidencial but, i don't have more time to think on it over and over again. i just want to clear my points because i'm now in a rush.



from red3warlord with gratitude

Comments

  • zibadianzibadian Member Posts: 6,349
    : hi to all of you....
    : once again, i need help....
    : my problem is that, how can i create a program that will print out the result of the inputed elements?
    :
    : example: when you take a grocery and pay what had you ordered, the computer will print out the reciept.
    :
    :
    : i know that this case is somehow confidencial but, i don't have more time to think on it over and over again. i just want to clear my points because i'm now in a rush.
    :
    :
    :
    : from red3warlord with gratitude
    :
    If you want to print text only, then you can use AssignPrn() to assign a text file to the printer. After that you can write to the printer as you would to a normal text file. On the Close() call, the text will be sent to the printer.
    For images you need to send escape codes to the printer or connect to a printer driver.
  • red3warlordred3warlord Member Posts: 77
    : : hi to all of you....
    : : once again, i need help....
    : : my problem is that, how can i create a program that will print out the result of the inputed elements?
    : :
    : : example: when you take a grocery and pay what had you ordered, the computer will print out the reciept.
    : :
    : :
    : : i know that this case is somehow confidencial but, i don't have more time to think on it over and over again. i just want to clear my points because i'm now in a rush.
    : :
    : :
    : :
    : : from red3warlord with gratitude
    : :
    : If you want to print text only, then you can use AssignPrn() to assign a text file to the printer. After that you can write to the printer as you would to a normal text file. On the Close() call, the text will be sent to the printer.
    : For images you need to send escape codes to the printer or connect to a printer driver.
    :
    uhm... i know i will step beyond the lines for asking you this but, may i have even just a very simple sample of a sourcecode about this matter? even just printing a single text....

    i hope you would..., but i understand if not.....


    from red3warlord with gratitude
  • zibadianzibadian Member Posts: 6,349
    : : : hi to all of you....
    : : : once again, i need help....
    : : : my problem is that, how can i create a program that will print out the result of the inputed elements?
    : : :
    : : : example: when you take a grocery and pay what had you ordered, the computer will print out the reciept.
    : : :
    : : :
    : : : i know that this case is somehow confidencial but, i don't have more time to think on it over and over again. i just want to clear my points because i'm now in a rush.
    : : :
    : : :
    : : :
    : : : from red3warlord with gratitude
    : : :
    : : If you want to print text only, then you can use AssignPrn() to assign a text file to the printer. After that you can write to the printer as you would to a normal text file. On the Close() call, the text will be sent to the printer.
    : : For images you need to send escape codes to the printer or connect to a printer driver.
    : :
    : uhm... i know i will step beyond the lines for asking you this but, may i have even just a very simple sample of a sourcecode about this matter? even just printing a single text....
    :
    : i hope you would..., but i understand if not.....
    :
    :
    : from red3warlord with gratitude
    :
    Here is a very simple code, which prints "hello world":
    [code]
    uses
    Printers;

    var
    f: Text;
    s: string;
    begin
    s := 'Hello world!';
    AssignPrn(f);
    Rewrite(f);
    Writeln(f, s);
    Close(f);
    end;
    [/code]
    If you compare that to writing "hello world" to a text file, you will see the similarities:
    [code]
    uses
    Printers;

    var
    f: Text;
    s: string;
    begin
    s := 'Hello world!';
    [b]AssignFile(f, 'hello.txt');[/b]
    Rewrite(f);
    Writeln(f, s);
    Close(f);
    end;
    [/code]
    If you're using TP for windows the code needs to be changed to:
    [code]
    uses
    WinPrn;

    var
    f: Text;
    s: string;
    begin
    s := 'Hello world!';
    AssignPrn(f, nil, nil, nil);
    [/code]
    The rest of the code is the same.
Sign In or Register to comment.