# CMNDPROC.BAS Documentation ## Overview This module contains the main program logic for handling print jobs and printer management in Visual Basic. It serves as the primary module containing core functionality for processing print commands and managing printer configurations. ## Global Variables ### Print Management Variables - `Place$(300)` - Array storing printer locations/names - `Lpt$(300)` - Array storing printer port names - `PrinterGroup$(300)` - Array storing printer group assignments - `Tray$(300)` - Array storing printer tray configurations - `Limits$(300)` - Array storing printer limits ### Submission Variables - `submask$(1000, 2)` - Array storing submission mask configurations - `submaskI%` - Submission mask counter - `plt$(40)` - Array storing plot configurations - `lptI%` - Printer counter - `pltI%` - Plot counter ### Queue Management - `sm` - Submission counter - `que` - Current queue number - `Replys$(100)` - Array storing replies - `replies%` - Reply counter - `replies2` - Secondary reply counter - `replys2$(100)` - Secondary replies array ### System Variables - `WDTServerTime!` - Watchdog timer server time - `Constipation%` - System block indicator - `mov$` - Current file being moved - `Mesgline$`, `Mesgline2$` - Message lines for printing - `pgs%` - Page counter - `source$` - Source file/location ### File Management - `MessageFileName$` - Message file path - `MessageLogName$`, `MessageLogName2$` - Log file paths - `NetWPath$` - Network path - `COMPLETE$`, `COMPLETE2$` - Completion flags - `INCOME$` - Income queue file - `PrintCfg$` - Print configuration file - `Reply$` - Reply file - `ReplyComplete$`, `ReplyComplete2$` - Reply completion flags ### Print Processing - `CADPRINT$` - CAD print file - `QUEHANDL$` - Queue handler file - `CADPRNT2$` - Secondary CAD print file - `TFIL$` - Temporary file - `MAKEPS$` - PostScript creation file - `XEPS$` - EPS file - `PLOTCFG$` - Plot configuration file - `PrinterCFG$` - Printer configuration file - `SUBSCFG$` - Subscription configuration file - `BufferName$` - Buffer file name ## Key Functions ### Print Job Processing - `AddHeaders()` - Adds headers to print jobs - `PrintPSFile()` - Processes PostScript files for printing - `PrintTextFile()` - Handles text file printing - `PrintDrawing()` - Processes drawing prints - `PrintWiring()` - Handles wiring diagram prints ### File Management - `MoveOUT()` - Moves files from CAD directory to user - `MoveIN()` - Moves files from user to CAD directory - `MoveBACK()` - Returns files to previous location - `CopyPart()` - Copies drawings between directories - `DeleteIt()` - Removes processed files - `CopyIt()` - Handles file copying operations ### Configuration - `LoadPlot()` - Loads plot configurations - `LoadPrinters()` - Initializes printer settings - `LoadSubDirs()` - Loads subdirectory configurations - `GetExternalUsersFile()` - Loads external user configurations ### System Management - `StartSystem()` - Initializes system operation - `InitVars()` - Sets up initial variables - `WDTServer()` - Manages watchdog timer - `FlushReplies()` - Processes pending replies - `Messages()` - Handles system messaging - `PrintLog()` - Manages logging operations ## Error Handling The module implements comprehensive error handling with: - Error logging to multiple log files - Error recovery procedures - File operation retry mechanisms - System state monitoring ## File Types Supported - AutoCAD files (.DWG) - PostScript files (.PS) - PDF files (.PDF) - Pro/ENGINEER files (.PLT, .DRW, .PRT) - Text files (.TXT) - Configuration files (.CFG) - Wiring diagrams (.WIR) - Markup files (.MRK) ## Network Integration - Supports network printing - Handles network paths - Manages network queues - Processes network user requests ## Security - User validation - Access control through printer groups - File operation logging - Operation tracking ## Dependencies - Visual Basic runtime - Network file system access - Printer drivers - PostScript processing capabilities ## Performance Considerations - File buffer management - Queue processing optimization - Error recovery mechanisms - Network timeout handling ## Form Integration CMNDPROC.BAS serves as the core command processing module that integrates with the following forms: ### Cmdproc-1.frm - Main command processing interface - Handles primary user input and command validation - Interfaces with system management functions - Manages initial command queue processing ### Cmdproc-2.frm - File operation handling - Implements file type validation - Manages file conversion processes - Controls file queue management ### Cmdproc-3.frm - Network communication interface - Processes network print requests - Handles network path resolution - Manages network queue status ### Cmdproc-4.frm - Security and access control - User authentication interface - Printer group management - Access logging implementation ### Cmdproc-5.frm - Error handling interface - Displays error messages - Manages error recovery procedures - Logs error information ### Cmdproc-6.frm - System monitoring interface - Performance tracking - Resource usage display - System status reporting ## Integration Flow CMNDPROC.BAS ⟷ Cmdproc-1.frm ⟷ [Cmdproc-2.frm through Cmdproc-6.frm] - Core functions in CMNDPROC.BAS are called by form modules - Forms provide UI elements for command processing functions - Each form specializes in specific system aspects - All forms communicate through CMNDPROC.BAS central control