Discussion:
Return to previous line
(too old to reply)
Isaac Joshua Chua
2015-03-13 02:34:47 UTC
Permalink
Hi guys! I would like to know if it is possible to go back to the previous line in report and print again on that line. I have a program that needs that function.
Example:
PRINT COLUMN 03,"Hi there"
*go back previous line*
PRINT COLUMN 12,"Jerry"
Ian Goddard
2015-03-13 09:06:52 UTC
Permalink
Post by Isaac Joshua Chua
Hi guys! I would like to know if it is possible to go back to the previous line in report and print again on that line. I have a program that needs that function.
PRINT COLUMN 03,"Hi there"
*go back previous line*
PRINT COLUMN 12,"Jerry"
From memory I don't think there's provision for this. You should
really work out all what has to go on the line before you print it.

Alternatively you could follow the approach that works for backspaces.
Embed the ASCII code for line up (possibly CTRL-K), print your text and
then embed the ASCII code (CTRL-J) for line down.

The line counting code which determines when to throw a new page won't
take into account what you've done.

Say you're on line 2 when you print your "Hi there". At the end of that
statement the printer will move to line 3 and the line count will be
updated to 3.

If you then put in another PRINT to issue the ASCII for line-up
(terminating the line with a semi-colon to suppress the normal end of
statement line throw) the printer will be physically on line 2 again but
the line count will still be at 3.

Your next statement to print "Jerry" as you show it will print the word,
throw a newline which will move the printer back down to the start of
line 3 and increment the line count to 4. The line count will then reach
the end of page line count and throw a new page whilst the printer is
physically one page above.

So the best way to do this is:

PRINT COLUMN 03,"Hi there"
PRINT {line up sequence} COLUMN 12,"Jerry" {line down sequence}

That way the whole printer juggling takes place within the one
statement. The line count code and actual count are in sync when the
statement completes. What happens in the middle of the statement stays
in the middle of the statement ;)
--
Ian

The Hotmail address is my spam-bin. Real mail address is iang
at austonley org uk
Ian Goddard
2015-03-13 09:33:15 UTC
Permalink
I should emphasise that what I've outlined is printer dependent. You
can't rely on all your printers behaving identically and, of course, if
you print to a file and hope later try to find all files containing "Hi
there Jerry" you won't succeed because the string won't be all in one piece.

Personally I think you're much better off taking the approach:

{stuff to assemble the string to be printed}
PRINT COLUMN 3, that_string

or

PRINT COLUMN 3, "Hi there"; {note semi-colon to stay on the same line}
{stuff to decide what to do next which might include
PRINT COLUMN 12, "Jerry";
or not but again, note the semi-colon}
PRINT {No semi-colon}
--
Ian

The Hotmail address is my spam-bin. Real mail address is iang
at austonley org uk
Jack Parker
2015-03-13 11:26:09 UTC
Permalink
I had to do this years ago, when comparing work orders across three different battleships on one piece of paper. We didn’t have enough memory (32K) to assemble the complete line before printing it, so we sent printer escape codes to the printer. It was an awesome sight to see the program run with the printer backing up and shooting forward to print each line. But then we upgraded to a 16bit OS and were able to assemble lines in memory before printing - ran a lot faster.

j.
Post by Isaac Joshua Chua
Hi guys! I would like to know if it is possible to go back to the previous line in report and print again on that line. I have a program that needs that function.
PRINT COLUMN 03,"Hi there"
*go back previous line*
PRINT COLUMN 12,"Jerry"
_______________________________________________
Informix-list mailing list
http://www.iiug.org/mailman/listinfo/informix-list
Ian Goddard
2015-03-13 11:46:45 UTC
Permalink
Post by Jack Parker
It was an awesome sight to see the program run with the printer backing up and shooting forward to print each line.
And probably ripping the paper occasionally.
--
Ian

The Hotmail address is my spam-bin. Real mail address is iang
at austonley org uk
Isaac Joshua Chua
2015-03-16 00:13:39 UTC
Permalink
Post by Ian Goddard
Post by Jack Parker
It was an awesome sight to see the program run with the printer backing up and shooting forward to print each line.
And probably ripping the paper occasionally.
--
Ian
The Hotmail address is my spam-bin. Real mail address is iang
at austonley org uk
Hey man! thanks for the info. What I want to do is to have the ascii code for line up. I also know the semicolon part but the program that I have will have a different output if I inserted the semicolon. For my program, the best way is to have the line-up ascii.
Ian Goddard
2015-03-16 09:45:27 UTC
Permalink
Post by Isaac Joshua Chua
Post by Ian Goddard
Post by Jack Parker
It was an awesome sight to see the program run with the printer backing up and shooting forward to print each line.
And probably ripping the paper occasionally.
Hey man! thanks for the info. What I want to do is to have the ascii code for line up. I also know the semicolon part but the program that I have will have a different output if I inserted the semicolon. For my program, the best way is to have the line-up ascii.
RTFM. The printer manual, that is.
--
Ian

The Hotmail address is my spam-bin. Real mail address is iang
at austonley org uk
Everett Mills
2015-03-16 14:28:15 UTC
Permalink
My best guess is that your old line printers were configured to use ASCII 17-20 as additional line controls. I'm pretty sure that there is no standardized code for line up, but 17-20 ares available for printer specific controls.

--EEM
-----Original Message-----
Sent: Monday, March 16, 2015 4:45 AM
Subject: Re: Return to previous line
Post by Isaac Joshua Chua
Post by Ian Goddard
Post by Jack Parker
It was an awesome sight to see the program run with the printer
backing up and shooting forward to print each line.
Post by Isaac Joshua Chua
Post by Ian Goddard
And probably ripping the paper occasionally.
Hey man! thanks for the info. What I want to do is to have the ascii
code for line up. I also know the semicolon part but the program that I
have will have a different output if I inserted the semicolon. For my
program, the best way is to have the line-up ascii.
RTFM. The printer manual, that is.
--
Ian
The Hotmail address is my spam-bin. Real mail address is iang at
austonley org uk _______________________________________________
Informix-list mailing list
http://www.iiug.org/mailman/listinfo/informix-list
Isaac Joshua Chua
2015-03-18 00:09:28 UTC
Permalink
Post by Everett Mills
My best guess is that your old line printers were configured to use ASCII 17-20 as additional line controls. I'm pretty sure that there is no standardized code for line up, but 17-20 ares available for printer specific controls.
--EEM
-----Original Message-----
Sent: Monday, March 16, 2015 4:45 AM
Subject: Re: Return to previous line
Post by Isaac Joshua Chua
Post by Ian Goddard
Post by Jack Parker
It was an awesome sight to see the program run with the printer
backing up and shooting forward to print each line.
Post by Isaac Joshua Chua
Post by Ian Goddard
And probably ripping the paper occasionally.
Hey man! thanks for the info. What I want to do is to have the ascii
code for line up. I also know the semicolon part but the program that I
have will have a different output if I inserted the semicolon. For my
program, the best way is to have the line-up ascii.
RTFM. The printer manual, that is.
--
Ian
The Hotmail address is my spam-bin. Real mail address is iang at
austonley org uk _______________________________________________
Informix-list mailing list
http://www.iiug.org/mailman/listinfo/informix-list
Ill try this one. Thanks!
Everett Mills
2015-03-16 16:36:11 UTC
Permalink
Better question: What are you attempting to achieve that requires a reverse line feed? If it's that you have a piece of data that isn't available until you load the next line, maybe the right answer is to build your data in a temp table before you start the report, that way you can use the semi-colons and/or commas to place your data on the report. For what it's worth, I never use the semi-colons, I just make each line a PRINT statement:

PRINT COLUMN 4, "My cat has", COLUMN 55, "horrible breath."

--EEM
-----Original Message-----
Sent: Monday, March 16, 2015 9:28 AM
Subject: RE: Return to previous line
My best guess is that your old line printers were configured to use
ASCII 17-20 as additional line controls. I'm pretty sure that there is
no standardized code for line up, but 17-20 ares available for printer
specific controls.
--EEM
-----Original Message-----
Sent: Monday, March 16, 2015 4:45 AM
Subject: Re: Return to previous line
Post by Isaac Joshua Chua
Post by Ian Goddard
Post by Jack Parker
It was an awesome sight to see the program run with the printer
backing up and shooting forward to print each line.
Post by Isaac Joshua Chua
Post by Ian Goddard
And probably ripping the paper occasionally.
Hey man! thanks for the info. What I want to do is to have the
ascii
code for line up. I also know the semicolon part but the program that
I have will have a different output if I inserted the semicolon. For
my program, the best way is to have the line-up ascii.
RTFM. The printer manual, that is.
--
Ian
The Hotmail address is my spam-bin. Real mail address is iang at
austonley org uk _______________________________________________
Informix-list mailing list
http://www.iiug.org/mailman/listinfo/informix-list
_______________________________________________
Informix-list mailing list
http://www.iiug.org/mailman/listinfo/informix-list
Isaac Joshua Chua
2015-03-18 00:08:50 UTC
Permalink
I want to print it after all records on that particular series is finish. I know there is an AFTER command but they want to use their own format.
Everett Mills
2015-03-18 13:08:52 UTC
Permalink
So, what you want to do is add a bit of data to the last entry of each group of an ON EVERY ROW set. Here's what I'd do in that case:

1. Pre-cook the data outside of your report function
2. Send the data as a parameter to your report function for every line in that group
3. Send another parameter, a record type which would be 1 on all rows except the last row in the group
4. For the last row in the group, send record type 2.
5. In the ON EVERY ROW section of the report function, have something like this:

IF ( rec_type = 2 ) THEN
PRINT COLUMN x, this_stuff, COLUMN z, extra_data_you_passed_in
ELSE
PRINT COLUMN x, this_stuff
END IF


That should take care of what you need, and you don't have to pull your hair out messing with control codes.
--EEM
-----Original Message-----
Sent: Tuesday, March 17, 2015 7:09 PM
Subject: Re: Return to previous line
I want to print it after all records on that particular series is
finish. I know there is an AFTER command but they want to use their own
format.
_______________________________________________
Informix-list mailing list
http://www.iiug.org/mailman/listinfo/informix-list
Loading...