Scripting

QW5 Help Files

Quality Window offers user exits to further extend its capabilities via scripting.


Scripts can be:


  • associated at the template level, folder level or system level  as a .QWX file
  • external files as a .VBS file



Script

Type


Code


Explanation

.QWX

Option Explicit


Function QW_AfterDisplay(QWFunction)

   Select Case QWFunction

          Case "A","E","I","C"

               If QWfile.Value(3) = QWfile.Value(4) Then

                  QWfile.Value(5) = "10" ' True

               Else

                  QWfile.Value(5) = "20" ' False

               End If

   End Select

End Function



When an Add, Edit, Insert or Copy record is saved in Quality Window, check to see if

V3 = V4.


If V3 = V4 

set V5 to 10

otherwise

set V5 to 20

.VBS

Option Explicit

Dim QWfile, Rec

Set QWfile=createobject("qwaccessclass.qwaccess")

QWfile.OpenMode = 2


QWfile.OpenFile "C:\MyQWData\MyTemplate.qwt"

QWfile.SortFile

For Rec = 1 to QWfile.Sorted.Count

      QWfile.GetRecord QWfile.Sorted(Rec).RecordNo

      QWfile.Value(8) = "10-True"

      QWfile.PutRecord Rec

      QWfile.ReCalcRecord Rec

      QWfile.PutRecord Rec

Next

MsgBox Rec, , "Records Updated"

QWfile.CloseFile

Loop through the template MyTemplate.qwt in the C:\MyQWData\ folder and set

V8 = 10-True