Title: Message
I think I now understand what is going on. 
 
To return the last printer in the list, the length specification used in the view command needs to be exactly the length of that last printer's name plus the -->.  If the length is not the same either it truncates the printer name or returns nothing at all.
 
I suspect incorrect handling of the string returned from the API.  Not a lot can be done to really fix it at my end but I have created a bogus ZZ-EndOfPrinterList printer as a workaround.  It also must be (at least in my case) a network printer to force it to the bottom of the list of network printers.
 
 
IS-1L1 is last printer in this example
>   \\FAS-BG5\IS-1L1< is 19 characters between > <
Length: 18
1 >   AATOPOFPRINTERL
2 >-->\\FAS-BG5\DEFAU
3 >  
\\FAS-BG5\DI-1L
4 >   \\FAS-BG5\DI-3L
5 >   \\FAS-BG5\ED-1L
6 >   \\FAS-BG5\ENT-1
7 >   \\FAS-BG5\IS-1D
8 >   \\FAS-BG5\IS-1L
9 >                 
 
Length: 19
1 >   AATOPOFPRINTERLI
2 >-->\\FAS-BG5\DEFAUL
3 >  
\\FAS-BG5\DI-1L2
4 >   \\FAS-BG5\DI-3L1
5 >   \\FAS-BG5\ED-1L1
6 >   \\FAS-BG5\ENT-1L
7 >   \\FAS-BG5\IS-1D2
8 >   \\FAS-BG5\IS-1L1
9 >                  
 
Length: 20
1 >   AATOPOFPRINTERLIS
2 >-->\\FAS-BG5\DEFAULT
3 >  
\\FAS-BG5\DI-1L2<Cr>
4 >  
\\FAS-BG5\DI-3L1<Cr>
5 >  
\\FAS-BG5\ED-1L1<Cr>
6 >  
\\FAS-BG5\ENT-1L1
7 >   \\FAS-BG5\IS-1D2<Cr>
8 >                   
 
ZZ-ENDOFPRINTERLIST is last printer in this example.
>   \\FAS-BG5\ZZ-ENDOFPRINTERLIST< is 32 characters between > <

Length: 31
1 >   AATOPOFPRINTERLIST         
2 >-->\\FAS-BG5\DEFAULT<CrLf>  
\\FAS-
3 >  
\\FAS-BG5\DI-1L2<CrLf>   \\FAS-B
4 >   \\FAS-BG5\DI-3L1<CrLf>   \\FAS-B
5 >   \\FAS-BG5\ED-1L1<CrLf>   \\FAS-B
6 >   \\FAS-BG5\ENT-1L1<CrLf>   \\FAS-
7 >  
\\FAS-BG5\IS-1D2<CrLf>   \\FAS-B
8 >   \\FAS-BG5\IS-1L1<CrLf>   \\FAS-B
9 >   \\FAS-BG5\ZZ-ENDOFPRINTERLIS
10 >                              
 
Length: 32
1 >   AATOPOFPRINTERLIST          
2 >-->\\FAS-BG5\DEFAULT<CrLf>  
\\FAS-B
3 >   \\FAS-BG5\DI-1L2<CrLf>   \\FAS-BG
4 >   \\FAS-BG5\DI-3L1<CrLf>   \\FAS-BG
5 >   \\FAS-BG5\ED-1L1<CrLf>   \\FAS-BG
6 >   \\FAS-BG5\ENT-1L1<CrLf>   \\FAS-B
7 >   \\FAS-BG5\IS-1D2<CrLf>   \\FAS-BG
8 >   \\FAS-BG5\IS-1L1<CrLf>   \\FAS-BG
9 >   \\FAS-BG5\ZZ-ENDOFPRINTERLIST
10 >                               
 
Length: 33
1 >   AATOPOFPRINTERLIST           
2 >-->\\FAS-BG5\DEFAULT<CrLf>  
\\FAS-BG
3 >   \\FAS-BG5\DI-1L2<CrLf>   \\FAS-BG5
4 >   \\FAS-BG5\DI-3L1<CrLf>   \\FAS-BG5
5 >   \\FAS-BG5\ED-1L1<CrLf>   \\FAS-BG5
6 >   \\FAS-BG5\ENT-1L1<CrLf>   \\FAS-BG
7 >   \\FAS-BG5\IS-1D2<CrLf>   \\FAS-BG5
8 >   \\FAS-BG5\IS-1L1<CrLf>   \\FAS-BG5
9 >                                
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich McNeil
Sent: Wednesday, July 14, 2004 2:57 PM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Meditech CS printer dialog

To get the last item on the list you might try to reduce the length in the View.

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Turner, Peter
Sent: Wednesday, July 14, 2004 2:46 PM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Meditech CS printer dialog

 

That's fine - that is what I meant about redoing the way the snippet operates - but what about the last item in the list?

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich McNeil
Sent: Wednesday, July 14, 2004 9:59 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Meditech CS printer dialog

I’d suggest the following modification:

 

T$ = W.View(Window:="Print [EMAIL PROTECTED],84", Row:=i, Col:=1, length:=30, B:=bcComboBoxAll)

T$ = Left(T$, Instr(T$ &  vbCrLf, vbCrLf) – 1))

 

This will strip off everything after the carriage return-line feed characters, if any.

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Turner, Peter
Sent: Wednesday, July 14, 2004 9:44 AM
To: [EMAIL PROTECTED]
Subject: [Talk] Meditech CS printer dialog

 

Trying to get a grip on the Meditech CS printer dialog box.  I have found the code snippet on web page that purports to do it but it doesn't seem to operate very well.  I have seen post that claim this does work - am I missing something?

For one thing, I have discovered that it really doesn't seem to parse to the bottom of the possible printers in the dialog list.  If there are 6, I can get up to the 5th.  If there are  7, I can get to the 6th. If I request the last printer, if I don't limit it in some way, it just keeps incrementing until it hits integer overflow.

What seems to be some quirk in the View function W.View(Window:="Print [EMAIL PROTECTED],84", Row:=i, Col:=1, length:=30, B:=bcComboBoxAll) provides that instead of a row starting at column 1 and reading to a CrLf or 30 characters, it just reads the next 30 characters, including a CarridgeReturnLineFeed combination if it is there.  Oddly, it does not do it on the top item in the list 

Currently, the way the snippet is written it finds the currently selected printer - the one with the --> in the line above where it should be, because the view wraps around into the next line.  This is a parse as read by the view function.  #5 is the currently selected printer, but the code picks #4 instead, then moves incorrectly because the index was wrong.

1 >   \\FAS-BG5\DEFAULT         
2 >   \\FAS-BG5\DI-1L2<CrLf>   \\FAS-
3 >   \\FAS-BG5\DI-3L1<CrLf>   \\FAS-
4 >   \\FAS-BG5\ED-1L1<CrLf>-->\\FAS-
5 >-->\\FAS-BG5\ENT-1L1<CrLf>   \\FAS
6 >   \\FAS-BG5\IS-1D2<CrLf>   \\FAS-
7 >   \\FAS-BG5\IS-1L1<CrLf>   \\FAS-


I can deal with this by redoing the way the snippet operates, but I have been unable to read the last item in the list.  I have tried increasing the length but the data read still does not include the last printer in the list.

Reply via email to