Announcement

Collapse
No announcement yet.

SourceCode Only

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SourceCode Only

    It's getting difficult to find all the code snippets and file versions. Let's use this thread to post code so we have it all in one place. I expect this problem to go away once we have the SVN fully functional.

    Stan
    Do not go quiet into that good night,
    ... Rage, rage against the dark.

  • #2
    There are six terms on each line:

    Element#1-$ term from VB source code
    Element#2-# 0=PB term available, 1=no term available or possible issue, check for substitution
    Element#3-$ PB term
    Element#4-# 0=nothing to consider, 1 term has multiple uses which may require consideration
    Element#5-# 0 reserved for possible POINTER TO FUNCTION that returns the PB term for this VB term
    Element#6-$ comment regarding the term, possibly used in output source, or for info for conversion programmers.

    NOTE Even though the second element is set to no term available(1), if the multiple uses, fourth element, is set to 1, the PB WORD exists.
    IF elements 2 AND 4 are set to one the usage of the term will have to be checked.
    This can be converted to an include file with a small utility to place the items in an array of some UDT, I have left it this way
    so it can be set up in a fashion deemed most suitable by the whoever has to access the information. I will be posting updates to
    file and the date of updates will be the first line of the file.

    Example:
    "BEEP",0,"BEEP",0,0,"Verbatim usage"
    Attached Files
    Rod
    I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

    Comment


    • #3
      Same file, more terms. STATEMENTS and KEYWORDS. 113 lines.

      Rod
      Attached Files
      Rod
      I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

      Comment


      • #4
        Same file, more terms. STATEMENTS, KEYWORDS, and FUNCTIONS. 238 lines.
        Attached Files
        Rod
        I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

        Comment


        • #5
          Rod,

          Here's a little program to convert your data files to PB random files. Please take a look at the TYPE. You have a better idea of how big those strings should be than I do. My test output ran to 93kb.

          For this to work properly do 2 things:
          1. take out all non-data lines at the top of your terms text file
          2. name the new file "vb2pbTerms-20080624.txt"

          Code:
          #PBFORMS CREATED V1.51
          '------------------------------------------------------------------------------
          
          #COMPILE EXE
          #DIM ALL
          
          '------------------------------------------------------------------------------
          '   ** Includes **
          '------------------------------------------------------------------------------
          #PBFORMS BEGIN INCLUDES
          #IF NOT %DEF(%WINAPI)
             #INCLUDE "WIN32API.INC"
          #ENDIF
          #INCLUDE "PBForms.INC"
          #PBFORMS END INCLUDES
          '------------------------------------------------------------------------------
          
          '------------------------------------------------------------------------------
          '   ** Constants **
          '------------------------------------------------------------------------------
          #PBFORMS BEGIN CONSTANTS
          %IDC_COMMENT            = 1014
          %IDC_CREATEDATAFILE     = 1026
          %IDC_FASTUPDATES        = 1023
          %IDC_INPUTFILEPATHNAME  = 1003
          %IDC_LABEL1             = 1001
          %IDC_LABEL10            = 1018
          %IDC_LABEL11            = 1034
          %IDC_LABEL12            = 1035
          %IDC_LABEL13            = 1036
          %IDC_LABEL14            = 1037
          %IDC_LABEL15            = 1038
          %IDC_LABEL2             = 1002
          %IDC_LABEL3             = 1004
          %IDC_LABEL4             = 1006
          %IDC_LABEL5             = 1007
          %IDC_LABEL6             = 1008
          %IDC_LABEL7             = 1009
          %IDC_LABEL8             = 1010
          %IDC_LABEL9             = 1011
          %IDC_LINE1              = 1020
          %IDC_LINE2              = 1021
          %IDC_LINE3              = 1028
          %IDC_LINE4              = 1029
          %IDC_LINE5              = 1030
          %IDC_LINECOUNT          = 1019
          %IDC_LINESREAD          = 1005
          %IDC_LOADVB2PBTERMS     = 1025
          %IDC_MULTIUSETERM       = 1016
          %IDC_NOPROGRESSUPDATES  = 1022
          %IDC_PBTERM             = 1017
          %IDC_PBTERMAVAILABLE    = 1013
          %IDC_POINTERTOPBWRAPPER = 1015
          %IDC_QUIT               = 1027
          %IDC_SLOWUPDATES        = 1024
          %IDC_TEXTBOX10          = 1031
          %IDC_TEXTBOX11          = 1032
          %IDC_TEXTBOX12          = 1033
          %IDC_VBTERM             = 1012
          %IDD_DataLoadTool       =  101
          #PBFORMS END CONSTANTS
          
          %NoScreenUpdates        = 1
          %SlowScreenUpdates      = 2
          %FastScreenUpdates      = 4
          '------------------------------------------------------------------------------
          
          '------------------------------------------------------------------------------
          '  *** Types ***
          '------------------------------------------------------------------------------
          TYPE DictionaryRecordType
             vbTerm AS STRING * 64
             pbTermAvailable AS LONG
             pbTerm AS STRING * 64
             MultiUse AS LONG
             pbWrapper AS DWORD
             Comment AS STRING * 256
          END TYPE
          
          
          '------------------------------------------------------------------------------
          '   ** Declarations **
          '------------------------------------------------------------------------------
          DECLARE CALLBACK FUNCTION ShowDataLoadToolProc()
          DECLARE FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
          #PBFORMS DECLARATIONS
          '------------------------------------------------------------------------------
          
          '------------------------------------------------------------------------------
          '   ** Main Application Entry Point **
          '------------------------------------------------------------------------------
          FUNCTION PBMAIN()
             ShowDataLoadTool %HWND_DESKTOP
          END FUNCTION
          '------------------------------------------------------------------------------
          
          '------------------------------------------------------------------------------
          '   ** CallBacks **
          '------------------------------------------------------------------------------
          CALLBACK FUNCTION ShowDataLoadToolProc()
             LOCAL lResult AS LONG
             LOCAL tempString AS STRING
             LOCAL inFile AS INTEGER
             LOCAL outFile AS INTEGER
             LOCAL lineCount AS LONG
             LOCAL record AS DictionaryRecordType
             LOCAL recCount AS LONG
             LOCAL Finished AS LONG
          
             STATIC updateFlag AS LONG
             STATIC sourceFileName AS STRING
             STATIC targetFileName AS STRING
          
          
          
             IF updateFlag < %NoScreenUpdates THEN     'on first run only
                updateFlag = %FastScreenUpdates        'fast updates default
             END IF
          
             IF LEN(sourceFileName) < 1 THEN
                sourceFileName = "vb2pbTerms-20080624.txt"
             END IF
          
             IF LEN(targetFileName) < 1 THEN
                targetFileName = "vb2pbTermDict-20080624.dat"
             END IF
          
          
             SELECT CASE AS LONG CBMSG
                CASE %WM_INITDIALOG
                   ' Initialization handler
          
                CASE %WM_NCACTIVATE
                   STATIC hWndSaveFocus AS DWORD
                   IF ISFALSE CBWPARAM THEN
                      ' Save control focus
                      hWndSaveFocus = GetFocus()
                   ELSEIF hWndSaveFocus THEN
                      ' Restore control focus
                      SetFocus(hWndSaveFocus)
                      hWndSaveFocus = 0
                   END IF
          
                CASE %WM_COMMAND
                   ' Process control notifications
                   SELECT CASE AS LONG CBCTL
                      CASE %IDC_NOPROGRESSUPDATES
                         IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                           IF updateFlag = %NoScreenUpdates THEN
                               CONTROL SET TEXT CBHNDL, %IDC_NOPROGRESSUPDATES, "No Progress Updates"
                               updateFlag = %FastScreenUpdates
                           ELSE
                               CONTROL SET TEXT CBHNDL, %IDC_NOPROGRESSUPDATES, "Progress Updates"
                               updateFlag = %NoScreenUpdates
                            END IF
                         END IF
          
                      CASE %IDC_SLOWUPDATES
                         IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                            updateFlag = %SlowScreenUpdates
                         END IF
          
                      CASE %IDC_FASTUPDATES
                         IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                            updateFlag = %FastScreenUpdates
                         END IF
          
                      CASE %IDC_LOADVB2PBTERMS
                         IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                            CONTROL SET TEXT CBHNDL, %IDC_INPUTFILEPATHNAME, CURDIR$
                            inFile = FREEFILE
                            OPEN sourceFileName FOR INPUT AS inFile
                            FILESCAN #inFile, RECORDS TO lineCount
                            tempString = TRIM$(STR$(lineCount))
                            CONTROL SET TEXT CBHNDL, %IDC_LINECOUNT, tempString
                            CLOSE #inFile
                         END IF
          
                      CASE %IDC_CREATEDATAFILE
                         IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                            inFile = FREEFILE
                            OPEN sourceFileName FOR INPUT AS inFile
                            outFile = FREEFILE
          
                            OPEN targetFileName FOR RANDOM AS outFile LEN = SIZEOF(record)
                            recCount = LOF(outFile) / SIZEOF(record)
          
                            lineCount = 0
                            DO
                               INPUT #inFile, record.vbTerm, _
                                              record.pbTermAvailable, _
                                              record.pbTerm, _
                                              record.MultiUse, _
                                              record.pbWrapper, _
                                              record.Comment
          
                               IF EOF(inFile) THEN Finished = %True ELSE Finished = %False
          
                               PUT #outFile, , record
          
                               INCR lineCount
                               IF updateFlag = %NoScreenUpdates THEN
                                  ITERATE DO
                                  CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(lineCount))
                               ELSE
                                  'IF updateFlag = %SlowScreenUpdates THEN
                                  '   SLEEP 500
                                  'ELSEIF updateFlag = %FastScreenUpdates THEN
                                  '   SLEEP 100
                                  'END IF
          
                                  CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(lineCount))
                                  CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                  CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                  CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                  CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                  CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                  CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                               END IF
                            LOOP UNTIL Finished
                         END IF
          
                      CASE %IDC_QUIT
                         IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                            lResult = MSGBOX("Are you sure you want to quit?", %MB_YESNOCANCEL, "DataTool")
                            IF lResult = %IDYES THEN
                               DIALOG END CBHNDL
                            END IF
                         END IF
          
                   END SELECT
             END SELECT
          END FUNCTION
          '------------------------------------------------------------------------------
          
          '------------------------------------------------------------------------------
          '   ** Dialogs **
          '------------------------------------------------------------------------------
          FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
             LOCAL lRslt  AS LONG
          
          #PBFORMS BEGIN DIALOG %IDD_DataLoadTool->->
             LOCAL hDlg   AS DWORD
             LOCAL hFont1 AS DWORD
             LOCAL hFont2 AS DWORD
          
             DIALOG NEW hParent, "Data Load Tool For Rod's VB Term Files", 315, 151, _
                444, 347, %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
                %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
                OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CLIENTEDGE OR _
                %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE OR %WS_EX_CONTROLPARENT OR _
                %WS_EX_APPWINDOW OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR, TO hDlg
             CONTROL ADD TEXTBOX, hDlg, %IDC_INPUTFILEPATHNAME, "Input File Path/Name", _
                70, 45, 190, 15, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_LINESREAD, "Lines Read", 70, 70, 65, 15, _
                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_LINECOUNT, "Line Count", 195, 70, 65, 15, _
                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_VBTERM, "vbTerm", 75, 120, 185, 20, _
                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERMAVAILABLE, "pbTerm Available", 75, _
                146, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL _
                OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                OR %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERM, "pbTerm", 75, 172, 185, 20, _
                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_MULTIUSETERM, "Multi Use Term", 75, 198, _
                185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_POINTERTOPBWRAPPER, "Pointer To " + _
                "pbWrapper", 75, 224, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_COMMENT, "Comment", 75, 250, 185, 20, _
                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD BUTTON,  hDlg, %IDC_NOPROGRESSUPDATES, "No Progress Updates", _
                24, 290, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT _
                OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                %WS_EX_LEFT OR %WS_EX_LTRREADING
             CONTROL ADD BUTTON,  hDlg, %IDC_SLOWUPDATES, "Slow Updates", 99, 290, 70, _
                20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                %WS_EX_LEFT OR %WS_EX_LTRREADING
             CONTROL ADD BUTTON,  hDlg, %IDC_FASTUPDATES, "Fast Updates", 180, 290, 70, _
                20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                %WS_EX_LEFT OR %WS_EX_LTRREADING
             CONTROL ADD BUTTON,  hDlg, %IDC_LOADVB2PBTERMS, "Load vb2pbTerms", 25, _
                315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                %WS_EX_LEFT OR %WS_EX_LTRREADING
             CONTROL ADD BUTTON,  hDlg, %IDC_CREATEDATAFILE, "Create Data File", 100, _
                315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                %WS_EX_LEFT OR %WS_EX_LTRREADING
             CONTROL ADD BUTTON,  hDlg, %IDC_QUIT, "Quit", 179, 315, 70, 20
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "Loads Rod's Data Files into UDT " + _
                "array saves to  vb2pbTermData.dat", 25, 10, 220, 25, %WS_CHILD OR _
                %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL2, "Input File:", 5, 45, 65, 15
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL3, "Lines Processed", 10, 70, 55, 25
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL4, "vbTerm", 10, 125, 60, 20
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL5, "pbTerm available?", 10, 150, 60, _
                20
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL6, "pbTerm", 10, 175, 60, 20
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL7, "Multi Use Term?", 10, 200, 60, 20
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL8, "Pointer to pbWrapper", 10, 225, _
                60, 20
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL9, "Comment", 10, 250, 60, 20
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL10, "Total Lines", 150, 70, 40, 20
             CONTROL ADD LINE,    hDlg, %IDC_LINE1, "Line1", 5, 100, 435, 10, %WS_CHILD _
                OR %WS_VISIBLE OR %SS_GRAYRECT
             CONTROL ADD LINE,    hDlg, %IDC_LINE2, "Line1", 5, 275, 260, 10, %WS_CHILD _
                OR %WS_VISIBLE OR %SS_GRAYRECT
             CONTROL ADD LINE,    hDlg, %IDC_LINE3, "Line3", 265, 275, 10, 70, _
                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
             CONTROL ADD LINE,    hDlg, %IDC_LINE4, "Line4", 265, 110, 10, 165, _
                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
             CONTROL ADD LINE,    hDlg, %IDC_LINE5, "Line5", 265, 5, 10, 95, %WS_CHILD _
                OR %WS_VISIBLE OR %SS_GRAYRECT
             CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX10, "NOTE Even though the second " + _
                "element is set to no term available(1), if the multiple uses, fourth " + _
                "element, is set to 1, the PB WORD exists. IF elements 2 AND 4 are set " + _
                "to one the usage of the term will have to be checked. This can be " + _
                "converted to an include file with a small utility to place the items " + _
                "in an array of some UDT, I have left it this way. Rod.", 280, 115, _
                155, 145, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                %ES_AUTOVSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
             CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX11, "Example:", 275, 280, 50, 15, _
                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL SET COLOR    hDlg, %IDC_TEXTBOX11, -1, %YELLOW
             CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX12, _
                "BEEP"",0,""BEEP"",0,0,""Verbatim usage", 275, 300, 170, 15, %WS_CHILD _
                OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR %ES_READONLY, _
                %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                %WS_EX_RIGHTSCROLLBAR
             CONTROL SET COLOR    hDlg, %IDC_TEXTBOX12, -1, %YELLOW
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL11, "%pbTermAvailable = 0", 280, 20, _
                115, 15
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL12, "%pbTermNotAvailable = 1", 280, _
                40, 135, 15
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL13, "%NotMultiUseTerm = 0", 280, 60, _
                115, 15
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL14, "%MultiUseTerm = 1", 280, 80, _
                115, 15
             CONTROL ADD LABEL,   hDlg, %IDC_LABEL15, "Item 2 and 4 Equates", 280, 5, _
                155, 10
             CONTROL SET COLOR    hDlg, %IDC_LABEL15, -1, %YELLOW
          
             hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
                %ANSI_CHARSET)
             hFont2 = PBFormsMakeFont("Courier New", 8, 400, %FALSE, %FALSE, %FALSE, _
                %ANSI_CHARSET)
          
             DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_INPUTFILEPATHNAME, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LINESREAD, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LINECOUNT, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_VBTERM, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_PBTERMAVAILABLE, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_PBTERM, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_MULTIUSETERM, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_POINTERTOPBWRAPPER, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_COMMENT, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_NOPROGRESSUPDATES, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_SLOWUPDATES, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_FASTUPDATES, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LOADVB2PBTERMS, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_CREATEDATAFILE, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_QUIT, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL1, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL2, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL3, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL4, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL5, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL6, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL7, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL8, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL9, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL10, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LINE1, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LINE2, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LINE3, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LINE4, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LINE5, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_TEXTBOX10, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_TEXTBOX11, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_TEXTBOX12, %WM_SETFONT, hFont2, 0
             CONTROL SEND hDlg, %IDC_LABEL11, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL12, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL13, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL14, %WM_SETFONT, hFont1, 0
             CONTROL SEND hDlg, %IDC_LABEL15, %WM_SETFONT, hFont1, 0
          #PBFORMS END DIALOG
          
             DIALOG SHOW MODAL hDlg, CALL ShowDataLoadToolProc TO lRslt
          
          #PBFORMS BEGIN CLEANUP %IDD_DataLoadTool
             DeleteObject hFont1
             DeleteObject hFont2
          #PBFORMS END CLEANUP
          
             FUNCTION = lRslt
          END FUNCTION
          Do not go quiet into that good night,
          ... Rage, rage against the dark.

          Comment


          • #6
            Added ability to review contents of random data file. Removed the screen updates -- they were kind of useless anyway.

            Code:
            #PBFORMS CREATED V1.51
            '------------------------------------------------------------------------------
            
            #COMPILE EXE
            #DIM ALL
            
            '------------------------------------------------------------------------------
            '   ** Includes **
            '------------------------------------------------------------------------------
            #PBFORMS BEGIN INCLUDES
            #IF NOT %DEF(%WINAPI)
                #INCLUDE "WIN32API.INC"
            #ENDIF
            #INCLUDE "PBForms.INC"
            #PBFORMS END INCLUDES
            '------------------------------------------------------------------------------
            
            '------------------------------------------------------------------------------
            '   ** Constants **
            '------------------------------------------------------------------------------
            #PBFORMS BEGIN CONSTANTS
            %IDC_BACK                  = 1022
            %IDC_COMMENT               = 1014
            %IDC_CREATEDATAFILE        = 1026
            %IDC_EXITFILEREVIEW        = 1039
            %IDC_FORWARD               = 1024
            %IDC_INPUTFILEPATHNAME     = 1003
            %IDC_LABEL1                = 1001
            %IDC_LABEL10               = 1018
            %IDC_LABEL11               = 1034
            %IDC_LABEL12               = 1035
            %IDC_LABEL13               = 1036
            %IDC_LABEL14               = 1037
            %IDC_LABEL15               = 1038
            %IDC_LABEL2                = 1002
            %IDC_LABEL3                = 1004
            %IDC_LABEL4                = 1006
            %IDC_LABEL5                = 1007
            %IDC_LABEL6                = 1008
            %IDC_LABEL7                = 1009
            %IDC_LABEL8                = 1010
            %IDC_LABEL9                = 1011
            %IDC_LINE1                 = 1020
            %IDC_LINE2                 = 1021
            %IDC_LINE3                 = 1028
            %IDC_LINE4                 = 1029
            %IDC_LINE5                 = 1030
            %IDC_LINECOUNT             = 1019
            %IDC_LINESREAD             = 1005
            %IDC_MULTIUSETERM          = 1016
            %IDC_PBTERM                = 1017
            %IDC_PBTERMAVAILABLE       = 1013
            %IDC_POINTERTOPBWRAPPER    = 1015
            %IDC_QUITPROGRAM           = 1027
            %IDC_REVIEWTERMSDICTIONARY = 1025
            %IDC_TEXTBOX10             = 1031
            %IDC_TEXTBOX11             = 1032
            %IDC_TEXTBOX12             = 1033
            %IDC_VBTERM                = 1012
            %IDD_DataLoadTool          =  101
            #PBFORMS END CONSTANTS
            
            '------------------------------------------------------------------------------
            
            '------------------------------------------------------------------------------
            '  *** Types ***
            '------------------------------------------------------------------------------
            TYPE DictionaryRecordType
               vbTerm AS STRING * 64
               pbTermAvailable AS LONG
               pbTerm AS STRING * 64
               MultiUse AS LONG
               pbWrapper AS DWORD
               Comment AS STRING * 256
            END TYPE
            
            '------------------------------------------------------------------------------
            '   ** Declarations **
            '------------------------------------------------------------------------------
            DECLARE CALLBACK FUNCTION ShowDataLoadToolProc()
            DECLARE FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
            #PBFORMS DECLARATIONS
            '------------------------------------------------------------------------------
            
            '------------------------------------------------------------------------------
            '   ** Main Application Entry Point **
            '------------------------------------------------------------------------------
            FUNCTION PBMAIN()
               ShowDataLoadTool %HWND_DESKTOP
            END FUNCTION
            '------------------------------------------------------------------------------
            
            '------------------------------------------------------------------------------
            '   ** CallBacks **
            '------------------------------------------------------------------------------
            CALLBACK FUNCTION ShowDataLoadToolProc()
               LOCAL lResult AS LONG
               LOCAL tempString AS STRING
               LOCAL inFile AS INTEGER
               LOCAL lineCount AS LONG
               LOCAL record AS DictionaryRecordType
               LOCAL Finished AS LONG
            
               STATIC sourceFileName AS STRING
               STATIC targetFileName AS STRING
               STATIC outFile AS INTEGER
               STATIC recNo AS LONG
               STATIC recCount AS LONG
            
            
               SELECT CASE AS LONG CBMSG
                  CASE %WM_INITDIALOG
                     ' Initialization handler
            
                     sourceFileName = "vb2pbTerms-20080624.txt"
                     targetFileName = "vb2pbTermDict-20080624.dat"
                     recNo = 1
                     recCount = 1
                     CONTROL SET TEXT CBHNDL, %IDC_INPUTFILEPATHNAME, CURDIR$
            
                  CASE %WM_NCACTIVATE
                     STATIC hWndSaveFocus AS DWORD
                     IF ISFALSE CBWPARAM THEN
                        ' Save control focus
                        hWndSaveFocus = GetFocus()
                     ELSEIF hWndSaveFocus THEN
                        ' Restore control focus
                        SetFocus(hWndSaveFocus)
                        hWndSaveFocus = 0
                     END IF
            
                  CASE %WM_COMMAND
                     ' Process control notifications
                     SELECT CASE AS LONG CBCTL
                        CASE %IDC_EXITFILEREVIEW
                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                              CONTROL ENABLE CBHNDL, %IDC_CREATEDATAFILE
                              CONTROL ENABLE CBHNDL, %IDC_QUITPROGRAM
                              CONTROL ENABLE CBHNDL, %IDC_REVIEWTERMSDICTIONARY
            
                              CONTROL DISABLE CBHNDL, %IDC_BACK
                              CONTROL DISABLE CBHNDL, %IDC_FORWARD
                              CONTROL DISABLE CBHNDL, %IDC_EXITFILEREVIEW
            
                              CLOSE #outFile
                           END IF
            
                        CASE %IDC_BACK
                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                              DECR recNo
                              IF recNo < 1 THEN recNo = recCount
                              CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(recNo))
                              DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWTERMSDICTIONARY, %BN_CLICKED
                           END IF
            
                        CASE %IDC_FORWARD
                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                              INCR recNo
                              IF recNo > recCount THEN recNo = 1
                              CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(recNo))
                              DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWTERMSDICTIONARY, %BN_CLICKED
                           END IF
            
            
                        CASE %IDC_REVIEWTERMSDICTIONARY
                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                              CONTROL DISABLE CBHNDL, %IDC_CREATEDATAFILE
                              CONTROL DISABLE CBHNDL, %IDC_QUITPROGRAM
                              CONTROL DISABLE CBHNDL, %IDC_REVIEWTERMSDICTIONARY
            
                              CONTROL ENABLE CBHNDL, %IDC_BACK
                              CONTROL ENABLE CBHNDL, %IDC_FORWARD
                              CONTROL ENABLE CBHNDL, %IDC_EXITFILEREVIEW
            
                              IF ISFALSE FILEATTR(#outFile, 0) THEN
                                 outFile = FREEFILE
                                 OPEN targetFileName FOR RANDOM AS outFile LEN = SIZEOF(record)
                                 recCount = LOF(outFile) / SIZEOF(record)
                              END IF
            
                              GET #outFile, recNo, record
            
                              'update screen display
                              CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                              CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                              CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                              CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                              CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                              CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
            
                           END IF
            
                        CASE %IDC_CREATEDATAFILE
                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                              inFile = FREEFILE
                              OPEN sourceFileName FOR INPUT AS inFile
            
                              outFile = FREEFILE
                              OPEN targetFileName FOR RANDOM AS outFile LEN = SIZEOF(record)
            
                              FILESCAN #inFile, RECORDS TO lineCount
                              tempString = TRIM$(STR$(lineCount))
                              CONTROL SET TEXT CBHNDL, %IDC_LINECOUNT, tempString
            
                              lineCount = 0
                              DO
                                 INPUT #inFile, record.vbTerm, _
                                                record.pbTermAvailable, _
                                                record.pbTerm, _
                                                record.MultiUse, _
                                                record.pbWrapper, _
                                                record.Comment
            
                                 IF EOF(inFile) THEN     'check for eof in source file
                                    Finished = %True
                                 ELSE
                                    Finished = %False
                                 END IF                  'continue last iteration of DO/LOOP to get last record in source file
            
                                 PUT #outFile, , record
            
                                 INCR lineCount
            
                                 'update screen display
                                 CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(lineCount))
                                 CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                 CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                 CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                 CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                 CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                 CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                              LOOP UNTIL Finished
                              CLOSE #inFile, #outFile
                           END IF
            
                        CASE %IDC_QUITPROGRAM
                           IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                              lResult = MSGBOX("Are you sure you want to quit?", %MB_YESNOCANCEL, "TermsData Tool")
                              IF lResult = %IDYES THEN
                                 CLOSE
                                 DIALOG END CBHNDL
                              END IF
                           END IF
            
                     END SELECT
               END SELECT
            END FUNCTION
            '------------------------------------------------------------------------------
            
            '------------------------------------------------------------------------------
            '   ** Dialogs **
            '------------------------------------------------------------------------------
            FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
               LOCAL lRslt  AS LONG
            
            #PBFORMS BEGIN DIALOG %IDD_DataLoadTool->->
                LOCAL hDlg   AS DWORD
                LOCAL hFont1 AS DWORD
                LOCAL hFont2 AS DWORD
            
                DIALOG NEW hParent, "Data Load Tool For Rod's VB Term Files", 315, 151, _
                    442, 346, %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
                    %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
                    OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CLIENTEDGE _
                    OR %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE OR %WS_EX_CONTROLPARENT OR _
                    %WS_EX_APPWINDOW OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                    %WS_EX_RIGHTSCROLLBAR, TO hDlg
                CONTROL ADD TEXTBOX, hDlg, %IDC_INPUTFILEPATHNAME, "Input File " + _
                    "Path/Name", 70, 45, 190, 15, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                    OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                    OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_LINESREAD, "Lines Read", 70, 70, 65, 20, _
                    %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                    %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                    OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_LINECOUNT, "Line Count", 195, 70, 65, 20, _
                    %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                    %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                    %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_VBTERM, "vbTerm", 75, 120, 185, 20, _
                    %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                    %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                    OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERMAVAILABLE, "pbTerm Available", 75, _
                    146, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                    %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                    %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERM, "pbTerm", 75, 172, 185, 20, _
                    %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                    %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                    OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_MULTIUSETERM, "Multi Use Term", 75, 198, _
                    185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                    %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                    OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_POINTERTOPBWRAPPER, "Pointer To " + _
                    "pbWrapper", 75, 224, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                    OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                    OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_COMMENT, "Comment", 75, 250, 185, 20, _
                    %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                    %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                    OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD BUTTON,  hDlg, %IDC_BACK, "<== Back", 24, 290, 70, 20, _
                    %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                    OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                    %WS_EX_LEFT OR %WS_EX_LTRREADING
                CONTROL ADD BUTTON,  hDlg, %IDC_FORWARD, "Forward ==>", 102, 290, 70, 20, _
                    %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                    OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                    %WS_EX_LEFT OR %WS_EX_LTRREADING
                CONTROL ADD BUTTON,  hDlg, %IDC_REVIEWTERMSDICTIONARY, "Review Terms " + _
                    "Dictionary", 102, 315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR _
                    %WS_TABSTOP OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR _
                    %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                CONTROL ADD BUTTON,  hDlg, %IDC_CREATEDATAFILE, "Create Data File", 25, _
                    315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                    %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                    %WS_EX_LEFT OR %WS_EX_LTRREADING
                CONTROL ADD BUTTON,  hDlg, %IDC_QUITPROGRAM, "QUIT PROGRAM", 179, 315, _
                    70, 20
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "Loads Rod's Data Files into UDT " + _
                    "array saves to  vb2pbTermData.dat", 25, 10, 220, 25, %WS_CHILD OR _
                    %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL2, "Input File:", 5, 45, 65, 15
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL3, "Lines Read Record No", 10, 70, _
                    55, 25
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL4, "vbTerm", 10, 125, 60, 20
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL5, "pbTerm available?", 10, 150, 60, _
                    20
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL6, "pbTerm", 10, 175, 60, 20
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL7, "Multi Use Term?", 10, 200, 60, _
                    20
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL8, "Pointer to pbWrapper", 10, 225, _
                    60, 20
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL9, "Comment", 10, 250, 60, 20
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL10, "Line Cnt Record Cnt", 140, 70, _
                    55, 20
                CONTROL ADD LINE,    hDlg, %IDC_LINE1, "Line1", 5, 100, 435, 10, _
                    %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                CONTROL ADD LINE,    hDlg, %IDC_LINE2, "Line1", 5, 275, 260, 10, _
                    %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                CONTROL ADD LINE,    hDlg, %IDC_LINE3, "Line3", 265, 275, 10, 70, _
                    %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                CONTROL ADD LINE,    hDlg, %IDC_LINE4, "Line4", 265, 110, 10, 165, _
                    %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                CONTROL ADD LINE,    hDlg, %IDC_LINE5, "Line5", 265, 5, 10, 95, %WS_CHILD _
                    OR %WS_VISIBLE OR %SS_GRAYRECT
                CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX10, "NOTE Even though the second " + _
                    "element is set to no term available(1), if the multiple uses, " + _
                    "fourth element, is set to 1, the PB WORD exists. IF elements 2 AND " + _
                    "4 are set to one the usage of the term will have to be checked. " + _
                    "This can be converted to an include file with a small utility to " + _
                    "place the items in an array of some UDT, I have left it this way. " + _
                    "Rod.", 280, 115, 155, 145, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                    %ES_MULTILINE OR %ES_AUTOVSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE _
                    OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX11, "Example:", 275, 280, 50, 15, _
                    %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                    %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                    OR %WS_EX_RIGHTSCROLLBAR
                CONTROL SET COLOR    hDlg, %IDC_TEXTBOX11, -1, %YELLOW
                CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX12, _
                    "BEEP"",0,""BEEP"",0,0,""Verbatim usage", 275, 300, 170, 15, _
                    %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                    %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                    OR %WS_EX_RIGHTSCROLLBAR
                CONTROL SET COLOR    hDlg, %IDC_TEXTBOX12, -1, %YELLOW
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL11, "%pbTermAvailable = 0", 280, 20, _
                    115, 15
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL12, "%pbTermNotAvailable = 1", 280, _
                    40, 135, 15
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL13, "%NotMultiUseTerm = 0", 280, 60, _
                    115, 15
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL14, "%MultiUseTerm = 1", 280, 80, _
                    115, 15
                CONTROL ADD LABEL,   hDlg, %IDC_LABEL15, "Item 2 and 4 Equates", 280, 5, _
                    155, 10
                CONTROL SET COLOR    hDlg, %IDC_LABEL15, -1, %YELLOW
                CONTROL ADD BUTTON,  hDlg, %IDC_EXITFILEREVIEW, "EXIT FILE REVIEW", 180, _
                    290, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP _
                    OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR _
                    %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
            
                hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
                    %ANSI_CHARSET)
                hFont2 = PBFormsMakeFont("Courier New", 8, 400, %FALSE, %FALSE, %FALSE, _
                    %ANSI_CHARSET)
            
                DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_INPUTFILEPATHNAME, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LINESREAD, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LINECOUNT, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_VBTERM, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_PBTERMAVAILABLE, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_PBTERM, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_MULTIUSETERM, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_POINTERTOPBWRAPPER, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_COMMENT, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_BACK, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_FORWARD, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_REVIEWTERMSDICTIONARY, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_CREATEDATAFILE, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_QUITPROGRAM, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL1, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL2, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL3, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL4, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL5, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL6, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL7, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL8, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL9, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL10, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LINE1, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LINE2, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LINE3, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LINE4, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LINE5, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_TEXTBOX10, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_TEXTBOX11, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_TEXTBOX12, %WM_SETFONT, hFont2, 0
                CONTROL SEND hDlg, %IDC_LABEL11, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL12, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL13, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL14, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_LABEL15, %WM_SETFONT, hFont1, 0
                CONTROL SEND hDlg, %IDC_EXITFILEREVIEW, %WM_SETFONT, hFont1, 0
            #PBFORMS END DIALOG
            
               DIALOG SHOW MODAL hDlg, CALL ShowDataLoadToolProc TO lRslt
            
            #PBFORMS BEGIN CLEANUP %IDD_DataLoadTool
                DeleteObject hFont1
                DeleteObject hFont2
            #PBFORMS END CLEANUP
            
               FUNCTION = lRslt
            END FUNCTION
            '------------------------------------------------------------------------------
            Do not go quiet into that good night,
            ... Rage, rage against the dark.

            Comment


            • #7
              Added ability to update the dictionary file without repeating what's already there. May actually help you now. Just keep adding new stuff to the bottom of the "vb2pbTermsCSV.txt" file and run this tool whenever you're ready to update the dictionary.


              Name the input file "vb2pbTermsCSV.txt"
              The output file will be named "vb2pbTermsDict.dct"
              Code:
              #PBFORMS CREATED V1.51
              '------------------------------------------------------------------------------
              
              #COMPILE EXE
              #DIM ALL
              
              '------------------------------------------------------------------------------
              '   ** Includes **
              '------------------------------------------------------------------------------
              #PBFORMS BEGIN INCLUDES
              #IF NOT %DEF(%WINAPI)
                  #INCLUDE "WIN32API.INC"
              #ENDIF
              #INCLUDE "PBForms.INC"
              #PBFORMS END INCLUDES
              '------------------------------------------------------------------------------
              
              '------------------------------------------------------------------------------
              '   ** Constants **
              '------------------------------------------------------------------------------
              #PBFORMS BEGIN CONSTANTS
              %IDC_BACK                  = 1022
              %IDC_COMMENT               = 1014
              %IDC_CREATEDATAFILE        = 1026
              %IDC_EXITFILEREVIEW        = 1039
              %IDC_FORWARD               = 1024
              %IDC_INPUTFILEPATHNAME     = 1003
              %IDC_LABEL1                = 1001
              %IDC_LABEL10               = 1018
              %IDC_LABEL11               = 1034
              %IDC_LABEL12               = 1035
              %IDC_LABEL13               = 1036
              %IDC_LABEL14               = 1037
              %IDC_LABEL15               = 1038
              %IDC_LABEL2                = 1002
              %IDC_LABEL3                = 1004
              %IDC_LABEL4                = 1006
              %IDC_LABEL5                = 1007
              %IDC_LABEL6                = 1008
              %IDC_LABEL7                = 1009
              %IDC_LABEL8                = 1010
              %IDC_LABEL9                = 1011
              %IDC_LINE1                 = 1020
              %IDC_LINE2                 = 1021
              %IDC_LINE3                 = 1028
              %IDC_LINE4                 = 1029
              %IDC_LINE5                 = 1030
              %IDC_LINECOUNT             = 1019
              %IDC_LINESREAD             = 1005
              %IDC_MULTIUSETERM          = 1016
              %IDC_PBTERM                = 1017
              %IDC_PBTERMAVAILABLE       = 1013
              %IDC_POINTERTOPBWRAPPER    = 1015
              %IDC_QUITPROGRAM           = 1027
              %IDC_REVIEWTERMSDICTIONARY = 1025
              %IDC_TEXTBOX10             = 1031
              %IDC_TEXTBOX11             = 1032
              %IDC_TEXTBOX12             = 1033
              %IDC_VBTERM                = 1012
              %IDD_DataLoadTool          =  101
              #PBFORMS END CONSTANTS
              
              '------------------------------------------------------------------------------
              
              '------------------------------------------------------------------------------
              '  *** Types ***
              '------------------------------------------------------------------------------
              TYPE DictionaryRecordType
                 vbTerm AS STRING * 64
                 pbTermAvailable AS LONG
                 pbTerm AS STRING * 64
                 MultiUse AS LONG
                 pbWrapper AS DWORD
                 Comment AS STRING * 256
              END TYPE
              
              '------------------------------------------------------------------------------
              '   ** Declarations **
              '------------------------------------------------------------------------------
              DECLARE CALLBACK FUNCTION ShowDataLoadToolProc()
              DECLARE FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
              #PBFORMS DECLARATIONS
              '------------------------------------------------------------------------------
              
              '------------------------------------------------------------------------------
              '   ** Main Application Entry Point **
              '------------------------------------------------------------------------------
              FUNCTION PBMAIN()
                 ShowDataLoadTool %HWND_DESKTOP
              END FUNCTION
              '------------------------------------------------------------------------------
              
              '------------------------------------------------------------------------------
              '   ** CallBacks **
              '------------------------------------------------------------------------------
              CALLBACK FUNCTION ShowDataLoadToolProc()
                 LOCAL lResult AS LONG
                 LOCAL tempString AS STRING
                 LOCAL inFile AS INTEGER
                 LOCAL lineCount AS LONG
                 LOCAL record AS DictionaryRecordType
                 LOCAL Finished AS LONG
                 LOCAL index AS LONG
                 LOCAL tempRecord AS DictionaryRecordtype
              
                 STATIC sourceFileName AS STRING
                 STATIC targetFileName AS STRING
                 STATIC outFile AS INTEGER
                 STATIC recNo AS LONG
                 STATIC recCount AS LONG
              
              
                 SELECT CASE AS LONG CBMSG
                    CASE %WM_INITDIALOG
                       ' Initialization handler
              
                       sourceFileName = "vb2pbTermsCSV.txt"
                       targetFileName = "vb2pbTermsDict.dct"
                       recNo = 1
                       recCount = 1
                       CONTROL SET TEXT CBHNDL, %IDC_INPUTFILEPATHNAME, CURDIR$
              
                    CASE %WM_NCACTIVATE
                       STATIC hWndSaveFocus AS DWORD
                       IF ISFALSE CBWPARAM THEN
                          ' Save control focus
                          hWndSaveFocus = GetFocus()
                       ELSEIF hWndSaveFocus THEN
                          ' Restore control focus
                          SetFocus(hWndSaveFocus)
                          hWndSaveFocus = 0
                       END IF
              
                    CASE %WM_COMMAND
                       ' Process control notifications
                       SELECT CASE AS LONG CBCTL
                          CASE %IDC_EXITFILEREVIEW
                             IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                CONTROL ENABLE CBHNDL, %IDC_CREATEDATAFILE
                                CONTROL ENABLE CBHNDL, %IDC_QUITPROGRAM
                                CONTROL ENABLE CBHNDL, %IDC_REVIEWTERMSDICTIONARY
              
                                CONTROL DISABLE CBHNDL, %IDC_BACK
                                CONTROL DISABLE CBHNDL, %IDC_FORWARD
                                CONTROL DISABLE CBHNDL, %IDC_EXITFILEREVIEW
              
                                CLOSE #outFile
                             END IF
              
                          CASE %IDC_BACK
                             IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                DECR recNo
                                IF recNo < 1 THEN recNo = recCount
                                CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(recNo))
                                DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWTERMSDICTIONARY, %BN_CLICKED
                             END IF
              
                          CASE %IDC_FORWARD
                             IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                INCR recNo
                                IF recNo > recCount THEN recNo = 1
                                CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(recNo))
                                DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWTERMSDICTIONARY, %BN_CLICKED
                             END IF
              
              
                          CASE %IDC_REVIEWTERMSDICTIONARY
                             IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                CONTROL DISABLE CBHNDL, %IDC_CREATEDATAFILE
                                CONTROL DISABLE CBHNDL, %IDC_QUITPROGRAM
                                CONTROL DISABLE CBHNDL, %IDC_REVIEWTERMSDICTIONARY
              
                                CONTROL ENABLE CBHNDL, %IDC_BACK
                                CONTROL ENABLE CBHNDL, %IDC_FORWARD
                                CONTROL ENABLE CBHNDL, %IDC_EXITFILEREVIEW
              
                                IF ISFALSE FILEATTR(#outFile, 0) THEN
                                   outFile = FREEFILE
                                   OPEN targetFileName FOR RANDOM AS outFile LEN = SIZEOF(record)
                                   recCount = LOF(outFile) / SIZEOF(record)
                                END IF
              
                                GET #outFile, recNo, record
              
                                'update screen display
                                CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
              
                             END IF
              
                          CASE %IDC_CREATEDATAFILE
                             IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                inFile = FREEFILE
                                OPEN sourceFileName FOR INPUT AS inFile
              
                                outFile = FREEFILE
                                OPEN targetFileName FOR RANDOM AS outFile LEN = SIZEOF(record)
                                recCount = LOF(outFile) / SIZEOF(record)
                                IF recCount > 1 THEN
                                   recNo = recCount + 1
                                ELSE
                                   recNo = 1
                                END IF
              
                                FILESCAN #inFile, RECORDS TO lineCount
                                tempString = TRIM$(STR$(lineCount))
                                CONTROL SET TEXT CBHNDL, %IDC_LINECOUNT, tempString
              
                                lineCount = 0
                                DO
                                   INPUT #inFile, record.vbTerm, _
                                                  record.pbTermAvailable, _
                                                  record.pbTerm, _
                                                  record.MultiUse, _
                                                  record.pbWrapper, _
                                                  record.Comment
              
                                   IF EOF(inFile) THEN     'check for eof in source file
                                      Finished = %True
                                   ELSE
                                      Finished = %False
                                   END IF                  'continue last iteration of DO/LOOP to get last record in source file
              
                                   FOR index = 1 TO recCount
                                      GET #outFile, index, tempRecord
                                      IF UCASE$(TRIM$(tempRecord.vbTerm)) = UCASE$(TRIM$(record.vbTerm)) THEN
                                         INCR lineCount
                                         ITERATE DO
                                      END IF
                                   NEXT index
              
                                   PUT #outFile, recNo, record
                                   INCR recNo
                                   INCR lineCount
              
                                   'update screen display
                                   CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(lineCount))
                                LOOP UNTIL Finished
                                CLOSE #inFile, #outFile
                             END IF
              
                          CASE %IDC_QUITPROGRAM
                             IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                lResult = MSGBOX("Are you sure you want to quit?", %MB_YESNOCANCEL, "TermsData Tool")
                                IF lResult = %IDYES THEN
                                   CLOSE
                                   DIALOG END CBHNDL
                                END IF
                             END IF
              
                       END SELECT
                 END SELECT
              END FUNCTION
              '------------------------------------------------------------------------------
              
              '------------------------------------------------------------------------------
              '   ** Dialogs **
              '------------------------------------------------------------------------------
              FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
                 LOCAL lRslt  AS LONG
              
              #PBFORMS BEGIN DIALOG %IDD_DataLoadTool->->
                  LOCAL hDlg   AS DWORD
                  LOCAL hFont1 AS DWORD
                  LOCAL hFont2 AS DWORD
              
                  DIALOG NEW hParent, "Data Load Tool For Rod's VB Term Files", 315, 151, _
                      442, 346, %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
                      %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
                      OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CLIENTEDGE _
                      OR %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE OR %WS_EX_CONTROLPARENT OR _
                      %WS_EX_APPWINDOW OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                      %WS_EX_RIGHTSCROLLBAR, TO hDlg
                  CONTROL ADD TEXTBOX, hDlg, %IDC_INPUTFILEPATHNAME, "Input File " + _
                      "Path/Name", 70, 45, 190, 15, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                      OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                      OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_LINESREAD, "Lines Read", 70, 70, 65, 20, _
                      %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                      %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                      OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_LINECOUNT, "Line Count", 195, 70, 65, 20, _
                      %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                      %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                      %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_VBTERM, "vbTerm", 75, 120, 185, 20, _
                      %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                      %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                      OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERMAVAILABLE, "pbTerm Available", 75, _
                      146, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                      %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                      %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERM, "pbTerm", 75, 172, 185, 20, _
                      %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                      %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                      OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_MULTIUSETERM, "Multi Use Term", 75, 198, _
                      185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                      %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                      OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_POINTERTOPBWRAPPER, "Pointer To " + _
                      "pbWrapper", 75, 224, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                      OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                      OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_COMMENT, "Comment", 75, 250, 185, 20, _
                      %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                      %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                      OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD BUTTON,  hDlg, %IDC_BACK, "<== Back", 24, 290, 70, 20, _
                      %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                      OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                      %WS_EX_LEFT OR %WS_EX_LTRREADING
                  CONTROL ADD BUTTON,  hDlg, %IDC_FORWARD, "Forward ==>", 102, 290, 70, 20, _
                      %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                      OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                      %WS_EX_LEFT OR %WS_EX_LTRREADING
                  CONTROL ADD BUTTON,  hDlg, %IDC_REVIEWTERMSDICTIONARY, "Review Terms " + _
                      "Dictionary", 102, 315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR _
                      %WS_TABSTOP OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR _
                      %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                  CONTROL ADD BUTTON,  hDlg, %IDC_CREATEDATAFILE, "Create Data File", 25, _
                      315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                      %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                      %WS_EX_LEFT OR %WS_EX_LTRREADING
                  CONTROL ADD BUTTON,  hDlg, %IDC_QUITPROGRAM, "QUIT PROGRAM", 179, 315, _
                      70, 20
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "Loads Rod's Data Files into UDT " + _
                      "array saves to  vb2pbTermData.dat", 25, 10, 220, 25, %WS_CHILD OR _
                      %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL2, "Input File:", 5, 45, 65, 15
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL3, "Lines Read Record No", 10, 70, _
                      55, 25
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL4, "vbTerm", 10, 125, 60, 20
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL5, "pbTerm available?", 10, 150, 60, _
                      20
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL6, "pbTerm", 10, 175, 60, 20
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL7, "Multi Use Term?", 10, 200, 60, _
                      20
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL8, "Pointer to pbWrapper", 10, 225, _
                      60, 20
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL9, "Comment", 10, 250, 60, 20
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL10, "Line Cnt Record Cnt", 140, 70, _
                      55, 20
                  CONTROL ADD LINE,    hDlg, %IDC_LINE1, "Line1", 5, 100, 435, 10, _
                      %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                  CONTROL ADD LINE,    hDlg, %IDC_LINE2, "Line1", 5, 275, 260, 10, _
                      %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                  CONTROL ADD LINE,    hDlg, %IDC_LINE3, "Line3", 265, 275, 10, 70, _
                      %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                  CONTROL ADD LINE,    hDlg, %IDC_LINE4, "Line4", 265, 110, 10, 165, _
                      %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                  CONTROL ADD LINE,    hDlg, %IDC_LINE5, "Line5", 265, 5, 10, 95, %WS_CHILD _
                      OR %WS_VISIBLE OR %SS_GRAYRECT
                  CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX10, "NOTE Even though the second " + _
                      "element is set to no term available(1), if the multiple uses, " + _
                      "fourth element, is set to 1, the PB WORD exists. IF elements 2 AND " + _
                      "4 are set to one the usage of the term will have to be checked. " + _
                      "This can be converted to an include file with a small utility to " + _
                      "place the items in an array of some UDT, I have left it this way. " + _
                      "Rod.", 280, 115, 155, 145, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                      %ES_MULTILINE OR %ES_AUTOVSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE _
                      OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX11, "Example:", 275, 280, 50, 15, _
                      %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                      %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                      OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL SET COLOR    hDlg, %IDC_TEXTBOX11, -1, %YELLOW
                  CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX12, _
                      "BEEP"",0,""BEEP"",0,0,""Verbatim usage", 275, 300, 170, 15, _
                      %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                      %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                      OR %WS_EX_RIGHTSCROLLBAR
                  CONTROL SET COLOR    hDlg, %IDC_TEXTBOX12, -1, %YELLOW
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL11, "%pbTermAvailable = 0", 280, 20, _
                      115, 15
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL12, "%pbTermNotAvailable = 1", 280, _
                      40, 135, 15
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL13, "%NotMultiUseTerm = 0", 280, 60, _
                      115, 15
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL14, "%MultiUseTerm = 1", 280, 80, _
                      115, 15
                  CONTROL ADD LABEL,   hDlg, %IDC_LABEL15, "Item 2 and 4 Equates", 280, 5, _
                      155, 10
                  CONTROL SET COLOR    hDlg, %IDC_LABEL15, -1, %YELLOW
                  CONTROL ADD BUTTON,  hDlg, %IDC_EXITFILEREVIEW, "EXIT FILE REVIEW", 180, _
                      290, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP _
                      OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR _
                      %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
              
                  hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
                      %ANSI_CHARSET)
                  hFont2 = PBFormsMakeFont("Courier New", 8, 400, %FALSE, %FALSE, %FALSE, _
                      %ANSI_CHARSET)
              
                  DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_INPUTFILEPATHNAME, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LINESREAD, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LINECOUNT, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_VBTERM, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_PBTERMAVAILABLE, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_PBTERM, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_MULTIUSETERM, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_POINTERTOPBWRAPPER, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_COMMENT, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_BACK, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_FORWARD, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_REVIEWTERMSDICTIONARY, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_CREATEDATAFILE, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_QUITPROGRAM, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL1, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL2, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL3, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL4, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL5, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL6, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL7, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL8, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL9, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL10, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LINE1, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LINE2, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LINE3, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LINE4, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LINE5, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_TEXTBOX10, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_TEXTBOX11, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_TEXTBOX12, %WM_SETFONT, hFont2, 0
                  CONTROL SEND hDlg, %IDC_LABEL11, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL12, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL13, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL14, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_LABEL15, %WM_SETFONT, hFont1, 0
                  CONTROL SEND hDlg, %IDC_EXITFILEREVIEW, %WM_SETFONT, hFont1, 0
              #PBFORMS END DIALOG
              
                 DIALOG SHOW MODAL hDlg, CALL ShowDataLoadToolProc TO lRslt
              
              #PBFORMS BEGIN CLEANUP %IDD_DataLoadTool
                  DeleteObject hFont1
                  DeleteObject hFont2
              #PBFORMS END CLEANUP
              
                 FUNCTION = lRslt
              END FUNCTION
              '------------------------------------------------------------------
              Last edited by StanHelton; 25 Jun 2008, 07:37 PM. Reason: clarify instructions at top
              Do not go quiet into that good night,
              ... Rage, rage against the dark.

              Comment


              • #8
                vb2pb Reference Tool

                Rod, here's my first effort on the reference tool you suggested. Let me know what you think of it. It reads the "vb2pbTermsDict.dct" file created by the DataTool (previous post).

                Code:
                #PBFORMS CREATED V1.51
                
                '---------------------------------
                ' vb2pb Reference Tool v0.1 -- sjh
                ' 6/25/2008
                ' reads "vb2pbTermsDict.dct" to
                '     retrieve results
                '---------------------------------
                
                
                #COMPILE EXE
                #DIM ALL
                
                '------------------------------------------------------------------------------
                '   ** Includes **
                '------------------------------------------------------------------------------
                #PBFORMS BEGIN INCLUDES
                #IF NOT %DEF(%WINAPI)
                    #INCLUDE "WIN32API.INC"
                #ENDIF
                #INCLUDE "PBForms.INC"
                #PBFORMS END INCLUDES
                '------------------------------------------------------------------------------
                
                '------------------------------------------------------------------------------
                '   ** Constants **
                '------------------------------------------------------------------------------
                #PBFORMS BEGIN CONSTANTS
                %IDC_BACK                     = 1022
                %IDC_COMMENT                  = 1014
                %IDC_ENTERVB6TERM             = 1003
                %IDC_EXITFILEREVIEW           = 1039
                %IDC_FINDPOWERBASICEQUIVALENT = 1026
                %IDC_FORWARD                  = 1024
                %IDC_LABEL1                   = 1001
                %IDC_LABEL2                   = 1002
                %IDC_LABEL4                   = 1006
                %IDC_LABEL5                   = 1007
                %IDC_LABEL6                   = 1008
                %IDC_LABEL7                   = 1009
                %IDC_LABEL8                   = 1010
                %IDC_LABEL9                   = 1011
                %IDC_LINE1                    = 1020
                %IDC_LINE2                    = 1021
                %IDC_MULTIUSETERM             = 1016
                %IDC_PBTERM                   = 1017
                %IDC_PBTERMAVAILABLE          = 1013
                %IDC_POINTERTOPBWRAPPER       = 1015
                %IDC_QUITPROGRAM              = 1027
                %IDC_REVIEWDICTIONARY         = 1025
                %IDC_VBTERM                   = 1012
                %IDD_PBREFTOOLFORVB6          =  101
                #PBFORMS END CONSTANTS
                '------------------------------------------------------------------------------
                
                %PBTermAvailable = 0
                %PBTermNotAvailable = 1
                %MultiUseTerm = 0
                %NotMultiUseTerm = 1
                
                '------------------------------------------------------------------------------
                '  *** Types ***
                '------------------------------------------------------------------------------
                TYPE DictionaryRecordType
                   vbTerm AS STRING * 64
                   pbTermAvailable AS LONG
                   pbTerm AS STRING * 64
                   MultiUse AS LONG
                   pbWrapper AS DWORD
                   Comment AS STRING * 256
                END TYPE
                
                '------------------------------------------------------------------------------
                '   ** Declarations **
                '------------------------------------------------------------------------------
                DECLARE CALLBACK FUNCTION ShowPBREFTOOLFORVB6Proc()
                DECLARE FUNCTION ShowPBREFTOOLFORVB6(BYVAL hParent AS DWORD) AS LONG
                #PBFORMS DECLARATIONS
                '------------------------------------------------------------------------------
                
                '------------------------------------------------------------------------------
                '   ** Main Application Entry Point **
                '------------------------------------------------------------------------------
                FUNCTION PBMAIN()
                    ShowPBREFTOOLFORVB6 %HWND_DESKTOP
                END FUNCTION
                '------------------------------------------------------------------------------
                
                '------------------------------------------------------------------------------
                '   ** CallBacks **
                '------------------------------------------------------------------------------
                CALLBACK FUNCTION ShowPBREFTOOLFORVB6Proc()
                    LOCAL lResult AS LONG
                    LOCAL tempString AS STRING
                    LOCAL Finished AS LONG
                
                    STATIC record AS DictionaryRecordType
                    STATIC sourceFileName AS STRING
                    STATIC sourceFile AS INTEGER
                    STATIC recNo AS LONG
                    STATIC recCount AS LONG
                
                    SELECT CASE AS LONG CBMSG
                        CASE %WM_INITDIALOG
                            ' Initialization handler
                
                            sourceFileName = "vb2pbTermsDict.dct"
                            sourceFile = FREEFILE
                            OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                            recCount = LOF(sourceFile) / SIZEOF(record)
                            recNo = 1
                
                
                        CASE %WM_NCACTIVATE
                            STATIC hWndSaveFocus AS DWORD
                            IF ISFALSE CBWPARAM THEN
                                ' Save control focus
                                hWndSaveFocus = GetFocus()
                            ELSEIF hWndSaveFocus THEN
                                ' Restore control focus
                                SetFocus(hWndSaveFocus)
                                hWndSaveFocus = 0
                            END IF
                
                        CASE %WM_COMMAND
                            ' Process control notifications
                            SELECT CASE AS LONG CBCTL
                               CASE %IDC_EXITFILEREVIEW
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                     'reenable program command buttons
                                     CONTROL ENABLE CBHNDL, %IDC_FINDPOWERBASICEQUIVALENT
                                     CONTROL ENABLE CBHNDL, %IDC_QUITPROGRAM
                                     CONTROL ENABLE CBHNDL, %IDC_REVIEWDICTIONARY
                
                                     'disable browsing buttons
                                     CONTROL DISABLE CBHNDL, %IDC_BACK
                                     CONTROL DISABLE CBHNDL, %IDC_FORWARD
                                     CONTROL DISABLE CBHNDL, %IDC_EXITFILEREVIEW
                
                                     IF ISTRUE FILEATTR(#sourceFile, 0) THEN
                                        CLOSE #sourceFile
                                     END IF
                                  END IF
                
                               CASE %IDC_BACK
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                     DECR recNo
                                     IF recNo < 1 THEN recNo = recCount
                                     DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWDICTIONARY, %BN_CLICKED
                                  END IF
                
                               CASE %IDC_FORWARD
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                     INCR recNo
                                     IF recNo > recCount THEN recNo = 1
                                     DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWDICTIONARY, %BN_CLICKED
                                  END IF
                
                
                               CASE %IDC_REVIEWDICTIONARY
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                     'disable program command buttons
                                     CONTROL DISABLE CBHNDL, %IDC_FINDPOWERBASICEQUIVALENT
                                     CONTROL DISABLE CBHNDL, %IDC_QUITPROGRAM
                                     CONTROL DISABLE CBHNDL, %IDC_REVIEWDICTIONARY
                
                                     'enable browsing buttons
                                     CONTROL ENABLE CBHNDL, %IDC_BACK
                                     CONTROL ENABLE CBHNDL, %IDC_FORWARD
                                     CONTROL ENABLE CBHNDL, %IDC_EXITFILEREVIEW
                
                                     IF ISFALSE FILEATTR(#sourceFile, 0) THEN
                                        sourceFile = FREEFILE
                                        OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                        recCount = LOF(sourceFile) / SIZEOF(record)
                                     END IF
                
                                     GET #sourceFile, recNo, record
                
                                     'update screen display
                                     CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                     CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                     CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                     CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                     CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                     CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                
                                     IF ISTRUE FILEATTR(#sourceFile, 0) THEN
                                        CLOSE #sourceFile
                                     END IF
                
                                  END IF
                
                                CASE %IDC_FINDPOWERBASICEQUIVALENT
                                    'search dictionary for user entered term
                                    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                        IF ISFALSE FILEATTR(#sourceFile, 0) THEN     'if file not open then open it
                                          sourceFile = FREEFILE
                                          OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                          recCount = LOF(sourceFile) / SIZEOF(record)
                                        END IF
                
                                        CONTROL GET TEXT CBHNDL, %IDC_ENTERVB6TERM TO tempString    'get the lookup term
                                        tempString = UCASE$(TRIM$(tempString))
                                        IF LEN(tempString) < 1 THEN
                                           BEEP
                                           EXIT SELECT
                                        END IF
                
                                        FOR recNo = 1 TO recCount        'run through the file -- speed not important here
                                                                         'because there aren't enought records in the file
                                                                         'to slow it down noticably
                                           GET #sourceFile, recNo, record
                                           IF ISTRUE UCASE$(TRIM$(record.vbTerm)) = tempString THEN
                                              EXIT FOR    'break on match
                                           END IF
                                        NEXT recNo
                
                                        IF ISTRUE FILEATTR(#sourceFile, 0) THEN   'close the file, don't need it here anymore
                                           CLOSE #sourceFile
                                        END IF
                
                                        IF ISFALSE UCASE$(TRIM$(record.vbTerm)) = tempString THEN   'if no match notify user
                                           RESET record
                                           record.vbTerm = "Term not yet in data list."
                                           record.Comment = "Please notify vb2pb project team"
                                        END IF
                
                                        'update screen display
                                        CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                        CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                
                                        IF record.pbTermAvailable = %PBTermAvailable THEN
                                           CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "PB term exists"
                                        ELSEIF record.pbTermAvailable = %PBTermNotAvailable THEN
                                           CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "No exact equivalent in PB"
                                        ELSE
                                           CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "Undefined value in Data List"
                                           CONTROL SET TEXT CBHNDL, %IDC_COMMENT, "Please notify vb2pb project team"
                                        END IF
                
                                        CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                
                                        IF record.MultiUse = %MultiUseTerm THEN
                                           CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "VB term has multiple uses"
                                        ELSEIF record.MultiUse = %NotMultiUseTerm THEN
                                           CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "VB term has 1 unique use"
                                        ELSE
                                           CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "Undefined value in Data List"
                                           CONTROL SET TEXT CBHNDL, %IDC_COMMENT, "Please notify vb2pb project team"
                                        END IF
                
                                        CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                    END IF
                
                                CASE %IDC_QUITPROGRAM
                                    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                       lResult = MSGBOX("Are you sure you want to quit?", %MB_YESNOCANCEL, "TermsData Tool")
                                       IF lResult = %IDYES THEN
                                           CLOSE
                                           DIALOG END CBHNDL
                                        END IF
                                    END IF
                
                            END SELECT
                    END SELECT
                END FUNCTION
                '------------------------------------------------------------------------------
                
                '------------------------------------------------------------------------------
                '   ** Dialogs **
                '------------------------------------------------------------------------------
                FUNCTION ShowPBREFTOOLFORVB6(BYVAL hParent AS DWORD) AS LONG
                    LOCAL lRslt  AS LONG
                
                #PBFORMS BEGIN DIALOG %IDD_PBREFTOOLFORVB6->->
                    LOCAL hDlg   AS DWORD
                    LOCAL hFont1 AS DWORD
                
                    DIALOG NEW hParent, "PB Reference Tool for VB Terms", 115, 157, 272, 313, _
                        %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
                        %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
                        OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CLIENTEDGE _
                        OR %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE OR %WS_EX_CONTROLPARENT OR _
                        %WS_EX_APPWINDOW OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                        %WS_EX_RIGHTSCROLLBAR, TO hDlg
                    CONTROL ADD TEXTBOX, hDlg, %IDC_ENTERVB6TERM, "", 70, 45, _
                        190, 15, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL, _
                        %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                        %WS_EX_RIGHTSCROLLBAR
                    CONTROL ADD TEXTBOX, hDlg, %IDC_VBTERM, "vbTerm", 75, 120, 185, 20, _
                        %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                        %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                        OR %WS_EX_RIGHTSCROLLBAR
                    CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERMAVAILABLE, "pbTerm Available", 75, _
                        146, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                        %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                        %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                    CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERM, "pbTerm", 75, 172, 185, 20, _
                        %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                        %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                        OR %WS_EX_RIGHTSCROLLBAR
                    CONTROL ADD TEXTBOX, hDlg, %IDC_MULTIUSETERM, "Multi Use Term", 75, 198, _
                        185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                        %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                        OR %WS_EX_RIGHTSCROLLBAR
                    CONTROL ADD TEXTBOX, hDlg, %IDC_POINTERTOPBWRAPPER, "Pointer To " + _
                        "pbWrapper", 75, 224, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                        OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                        OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                    CONTROL ADD TEXTBOX, hDlg, %IDC_COMMENT, "Comment", 75, 250, 185, 20, _
                        %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                        %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                        OR %WS_EX_RIGHTSCROLLBAR
                    CONTROL ADD BUTTON,  hDlg, %IDC_BACK, "<== Back", 128, 290, 70, 20, _
                        %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                        OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                        %WS_EX_LEFT OR %WS_EX_LTRREADING
                    CONTROL ADD BUTTON,  hDlg, %IDC_FORWARD, "Forward ==>", 200, 290, 70, 20, _
                        %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                        OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                        %WS_EX_LEFT OR %WS_EX_LTRREADING
                    CONTROL ADD BUTTON,  hDlg, %IDC_REVIEWDICTIONARY, "Review Dictionary", _
                        100, 85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT _
                        OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                        %WS_EX_LEFT OR %WS_EX_LTRREADING
                    CONTROL ADD BUTTON,  hDlg, %IDC_FINDPOWERBASICEQUIVALENT, "Find PB Term", _
                        5, 85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT _
                        OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                        %WS_EX_LEFT OR %WS_EX_LTRREADING
                    CONTROL ADD BUTTON,  hDlg, %IDC_QUITPROGRAM, "QUIT PROGRAM", 5, 290, 70, _
                        20
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "VB6 to PowerBASIC Reference Tool " + _
                        "        from                                    the vb2pb Open " + _
                        "Source Converter Project", 25, 5, 220, 35
                    CONTROL SET COLOR    hDlg, %IDC_LABEL1, %BLUE, -1
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL2, "VB6 Term:", 5, 45, 65, 15
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL4, "vbTerm", 10, 125, 60, 20
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL5, "pbTerm available?", 10, 150, 60, _
                        20
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL6, "pbTerm", 10, 175, 60, 20
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL7, "Multi Use Term?", 10, 200, 60, _
                        20
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL8, "Pointer to pbWrapper", 10, 225, _
                        60, 20
                    CONTROL ADD LABEL,   hDlg, %IDC_LABEL9, "Comment", 10, 250, 60, 20
                    CONTROL ADD LINE,    hDlg, %IDC_LINE1, "Line1", 0, 65, 275, 10, %WS_CHILD _
                        OR %WS_VISIBLE OR %SS_GRAYRECT
                    CONTROL ADD LINE,    hDlg, %IDC_LINE2, "Line1", 0, 275, 275, 10, _
                        %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                    CONTROL ADD BUTTON,  hDlg, %IDC_EXITFILEREVIEW, "EXIT FILE REVIEW", 195, _
                        85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP _
                        OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR _
                        %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                
                    hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
                        %ANSI_CHARSET)
                
                    DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_ENTERVB6TERM, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_VBTERM, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_PBTERMAVAILABLE, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_PBTERM, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_MULTIUSETERM, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_POINTERTOPBWRAPPER, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_COMMENT, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_BACK, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_FORWARD, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_REVIEWDICTIONARY, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_FINDPOWERBASICEQUIVALENT, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_QUITPROGRAM, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL1, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL2, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL4, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL5, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL6, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL7, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL8, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LABEL9, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LINE1, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_LINE2, %WM_SETFONT, hFont1, 0
                    CONTROL SEND hDlg, %IDC_EXITFILEREVIEW, %WM_SETFONT, hFont1, 0
                #PBFORMS END DIALOG
                
                    DIALOG SHOW MODAL hDlg, CALL ShowPBREFTOOLFORVB6Proc TO lRslt
                
                #PBFORMS BEGIN CLEANUP %IDD_PBREFTOOLFORVB6
                    DeleteObject hFont1
                #PBFORMS END CLEANUP
                
                    FUNCTION = lRslt
                END FUNCTION
                '-----------------------------------------------------------------
                Do not go quiet into that good night,
                ... Rage, rage against the dark.

                Comment


                • #9
                  Thanks Stan.

                  That the lookup tool works pretty good. I think we should later that, but that could be a rather good tool down the road. You know, fancy it up with music and pict...ah you know.

                  I'm going to carry on in the text format for now, I do a lot of cutting pasting, but I'll run it through and post the "vb2pbTermsDict.dct" file for updates. However, can it be used to edit out any errors I may make or changes as we make things available?

                  I'm sure you recall that I posted a list of features that we should be sure to get into the first version of the converter. Could you whip up a small VB file with at least one of each of the things I listed, even more if you think, and very little code to access each of the features, like for example if the user types something in a textbox the text is retrieved and placed on a label or some such activity with each feature. I don't need an executable, just the source code for those features. You can email the to me directly if you wish, rather than post them here.

                  Don't spend an awful lot of time on it.

                  Thanks

                  Rod
                  Last edited by Rodney Hicks; 25 Jun 2008, 08:20 PM. Reason: Happy fingers.
                  Rod
                  I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

                  Comment


                  • #10
                    Ref Tool v0.02

                    Added the edit feature you requested.

                    Code:
                    #PBFORMS CREATED V1.51
                    
                    '---------------------------------
                    ' vb2pb Reference Tool v0.1 -- sjh
                    ' 6/25/2008
                    ' reads "vb2pbTermsDict.dct" to
                    '     retrieve results
                    '---------------------------------
                    
                    
                    '------------------------------------
                    ' vb2pb Reference Tool v0.2
                    ' 6/26/2008 sjh
                    '  uses "vb2pbTermsDict.dct" for data
                    '
                    '  added ability to edit terms
                    '------------------------------------
                    
                    
                    
                    
                    #COMPILE EXE
                    #DIM ALL
                    
                    '------------------------------------------------------------------------------
                    '   ** Includes **
                    '------------------------------------------------------------------------------
                    #PBFORMS BEGIN INCLUDES
                    #IF NOT %DEF(%WINAPI)
                        #INCLUDE "WIN32API.INC"
                    #ENDIF
                    #INCLUDE "PBForms.INC"
                    #PBFORMS END INCLUDES
                    '------------------------------------------------------------------------------
                    
                    '------------------------------------------------------------------------------
                    '   ** Constants **
                    '------------------------------------------------------------------------------
                    #PBFORMS BEGIN CONSTANTS
                    %IDC_ACTIVEVB6TERM            = 1052
                    %IDC_ActiveVBTerm             = 1054
                    %IDC_BACK                     = 1022
                    %IDC_CANCELEDITS              = 1044
                    %IDC_COMMENT                  = 1014
                    %IDC_EditComment              = 1046
                    %IDC_EditMultiUseTerm         = 1048
                    %IDC_EDITORSTATUS             = 1051
                    %IDC_EditPBTerm               = 1049
                    %IDC_EditPBTermAvailable      = 1050
                    %IDC_EditPointerToPBWrapper   = 1047
                    %IDC_EditVBTerm               = 1045
                    %IDC_ENTEREDITMODE            = 1041
                    %IDC_ENTERVB6TERM             = 1003
                    %IDC_EXITFILEREVIEW           = 1039
                    %IDC_FINDPOWERBASICEQUIVALENT = 1026
                    %IDC_FORWARD                  = 1024
                    %IDC_LABEL1                   = 1001
                    %IDC_LABEL2                   = 1002
                    %IDC_LABEL3                   = 1055
                    %IDC_LABEL4                   = 1006
                    %IDC_LABEL5                   = 1007
                    %IDC_LABEL6                   = 1008
                    %IDC_LABEL7                   = 1009
                    %IDC_LABEL8                   = 1010
                    %IDC_LABEL9                   = 1011
                    %IDC_LINE1                    = 1020
                    %IDC_LINE2                    = 1021
                    %IDC_LINE3                    = 1040
                    %IDC_MULTIUSETERM             = 1016
                    %IDC_PBTERM                   = 1017
                    %IDC_PBTERMAVAILABLE          = 1013
                    %IDC_POINTERTOPBWRAPPER       = 1015
                    %IDC_POSTEDITSTODICTIONARY    = 1043
                    %IDC_QUITPROGRAM              = 1027
                    %IDC_REVIEWDICTIONARY         = 1025
                    %IDC_SEARCHMODE               = 1042
                    %IDC_VBTERM                   = 1012
                    %IDD_PBREFTOOLFORVB6          =  101
                    #PBFORMS END CONSTANTS
                    '------------------------------------------------------------------------------
                    
                    %PBTermAvailable = 0
                    %PBTermNotAvailable = 1
                    %MultiUseTerm = 0
                    %NotMultiUseTerm = 1
                    %EditorInactive = 0
                    %EditMode = 1
                    %SearchMode = 2
                    %AllowEdits = %WM_USER + 501
                    
                    '------------------------------------------------------------------------------
                    '  *** Types ***
                    '------------------------------------------------------------------------------
                    TYPE DictionaryRecordType
                       vbTerm AS STRING * 64
                       pbTermAvailable AS LONG
                       pbTerm AS STRING * 64
                       MultiUse AS LONG
                       pbWrapper AS DWORD
                       Comment AS STRING * 256
                    END TYPE
                    
                    '------------------------------------------------------------------------------
                    '   ** Declarations **
                    '------------------------------------------------------------------------------
                    DECLARE CALLBACK FUNCTION ShowPBREFTOOLFORVB6Proc()
                    DECLARE FUNCTION ShowPBREFTOOLFORVB6(BYVAL hParent AS DWORD) AS LONG
                    #PBFORMS DECLARATIONS
                    '------------------------------------------------------------------------------
                    
                    '------------------------------------------------------------------------------
                    '   ** Main Application Entry Point **
                    '------------------------------------------------------------------------------
                    FUNCTION PBMAIN()
                        ShowPBREFTOOLFORVB6 %HWND_DESKTOP
                    END FUNCTION
                    '------------------------------------------------------------------------------
                    
                    '------------------------------------------------------------------------------
                    '   ** CallBacks **
                    '------------------------------------------------------------------------------
                    CALLBACK FUNCTION ShowPBREFTOOLFORVB6Proc()
                        LOCAL lResult AS LONG
                        LOCAL tempString AS STRING
                        LOCAL Finished AS LONG
                        LOCAL length AS LONG
                    
                        STATIC record AS DictionaryRecordType
                        STATIC editRecord AS DictionaryRecordType
                        STATIC sourceFileName AS STRING
                        STATIC sourceFile AS INTEGER
                        STATIC recNo AS LONG
                        STATIC recCount AS LONG
                        STATIC EditorStatus AS LONG
                        STATIC searchTerm AS STRING
                    
                    
                        SELECT CASE AS LONG CBMSG
                            CASE %WM_INITDIALOG
                                ' Initialization handler
                    
                                sourceFileName = "vb2pbTermsDict.dct"
                                sourceFile = FREEFILE
                                OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                recCount = LOF(sourceFile) / SIZEOF(record)
                                recNo = 1
                    
                                GET #sourceFile, recNo, record
                                CLOSE #sourceFile
                    
                                TYPE SET editRecord = record
                    
                                'initialize screen display
                                CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                                CONTROL SET TEXT CBHNDL, %IDC_EditVBTerm, TRIM$(editRecord.vbTerm)
                                CONTROL SET TEXT CBHNDL, %IDC_PBTermAvailable, TRIM$(STR$(editRecord.pbTermAvailable))
                                CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, TRIM$(editRecord.pbTerm)
                                CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, TRIM$(STR$(editRecord.MultiUse))
                                CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, TRIM$(STR$(editRecord.pbWrapper))
                                CONTROL SET TEXT CBHNDL, %IDC_EditComment, TRIM$(editRecord.Comment)
                    
                            CASE %WM_NCACTIVATE
                                STATIC hWndSaveFocus AS DWORD
                                IF ISFALSE CBWPARAM THEN
                                    ' Save control focus
                                    hWndSaveFocus = GetFocus()
                                ELSEIF hWndSaveFocus THEN
                                    ' Restore control focus
                                    SetFocus(hWndSaveFocus)
                                    hWndSaveFocus = 0
                                END IF
                    
                            CASE %WM_COMMAND
                                ' Process control notifications
                                SELECT CASE AS LONG CBCTL
                                   CASE %IDC_EXITFILEREVIEW
                                      IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                         'reenable program command buttons
                                         CONTROL ENABLE CBHNDL, %IDC_FINDPOWERBASICEQUIVALENT
                                         CONTROL ENABLE CBHNDL, %IDC_QUITPROGRAM
                    
                                         'disable browsing buttons
                                         CONTROL DISABLE CBHNDL, %IDC_BACK
                                         CONTROL DISABLE CBHNDL, %IDC_FORWARD
                                         CONTROL DISABLE CBHNDL, %IDC_EXITFILEREVIEW
                    
                                         IF ISTRUE FILEATTR(#sourceFile, 0) THEN
                                            CLOSE #sourceFile
                                         END IF
                                      END IF
                    
                                   CASE %IDC_BACK
                                      IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                         DECR recNo
                                         IF recNo < 1 THEN recNo = recCount
                                         DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWDICTIONARY, %BN_CLICKED
                                         tempString = TRIM$(record.vbTerm)
                                         CONTROL SET TEXT CBHNDL, %IDC_ActiveVBTerm, tempString
                                      END IF
                    
                                   CASE %IDC_FORWARD
                                      IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                         INCR recNo
                                         IF recNo > recCount THEN recNo = 1
                                         DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWDICTIONARY, %BN_CLICKED
                                         tempString = TRIM$(record.vbTerm)
                                         CONTROL SET TEXT CBHNDL, %IDC_ActiveVBTerm, tempString
                                      END IF
                    
                    
                                   CASE %IDC_REVIEWDICTIONARY
                                      IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                         'disable program command buttons
                                         CONTROL DISABLE CBHNDL, %IDC_FINDPOWERBASICEQUIVALENT
                    
                                         'enable browsing buttons
                                         CONTROL ENABLE CBHNDL, %IDC_BACK
                                         CONTROL ENABLE CBHNDL, %IDC_FORWARD
                                         CONTROL ENABLE CBHNDL, %IDC_EXITFILEREVIEW
                    
                                         IF ISFALSE FILEATTR(#sourceFile, 0) THEN
                                            sourceFile = FREEFILE
                                            OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                            recCount = LOF(sourceFile) / SIZEOF(record)
                                         END IF
                    
                                         GET #sourceFile, recNo, record
                                         TYPE SET editRecord = record
                    
                                         'update screen display
                                         CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                         CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                         CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                         CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                         CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                         CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                                         CONTROL SET TEXT CBHNDL, %IDC_EditVBTerm, TRIM$(record.vbTerm)
                                         CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, TRIM$(STR$(record.pbTermAvailable))
                                         CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, TRIM$(record.pbTerm)
                                         CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, TRIM$(STR$(record.MultiUse))
                                         CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, TRIM$(STR$(record.pbWrapper))
                                         CONTROL SET TEXT CBHNDL, %IDC_EditComment, TRIM$(record.Comment)
                    
                                         IF ISTRUE FILEATTR(#sourceFile, 0) THEN
                                            CLOSE #sourceFile
                                         END IF
                    
                                      END IF
                    
                                    CASE %IDC_FINDPOWERBASICEQUIVALENT
                                        'search dictionary for user entered term
                                        IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                            CONTROL GET TEXT CBHNDL, %IDC_ENTERVB6TERM TO searchTerm
                                            searchTerm = UCASE$(TRIM$(searchTerm))
                                            length = LEN(searchTerm)
                                            IF length < 1 THEN
                                               CONTROL SET TEXT CBHNDL, %IDC_ENTERVB6TERM, "Nothing to find"
                                            ELSE
                    
                                               IF ISFALSE FILEATTR(#sourceFile, 0) THEN     'if file not open then open it
                                                 sourceFile = FREEFILE
                                                 OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                               END IF
                                               recCount = LOF(sourceFile) / SIZEOF(record)
                    
                                               FOR recNo = 1 TO recCount        'run through the file -- speed not important here
                                                                              'because there aren't enought records in the file
                                                                              'to slow it down noticably
                                                  GET #sourceFile, recNo, record
                                                  TYPE SET editRecord = record
                                                  IF ISTRUE UCASE$(TRIM$(record.vbTerm)) = UCASE$(TRIM$(searchTerm)) THEN
                                                     EXIT FOR    'break on match
                                                  END IF
                                               NEXT recNo
                    
                                               IF recNo > recCount THEN
                                                  RESET record
                                                  record.vbTerm = "Term not yet in data list."
                                                  record.Comment = "Please notify vb2pb project team"
                                               ELSE
                                                  'update screen display
                                                  CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                                  CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                    
                                                  IF record.pbTermAvailable = %PBTermAvailable THEN
                                                     CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "PB term exists"
                                                  ELSEIF record.pbTermAvailable = %PBTermNotAvailable THEN
                                                     CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "No exact equivalent in PB"
                                                  ELSE
                                                     CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "Undefined value in Data List"
                                                     CONTROL SET TEXT CBHNDL, %IDC_COMMENT, "Please notify vb2pb project team"
                                                  END IF
                    
                                                  CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                    
                                                  IF record.MultiUse = %MultiUseTerm THEN
                                                     CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "VB term has multiple uses"
                                                  ELSEIF record.MultiUse = %NotMultiUseTerm THEN
                                                     CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "VB term has 1 unique use"
                                                  ELSE
                                                     CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "Undefined value in Data List"
                                                     CONTROL SET TEXT CBHNDL, %IDC_COMMENT, "Please notify vb2pb project team"
                                                  END IF
                    
                                                  CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                               END IF
                                            END IF
                                        END IF
                    
                                    CASE %IDC_QUITPROGRAM
                                        IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                           lResult = MSGBOX("Are you sure you want to quit?", %MB_YESNOCANCEL, "TermsData Tool")
                                           IF lResult = %IDYES THEN
                                               CLOSE
                                               DIALOG END CBHNDL
                                            END IF
                                        END IF
                    
                                    CASE %IDC_ENTEREDITMODE
                                       IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                          IF EditorStatus = %EditorInactive OR EditorStatus = %SearchMode THEN
                                             IF EditorStatus = %EditorInactive THEN
                                                CONTROL ENABLE CBHNDL, %IDC_POSTEDITSTODICTIONARY
                                                CONTROL ENABLE CBHNDL, %IDC_CANCELEDITS
                                             ELSE
                                                CONTROL DISABLE CBHNDL, %IDC_POSTEDITSTODICTIONARY
                                                CONTROL DISABLE CBHNDL, %IDC_CANCELEDITS
                                             END IF
                                             
                                             CONTROL ENABLE CBHNDL, %IDC_ActiveVBTerm
                                             CONTROL ENABLE CBHNDL, %IDC_EditComment
                                             CONTROL ENABLE CBHNDL, %IDC_EditMultiUseTerm
                                             CONTROL ENABLE CBHNDL, %IDC_EditPBTerm
                                             CONTROL ENABLE CBHNDL, %IDC_EditPointerToPBWrapper
                                             CONTROL ENABLE CBHNDL, %IDC_EditPBTermAvailable
                                             CONTROL ENABLE CBHNDL, %IDC_EditVBTerm
                                             CONTROL ENABLE CBHNDL, %IDC_EditComment
                    
                                             TYPE SET editRecord = record
                    
                                             tempString = TRIM$(record.vbTerm)
                                             CONTROL SET TEXT CBHNDL, %IDC_ActiveVBTerm, tempString
                                             
                                             CONTROL SET TEXT CBHNDL, %IDC_EditComment, editRecord.Comment
                                             CONTROL SET TEXT CBHNDL, %IDC_EditVBTerm, editRecord.vbTerm
                                             CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, editRecord.pbTerm
                                             CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, TRIM$(STR$(editRecord.pbWrapper))
                                             IF editRecord.pbTermAvailable = %PBTermAvailable THEN
                                                tempString = "PB Term Available"
                                             ELSEIF editRecord.pbTermAvailable = %PBTermNotAvailable THEN
                                                tempString = "No PB Term Available"
                                             END IF
                                             CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, tempString
                                             IF editRecord.MultiUse = %MULTIUSETERM THEN
                                                tempString = "Multi Use Term"
                                             ELSEIF editRecord.MultiUse = %NOTMULTIUSETERM THEN
                                                tempString = "Single Use Term"
                                             END IF
                                             CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, tempString
                    
                                             CONTROL SET TEXT CBHNDL, %IDC_ENTEREDITMODE, "EXIT Edit Mode"
                                             CONTROL SET TEXT CBHNDL, %IDC_EDITORSTATUS, "Edit Mode"
                                             CONTROL SET TEXT CBHNDL, %IDC_SearchMode, "Search Mode"
                                             
                                             EditorStatus = %EditMode
                    
                                          ELSEIF EditorStatus = %EditMode THEN
                                             EditorStatus = %EditorInactive
                                             CONTROL SET TEXT CBHNDL, %IDC_ENTEREDITMODE, "Enter Edit Mode"
                                             CONTROL SET TEXT CBHNDL, %IDC_EDITORSTATUS, "Editor Inactive"
                    
                                             CONTROL DISABLE CBHNDL, %IDC_POSTEDITSTODICTIONARY
                                             CONTROL DISABLE CBHNDL, %IDC_CANCELEDITS
                                             CONTROL DISABLE CBHNDL, %IDC_ActiveVBTerm
                                             CONTROL DISABLE CBHNDL, %IDC_EditComment
                                             CONTROL DISABLE CBHNDL, %IDC_EditMultiUseTerm
                                             CONTROL DISABLE CBHNDL, %IDC_EditPBTerm
                                             CONTROL DISABLE CBHNDL, %IDC_EditPointerToPBWrapper
                                             CONTROL DISABLE CBHNDL, %IDC_EditPBTermAvailable
                                             CONTROL DISABLE CBHNDL, %IDC_EditVBTerm
                                          END IF
                                       END IF
                    
                                    CASE %IDC_SEARCHMODE
                                       IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                          IF EditorStatus = %SearchMode THEN
                                             EditorStatus = %EditMode
                                             CONTROL SET TEXT CBHNDL, %IDC_SEARCHMODE, "Enter Search Mode"
                                             CONTROL SET TEXT CBHNDL, %IDC_EditorStatus, "Edit Mode"
                                             CONTROL SET TEXT CBHNDL, %IDC_ENTEREDITMODE, "EXIT Edit Mode"
                                          ELSE
                                             EditorStatus = %SearchMode
                                             CONTROL SET TEXT CBHNDL, %IDC_SEARCHMODE, "EXIT Search Mode"
                                             CONTROL SET TEXT CBHNDL, %IDC_EditorStatus, "Search Mode"
                                             CONTROL POST CBHNDL, %IDC_ENTEREDITMODE, %WM_COMMAND, %BN_CLICKED, 0
                                          END IF
                                       END IF
                    
                                    CASE %IDC_CANCELEDITS
                                       IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                          TYPE SET editRecord = record
                    
                                          CONTROL SET TEXT CBHNDL, %IDC_EditComment, editRecord.Comment
                                          CONTROL SET TEXT CBHNDL, %IDC_EditVBTerm, editRecord.vbTerm
                                          CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, editRecord.pbTerm
                                          CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, TRIM$(STR$(editRecord.pbWrapper))
                                          IF editRecord.pbTermAvailable = %PBTermAvailable THEN
                                             tempString = "PB Term Available"
                                          ELSEIF editRecord.pbTermAvailable = %PBTermNotAvailable THEN
                                             tempString = "No PB Term Available"
                                          END IF
                                          CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, tempString
                                          IF editRecord.MultiUse = %MULTIUSETERM THEN
                                             tempString = "Multi Use Term"
                                          ELSEIF editRecord.MultiUse = %NOTMULTIUSETERM THEN
                                             tempString = "Single Use Term"
                                          END IF
                                          CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, tempString
                                       END IF
                    
                                    CASE %IDC_POSTEDITSTODICTIONARY
                                       IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                          lResult = MSGBOX("Post changes to Dictionary?", %MB_YESNO)
                                          IF lResult = %IDYES THEN
                                             TYPE SET record = editRecord
                    
                                             IF ISFALSE(FILEATTR(#sourceFile, 0)) THEN
                                                sourceFile = FREEFILE
                                                OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                             END IF
                                             recCount = LOF(sourceFile) / SIZEOF(record)
                                             PUT #sourceFile, recNo, record
                                             CLOSE #sourceFile
                    
                                             CONTROL SET TEXT CBHNDL, %IDC_COMMENT, record.Comment
                                             CONTROL SET TEXT CBHNDL, %IDC_VBTERM, record.vbTerm
                                             CONTROL SET TEXT CBHNDL, %IDC_PBTERM, record.pbTerm
                                             CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                             IF record.pbTermAvailable = %PBTermAvailable THEN
                                                tempString = "PB Term Available"
                                             ELSEIF record.pbTermAvailable = %PBTermNotAvailable THEN
                                                tempString = "No PB Term Available"
                                             END IF
                                             CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, tempString
                                             IF record.MultiUse = %MULTIUSETERM THEN
                                                tempString = "Multi Use Term"
                                             ELSEIF record.MultiUse = %NOTMULTIUSETERM THEN
                                                tempString = "Single Use Term"
                                             END IF
                                             CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, tempString
                                          END IF
                                       END IF
                    
                                    CASE %IDC_ActiveVBTerm
                                       CONTROL GET TEXT CBHNDL, %IDC_ActiveVBTerm TO tempString
                                       CONTROL SET TEXT CBHNDL, %IDC_ENTERVB6TERM, tempString
                                       searchTerm = TRIM$(tempString)
                    
                                    CASE %IDC_EditComment
                                       IF EditorStatus = %EditMode OR EditorStatus = %SearchMode THEN
                                          CONTROL GET TEXT CBHNDL, %IDC_EditComment TO editRecord.Comment
                                       ELSE
                                          CONTROL SET TEXT CBHNDL, %IDC_EditComment, ""
                                       END IF
                    
                                    CASE %IDC_EditMultiUseTerm
                                       IF EditorStatus = %EditMode OR EditorStatus = %SearchMode THEN
                                          CONTROL GET TEXT CBHNDL, %IDC_EditMultiUseTerm TO tempString
                                          IF UCASE$(TRIM$(tempString)) = "Y" THEN
                                             editRecord.MultiUse = %MultiUseTerm
                                          ELSEIF UCASE$(TRIM$(tempString)) = "N" THEN
                                             editRecord.MultiUse = %NotMultiUseTerm
                                          ELSE
                                             CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, "Enter Y or N, please"
                                          END IF
                                       ELSE
                                          CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, ""
                                       END IF
                    
                                    CASE %IDC_EditPBTerm
                                       IF EditorStatus = %EditMode OR EditorStatus = %SearchMode THEN
                                          CONTROL GET TEXT CBHNDL, %IDC_EditPBTerm TO editRecord.pbTerm
                                       ELSE
                                          CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, ""
                                       END IF
                    
                                    CASE %IDC_EditPointerToPBWrapper
                                       IF EditorStatus = %EditMode OR EditorStatus = %SearchMode THEN
                                          CONTROL GET TEXT CBHNDL, %IDC_EditPointerToPBWrapper TO tempString
                                          editRecord.pbWrapper = VAL(tempString)
                                       ELSE
                                          CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, ""
                                       END IF
                    
                                    CASE %IDC_EditPBTermAvailable
                                       IF EditorStatus = %EditMode OR EditorStatus = %SearchMode THEN
                                          CONTROL GET TEXT CBHNDL, %IDC_EditPBTermAvailable TO tempString
                                          IF UCASE$(TRIM$(tempString)) = "Y" THEN
                                             editRecord.pbTermAvailable = %PBTermAvailable
                                          ELSEIF UCASE$(TRIM$(tempString)) = "N" THEN
                                             editRecord.pbTermAvailable = %PBTermNotAvailable
                                          ELSE
                                             CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, "Enter Y or N, please"
                                          END IF
                                       ELSE
                                          CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, ""
                                       END IF
                    
                                END SELECT
                        END SELECT
                    
                    END FUNCTION
                    '------------------------------------------------------------------------------
                    
                    '------------------------------------------------------------------------------
                    '   ** Dialogs **
                    '------------------------------------------------------------------------------
                    FUNCTION ShowPBREFTOOLFORVB6(BYVAL hParent AS DWORD) AS LONG
                        LOCAL lRslt  AS LONG
                    
                    #PBFORMS BEGIN DIALOG %IDD_PBREFTOOLFORVB6->->
                        LOCAL hDlg   AS DWORD
                        LOCAL hFont1 AS DWORD
                    
                        DIALOG NEW hParent, "PB Reference Tool for VB Terms", 115, 159, 494, 311, _
                            %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
                            %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
                            OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CLIENTEDGE _
                            OR %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE OR %WS_EX_CONTROLPARENT OR _
                            %WS_EX_APPWINDOW OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                            %WS_EX_RIGHTSCROLLBAR, TO hDlg
                        CONTROL ADD TEXTBOX, hDlg, %IDC_ENTERVB6TERM, "", 70, 45, 190, 15, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL, _
                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                            %WS_EX_RIGHTSCROLLBAR
                        CONTROL SET COLOR    hDlg, %IDC_ENTERVB6TERM, %BLUE, %YELLOW
                        CONTROL ADD TEXTBOX, hDlg, %IDC_VBTERM, "vbTerm", 75, 120, 185, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                            %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                            OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERMAVAILABLE, "pbTerm Available", 75, _
                            146, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                            %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                            %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERM, "pbTerm", 75, 172, 185, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                            %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                            OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_MULTIUSETERM, "Multi Use Term", 75, 198, _
                            185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                            %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                            OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_POINTERTOPBWRAPPER, "Pointer To " + _
                            "pbWrapper", 75, 224, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                            OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                            OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_COMMENT, "Comment", 75, 250, 185, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                            %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                            OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD BUTTON,  hDlg, %IDC_BACK, "<== Back", 128, 290, 70, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                            OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                            %WS_EX_LEFT OR %WS_EX_LTRREADING
                        CONTROL ADD BUTTON,  hDlg, %IDC_FORWARD, "Forward ==>", 200, 290, 70, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                            OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                            %WS_EX_LEFT OR %WS_EX_LTRREADING
                        CONTROL ADD BUTTON,  hDlg, %IDC_REVIEWDICTIONARY, "Review Dictionary", _
                            100, 85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT _
                            OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                            %WS_EX_LEFT OR %WS_EX_LTRREADING
                        CONTROL ADD BUTTON,  hDlg, %IDC_FINDPOWERBASICEQUIVALENT, "Find PB Term", _
                            5, 85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT _
                            OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                            %WS_EX_LEFT OR %WS_EX_LTRREADING
                        CONTROL ADD BUTTON,  hDlg, %IDC_QUITPROGRAM, "QUIT PROGRAM", 5, 290, 70, _
                            20
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "VB6 to PowerBASIC Reference Tool " + _
                            "        from                                    the vb2pb Open " + _
                            "Source Converter Project", 25, 5, 220, 35
                        CONTROL SET COLOR    hDlg, %IDC_LABEL1, %BLUE, -1
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL2, "VB6 Term:", 5, 45, 65, 15
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL4, "vbTerm", 10, 125, 60, 20
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL5, "pbTerm available?", 10, 150, 60, _
                            20
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL6, "pbTerm", 10, 175, 60, 20
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL7, "Multi Use Term?", 10, 200, 60, _
                            20
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL8, "Pointer to pbWrapper", 10, 225, _
                            60, 20
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL9, "Comment", 10, 250, 60, 20
                        CONTROL ADD LINE,    hDlg, %IDC_LINE1, "Line1", 0, 65, 275, 10, %WS_CHILD _
                            OR %WS_VISIBLE OR %SS_GRAYRECT
                        CONTROL ADD LINE,    hDlg, %IDC_LINE2, "Line1", 0, 275, 275, 10, _
                            %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                        CONTROL ADD BUTTON,  hDlg, %IDC_EXITFILEREVIEW, "EXIT FILE REVIEW", 195, _
                            85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP _
                            OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR _
                            %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                        CONTROL ADD LINE,    hDlg, %IDC_LINE3, "Line3", 275, 0, 10, 310, _
                            %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                        CONTROL ADD BUTTON,  hDlg, %IDC_ENTEREDITMODE, "Enter Edit Mode", 295, _
                            40, 85, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                            %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                            %WS_EX_LEFT OR %WS_EX_LTRREADING
                        CONTROL ADD BUTTON,  hDlg, %IDC_SEARCHMODE, "Search Mode", 390, 40, 85, _
                            20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                            %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                            %WS_EX_LEFT OR %WS_EX_LTRREADING
                        CONTROL ADD BUTTON,  hDlg, %IDC_POSTEDITSTODICTIONARY, "Post Edits to " + _
                            "Dictionary", 300, 280, 85, 20, %WS_CHILD OR %WS_VISIBLE OR _
                            %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT OR %BS_MULTILINE OR _
                            %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT OR _
                            %WS_EX_LTRREADING
                        CONTROL ADD BUTTON,  hDlg, %IDC_CANCELEDITS, "Cancel Edits", 395, 280, _
                            85, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR _
                            %BS_TEXT OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT _
                            OR %WS_EX_LTRREADING
                        CONTROL ADD TEXTBOX, hDlg, %IDC_EditVBTerm, "", 290, 120, 200, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                            %ES_AUTOVSCROLL OR %ES_WANTRETURN, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                            OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_EditComment, "", 290, 250, 200, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                            %ES_AUTOVSCROLL OR %ES_WANTRETURN, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                            OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_EditPointerToPBWrapper, "", 290, 224, _
                            200, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                            %ES_AUTOVSCROLL OR %ES_WANTRETURN OR %ES_NUMBER, %WS_EX_CLIENTEDGE _
                            OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_EditMultiUseTerm, "", 290, 198, 200, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                            %ES_AUTOVSCROLL OR %ES_WANTRETURN, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                            OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_EditPBTerm, "", 290, 172, 200, 20, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                            %ES_AUTOVSCROLL OR %ES_WANTRETURN, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                            OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD TEXTBOX, hDlg, %IDC_EditPBTermAvailable, "", 290, 146, 200, _
                            20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                            %ES_AUTOVSCROLL OR %ES_WANTRETURN, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                            OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                        CONTROL ADD LABEL,   hDlg, %IDC_EDITORSTATUS, "Editor Status", 340, 70, _
                            90, 20, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR _
                            %WS_EX_LTRREADING
                        CONTROL ADD LABEL,   hDlg, %IDC_ACTIVEVB6TERM, "Active VB6 Term", 295, _
                            95, 55, 20
                        CONTROL ADD TEXTBOX, hDlg, %IDC_ActiveVBTerm, "", 355, 95, 120, 15, _
                            %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL, _
                            %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                            %WS_EX_RIGHTSCROLLBAR
                        CONTROL SET COLOR    hDlg, %IDC_ActiveVBTerm, %BLUE, %YELLOW
                        CONTROL ADD LABEL,   hDlg, %IDC_LABEL3, "Click on Enter Edit Mode to edit " + _
                            "active record or Search Mode to find a specific record", 295, 5, _
                            180, 30
                        CONTROL SET COLOR    hDlg, %IDC_LABEL3, %BLUE, -1
                    
                        hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
                            %ANSI_CHARSET)
                    
                        DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_ENTERVB6TERM, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_VBTERM, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_PBTERMAVAILABLE, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_PBTERM, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_MULTIUSETERM, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_POINTERTOPBWRAPPER, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_COMMENT, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_BACK, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_FORWARD, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_REVIEWDICTIONARY, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_FINDPOWERBASICEQUIVALENT, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_QUITPROGRAM, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL1, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL2, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL4, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL5, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL6, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL7, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL8, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL9, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LINE1, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LINE2, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EXITFILEREVIEW, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LINE3, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_ENTEREDITMODE, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_SEARCHMODE, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_POSTEDITSTODICTIONARY, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_CANCELEDITS, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EditVBTerm, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EditComment, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EditPointerToPBWrapper, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EditMultiUseTerm, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EditPBTerm, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EditPBTermAvailable, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_EDITORSTATUS, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_ACTIVEVB6TERM, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_ActiveVBTerm, %WM_SETFONT, hFont1, 0
                        CONTROL SEND hDlg, %IDC_LABEL3, %WM_SETFONT, hFont1, 0
                    #PBFORMS END DIALOG
                    
                        DIALOG SHOW MODAL hDlg, CALL ShowPBREFTOOLFORVB6Proc TO lRslt
                    
                    #PBFORMS BEGIN CLEANUP %IDD_PBREFTOOLFORVB6
                        DeleteObject hFont1
                    #PBFORMS END CLEANUP
                    
                        FUNCTION = lRslt
                    END FUNCTION
                    Last edited by StanHelton; 26 Jun 2008, 02:15 PM. Reason: fix version number
                    Do not go quiet into that good night,
                    ... Rage, rage against the dark.

                    Comment


                    • #11
                      Thanky, thanky.

                      Rod
                      Rod
                      I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

                      Comment


                      • #12
                        Dictionary Tool

                        This tool combines the functions of the TermData tool and the DictionaryEditor tool into one application.

                        Code:
                        #PBFORMS CREATED V1.51
                        #COMPILE EXE
                        #DIM ALL
                        
                        '------------------------------------------------------------------------------
                        '   *** Includes ***
                        '------------------------------------------------------------------------------
                        #PBFORMS BEGIN INCLUDES
                        %USEMACROS = 1
                        #IF NOT %DEF(%WINAPI)
                            #INCLUDE "WIN32API.INC"
                        #ENDIF
                        #IF NOT %DEF(%COMMCTRL_INC)
                            #INCLUDE "COMMCTRL.INC"
                        #ENDIF
                        #INCLUDE "PBForms.INC"
                        #PBFORMS END INCLUDES
                        '------------------------------------------------------------------------------
                        
                        '------------------------------------------------------------------------------
                        '   ** Constants **
                        '------------------------------------------------------------------------------
                        #PBFORMS BEGIN CONSTANTS
                        %IDC_ACTIVEVB6TERM            = 1052
                        %IDC_ActiveVBTerm             = 1054
                        %IDC_ADDNEWTERMMANUALLY       = 1060
                        %IDC_AdvanceIncrement         = 1057
                        %IDC_BACK                     = 1022
                        %IDC_cmdExecute               = 1007
                        %IDC_cmdQUIT                  = 1008
                        %IDC_COMMENT                  = 1014
                        %IDC_CREATEDATAFILE           = 1026
                        %IDC_EditComment              = 1046
                        %IDC_EditMultiUseTerm         = 1048
                        %IDC_EDITORSTATUS             = 1051
                        %IDC_EditPBTerm               = 1049
                        %IDC_EditPBTermAvailable      = 1050
                        %IDC_EditPointerToPBWrapper   = 1047
                        %IDC_EditVBTerm               = 1045
                        %IDC_ENTEREDITMODE            = 1041
                        %IDC_ENTERVB6TERM             = 1003
                        %IDC_EXITFILEREVIEW           = 1039
                        %IDC_FINDPOWERBASICEQUIVALENT = 1069
                        %IDC_FORWARD                  = 1024
                        %IDC_FRAME1                   = 1002
                        %IDC_IncrementSpinner         = 1059
                        %IDC_INPUTFILEPATHNAME        = 1063
                        %IDC_LABEL1                   = 1001
                        %IDC_LABEL10                  = 1018
                        %IDC_LABEL11                  = 1034
                        %IDC_LABEL12                  = 1035
                        %IDC_LABEL13                  = 1036
                        %IDC_LABEL14                  = 1037
                        %IDC_LABEL15                  = 1038
                        %IDC_LABEL2                   = 1061
                        %IDC_LABEL3                   = 1070
                        %IDC_LABEL4                   = 1006
                        %IDC_LABEL5                   = 1066
                        %IDC_LABEL6                   = 1067
                        %IDC_LABEL7                   = 1009
                        %IDC_LABEL8                   = 1010
                        %IDC_LABEL9                   = 1011
                        %IDC_lblVB6SearchTerm         = 1062
                        %IDC_LINE1                    = 1020
                        %IDC_LINE2                    = 1021
                        %IDC_LINE3                    = 1028
                        %IDC_LINE4                    = 1029
                        %IDC_LINE5                    = 1030
                        %IDC_LINECOUNT                = 1019
                        %IDC_LINESREAD                = 1005
                        %IDC_MULTIUSETERM             = 1016
                        %IDC_optLOADTERMS             = 1064
                        %IDC_optREFERENCETOOL         = 1065
                        %IDC_PBTERM                   = 1017
                        %IDC_PBTERMAVAILABLE          = 1013
                        %IDC_POINTERTOPBWRAPPER       = 1015
                        %IDC_POSTEDITSTODICTIONARY    = 1043
                        %IDC_QUITPROGRAM              = 1027
                        %IDC_REVIEWDICTIONARY         = 1025
                        %IDC_REVIEWTERMSDICTIONARY    = 1068
                        %IDC_TEXTBOX10                = 1031
                        %IDC_TEXTBOX11                = 1032
                        %IDC_TEXTBOX12                = 1033
                        %IDC_VBTERM                   = 1012
                        %IDD_DataLoadTool             =  101
                        %IDD_PBREFTOOLFORVB6          =  102
                        %IDD_VB2PBTOOLS               =  103
                        #PBFORMS END CONSTANTS
                        '------------------------------------------------------------------------------
                        
                        %PBTermAvailable = 0
                        %PBTermNotAvailable = 1
                        %MultiUseTerm = 0
                        %NotMultiUseTerm = 1
                        %EditorInactive = 0
                        %EditMode = 1
                        %AddNewTerm = 2
                        %NoTermDefined = 0
                        %VB6Term = 1
                        %PBWinTerm = 2
                        %DataLoadTool = 3
                        %ReferenceTool = 4
                        
                        $Title = "vb2pb Reference Tool v1.03"
                        
                        '------------------------------------------------------------------------------
                        '  *** GLOBALS ***
                        '------------------------------------------------------------------------------
                        
                        '------------------------------------------------------------------------------
                        '   *** Types ***
                        '------------------------------------------------------------------------------
                        TYPE DictionaryRecordType
                            vbTerm AS STRING * 64
                            pbTermAvailable AS LONG
                            pbTerm AS STRING * 64
                            MultiUse AS LONG
                            pbWrapper AS DWORD
                            Comment AS STRING * 256
                        END TYPE
                        
                        '------------------------------------------------------------------------------
                        '   ** Declarations **
                        '------------------------------------------------------------------------------
                        DECLARE CALLBACK FUNCTION ShowVB2PBTOOLSProc()
                        DECLARE FUNCTION ShowVB2PBTOOLS(BYVAL hParent AS DWORD) AS LONG
                        DECLARE CALLBACK FUNCTION ShowDataLoadToolProc()
                        DECLARE FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
                        DECLARE CALLBACK FUNCTION ShowPBREFTOOLFORVB6Proc()
                        DECLARE FUNCTION ShowPBREFTOOLFORVB6(BYVAL hParent AS DWORD) AS LONG
                        #PBFORMS DECLARATIONS
                        
                        DECLARE FUNCTION vbDataLoadTool() AS LONG
                        DECLARE FUNCTION vb2pbReferenceTool() AS LONG
                        '------------------------------------------------------------------------------
                        
                        '------------------------------------------------------------------------------
                        '   ** Main Application Entry Point **
                        '------------------------------------------------------------------------------
                        FUNCTION PBMAIN()
                            PBFormsInitComCtls (%ICC_WIN95_CLASSES OR %ICC_DATE_CLASSES OR %ICC_INTERNET_CLASSES)
                            ShowVB2PBTOOLS %HWND_DESKTOP
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        FUNCTION vbDataLoadTool() AS LONG
                            ShowDataLoadTool %HWND_DESKTOP
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        FUNCTION vb2pbReferenceTool() AS LONG
                            ShowPBREFTOOLFORVB6 %HWND_DESKTOP
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        
                        '------------------------------------------------------------------------------
                        '   ** CallBacks **
                        '------------------------------------------------------------------------------
                        CALLBACK FUNCTION ShowVB2PBTOOLSProc()
                            STATIC CmdFunction AS LONG
                        
                            SELECT CASE AS LONG CBMSG
                                CASE %WM_INITDIALOG
                                    ' Initialization handler
                                    CONTROL SET OPTION CBHNDL, %IDC_optREFERENCETOOL, %IDC_optLOADTERMS, %IDC_optREFERENCETOOL
                                    CmdFunction = %ReferenceTool
                        
                                CASE %WM_NCACTIVATE
                                    STATIC hWndSaveFocus AS DWORD
                                    IF ISFALSE CBWPARAM THEN
                                        ' Save control focus
                                        hWndSaveFocus = GetFocus()
                                    ELSEIF hWndSaveFocus THEN
                                        ' Restore control focus
                                        SetFocus(hWndSaveFocus)
                                        hWndSaveFocus = 0
                                    END IF
                        
                                CASE %WM_COMMAND
                                    ' Process control notifications
                                    SELECT CASE AS LONG CBCTL
                                        CASE %IDC_optLOADTERMS
                                            IF CBCTLMSG = %BN_CLICKED THEN
                                                CmdFunction = %DataLoadTool
                                            END IF
                        
                                        CASE %IDC_optREFERENCETOOL
                                            IF CBCTLMSG = %BN_CLICKED THEN
                                                CmdFunction = %ReferenceTool
                                            END IF
                        
                                        CASE %IDC_cmdExecute
                                            IF CBCTLMSG = %BN_CLICKED THEN
                                                IF CmdFunction = %DataLoadTool THEN
                                                    vbDataLoadTool()
                                                ELSEIF CmdFunction = %ReferenceTool THEN
                                                    vb2pbReferenceTool
                                                END IF
                                            END IF
                        
                                        CASE %IDC_cmdQUIT
                                            IF CBCTLMSG = %BN_CLICKED THEN
                                                DIALOG END CBHNDL
                                            END IF
                        
                                    END SELECT
                            END SELECT
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        CALLBACK FUNCTION ShowDataLoadToolProc()
                            LOCAL lResult AS LONG
                            LOCAL tempString AS STRING
                            LOCAL inFile AS INTEGER
                            LOCAL lineCount AS LONG
                            LOCAL record AS DictionaryRecordType
                            LOCAL Finished AS LONG
                            LOCAL index AS LONG
                            LOCAL tempRecord AS DictionaryRecordtype
                        
                            STATIC sourceFileName AS STRING
                            STATIC targetFileName AS STRING
                            STATIC outFile AS INTEGER
                            STATIC recNo AS LONG
                            STATIC recCount AS LONG
                        
                        
                            SELECT CASE AS LONG CBMSG
                                CASE %WM_INITDIALOG
                                    ' Initialization handler
                        
                                    sourceFileName = "vb2pbTermsCSV.txt"
                                    targetFileName = "vb2pbTermsDict.dct"
                                    recNo = 1
                                    recCount = 1
                                    CONTROL SET TEXT CBHNDL, %IDC_INPUTFILEPATHNAME, CURDIR$
                        
                                CASE %WM_NCACTIVATE
                                    STATIC hWndSaveFocus AS DWORD
                                    IF ISFALSE CBWPARAM THEN
                                        ' Save control focus
                                        hWndSaveFocus = GetFocus()
                                    ELSEIF hWndSaveFocus THEN
                                        ' Restore control focus
                                        SetFocus(hWndSaveFocus)
                                        hWndSaveFocus = 0
                                    END IF
                        
                                CASE %WM_COMMAND
                                    ' Process control notifications
                                    SELECT CASE AS LONG CBCTL
                                        CASE %IDC_EXITFILEREVIEW
                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                CONTROL ENABLE CBHNDL, %IDC_CREATEDATAFILE
                                                CONTROL ENABLE CBHNDL, %IDC_QUITPROGRAM
                                                CONTROL ENABLE CBHNDL, %IDC_REVIEWTERMSDICTIONARY
                        
                                                CONTROL DISABLE CBHNDL, %IDC_BACK
                                                CONTROL DISABLE CBHNDL, %IDC_FORWARD
                                                CONTROL DISABLE CBHNDL, %IDC_EXITFILEREVIEW
                        
                                                CLOSE #outFile
                                            END IF
                        
                                        CASE %IDC_BACK
                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                DECR recNo
                                                IF recNo < 1 THEN recNo = recCount
                                                CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(recNo))
                                                DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWTERMSDICTIONARY, %BN_CLICKED
                                            END IF
                        
                                        CASE %IDC_FORWARD
                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                INCR recNo
                                                IF recNo > recCount THEN recNo = 1
                                                CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(recNo))
                                                DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWTERMSDICTIONARY, %BN_CLICKED
                                            END IF
                        
                        
                                        CASE %IDC_REVIEWTERMSDICTIONARY
                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                CONTROL DISABLE CBHNDL, %IDC_CREATEDATAFILE
                                                CONTROL DISABLE CBHNDL, %IDC_QUITPROGRAM
                                                CONTROL DISABLE CBHNDL, %IDC_REVIEWTERMSDICTIONARY
                        
                                                CONTROL ENABLE CBHNDL, %IDC_BACK
                                                CONTROL ENABLE CBHNDL, %IDC_FORWARD
                                                CONTROL ENABLE CBHNDL, %IDC_EXITFILEREVIEW
                        
                                                IF ISFALSE FILEATTR(#outFile, 0) THEN
                                                    outFile = FREEFILE
                                                    OPEN targetFileName FOR RANDOM AS outFile LEN = SIZEOF(record)
                                                    recCount = LOF(outFile) / SIZEOF(record)
                                                END IF
                        
                                                GET #outFile, recNo, record
                        
                                                'update screen display
                                                CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                                CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                                CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                                CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                                CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                                CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                        
                                            END IF
                        
                                        CASE %IDC_CREATEDATAFILE
                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                inFile = FREEFILE
                                                OPEN sourceFileName FOR INPUT AS inFile
                        
                                                outFile = FREEFILE
                                                OPEN targetFileName FOR RANDOM AS outFile LEN = SIZEOF(record)
                                                recCount = LOF(outFile) / SIZEOF(record)
                                                IF recCount > 1 THEN
                                                    recNo = recCount + 1
                                                ELSE
                                                    recNo = 1
                                                END IF
                        
                                                FILESCAN #inFile, RECORDS TO lineCount
                                                tempString = TRIM$(STR$(lineCount))
                                                CONTROL SET TEXT CBHNDL, %IDC_LINECOUNT, tempString
                        
                                                lineCount = 0
                                                DO
                                                    INPUT #inFile, record.vbTerm, _
                                                                        record.pbTermAvailable, _
                                                                        record.pbTerm, _
                                                                        record.MultiUse, _
                                                                        record.pbWrapper, _
                                                                        record.Comment
                        
                                                    IF EOF(inFile) THEN     'check for eof in source file
                                                        Finished = %True
                                                    ELSE
                                                        Finished = %False
                                                    END IF                  'continue last iteration of DO/LOOP to get last record in source file
                        
                                                    FOR index = 1 TO recCount
                                                        GET #outFile, index, tempRecord
                                                        IF UCASE$(TRIM$(tempRecord.vbTerm)) = UCASE$(TRIM$(record.vbTerm)) THEN
                                                            INCR lineCount
                                                            ITERATE DO
                                                        END IF
                                                    NEXT index
                        
                                                    PUT #outFile, recNo, record
                                                    INCR recNo
                                                    INCR lineCount
                        
                                                    'update screen display
                                                    CONTROL SET TEXT CBHNDL, %IDC_LINESREAD, TRIM$(STR$(lineCount))
                                                LOOP UNTIL Finished
                                                CLOSE #inFile, #outFile
                                            END IF
                        
                                        CASE %IDC_QUITPROGRAM
                                            IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                                lResult = MSGBOX("Are you sure you want to quit?", %MB_YESNOCANCEL, "TermsData Tool")
                                                IF lResult = %IDYES THEN
                                                    CLOSE
                                                    DIALOG END CBHNDL
                                                END IF
                                            END IF
                        
                                    END SELECT
                            END SELECT
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        CALLBACK FUNCTION ShowPBREFTOOLFORVB6Proc()
                             LOCAL lResult AS LONG
                             LOCAL tempString AS STRING
                             LOCAL Finished AS LONG
                             LOCAL length AS LONG
                             LOCAL sResult AS STRING
                        
                             STATIC record AS DictionaryRecordType
                             STATIC editRecord AS DictionaryRecordType
                             STATIC sourceFileName AS STRING
                             STATIC sourceFile AS INTEGER
                             STATIC recNo AS LONG
                             STATIC recCount AS LONG
                             STATIC EditorStatus AS LONG
                             STATIC searchTerm AS STRING
                             STATIC SearchFor AS LONG
                             STATIC TermAvailMessageFlag AS LONG
                             STATIC MultiUseMessageFlag AS LONG
                        
                        
                             SELECT CASE AS LONG CBMSG
                                  CASE %WM_INITDIALOG
                                        ' Initialization handler
                        
                                        sourceFileName = "vb2pbTermsDict.dct"
                                        sourceFile = FREEFILE
                                        OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                        recCount = LOF(sourceFile) / SIZEOF(record)
                                        recNo = 1
                        
                                        GET #sourceFile, recNo, record
                                        CLOSE #sourceFile
                        
                                        TYPE SET editRecord = record
                        
                                        'initialize screen display
                                        CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                        CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                        CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                        CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                        CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                        CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                        
                                  CASE %WM_NCACTIVATE
                                        STATIC hWndSaveFocus AS DWORD
                                        IF ISFALSE CBWPARAM THEN
                                             ' Save control focus
                                             hWndSaveFocus = GetFocus()
                                        ELSEIF hWndSaveFocus THEN
                                             ' Restore control focus
                                             SetFocus(hWndSaveFocus)
                                             hWndSaveFocus = 0
                                        END IF
                        
                                  CASE %WM_COMMAND
                                        ' Process control notifications
                                        SELECT CASE AS LONG CBCTL
                                            CASE %IDC_EXITFILEREVIEW
                                                IF CBCTLMSG = %BN_CLICKED THEN
                                                    'reenable program command buttons
                                                    CONTROL ENABLE CBHNDL, %IDC_FINDPOWERBASICEQUIVALENT
                                                    CONTROL ENABLE CBHNDL, %IDC_QUITPROGRAM
                        
                                                    'disable browsing buttons
                                                    CONTROL DISABLE CBHNDL, %IDC_BACK
                                                    CONTROL DISABLE CBHNDL, %IDC_FORWARD
                                                    CONTROL DISABLE CBHNDL, %IDC_EXITFILEREVIEW
                        
                                                    IF ISTRUE FILEATTR(#sourceFile, 0) THEN
                                                        CLOSE #sourceFile
                                                    END IF
                                                END IF
                        
                                            CASE %IDC_BACK
                                                IF CBCTLMSG = %BN_CLICKED THEN
                                                    CONTROL GET TEXT CBHNDL, %IDC_AdvanceIncrement TO sResult
                                                    lResult = VAL(sResult)
                                                    IF lResult = 0 THEN
                                                        lResult = 1
                                                    END IF
                                                    recNo = recNo - lResult
                                                    IF recNo < 1 THEN recNo = recCount
                                                    DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWDICTIONARY, %BN_CLICKED
                                                END IF
                        
                                            CASE %IDC_FORWARD
                                                IF CBCTLMSG = %BN_CLICKED THEN
                                                    CONTROL GET TEXT CBHNDL, %IDC_AdvanceIncrement TO sResult
                                                    lResult = VAL(sResult)
                                                    IF lResult = 0 THEN
                                                        lResult = 1
                                                    END IF
                                                    recNo = recNo + lResult
                                                    IF recNo > recCount THEN recNo = 1
                                                    DIALOG POST CBHNDL, %WM_COMMAND, %IDC_REVIEWDICTIONARY, %BN_CLICKED
                                                END IF
                        
                        
                                            CASE %IDC_REVIEWDICTIONARY
                                                IF CBCTLMSG = %BN_CLICKED THEN
                                                    'disable program command buttons
                                                    CONTROL DISABLE CBHNDL, %IDC_FINDPOWERBASICEQUIVALENT
                        
                                                    'enable browsing buttons
                                                    CONTROL ENABLE CBHNDL, %IDC_BACK
                                                    CONTROL ENABLE CBHNDL, %IDC_FORWARD
                                                    CONTROL ENABLE CBHNDL, %IDC_EXITFILEREVIEW
                        
                                                    IF ISFALSE FILEATTR(#sourceFile, 0) THEN
                                                        sourceFile = FREEFILE
                                                        OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                                        recCount = LOF(sourceFile) / SIZEOF(record)
                                                    END IF
                        
                                                    GET #sourceFile, recNo, record
                                                    TYPE SET editRecord = record
                        
                                                    'update screen display
                                                    CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                                    CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, TRIM$(STR$(record.pbTermAvailable))
                                                    CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                                                    CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, TRIM$(STR$(record.MultiUse))
                                                    CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                                    CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                                                    CONTROL SET TEXT CBHNDL, %IDC_EditVBTerm, TRIM$(record.vbTerm)
                        
                                                    IF ISFALSE TermAvailMessageFlag THEN
                                                        TermAvailMessageFlag = -1
                                                        CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, TRIM$(STR$(record.pbTermAvailable))
                                                        RESET TermAvailMessageFlag
                                                    END IF
                        
                                                    CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, TRIM$(record.pbTerm)
                        
                                                    IF ISFALSE MultiUseMessageFlag THEN
                                                        MultiUseMessageFlag = -1
                                                        CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, TRIM$(STR$(record.MultiUse))
                                                        RESET MultiUseMessageFlag
                                                    END IF
                        
                                                    CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, TRIM$(STR$(record.pbWrapper))
                                                    CONTROL SET TEXT CBHNDL, %IDC_EditComment, TRIM$(record.Comment)
                        
                                                    'set reference boxes
                                                    IF SearchFor = %NoTermDefined OR SearchFor = %VB6Term THEN
                                                        tempString = TRIM$(record.vbTerm)
                                                    ELSE
                                                        tempString = TRIM$(record.pbTerm)
                                                    END IF
                                                    CONTROL SET TEXT CBHNDL, %IDC_ActiveVBTerm, tempString
                        
                        
                                                    IF ISTRUE FILEATTR(#sourceFile, 0) THEN
                                                        CLOSE #sourceFile
                                                    END IF
                        
                                                END IF
                        
                                             CASE %IDC_FINDPOWERBASICEQUIVALENT
                                                  'search dictionary for user entered term
                                                  IF CBCTLMSG = %BN_CLICKED THEN
                                                      'allow user to search for VB or PB terms
                                                      lResult = MSGBOX("Is this a PBWin term?", _
                                                                       %MB_YESNO OR %MB_TASKMODAL, _
                                                                       $Title)
                                                      IF lResult = %IDYES THEN
                                                          SearchFor = %PBWinTerm
                                                          CONTROL SET TEXT CBHNDL, %IDC_lblVB6SearchTerm, "PBWin term"
                                                      ELSE
                                                          SearchFor = %VB6Term
                                                          CONTROL SET TEXT CBHNDL, %IDC_lblVB6SearchTerm, "VB6 term"
                                                      END IF
                        
                                                      'get searchterm from textbox & perform search
                                                      CONTROL GET TEXT CBHNDL, %IDC_ENTERVB6TERM TO searchTerm
                                                      searchTerm = UCASE$(TRIM$(searchTerm))
                                                      length = LEN(searchTerm)
                                                      IF length < 1 THEN
                                                          CONTROL SET TEXT CBHNDL, %IDC_ENTERVB6TERM, "Nothing to find"
                                                      ELSE
                        
                                                          IF ISFALSE FILEATTR(#sourceFile, 0) THEN     'if file not open then open it
                                                             sourceFile = FREEFILE
                                                             OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                                          END IF
                                                          recCount = LOF(sourceFile) / SIZEOF(record)
                        
                                                          FOR recNo = 1 TO recCount        'run through the file -- speed not important here
                                                                                                  'because there aren't enought records in the file
                                                                                                  'to slow it down noticably
                                                              GET #sourceFile, recNo, record
                                                              TYPE SET editRecord = record
                        
                                                              IF SearchFor = %VB6Term _
                                                              OR SearchFor = %NoTermDefined THEN  'compare searchTerm to record.vbTerm
                                                                  IF ISTRUE UCASE$(TRIM$(record.vbTerm)) = UCASE$(TRIM$(searchTerm)) THEN
                                                                      EXIT FOR    'break on match
                                                                  END IF
                                                              ELSE    'compare searchTerm to record.pbTerm
                                                                  IF ISTRUE UCASE$(TRIM$(record.pbTerm)) = UCASE$(TRIM$(searchTerm)) THEN
                                                                      EXIT FOR      'break on match
                                                                  END IF
                                                              END IF
                                                          NEXT recNo
                        
                                                          IF recNo > recCount THEN
                                                              RESET record
                                                              record.vbTerm = "Term not yet in data list."
                                                              record.Comment = "Please notify vb2pb project team"
                                                          ELSE
                                                              'update screen display
                                                              CONTROL SET TEXT CBHNDL, %IDC_VBTERM, TRIM$(record.vbTerm)
                                                              CONTROL SET TEXT CBHNDL, %IDC_COMMENT, TRIM$(record.Comment)
                        
                                                              IF ISFALSE TermAvailMessageFlag THEN
                                                                  IF record.pbTermAvailable = %PBTermAvailable THEN
                                                                      CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "PB term exists"
                                                                  ELSEIF record.pbTermAvailable = %PBTermNotAvailable THEN
                                                                      CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "No exact equivalent in PB"
                                                                  ELSE
                                                                      CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, "Undefined value in Data List"
                                                                      CONTROL SET TEXT CBHNDL, %IDC_COMMENT, "Please notify vb2pb project team"
                                                                  END IF
                                                              END IF
                        
                                                              CONTROL SET TEXT CBHNDL, %IDC_PBTERM, TRIM$(record.pbTerm)
                        
                                                              IF ISFALSE MultiUseMessageFlag THEN
                                                                  IF record.MultiUse = %MultiUseTerm THEN
                                                                      CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "VB term has multiple uses"
                                                                  ELSEIF record.MultiUse = %NotMultiUseTerm THEN
                                                                      CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "VB term has 1 unique use"
                                                                  ELSE
                                                                      CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, "Undefined value in Data List"
                                                                      CONTROL SET TEXT CBHNDL, %IDC_COMMENT, "Please notify vb2pb project team"
                                                                  END IF
                                                              END IF
                        
                                                              CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                                          END IF
                                                      END IF
                                                  END IF
                        
                                             CASE %IDC_QUITPROGRAM
                                                  IF CBCTLMSG = %BN_CLICKED THEN
                                                      lResult = MSGBOX("Are you sure you want to quit?", %MB_YESNOCANCEL, $Title)
                                                      IF lResult = %IDYES THEN
                                                            CLOSE
                                                            DIALOG END CBHNDL
                                                        END IF
                                                  END IF
                        
                                             CASE %IDC_ENTEREDITMODE
                                                 IF CBCTLMSG = %BN_CLICKED THEN
                                                     IF EditorStatus = %EditorInactive THEN
                                                         IF EditorStatus = %EditorInactive THEN
                                                             CONTROL ENABLE CBHNDL, %IDC_POSTEDITSTODICTIONARY
                                                         ELSE
                                                             CONTROL DISABLE CBHNDL, %IDC_POSTEDITSTODICTIONARY
                                                         END IF
                        
                                                         'set control flags
                                                         IF ISFALSE TermAvailMessageFlag THEN
                                                             TermAvailMessageFlag = -1
                                                         END IF
                                                         IF ISFALSE MultiUseMessageFlag THEN
                                                             MultiUseMessageFlag = -1
                                                         END IF
                        
                                                         'enable edits
                                                         CONTROL ENABLE CBHNDL, %IDC_ADDNEWTERMMANUALLY
                                                         CONTROL ENABLE CBHNDL, %IDC_ActiveVBTerm
                                                         CONTROL ENABLE CBHNDL, %IDC_EditComment
                                                         CONTROL ENABLE CBHNDL, %IDC_EditMultiUseTerm
                                                         CONTROL ENABLE CBHNDL, %IDC_EditPBTerm
                                                         CONTROL ENABLE CBHNDL, %IDC_EditPointerToPBWrapper
                                                         CONTROL ENABLE CBHNDL, %IDC_EditPBTermAvailable
                                                         CONTROL ENABLE CBHNDL, %IDC_EditVBTerm
                                                         CONTROL ENABLE CBHNDL, %IDC_EditComment
                        
                                                         'initialize editRecord
                                                         TYPE SET editRecord = record
                        
                                                         'set vbTerm textbox
                                                         tempString = TRIM$(record.vbTerm)
                                                         CONTROL SET TEXT CBHNDL, %IDC_ActiveVBTerm, tempString
                        
                                                         'set edit textboxes
                                                         CONTROL SET TEXT CBHNDL, %IDC_EditComment, editRecord.Comment
                                                         CONTROL SET TEXT CBHNDL, %IDC_EditVBTerm, editRecord.vbTerm
                                                         CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, editRecord.pbTerm
                                                         CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, TRIM$(STR$(editRecord.pbWrapper))
                        
                                                         IF editRecord.pbTermAvailable = %PBTermAvailable THEN
                                                             tempString = "PB Term Available"
                                                         ELSEIF editRecord.pbTermAvailable = %PBTermNotAvailable THEN
                                                             tempString = "No exact equivalent in PB"
                                                         END IF
                                                         CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, TRIM$(tempString)
                        
                                                         IF editRecord.MultiUse = %MULTIUSETERM THEN
                                                             tempString = "Multi Use Term"
                                                         ELSEIF editRecord.MultiUse = %NOTMULTIUSETERM THEN
                                                             tempString = "VB term has 1 unique use"
                                                         END IF
                                                         CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, tempString
                        
                                                         CONTROL SET TEXT CBHNDL, %IDC_ENTEREDITMODE, "EXIT Edit Mode"
                                                         CONTROL SET TEXT CBHNDL, %IDC_EDITORSTATUS, "Edit Mode"
                        
                                                         'set control flags
                                                         EditorStatus = %EditMode
                                                         RESET TermAvailMessageFlag
                                                         RESET MultiUseMessageFlag
                        
                                                     ELSEIF EditorStatus = %EditMode OR EditorStatus = %AddNewTerm THEN
                                                         'set control flags
                                                         IF ISFALSE TermAvailMessageFlag THEN
                                                             TermAvailMessageFlag = -1
                                                         END IF
                                                         IF ISFALSE MultiUseMessageFlag THEN
                                                             MultiUseMessageFlag = -1
                                                         END IF
                        
                                                         CONTROL SET TEXT CBHNDL, %IDC_ENTEREDITMODE, "Enter Edit Mode"
                                                         CONTROL SET TEXT CBHNDL, %IDC_EDITORSTATUS, "Editor Inactive"
                        
                                                         CONTROL ENABLE CBHNDL, %IDC_FINDPOWERBASICEQUIVALENT
                        
                                                         CONTROL DISABLE CBHNDL, %IDC_ADDNEWTERMMANUALLY
                                                         CONTROL DISABLE CBHNDL, %IDC_POSTEDITSTODICTIONARY
                                                         CONTROL DISABLE CBHNDL, %IDC_ActiveVBTerm
                                                         CONTROL DISABLE CBHNDL, %IDC_EditComment
                                                         CONTROL DISABLE CBHNDL, %IDC_EditMultiUseTerm
                                                         CONTROL DISABLE CBHNDL, %IDC_EditPBTerm
                                                         CONTROL DISABLE CBHNDL, %IDC_EditPointerToPBWrapper
                                                         CONTROL DISABLE CBHNDL, %IDC_EditPBTermAvailable
                                                         CONTROL DISABLE CBHNDL, %IDC_EditVBTerm
                        
                                                         'set control flags
                                                         EditorStatus = %EditorInactive
                                                         RESET TermAvailMessageFlag
                                                         RESET MultiUseMessageFlag
                                                     END IF
                                                 END IF
                        
                        
                                             CASE %IDC_POSTEDITSTODICTIONARY
                                                 IF CBCTLMSG = %BN_CLICKED THEN
                                                     IF EditorStatus = %EditMode THEN
                                                        lResult = MSGBOX("Post changes to Dictionary?", %MB_YESNO OR %MB_TASKMODAL, $Title)
                                                        IF lResult = %IDYES THEN
                                                            TYPE SET record = editRecord
                        
                                                            IF ISFALSE(FILEATTR(#sourceFile, 0)) THEN
                                                                sourceFile = FREEFILE
                                                                OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                                            END IF
                                                            recCount = LOF(sourceFile) / SIZEOF(record)
                                                            PUT #sourceFile, recNo, record
                                                            CLOSE #sourceFile
                        
                                                            CONTROL SET TEXT CBHNDL, %IDC_COMMENT, record.Comment
                                                            CONTROL SET TEXT CBHNDL, %IDC_VBTERM, record.vbTerm
                                                            CONTROL SET TEXT CBHNDL, %IDC_PBTERM, record.pbTerm
                                                            CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(record.pbWrapper))
                                                            IF record.pbTermAvailable = %PBTermAvailable THEN
                                                                tempString = "PB Term Available"
                                                            ELSEIF record.pbTermAvailable = %PBTermNotAvailable THEN
                                                                tempString = "No exact equivalent in PB"
                                                            END IF
                                                            CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, tempString
                                                            IF record.MultiUse = %MULTIUSETERM THEN
                                                                tempString = "Multi Use Term"
                                                            ELSEIF record.MultiUse = %NOTMULTIUSETERM THEN
                                                                tempString = "VB term has 1 unique use"
                                                            END IF
                                                            CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, tempString
                                                        END IF
                                                    ELSEIF EditorStatus = %AddNewTerm THEN
                                                        IF ISFALSE(FILEATTR(#sourceFile, 0)) THEN
                                                            sourceFile = FREEFILE
                                                            OPEN sourceFileName FOR RANDOM AS sourceFile LEN = SIZEOF(record)
                                                        END IF
                                                        recCount = LOF(sourceFile) / SIZEOF(record)
                                                        recNo = recCount + 1
                        
                                                        RESET editRecord
                        
                                                        CONTROL SET TEXT CBHNDL, %IDC_COMMENT, editRecord.Comment
                                                        CONTROL SET TEXT CBHNDL, %IDC_VBTERM, editRecord.vbTerm
                                                        CONTROL SET TEXT CBHNDL, %IDC_PBTERM, editRecord.pbTerm
                                                        CONTROL SET TEXT CBHNDL, %IDC_POINTERTOPBWRAPPER, TRIM$(STR$(editRecord.pbWrapper))
                                                        IF editRecord.pbTermAvailable = %PBTermAvailable THEN
                                                            tempString = "PB Term Available"
                                                        ELSEIF editRecord.pbTermAvailable = %PBTermNotAvailable THEN
                                                            tempString = "No exact equivalent in PB"
                                                        END IF
                                                        CONTROL SET TEXT CBHNDL, %IDC_PBTERMAVAILABLE, tempString
                                                        IF editRecord.MultiUse = %MULTIUSETERM THEN
                                                            tempString = "Multi Use Term"
                                                        ELSEIF editRecord.MultiUse = %NOTMULTIUSETERM THEN
                                                            tempString = "VB term has 1 unique use"
                                                        END IF
                                                        CONTROL SET TEXT CBHNDL, %IDC_MULTIUSETERM, tempString
                        
                                                        IF ISTRUE (FILEATTR(#sourceFile, 0)) THEN
                                                            CLOSE #sourceFile
                                                        END IF
                        
                                                        TYPE SET record = editRecord
                                                        PUT #sourceFile, recNo, record
                        
                                                        IF ISTRUE(FILEATTR(#sourceFile, 0)) THEN
                                                            CLOSE #sourceFile
                                                        END IF
                        
                                                    END IF
                                                 END IF
                        
                                             CASE %IDC_ActiveVBTerm
                                                 CONTROL GET TEXT CBHNDL, %IDC_ActiveVBTerm TO tempString
                                                 CONTROL SET TEXT CBHNDL, %IDC_ENTERVB6TERM, tempString
                                                 searchTerm = TRIM$(tempString)
                        
                                             CASE %IDC_EditComment
                                                 IF EditorStatus = %EditMode OR EditorStatus = %AddNewTerm THEN
                                                     CONTROL GET TEXT CBHNDL, %IDC_EditComment TO editRecord.Comment
                                                 END IF
                        
                                             CASE %IDC_EditMultiUseTerm
                                                 IF EditorStatus = %EditMode AND ISFALSE MultiUseMessageFlag THEN
                                                     MultiUseMessageFlag = -1
                                                     lResult = MSGBOX("Is VB6 term a multiuse term?", _
                                                                      %MB_YESNOCANCEL OR %MB_TASKMODAL, _
                                                                      $Title)
                                                     IF lResult = %IDYES THEN
                                                         editRecord.MultiUse = %MULTIUSETERM
                                                         tempString = "Multi Use term"
                                                     ELSEIF lResult = %IDNO THEN
                                                         editRecord.MultiUse = %NOTMULTIUSETERM
                                                         tempString = "VB term has 1 unique use"
                                                     ELSEIF lResult = %IDCANCEL THEN
                                                         EXIT SELECT
                                                     END IF
                                                     CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, TRIM$(tempString)
                                                     CONTROL SET FOCUS CBHNDL, %IDC_ActiveVBTerm
                                                     RESET MultiUseMessageFlag
                                                 END IF
                        
                                             CASE %IDC_EditPBTerm
                                                 IF EditorStatus = %EditMode THEN
                                                     CONTROL GET TEXT CBHNDL, %IDC_EditPBTerm TO editRecord.pbTerm
                                                 END IF
                        
                                             CASE %IDC_EditPointerToPBWrapper
                                                 IF EditorStatus = %EditMode THEN
                                                     CONTROL GET TEXT CBHNDL, %IDC_EditPointerToPBWrapper TO tempString
                                                     editRecord.pbWrapper = VAL(tempString)
                                                 END IF
                        
                                             CASE %IDC_EditPBTermAvailable
                                                IF CBCTLMSG = %EN_CHANGE THEN
                                                    IF TermAvailMessageFlag THEN EXIT FUNCTION
                                                    IF EditorStatus = %EditMode THEN
                                                        TermAvailMessageFlag = -1
                                                        lResult = MSGBOX("Is an exact PB equivalent available?", _
                                                                         %MB_YESNOCANCEL OR %MB_TASKMODAL, _
                                                                         $Title)
                                                        IF lResult = %IDYES THEN
                                                            editRecord.pbTermAvailable = %PBTermAvailable
                                                            CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, "PB term available"
                                                        ELSE
                                                            editRecord.pbTermAvailable = %PBTermNotAvailable
                                                            CONTROL SET TEXT CBHNDL, %IDC_EditPBTermAvailable, "Exact PB equivalent not available"
                                                        END IF
                                                        CONTROL SET FOCUS CBHNDL, %IDC_ActiveVBTerm
                                                        RESET TermAvailMessageFlag
                                                    END IF
                                                END IF
                        
                                             CASE %IDC_ADDNEWTERMMANUALLY
                                                 IF CBCTLMSG = %BN_CLICKED THEN
                                                     CONTROL ENABLE CBHNDL, %IDC_POSTEDITSTODICTIONARY
                                                     CONTROL ENABLE CBHNDL, %IDC_ActiveVBTerm
                                                     CONTROL ENABLE CBHNDL, %IDC_EditComment
                                                     CONTROL ENABLE CBHNDL, %IDC_EditMultiUseTerm
                                                     CONTROL ENABLE CBHNDL, %IDC_EditPBTerm
                                                     CONTROL ENABLE CBHNDL, %IDC_EditPointerToPBWrapper
                                                     CONTROL ENABLE CBHNDL, %IDC_EditPBTermAvailable
                                                     CONTROL ENABLE CBHNDL, %IDC_EditVBTerm
                                                     CONTROL ENABLE CBHNDL, %IDC_EditComment
                        
                                                     RESET editRecord
                        
                                                     CONTROL SET TEXT CBHNDL, %IDC_EditVBTerm, TRIM$(editRecord.vbTerm)
                        
                                                     IF ISFALSE TermAvailMessageFlag THEN
                                                         TermAvailMessageFlag = -1
                                                         IF editRecord.pbTermAvailable = %pbTermNotAvailable THEN
                                                             CONTROL SET TEXT CBHNDL, %IDC_PBTermAvailable, "PB term available"
                                                         ELSE
                                                             CONTROL SET TEXT CBHNDL, %IDC_PBTermAvailable, "PB term not availble"
                                                         END IF
                                                         CONTROL SET FOCUS CBHNDL, %IDC_ActiveVBTerm
                                                         RESET TermAvailMessageFlag
                                                     END IF
                        
                                                     CONTROL SET TEXT CBHNDL, %IDC_EditPBTerm, TRIM$(editRecord.pbTerm)
                        
                                                     IF ISFALSE MultiUseMessageFlag THEN
                                                         MultiUseMessageFlag = -1
                                                         IF editRecord.MultiUse = %NotMultiUseTerm THEN
                                                             tempString = "Single use term"
                                                         ELSE
                                                             tempString = "VB term has 1 unique use"
                                                         END IF
                                                         CONTROL SET TEXT CBHNDL, %IDC_EditMultiUseTerm, tempString
                                                         CONTROL SET FOCUS CBHNDL, %IDC_ActiveVBTerm
                                                         RESET MultiUseMessageFlag
                                                     END IF
                        
                                                     CONTROL SET TEXT CBHNDL, %IDC_EditPointerToPBWrapper, TRIM$(STR$(editRecord.pbWrapper))
                                                     CONTROL SET TEXT CBHNDL, %IDC_EditComment, TRIM$(editRecord.Comment)
                        
                                                     EditorStatus = %AddNewTerm
                                                 END IF
                        
                                        END SELECT
                             END SELECT
                        
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        
                        '------------------------------------------------------------------------------
                        '   ** Dialogs **
                        '------------------------------------------------------------------------------
                        FUNCTION ShowVB2PBTOOLS(BYVAL hParent AS DWORD) AS LONG
                            LOCAL lRslt  AS LONG
                        
                        #PBFORMS BEGIN DIALOG %IDD_VB2PBTOOLS->->
                            LOCAL hDlg   AS DWORD
                            LOCAL hFont1 AS DWORD
                        
                            DIALOG NEW hParent, "vb2pb Tools", 280, 159, 152, 136, %WS_POPUP OR _
                                %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR %WS_MINIMIZEBOX OR _
                                %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR %DS_3DLOOK OR _
                                %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CONTROLPARENT OR %WS_EX_LEFT _
                                OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO hDlg
                            DIALOG  SET COLOR   hDlg, %BLUE, %CYAN
                            CONTROL ADD FRAME,  hDlg, %IDC_FRAME1, "Select vb2pb Tool", 10, 13, 130, _
                                82
                            CONTROL SET COLOR   hDlg, %IDC_FRAME1, %BLUE, %CYAN
                            ' %WS_GROUP...
                            CONTROL ADD OPTION, hDlg, %IDC_optLOADTERMS, "Load Terms from CSV file", _
                                15, 38, 120, 20, %WS_GROUP OR %WS_CHILD OR %WS_VISIBLE, %WS_EX_LEFT _
                                OR %WS_EX_LTRREADING
                            CONTROL SET COLOR   hDlg, %IDC_optLOADTERMS, -1, %CYAN
                            CONTROL ADD OPTION, hDlg, %IDC_optREFERENCETOOL, "Reference Tool", 15, _
                                65, 120, 20
                            CONTROL SET COLOR   hDlg, %IDC_optREFERENCETOOL, -1, %CYAN
                            CONTROL ADD BUTTON, hDlg, %IDC_cmdExecute, "Start Selected", 11, 105, 60, _
                                25, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                                %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON, hDlg, %IDC_cmdQUIT, "QUIT", 81, 105, 60, 25
                        
                            hFont1 = PBFormsMakeFont("MS Sans Serif", 10, 400, %FALSE, %FALSE, _
                                %FALSE, %ANSI_CHARSET)
                        
                            DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_FRAME1, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_optLOADTERMS, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_optREFERENCETOOL, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_cmdExecute, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_cmdQUIT, %WM_SETFONT, hFont1, 0
                        #PBFORMS END DIALOG
                        
                            DIALOG SHOW MODAL hDlg, CALL ShowVB2PBTOOLSProc TO lRslt
                        
                        #PBFORMS BEGIN CLEANUP %IDD_VB2PBTOOLS
                            DeleteObject hFont1
                        #PBFORMS END CLEANUP
                        
                            FUNCTION = lRslt
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        
                        FUNCTION ShowDataLoadTool(BYVAL hParent AS DWORD) AS LONG
                            LOCAL lRslt  AS LONG
                        
                        #PBFORMS BEGIN DIALOG %IDD_DataLoadTool->->
                            LOCAL hDlg   AS DWORD
                            LOCAL hFont1 AS DWORD
                            LOCAL hFont2 AS DWORD
                        
                            DIALOG NEW hParent, "Data Load Tool For Rod's VB Term Files", 315, 151, _
                                442, 346, %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
                                %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
                                OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CLIENTEDGE _
                                OR %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE OR %WS_EX_CONTROLPARENT OR _
                                %WS_EX_APPWINDOW OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                %WS_EX_RIGHTSCROLLBAR, TO hDlg
                            CONTROL ADD TEXTBOX, hDlg, %IDC_INPUTFILEPATHNAME, "Input File " + _
                                "Path/Name", 70, 45, 190, 15, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                                OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                                OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_LINESREAD, "Lines Read", 70, 70, 65, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_LINECOUNT, "Line Count", 195, 70, 65, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                                %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_VBTERM, "vbTerm", 75, 120, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERMAVAILABLE, "pbTerm Available", 75, _
                                146, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                                %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERM, "pbTerm", 75, 172, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_MULTIUSETERM, "Multi Use Term", 75, 198, _
                                185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_POINTERTOPBWRAPPER, "Pointer To " + _
                                "pbWrapper", 75, 224, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                                OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                                OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_COMMENT, "Comment", 75, 250, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD BUTTON,  hDlg, %IDC_BACK, "<== Back", 24, 290, 70, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                                OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_FORWARD, "Forward ==>", 102, 290, 70, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                                OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_REVIEWTERMSDICTIONARY, "Review Terms " + _
                                "Dictionary", 102, 315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR _
                                %WS_TABSTOP OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR _
                                %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_CREATEDATAFILE, "Create Data File", 25, _
                                315, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                                %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_QUITPROGRAM, "QUIT PROGRAM", 179, 315, _
                                70, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "Loads Rod's Data Files into UDT " + _
                                "array saves to  vb2pbTermData.dat", 25, 10, 220, 25, %WS_CHILD OR _
                                %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL SET COLOR    hDlg, %IDC_LABEL1, %BLUE, -1
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL2, "Input File:", 5, 45, 65, 15
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL3, "Lines Read Record No", 10, 70, _
                                55, 25
                            CONTROL SET COLOR    hDlg, %IDC_LABEL3, %BLUE, -1
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL4, "vbTerm", 10, 125, 60, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL5, "pbTerm available?", 10, 150, 60, _
                                20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL6, "pbTerm", 10, 175, 60, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL7, "Multi Use Term?", 10, 200, 60, _
                                20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL8, "Pointer to pbWrapper", 10, 225, _
                                60, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL9, "Comment", 10, 250, 60, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL10, "Line Cnt Record Cnt", 140, 70, _
                                55, 20
                            CONTROL ADD LINE,    hDlg, %IDC_LINE1, "Line1", 5, 100, 435, 10, _
                                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD LINE,    hDlg, %IDC_LINE2, "Line1", 5, 275, 260, 10, _
                                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD LINE,    hDlg, %IDC_LINE3, "Line3", 265, 275, 10, 70, _
                                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD LINE,    hDlg, %IDC_LINE4, "Line4", 265, 110, 10, 165, _
                                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD LINE,    hDlg, %IDC_LINE5, "Line5", 265, 5, 10, 95, %WS_CHILD _
                                OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX10, "NOTE Even though the second " + _
                                "element is set to no term available(1), if the multiple uses, " + _
                                "fourth element, is set to 1, the PB WORD exists. IF elements 2 AND " + _
                                "4 are set to one the usage of the term will have to be checked. " + _
                                "This can be converted to an include file with a small utility to " + _
                                "place the items in an array of some UDT, I have left it this way. " + _
                                "Rod.", 280, 115, 155, 145, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR _
                                %ES_MULTILINE OR %ES_AUTOVSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE _
                                OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX11, "Example:", 275, 280, 50, 15, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL SET COLOR    hDlg, %IDC_TEXTBOX11, -1, %YELLOW
                            CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX12, _
                                "BEEP"",0,""BEEP"",0,0,""Verbatim usage", 275, 300, 170, 15, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL SET COLOR    hDlg, %IDC_TEXTBOX12, -1, %YELLOW
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL11, "%pbTermAvailable = 0", 280, 20, _
                                115, 15
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL12, "%pbTermNotAvailable = 1", 280, _
                                40, 135, 15
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL13, "%NotMultiUseTerm = 0", 280, 60, _
                                115, 15
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL14, "%MultiUseTerm = 1", 280, 80, _
                                115, 15
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL15, "Item 2 and 4 Equates", 280, 5, _
                                155, 10
                            CONTROL SET COLOR    hDlg, %IDC_LABEL15, -1, %YELLOW
                            CONTROL ADD BUTTON,  hDlg, %IDC_EXITFILEREVIEW, "EXIT FILE REVIEW", 180, _
                                290, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP _
                                OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR _
                                %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                        
                            hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
                                %ANSI_CHARSET)
                            hFont2 = PBFormsMakeFont("Courier New", 8, 400, %FALSE, %FALSE, %FALSE, _
                                %ANSI_CHARSET)
                        
                            DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_INPUTFILEPATHNAME, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LINESREAD, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LINECOUNT, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_VBTERM, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_PBTERMAVAILABLE, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_PBTERM, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_MULTIUSETERM, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_POINTERTOPBWRAPPER, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_COMMENT, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_BACK, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_FORWARD, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_REVIEWTERMSDICTIONARY, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_CREATEDATAFILE, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_QUITPROGRAM, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL1, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL2, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL3, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL4, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL5, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL6, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL7, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL8, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL9, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL10, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LINE1, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LINE2, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LINE3, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LINE4, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LINE5, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_TEXTBOX10, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_TEXTBOX11, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_TEXTBOX12, %WM_SETFONT, hFont2, 0
                            CONTROL SEND hDlg, %IDC_LABEL11, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL12, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL13, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL14, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_LABEL15, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EXITFILEREVIEW, %WM_SETFONT, hFont1, 0
                        #PBFORMS END DIALOG
                        
                            DIALOG SHOW MODAL hDlg, CALL ShowDataLoadToolProc TO lRslt
                        
                        #PBFORMS BEGIN CLEANUP %IDD_DataLoadTool
                            DeleteObject hFont1
                            DeleteObject hFont2
                        #PBFORMS END CLEANUP
                        
                            FUNCTION = lRslt
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        
                        FUNCTION ShowPBREFTOOLFORVB6(BYVAL hParent AS DWORD) AS LONG
                             LOCAL lRslt  AS LONG
                        
                        #PBFORMS BEGIN DIALOG %IDD_PBREFTOOLFORVB6->->
                            LOCAL hDlg   AS DWORD
                            LOCAL hFont1 AS DWORD
                        
                            DIALOG NEW hParent, "PB Reference Tool for VB Terms", 115, 159, 494, 322, _
                                %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
                                %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
                                OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CLIENTEDGE _
                                OR %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE OR %WS_EX_CONTROLPARENT OR _
                                %WS_EX_APPWINDOW OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                %WS_EX_RIGHTSCROLLBAR, TO hDlg
                            CONTROL ADD TEXTBOX, hDlg, %IDC_ENTERVB6TERM, "", 70, 45, 190, 15, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL, _
                                %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                %WS_EX_RIGHTSCROLLBAR
                            CONTROL SET COLOR    hDlg, %IDC_ENTERVB6TERM, %BLUE, %YELLOW
                            CONTROL ADD BUTTON,  hDlg, %IDC_FINDPOWERBASICEQUIVALENT, "Find PB Term", _
                                5, 85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT _
                                OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_REVIEWDICTIONARY, "Review Dictionary", _
                                100, 85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT _
                                OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_EXITFILEREVIEW, "EXIT FILE REVIEW", 195, _
                                85, 70, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP _
                                OR %BS_TEXT OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR _
                                %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_QUITPROGRAM, "QUIT", 5, 295, 55, 20
                            CONTROL ADD TEXTBOX, hDlg, %IDC_AdvanceIncrement, "1", 105, 300, 60, 15, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY OR %ES_NUMBER, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD "msctls_updown32", hDlg, %IDC_IncrementSpinner, _
                                "msctls_updown32_2", 165, 295, 12, 20, %WS_CHILD OR %WS_VISIBLE OR _
                                %UDS_WRAP OR %UDS_SETBUDDYINT OR %UDS_ALIGNRIGHT OR %UDS_AUTOBUDDY
                            CONTROL ADD BUTTON,  hDlg, %IDC_BACK, "<== Back", 180, 295, 45, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                                OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_FORWARD, "Forward ==>", 225, 295, 50, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT _
                                OR %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_ENTEREDITMODE, "Enter Edit Mode", 295, _
                                40, 90, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR _
                                %BS_MULTILINE OR %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING
                            CONTROL ADD BUTTON,  hDlg, %IDC_ADDNEWTERMMANUALLY, "Add New Term " + _
                                "Manually", 395, 40, 90, 20, %WS_CHILD OR %WS_VISIBLE OR _
                                %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT OR %BS_MULTILINE OR _
                                %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING
                            CONTROL ADD TEXTBOX, hDlg, %IDC_EditVBTerm, "", 290, 120, 200, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                                %ES_AUTOVSCROLL, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_EditPBTermAvailable, "", 290, 146, 200, _
                                20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_READONLY, _
                                %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_EditPBTerm, "", 290, 172, 200, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT, %WS_EX_CLIENTEDGE OR _
                                %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_EditMultiUseTerm, "", 290, 198, 200, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_READONLY, _
                                %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_EditPointerToPBWrapper, "", 290, 224, _
                                200, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_NUMBER, _
                                %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_EditComment, "", 290, 250, 200, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_MULTILINE OR _
                                %ES_AUTOVSCROLL, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD BUTTON,  hDlg, %IDC_POSTEDITSTODICTIONARY, "Post Edits to " + _
                                "Dictionary", 345, 285, 85, 20, %WS_CHILD OR %WS_VISIBLE OR _
                                %WS_DISABLED OR %WS_TABSTOP OR %BS_TEXT OR %BS_MULTILINE OR _
                                %BS_PUSHBUTTON OR %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING
                            CONTROL ADD TEXTBOX, hDlg, %IDC_VBTERM, "vbTerm", 75, 120, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERMAVAILABLE, "", 75, 146, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_PBTERM, "pbTerm", 75, 172, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_MULTIUSETERM, "", 75, 198, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_POINTERTOPBWRAPPER, "Pointer To " + _
                                "pbWrapper", 75, 224, 185, 20, %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT _
                                OR %ES_AUTOHSCROLL OR %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT _
                                OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD TEXTBOX, hDlg, %IDC_COMMENT, "Comment", 75, 250, 185, 20, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL OR _
                                %ES_READONLY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                                OR %WS_EX_RIGHTSCROLLBAR
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "VB6 to PowerBASIC Reference Tool " + _
                                "        from                                    the vb2pb Open " + _
                                "Source Converter Project", 25, 5, 220, 35
                            CONTROL ADD LABEL,   hDlg, %IDC_lblVB6SearchTerm, "VB6 Term:", 5, 45, 65, _
                                15
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL4, "vbTerm", 10, 125, 60, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL5, "pbTerm available?", 10, 150, 60, _
                                20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL6, "pbTerm", 10, 175, 60, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL7, "Multi Use Term?", 10, 200, 60, _
                                20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL8, "Pointer to pbWrapper", 10, 225, _
                                60, 20
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL9, "Comment", 10, 250, 60, 20
                            CONTROL ADD LINE,    hDlg, %IDC_LINE1, "Line1", 0, 65, 275, 10, %WS_CHILD _
                                OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD LINE,    hDlg, %IDC_LINE2, "Line1", 0, 275, 275, 10, _
                                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD LINE,    hDlg, %IDC_LINE3, "Line3", 275, 0, 10, 320, _
                                %WS_CHILD OR %WS_VISIBLE OR %SS_GRAYRECT
                            CONTROL ADD LABEL,   hDlg, %IDC_EDITORSTATUS, "Editor Status", 340, 70, _
                                90, 20, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR _
                                %WS_EX_LTRREADING
                            CONTROL ADD LABEL,   hDlg, %IDC_ACTIVEVB6TERM, "Active VB6 Term", 295, _
                                95, 55, 20
                            CONTROL ADD TEXTBOX, hDlg, %IDC_ActiveVBTerm, "", 355, 95, 120, 15, _
                                %WS_CHILD OR %WS_VISIBLE OR %ES_LEFT OR %ES_AUTOHSCROLL, _
                                %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                                %WS_EX_RIGHTSCROLLBAR
                            CONTROL SET COLOR    hDlg, %IDC_ActiveVBTerm, %BLUE, %YELLOW
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL3, "Click on Enter Edit Mode to edit " + _
                                "active record or Search Mode to find a specific record", 295, 5, _
                                180, 30
                            CONTROL ADD LABEL,   hDlg, %IDC_LABEL10, "Increment", 105, 290, 50, 10
                        
                            hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
                                %ANSI_CHARSET)
                        
                            DIALOG  SEND hDlg, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_ENTERVB6TERM, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_FINDPOWERBASICEQUIVALENT, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_REVIEWDICTIONARY, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_AdvanceIncrement, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_IncrementSpinner, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_ENTEREDITMODE, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_ADDNEWTERMMANUALLY, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EditVBTerm, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EditPBTermAvailable, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EditPBTerm, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EditMultiUseTerm, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EditPointerToPBWrapper, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EditComment, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_POSTEDITSTODICTIONARY, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_lblVB6SearchTerm, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_EDITORSTATUS, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_ACTIVEVB6TERM, %WM_SETFONT, hFont1, 0
                            CONTROL SEND hDlg, %IDC_ActiveVBTerm, %WM_SETFONT, hFont1, 0
                        #PBFORMS END DIALOG
                        
                             DIALOG SHOW MODAL hDlg, CALL ShowPBREFTOOLFORVB6Proc TO lRslt
                        
                        #PBFORMS BEGIN CLEANUP %IDD_PBREFTOOLFORVB6
                            DeleteObject hFont1
                        #PBFORMS END CLEANUP
                        
                             FUNCTION = lRslt
                        END FUNCTION
                        '------------------------------------------------------------------------------
                        Do not go quiet into that good night,
                        ... Rage, rage against the dark.

                        Comment


                        • #13
                          Dictionary added to SVN

                          Originally posted by StanHelton View Post
                          This tool combines the functions of the TermData tool and the DictionaryEditor tool into one application.
                          I've added the dictionary code to SVN.

                          Comment


                          • #14
                            WIP -- all the stuff I have coded as of today

                            There's a FileList.txt in the zip. Look at that first, please. All of these are incomplete, but they all compile in PB8 and PB9.

                            Some folks tell me my code is too verbose. Upside is I never have any trouble understanding my old code.
                            Attached Files
                            Do not go quiet into that good night,
                            ... Rage, rage against the dark.

                            Comment


                            • #15
                              Stan,

                              Took a look at your code, I'm still trying to get my head around your effort and understand what you are doing, when you are doing it, and why you did what you did?

                              BTW, I like your coding style, verbose comments are always welcome from my perspective.

                              A design question at this point needs to be considered. Will we be running the Tokenizer from the Scintilla editor, or the editor from the Tokenizer? This will affect how the two pieces of code will co-exist with each other, but IMHO we need to determine which aspect of the converter is to have primary focus, editor, or Tokenizer?

                              From my experience with my Firefly app it makes more sense to me to run Tokenizer from the editor, but that's just my opinion, I'm open either way. In my conversion of the editor to DDT I just assumed that we would run the Tokenizer from the editor and set up my code to reflect this scenario, but if this is not the case then I should probably not code anymore until this issue is resolved.

                              But I still plan on playing some more with my new toys.
                              Later...

                              JR

                              "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                              Comment


                              • #16
                                Originally posted by John R. Heathcote View Post
                                ...
                                BTW, I like your coding style, verbose comments are always welcome from my perspective.
                                Thank you. At first I thought I might be a little over the top, but then I decided, what the heck, I'll just do it the way I always do it.

                                A design question at this point needs to be considered. Will we be running the Tokenizer from the Scintilla editor, or the editor from the Tokenizer? This will affect how the two pieces of code will co-exist with each other, but IMHO we need to determine which aspect of the converter is to have primary focus, editor, or Tokenizer?
                                Everything in my code is designed to run from the Tokenizer. But I'm open to ideas and discussion. I set it up this way before you showed me how Scintilla works.

                                Enjoy the new toy! I'm still experimenting. It's a blast!
                                Do not go quiet into that good night,
                                ... Rage, rage against the dark.

                                Comment


                                • #17
                                  toys
                                  toy!
                                  It's a blast!
                                  Maybe I should see if I can change my order.

                                  I'm still experimenting.
                                  From the sounds of things I'm gonna be still experimenting when PB 10 gets released.
                                  Rod
                                  I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

                                  Comment


                                  • #18
                                    Stan,

                                    At first I thought I might be a little over the top, but then I decided, what the heck, I'll just do it the way I always do it.
                                    Personally, I would rather have too many comments verses not enough. I find with lack of comments one tends to skip over critical sections of code that really deserve your attention. If comments are provided one can glean the intent of the code and make an informed decision as to what is important or not. But that's just me.

                                    Everything in my code is designed to run from the Tokenizer...
                                    We need to decide if we intend to support a limited source code editor or not. I think I have most of the framework built for such an editor, but I would need to know how we intend to utilize it, or not, in order to proceed with further coding.

                                    ...But I'm open to ideas and discussion.
                                    Thanks.

                                    I set it up this way before you showed me how Scintilla works.
                                    Well, it was not my intention to throw a spanner in the works (as the British would say), but I think there are some advantages of supporting our own code editor, at least for the purpose of source code conversion. Immediate integration is one advantage, we would be afforded the opportunity to customize the editor for the purpose of extending conversion capabilities as another advantage.

                                    As always, if the group is not for this concept I'm ok with that too.

                                    Enjoy the new toy!
                                    I am.
                                    Later...

                                    JR

                                    "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                                    Comment


                                    • #19
                                      Originally posted by John R. Heathcote View Post
                                      ...
                                      Well, it was not my intention to throw a spanner in the works (as the British would say), but I think there are some advantages of supporting our own code editor, at least for the purpose of source code conversion. Immediate integration is one advantage, we would be afforded the opportunity to customize the editor for the purpose of extending conversion capabilities as another advantage.
                                      ...
                                      Somewhere in all that code I set up a string to pass to an edit window for read only VB and line edit PB, but I haven't implemented the editor. I know we're backwards to each other on which way to go with this. How much trouble would it be to run the Tokenizer and Scintilla in parallel and pass strings back and forth? I think I'm talking about making the Tokenizer a COM server to the editor. There should be a way to let the editor drive this part of the operation. Just a concept at this point.
                                      Do not go quiet into that good night,
                                      ... Rage, rage against the dark.

                                      Comment


                                      • #20
                                        Stan,

                                        Somewhere in all that code I set up a string to pass to an edit window for read only VB and line edit PB, but I haven't implemented the editor.
                                        A perfect opportunity for discussion IMO.

                                        I know we're backwards to each other on which way to go with this.
                                        Not really. I think we both want to get the job done in the most efficient manner possible. You are looking at the conversion issue from the perspective of the Tokenizer, I'm looking at the same issue from the editor perspective. Somewhere between our two positions lies the answer. You know the capabilities of the Tokenizer, so I won't presume to speak for you in that regard. I will briefly outline some of the advantages I think are important for conversion from the editor perspective.
                                        1. File management could be handled from the editor.
                                        2. Allows user to clean up, reformat, generate reports via OBNOXIOUS COMMENTS, or otherwise simplify source code lines prior to conversion.
                                        3. Would allow Tokenizer code to concentrate on converter setups and actual VB code conversion(s).
                                        4. Offers more flexibility for the user to input code to the Tokenizer, line by line, from a selection, via book marks, procedure by procedure, file by file, or a combination of any of the aforementioned input methods.
                                        5. Offers the user the ability to watch conversion(s) as they happen.
                                        6. Any conversion performed by the Tokenizer is written to the editor control for user review before changes are written out to disk.

                                        Personally, I think the ability to view conversion changes as they happen in addition to flexibility are two major reasons I opt for the editor solution. I like the visual feedback (reassurance?) aspect of this process.

                                        When I was designing highways for a living I must have used nearly every civil design earthwork package out there to perform my job. The software that allowed me to provided the best roadway design was also the most flexible in its implementation and use. This flexibility allowed me to optimize my design from the point of safety and driveability and cost containment. This software was also the one that was command driven, originally written in the early to mid 70's.

                                        Although we are talking about programming language conversion here I think the points about the design earthwork software are applicable in this instance too.

                                        How much trouble would it be to run the Tokenizer and Scintilla in parallel and pass strings back and forth?
                                        This is very doable, the issue is which processing scenario would be most efficient and flexible for the user?

                                        A equally brief outline how running the Tokenizer inside of the editor would work:
                                        1. Load file/project into editor.
                                        2. If multiple files loaded autoselect VB starting procedure/form.
                                        3. Set Scintilla cursor location to user pick, default at line 1.
                                        4. Select conversion setups/level from Tokenizer dialog, I think which you already have built, most of it anyway.
                                        5. Set conversion controls, CCL, book marks etc.
                                        6. Start conversion.
                                        7. Read Scintilla editor text line by line and pass to Tokenizer. Certain conversion which requires a read ahead buffer can be handled too. Scintilla allows you to read an individual character, line, group of lines, entire editor contents if you want to.
                                        8. Text passed to Tokenizer for conversion.
                                        9. Tokenizer returns converted line, along with a status if the line were converted or not.
                                        10. If line converted, update Scintilla edit control.
                                        11. If not at EOF goto 7
                                        12. EOF - DONE!

                                        Although the actual conversion would be a little more complicated than this, the basic process would be the same. In the case where the read ahead buffer must be employed for conversion it is a simple matter to keep track of the lines that we read from the edit control, convert, then write a block of text back out to the editor control. Easy to do. If you look at some of the OBNOXIOUS COMMENT reports, and the code to do this you can get some idea of the simplicity involved.

                                        The beauty of this process is you have the flexibility to replace one text line with one converted line, one text line with many conversion lines, or many text lines with one conversion line. The Scintilla control takes care of the text insertion, all we have to do is keep track of where the text is to be inserted.

                                        I think I'm talking about making the Tokenizer a COM server to the editor. There should be a way to let the editor drive this part of the operation. Just a concept at this point.
                                        Sounds to me we are talking the same language here, and we don't need to convert. :laugh:

                                        Sorry about the length of this post, there was a lot to talk about, besides when I get on a roll...
                                        Later...

                                        JR

                                        "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                                        Comment

                                        Working...
                                        X