Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tray update
Message
 
 
To
26/10/2004 06:08:09
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00952356
Message ID:
00954545
Views:
9
Srdjan,

>Looking at yr code, idea comes to my mind ;

There's not much complex to the code either, it's pretty sraightforward.

>Making class having universal calls for common tasks like
>While internaly tasks could be dispatched to different methods for different printer types ...

Rather than extending by making new CASE additions (which makes the class more fragile, ie someone goes in to fix/insert a Postscript fragment they can break a working PCL4 fragment), I'd use a simpler inheritance scheme:
FormsPrinter                && abstract class to define the interface
   PCL4FormsPrinter         && fully functional PCL4 class
      UserSpecificPrinterA  && if needed to add 
   PostscriptFormsPrinter   && fully functional Postscript
      UserSpecificPrinterB
There's also the new report features of Europa where a forms engine like this could be put to use but it'd be simple because it could just be written to GDI+ and let the O/S deal with the printer specifics.

>
>define class virtual_printer as custom
>
>output_type='PostScript'
>procedure write_at
>lparameters nTop , nLeft,cOutpuText
>
>do case
>   case this.output_type = 'PCL4'
>        this.pcl4_write_at(lparameters nTop , nLeft,cOutpuText)
>
>   case this.output_type = 'PostScript'
>        this.postsript_write_at(lparameters nTop , nLeft,cOutpuText)
>endcase
>enddefine
>
>
>It could be sort of 'open source', so who ever hv valid code for controling
>certain printer type can contribute in making versatile class
>for programatticaly writing to laser printers.
>
>Just Idea :))
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform