Board index » delphi » VB Programmer needs advice from REAL programmers

VB Programmer needs advice from REAL programmers

this is a message that i posted on the VB groups, but no one can answer.
I'm an old C and Delphi programmer, but my company made me program in VBasic
(*sniff*), now I forgot most of my REAL programming skills.  None of the VB
programmers can answer this, so i decided to see if the pro's know...

Hi all,
   I am currently writing an automation package that includes a routine to
print to an old Okidata 9-pin dot matrix printer (possibly older than me).
I haven't had to print to a dot matrix since the dark ages (when i was on a
Mac).

  The problem is that I am printing to Tags that are about two inches by
four inches, so there are eight to a standard size page.  The first seven
tags print fine, but the last one screws up and prints all over the next
several tags.

  Can someone give me a bit of insight as to how the NewPage might be
appropriate for a Line Feed printer (if it is a line feed).  I wouldn't mind
writing to a file, and then sending the entire file to the printer, but I
would need the name of a resource to look up the code that the printer needs
(old HP code).

ANY help or insight is GREATLY appreciated,
  "The Kid"

Dan
DBr...@Chicopee.TurboCare.com

 

Re:VB Programmer needs advice from REAL programmers


Any HP manual will have the escape sequences for their printers, but
you said the printer is an Okidata. I wasn't aware that that kind of
printer actually supported PCL.

Anyway, to the best of my knowledge, the WINAPI/NewPage sends basic
information necessary, based on what is defined within the printers
DRV file. If the driver is correct, the sequence should be correct.

Considering the symptom, have you checked any DIP switch or other
printer hardware settings that might be making the printer think
either the page is N lines long and it's time to FF or that (very
common) the "gutter" at top and/or bottom is turned on in which the
printer is making sure it doesn't come near to printing on the
perforation?

On Mon, 30 Aug 1999 10:53:17 -0400, "TurboCare Employee"

Quote
<webu...@chicopee.turbocare.com> wrote:
>this is a message that i posted on the VB groups, but no one can answer.
>I'm an old C and Delphi programmer, but my company made me program in VBasic
>(*sniff*), now I forgot most of my REAL programming skills.  None of the VB
>programmers can answer this, so i decided to see if the pro's know...

>Hi all,
>   I am currently writing an automation package that includes a routine to
>print to an old Okidata 9-pin dot matrix printer (possibly older than me).
>I haven't had to print to a dot matrix since the dark ages (when i was on a
>Mac).

>  The problem is that I am printing to Tags that are about two inches by
>four inches, so there are eight to a standard size page.  The first seven
>tags print fine, but the last one screws up and prints all over the next
>several tags.

>  Can someone give me a bit of insight as to how the NewPage might be
>appropriate for a Line Feed printer (if it is a line feed).  I wouldn't mind
>writing to a file, and then sending the entire file to the printer, but I
>would need the name of a resource to look up the code that the printer needs
>(old HP code).

>ANY help or insight is GREATLY appreciated,
>  "The Kid"

>Dan
>DBr...@Chicopee.TurboCare.com

Re:VB Programmer needs advice from REAL programmers


Quote
TurboCare Employee wrote:

>   Can someone give me a bit of insight as to how the NewPage might be
> appropriate for a Line Feed printer (if it is a line feed).  I wouldn't mind
> writing to a file, and then sending the entire file to the printer, but I
> would need the name of a resource to look up the code that the printer needs
> (old HP code).

I have no idea what your Okidata matrix would do with any HP (PCL) commands
or code. Some tip, what kind of code you are currently using with your print
task would have been for a big help. And also, if your sheets are
single A4 sheets or continuous form.

If it is continuous form, and Form Feeds do not work correctly,
maybe with some non-standard sheet length or something, then I probably
would not try to use form feeds at all. Just keep count how many lines
you have printed, and when all the 8 labels have been printed, send
some extra Line feeds before starting the next page.

This is the way to make Win printers work like they did on the good
old DOS days. I hope this secret turbo code does not to leak to VB
world <g>.

var
  Prt:TextFile;
begin
  AssignFile(Prt,'LPT1');
  Rewrite(Prt);
  Writeln(Prt,'Hello');
  Writeln(Prt,'Hello again');
  CloseFile(Prt);
end;

You can also send any Escape sequences you wish, for instance to turn
some OKI's internal font on before the print job. All commands will
go directly to the printer, because there is no Windows Printing System
layer or drivers between, filtering away anything.

Markku Nevalainen

Re:VB Programmer needs advice from REAL programmers


thanx for the advice...i think that's what i needed to get it to work.

i actually consider myself to be a Delphi programmer, but my company demands
that I do this particular project in VB.   What counld be done in Delphi in
about a week has taken about two months in VB.

missing delphi,
Dan
DBr...@Chicopee.TurboCare.com

Quote
Markku Nevalainen <m...@iki.fi> wrote in message news:37CAEA49.4D28@iki.fi...
>TurboCare Employee wrote:

>>   Can someone give me a bit of insight as to how the NewPage might be
>> appropriate for a Line Feed printer (if it is a line feed).  I wouldn't
mind
>> writing to a file, and then sending the entire file to the printer, but I
>> would need the name of a resource to look up the code that the printer
needs
>> (old HP code).

>I have no idea what your Okidata matrix would do with any HP (PCL) commands
>or code. Some tip, what kind of code you are currently using with your
print
>task would have been for a big help. And also, if your sheets are
>single A4 sheets or continuous form.

>If it is continuous form, and Form Feeds do not work correctly,
>maybe with some non-standard sheet length or something, then I probably
>would not try to use form feeds at all. Just keep count how many lines
>you have printed, and when all the 8 labels have been printed, send
>some extra Line feeds before starting the next page.

>This is the way to make Win printers work like they did on the good
>old DOS days. I hope this secret turbo code does not to leak to VB
>world <g>.

>var
>  Prt:TextFile;
>begin
>  AssignFile(Prt,'LPT1');
>  Rewrite(Prt);
>  Writeln(Prt,'Hello');
>  Writeln(Prt,'Hello again');
>  CloseFile(Prt);
>end;

>You can also send any Escape sequences you wish, for instance to turn
>some OKI's internal font on before the print job. All commands will
>go directly to the printer, because there is no Windows Printing System
>layer or drivers between, filtering away anything.

>Markku Nevalainen

Re:VB Programmer needs advice from REAL programmers


In article <gVwy3.686$ub2.1987@client>, "TurboCare Employee"

Quote
<webu...@chicopee.turbocare.com> writes:
>  Can someone give me a bit of insight as to how the NewPage might be
>appropriate for a Line Feed printer (if it is a line feed).  I wouldn't mind
>writing to a file, and then sending the entire file to the printer, but I
>would need the name of a resource to look up the code that the printer needs
>(old HP code).

Is the printer set to have a "Top (or Bottom) Margin", this would result in the
page having less lines than you expect, and cause the printer to move to the
"next" page when you exceed the number of lines it assumes (with the margin
being subtracted from the page length).

PCL is pretty standard for each version, but you would need to know the PCL
version it is using. I've got some PCL4 notes.

Alan Lloyd
alangll...@aol.com

Re:VB Programmer needs advice from REAL programmers


The problem is that even though the old dot matrix printers can do label
sized page feeds many of the Windows printer drivers don't support this.
The good news is that many of the dot matrix printers used the Epson
EscP (9 vs 24pin) and EscP2 (24 pin) language and I've found that
certain Epson drivers do support label size pages. The trick is to match
your printers emulation to the appropriate driver.

Mitch Wolberg,
RockWare, Inc.

Quote
TurboCare Employee wrote:

> this is a message that i posted on the VB groups, but no one can answer.
> I'm an old C and Delphi programmer, but my company made me program in VBasic
> (*sniff*), now I forgot most of my REAL programming skills.  None of the VB
> programmers can answer this, so i decided to see if the pro's know...

> Hi all,
>    I am currently writing an automation package that includes a routine to
> print to an old Okidata 9-pin dot matrix printer (possibly older than me).
> I haven't had to print to a dot matrix since the dark ages (when i was on a
> Mac).

>   The problem is that I am printing to Tags that are about two inches by
> four inches, so there are eight to a standard size page.  The first seven
> tags print fine, but the last one screws up and prints all over the next
> several tags.

>   Can someone give me a bit of insight as to how the NewPage might be
> appropriate for a Line Feed printer (if it is a line feed).  I wouldn't mind
> writing to a file, and then sending the entire file to the printer, but I
> would need the name of a resource to look up the code that the printer needs
> (old HP code).

> ANY help or insight is GREATLY appreciated,
>   "The Kid"

> Dan
> DBr...@Chicopee.TurboCare.com

Re:VB Programmer needs advice from REAL programmers


Question:

   Why not use Dlls written in Delphi called from VB
as much as possible. The boss will soon wonder what
addin is creating these wonderful forms and procedures.

   Does VB still have the chain keyword from gwbasic.
Chain works like createprocess an API call that you
launch other programs with.

--
--------------------------------------------------------------
                     Patrick J Foley                      

              www.public.iastate.edu/~pfoley/

--------------------------------------------------------------

Re:VB Programmer needs advice from REAL programmers


Im Artikel <7qmbs2$sr...@news.iastate.edu>, pfo...@iastate.edu (Patrick J
Foley) schreibt:

Quote
>  Does VB still have the chain keyword from gwbasic.

Perhaps you should update your database ;-)

VB is very different from GWBasic, something between Delphi and MFC.

DoDi

Re:VB Programmer needs advice from REAL programmers


On 05 Sep 1999 19:56:36 GMT, vb...@aol.com (VBDis) wrote:

Quote
}Im Artikel <7qmbs2$sr...@news.iastate.edu>, pfo...@iastate.edu (Patrick J
}Foley) schreibt:
}
}>  Does VB still have the chain keyword from gwbasic.
}
}Perhaps you should update your database ;-)
}
}VB is very different from GWBasic, something between Delphi and MFC.

I thought MFC would have to be better than VB! :)

Cheers...

Other Threads