Attribute VB_Name = "ResultInterpreter" Option Explicit Global strCurrSelection As String Function Get_Word(strText As String, intWordNum As Integer) As Variant Dim intI As Integer Dim intSpc As Integer Dim blnMatch As Boolean intSpc = 1 blnMatch = False Get_Word = -1 If Len(strText) = 0 Then Exit Function For intI = 1 To Len(strText) If intWordNum = intSpc Then If Not blnMatch Then Get_Word = "" blnMatch = True Get_Word = Get_Word & Mid(strText, intI, 1) ElseIf intSpc > intWordNum Then Exit Function End If If Mid(strText, intI, 1) = " " Then intSpc = intSpc + 1 End If Next intI End Function Function Parse_It(intNumChunk As Integer, strText As String) As Variant Dim intI As Integer Dim intC As Integer Dim intPos As Integer Dim blnTail As Boolean Dim blnHead As Boolean Dim intBarNum As Integer blnTail = False blnHead = False Parse_It = -1 intBarNum = 0 If Len(strText) = 0 Then Exit Function For intI = 1 To Len(strText) If Mid(strText, intI, 1) = "|" Then If Not blnHead Then blnHead = True intBarNum = intBarNum + 1 Else blnHead = False blnTail = True End If End If If intNumChunk = intBarNum Then intPos = InStr(intI + 1, strText, "|") Parse_It = Mid(strText, intPos + 1, Len(strText) - intPos) strCurrSelection = Mid(strText, intI + 1, intPos - (intI + 1)) Exit Function End If Next intI End Function Sub Interpret_Keyword(strKeyWord As Variant, isProfile As Boolean) Dim varVal As Variant Dim intRow As Integer Dim intCol As Integer Dim intAtSignPos As Integer Dim intEqualPos As Integer Dim intDotPos As Integer Dim strFormType As String '**** if profile then ' |F@1.2=data| where F=raw formtype ' else ' |1.2=data| If Len(strKeyWord) > 0 Then intDotPos = InStr(strKeyWord, ".") intEqualPos = InStr(strKeyWord, "=") If Not isProfile Then intRow = Val(Mid(strKeyWord, 1, intDotPos - 1)) intCol = Val(Mid(strKeyWord, intDotPos + 1, intEqualPos - (intDotPos + 1))) Else intAtSignPos = InStr(strKeyWord, "@") strFormType = Mid(strKeyWord, 1, intAtSignPos - 1) intRow = Val(Mid(strKeyWord, intAtSignPos + 1, intDotPos - (intAtSignPos + 1))) intCol = Val(Mid(strKeyWord, intDotPos + 1, intEqualPos - (intDotPos + 1))) End If varVal = Mid(strKeyWord, intEqualPos + 1, Len(strKeyWord) - intEqualPos) End If End Sub Function Interpret_Exam(isProfile As Boolean, strText As String) As Boolean Dim intChunkNum As Integer Dim varResult As Variant Dim intWordNum As Integer Dim intI As Integer Interpret_Exam = True varResult = 0 intChunkNum = 1 Do While varResult <> -1 varResult = Parse_It(intChunkNum, strText) If varResult = -1 Then Exit Do strText = varResult 'MsgBox "About to Interpret Chunk: " & strCurrSelection varResult = 0 intWordNum = 1 '**** Interpret varResult variable ******* 'MsgBox "About to Interpret Word No.> " & intWordNum & ") [" & strCurrSelection & "]..." Interpret_Keyword strCurrSelection, isProfile intWordNum = intWordNum + 1 varResult = 0 Loop End Function