FrymasterVB/filewatch.frm.md

1.5 KiB

FileWatch Form Documentation

This form provides a file monitoring interface that watches multiple system files and displays their existence status.

Form Controls

  • lstFileWatch: ListBox control that displays file statuses
  • Timer1: Timer control that refreshes file statuses every 1 second
  • cmdClose: Command button to close the form

Key Functions

Form_Load()

Initializes the form by populating the ListBox with various system files to monitor:

  • Message files
  • Log files
  • Complete/Income/Reply files
  • CAD related files
  • Printer configuration files
  • ACAD files
  • PROE files

Timer1_Timer()

  • Runs every second
  • Iterates through each item in lstFileWatch
  • Parses the status string and updates file existence status
  • Format: "[Status] | [Mode] | [Filename]"

doesit$(fl$, mode$)

Checks file existence and returns formatted status string:

Mode types:

  • 0: Normal file check
    • Exists: "Normal Exists"
    • Not Exists: "--Warn Not Exists"
  • 1: Inverse check
    • Exists: "--Warn Exists"
    • Not Exists: "Normal Not Exists"
  • 2: Error on exists
    • Exists: "ERROR Exists"
    • Not Exists: "Normal Not Exists"
  • 3: Error on not exists
    • Exists: "Normal Exists"
    • Not Exists: "ERROR Not Exists"

Usage

The form provides real-time monitoring of system files with color-coded status indicators:

  • Normal: File exists as expected
  • Warning: File exists/doesn't exist contrary to expectations
  • Error: Critical file state mismatch