xFns.DCount(Instring, Delimiter) End Function Public Function Field(ByRef sString As Object, ByRef sDelimiter As Object, ByRef nSegmentNumber As Object) As String Field = PxFns.Field(sString, sDelimiter, nSegmentNumber) End Function Public Function Index(ByRef s As Object, ByRef sFind As Object, ByRef nOccur As Object) As Integer Index = PxFns.Index(s, sFind, nOccur) End Function Public Function Alpha(ByRef s As Object) As Boolean Alpha = PxFns.Alpha(s) End Function Public Function Extract(ByRef s As Object, ByRef nAttrib As Object, Optional ByRef nValue As Object = 0, Optional ByRef nSubvalue As Object = 0) As Object Extract = PxFns.Extract(s, nAttrib, nValue, nSubvalue) End Function Public Function RReplace(ByRef s As Object, ByRef i254 As Object, ByRef a As Object, Optional ByRef b As Object = Nothing, Optional ByRef c As Object = Nothing) As String If i254 = 0 Then 'UPGRADE_WARNING: Couldn't resolve default property of object i254. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm i254 = 1 End If 'UPGRADE_NOTE: IsMissing(c) was changed to IsNothing(c). 'UPGRADE_NOTE: IsMissing(b) was changed to IsNothing(b). If IsNothing(b) Then RReplace = PxFns.RReplace(s, i254, a) ElseIf IsNothing(c) Then RReplace = PxFns.RReplace(s, i254, a, b) Else RReplace = PxFns.RReplace(s, i254, a, b, c) End If End Function Public Function Dylete(ByRef s As Object, ByRef i254 As Object, Optional ByRef a As Object = Nothing, Optional ByRef b As Object = Nothing) As String 'UPGRADE_NOTE: IsMissing(b) was changed to IsNothing(b). 'UPGRADE_NOTE: IsMissing(a) was changed to IsNothing(a). If IsNothing(a) Then Dylete = PxFns.Dylete(s, i254) ElseIf IsNothing(b) Then Dylete = PxFns.Dylete(s, i254, a) Else Dylete = PxFns.Dylete(s, i254, a, b) End If End Function Public Function Insert(ByRef s As Object, ByRef i254 As Object, ByRef a As Object, Optional ByRef b As Object = Nothing, Optional ByRef c As Object = Nothing) As String 'UPGRADE_NOTE: IsMissing(c) was changed to IsNothing(c). 'UPGRADE_NOTE: IsMissing(b) was changed to IsNothing(b). If IsNothing(b) Then Insert = PxFns.Insert(s, i254, a) ElseIf IsNothing(c) Then Insert = PxFns.Insert(s, i254, a, b) Else 'UPGRADE_WARNING: Couldn't resolve default property of object i254. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Insert = PxFns.Insert(s, i254, a, b, c) End If End Function 'UPGRADE_WARNING: ParamArray d was changed from ByRef to ByVal. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1003.htm Public Function Locate(ByRef sFind As Object, ByRef sSep As Object, ByRef sStringIn As Object, ParamArray ByVal d() As Object) As Boolean Select Case UBound(d) Case 0 'UPGRADE_WARNING: Couldn't resolve default property of object sStringIn. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sSep. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sFind. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Locate = PxFns.Locate(sFind, sSep, sStringIn, d(0)) Case 1 'UPGRADE_WARNING: Couldn't resolve default property of object sStringIn. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sSep. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sFind. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Locate = PxFns.Locate(sFind, sSep, sStringIn, d(0), d(1)) Case 2 'UPGRADE_WARNING: Couldn't resolve default property of object sStringIn. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sSep. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sFind. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Locate = PxFns.Locate(sFind, sSep, sStringIn, d(0), d(1), d(2)) Case 3 'UPGRADE_WARNING: Couldn't resolve default property of object sStringIn. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sSep. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sFind. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Locate = PxFns.Locate(sFind, sSep, sStringIn, d(0), d(1), d(2), d(3)) Case 4 'UPGRADE_WARNING: Couldn't resolve default property of object sStringIn. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sSep. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object sFind. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Locate = PxFns.Locate(sFind, sSep, sStringIn, d(0), d(1), d(2), d(3), d(4)) End Select End Function Public Function Col1() As Integer Col1 = PxFns.Col1 End Function Public Function Col2() As Integer Col2 = PxFns.Col2 End Function Public Function Num(ByVal s As String) As Object Dim b As Boolean If s = "" Then b = True Else b = IsNumeric(s) End If If b = True Then Num = 1 Else Num = 0 End Function Public Function MMod(ByRef Dividend As Object, ByRef Divisor As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object Divisor. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object Dividend. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Mod has a new behavior. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1041.htm MMod = Val(Dividend) Mod Val(Divisor) End Function Public Function NNot(ByRef arg As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object arg. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object PxFns.NNot(arg). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm NNot = PxFns.NNot(arg) End Function Public Function RRnd(ByRef n As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object n. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm n = Val(n) 'UPGRADE_WARNING: Couldn't resolve default property of object n. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm RRnd = Int(Rnd() * (n + 0.99)) End Function Public Function SStr(ByRef s As Object, ByRef n As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object n. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm SStr = PxFns.SStr(s, n) End Function Public Function Seq(ByRef s As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Seq = PxFns.Seq(s) End Function Public Function IConv(ByRef s As Object, ByRef sProcessCode As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object sProcessCode. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object PxFns.IConv(s, sProcessCode). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm IConv = PxFns.IConv(s, sProcessCode) End Function Public Function OConv(ByRef s As Object, ByRef sProcessCode As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object sProcessCode. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object PxFns.OConv(s, sProcessCode). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm OConv = PxFns.OConv(s, sProcessCode) End Function Public Function Fmt(ByRef s As Object, ByRef sCode As Object) As String 'UPGRADE_WARNING: Couldn't resolve default property of object sCode. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Fmt = PxFns.Fmt(s, sCode) End Function Public Function Matches(ByRef s As Object, ByRef ProcessCode As Object) As Boolean 'UPGRADE_WARNING: Couldn't resolve default property of object ProcessCode. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm Matches = PxFns.Matches(s, ProcessCode) End Function Public Function MCBool(ByRef arg As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object arg. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm MCBool = PxFns.MCBool(arg) End Function Public Function MVBool(ByRef Arg1 As Object, ByRef Op As Object, ByRef Arg2 As Object) As Object 'UPGRADE_WARNING: Couldn't resolve default property of object Arg2. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object Op. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object Arg1. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object PxFns.MVBool(Arg1, Op, Arg2). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm MVBool = PxFns.MVBool(Arg1, Op, Arg2) End Function '991227 JPC MV functions as Access/VB helpers Public Function MVR(ByRef s As Object) As String '991228 JPC handle null 'UPGRADE_WARNING: Use of Null/IsNull() detected. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1049.htm If IsDbNull(s) Then Exit Function MVR = PxFns.MVR(s) End Function Public Function MVW(ByRef s As Object) As String MVW = PxFns.MVW(s) End Function Public Function MVOConv(ByRef s As Object, ByRef sProcessCode As Object) As String 'UPGRADE_WARNING: Couldn't resolve default property of object sProcessCode. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm MVOConv = PxFns.MVOConv(s, sProcessCode) End Function Public Function MVIConv(ByRef s As Object, ByRef sProcessCode As Object) As String 'UPGRADE_WARNING: Couldn't resolve default property of object sProcessCode. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm MVIConv = PxFns.MVIConv(s, sProcessCode) End Function End ModuleOption Strict Off Option Explicit On Imports Microsoft.VisualBasic Imports System.Text Module basPxLibAdd Public gsProcBuffer1 As String ' Public Function CORRELATIVE_EVAL(ByVal sQVal As String, ByRef sProcessCode As String, ByRef sdItem As String, ByRef sId As String, ByRef sFV As String) As Object '-- your custom correlative handlers go into the CASE block of this routine Dim i, j As Integer Dim sResult, sResponse As String Dim sProcesscodeIndividual As String Dim sQValMV, s As String Dim saC() As String Dim nMV As Integer '020227 evening JPC 'Is this a multiple-processingCode ? If InStr(sProcessCode, Chr(253)) Then 'UPGRADE_WARNING: Couldn't resolve default property of object DCount(sProcessCode, Chr(253)). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm For i = 1 To DCount(sProcessCode, Chr(253)) sProcesscodeIndividual = Field(sProcessCode, Chr(253), i) 'UPGRADE_WARNING: Couldn't resolve default property of object CORRELATIVE_EVAL(sQVal, sProcesscodeIndividual, sdItem, sId, sFV). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm sQVal = CORRELATIVE_EVAL(sQVal, sProcesscodeIndividual, sdItem, sId, sFV) Next i CORRELATIVE_EVAL = sQVal Exit Function End If 'Apply separately to multivalued data 'UPGRADE_WARNING: Couldn't resolve default property of object DCount(sQVal, Chr(253)). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm nMV = DCount(sQVal, Chr(253)) If nMV = 0 Then nMV = 1 For i = 1 To nMV sQValMV = Field(sQVal, Chr(253), i) Select Case UCase(sProcessCode) 'Custom Cases go here eg "F;33(TORDD;x;4;4);33(TORDD;x;9;9);*;S" which we don't do 'automatically and are not likely to in the near future ' 'These first 2 commented-out Case's are real-life examples from our work. 'Case "A;N(ALINE1):N(ALINE2):N(ALINE3)" ' 'addresses which are single values, we arrange them as 3 lines in 1 column ' sResult = Left(Extract(sdItem, 2), 30) & Chr(253) _ '' & Left$(Extract(sdItem, 3), 30) & Chr(253) & Left$(Extract(sdItem, 4), 30) 'Case "F;33(TORDD;x;4;4);33(TORDD;x;9;9);*;S" ' Call RRead(s, "ordd", Extract(sdItem, 33)) ' sResult = Val(Extract(s, 4)) * Val(Extract(s, 9)) Case Else If Left(sProcessCode, 8) = "CUSTOMA;" Then saC = Split(sProcessCode, ";") sResult = saC(1) For j = 3 To UBound(saC) Step 2 Select Case saC(j - 1) Case "+" : sResult = CStr(Val(sResult) + Val(saC(j))) Case "-" : sResult = CStr(Val(sResult) - Val(saC(j))) Case "*" : sResult = CStr(Val(sResult) * Val(saC(j))) Case "/" : sResult = CStr(Val(sResult) / Val(saC(j))) Case "^" : sResult = CStr(Val(sResult) ^ Val(saC(j))) Case Else : sResult = sResult & Chr(253) & saC(j) End Select Next j Else 'OConv covers string patterns, masks, "g" and "t"(transfer) etc 'so it does give a reasonable hit rate here 'If you get sResult = "####" then you need to write something into 'the custom section above 'UPGRADE_WARNING: Couldn't resolve default property of object OConv(sQValMV, sProcessCode). Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm sResult = OConv(sQValMV, sProcessCode) End If End Select If i = 1 Then sResponse = sResult Else sResponse = sResponse & Chr(253) & sResult End If Next i CORRELATIVE_EVAL = sResponse End Function End ModuleOption Strict Off Option Explicit On Imports Microsoft.VisualBasic Imports System.Text Module basPxLibrary 'Module basPxLibrary - library functions for link to PixieEngine 'TAKE CARE over changing this code. Most areas suitable for VAR-customisation 'are separated out into a companion module "basPxLibAdd" ' 'Create your own separate "bas" modules in which to write your app 'See examples basFBFDemo, basExamples, basExample2 ' 'Copyright (C)2001 Pixie Partners 'PixieWare licencees are granted permission to reuse, copy and 'modify this code under the terms of the Pixie Public License 'ref http://www.pixieware.com/qpl.htm 'In brief: * Retain this notice in this module or modifed versions of it. '* Do not falsely claim credit for authoring this code. '* Inform us of your significant modifications improving functionality 'so they may at our discretion be incorporated for everyone's benefit. ' '020927 JPC Convert from VB6 to VB7 (dotNet) '020830 JPC System(N) '010711 JPC WhoPickFormat '010704 JPC Caching technique '000313 ADR & MYW Merged '991207 JPC, ADR, ADP, MYW Pixie Partners Ltd ' '---------------------------------------------------------- '020425 JPC WebBatch, Phantom, FBF ExecuteQuery '020118 JPC go Public with this variable and base on CHAR(254) '010612 JPC support DATA Public gbWebBatch, gbPhantom As Boolean Public gsMockInput As String '010425 Private msCache() As String Public gsCacheID As String '010326 Public gsDataStore As String '010326 JPC Debug(Log) ALERT and EXIT functions RRead etc if ItemID = "" '010326 JPC Public gbDebugLog As Boolean Public gsAccount As String Public UserPort As interop.pixieengine.Port '000821 JPC PixieEngine 1.1 XCommon, see also Sub BP.CallBack Public XCommon As Scripting.Dictionary Public gsSentence As String Public gsChain As String '011026 JPC replace SelectArray with UserPort.SelectResult 'Public SelectArray As Variant '010328 Private mnSelectResultIndex As Integer Public MatWriteSafety As Boolean Public Sub Debuglog(ByRef s As Object) 'Do Nothing, work out write log file later .. End Sub Public Function WhoPickFormat() As Object 'like "1 john testpxe1" rather than "john*1 testpxe1" Dim s1, s2 As String Dim iPos As Integer s1 = ExecutePS("WHO") iPos = InStr(s1, " ") s2 = Mid(s1, iPos) s1 = Left(s1, iPos - 1) WhoPickFormat = Field(s1, "*", 2) & " " & Field(s1, "*", 1) & s2 End Function 'UPGRADE_WARNING: ParamArray MockInput was changed from ByRef to ByVal. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1003.htm Public Sub DData(ParamArray ByVal MockInput() As Object) Dim s As String s = Join(MockInput, Chr(254)) If gsMockInput = "" Then gsMockInput = s Else gsMockInput = gsMockInput & Chr(13) & s End If End Sub Public Sub DDataClear() gsMockInput = "" End Sub Public Sub SStop(Optional ByVal ErrAddNote1 As Object = "", Optional ByVal ErrAddNote2 As Object = "") '020130 JPC ErrAddNote, usually '201' Dim sErrMsg As String sErrMsg = "SSTOP" If ErrAddNote1 > "" Then sErrMsg = sErrMsg & " " & ErrAddNote2 End If If ErrAddNote2 > "" Then sErrMsg = sErrMsg & ", " & ErrAddNote2 & "," End If sErrMsg = sErrMsg & " in VAR app for return to TCL" 'UPGRADE_NOTE: Object UserPort may not be destroyed until it is garbage collected. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1029.htm 'JOHN's NOTE, UserPort is a COM object accessed via COM INTEROP so this warning is probably not relevant. UserPort = Nothing Err.Raise(900, , sErrMsg) End Sub Public Sub Continue() ' DO NOTHING JUST CONTINUE "NULL" End Sub Public Function COUNT(ByRef Instring As Object, ByRef Delimiter As Object) As Object COUNT = DCount(Instring, Delimiter) - 1 End Function Public Function Sentence() As Object Sentence = gsSentence End Function Public Sub TCLRead(ByRef s As Object) s = gsSentence End Sub Public Sub IInput(ByRef s As Object, Optional ByVal a1 As Object = Nothing, Optional ByVal a2 As Object = Nothing) Dim iType As Short Dim sA1Trim As String Dim iPos As Integer ' '010612 JPC special to support legacy DATA calls as DData If gsMockInput > "" Then iPos = InStr(gsMockInput, Chr(254)) If iPos > 0 Then 'UPGRADE_WARNING: Couldn't resolve default property of object s. Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup1037.htm s = Left(g