Sage 100

 View Only
  • 1.  Help finding a Visual Integrator function

    Posted 02-15-2019 20:39

    Does anyone know how to tell VI to look at the right 6 characters of a field?

    For example ---
    The source file has the following values
    AI000002483
    RIN000005123

    And I want to bring in the right 6 characters of the source field:
    002483
    005123

    Currently, I have the starting position and length set, but that only works if the field length is consistent.  However, the source field is not always consistently the same length.  I am currently getting the following results:
    002483
    000512

    Does anyone know of a function in Visual Integrator that would accomplish this task?



    ------------------------------
    Dan Isaacson
    Bennett/Porter & Associates, Inc.
    ------------------------------


  • 2.  RE: Help finding a Visual Integrator function
    Best Answer

    Posted 02-15-2019 20:46
    MID(string$,offset[,len][,ERR=stmtref])
     
    Where:

    len
       Length of the substring.
    offset
       Starting position of the substring. Numeric expression, integer. If the integer is negative, the offset is taken from the end of the string.
    stmtref
       Program line number or statement label to which to transfer control.
    string$
       String expression whose hash value is to be returned.
    Returns
       Extracted portion of string (similar to substring).

    Description
    Use the MID( ) function to extract a portion of a string. Using this function is similar to using a substring except that it can be used directly with the return value of a function, variable or expression:

    IF MID(MSE,22,1)>$00$ AND MID(MSE,22,1)<$FF$ THEN %WDX$="[WDX]"
    In addition, if the offset is negative, PxPlus uses it as an offset from the end of the string. For example, MID(X$,-1) is the last character of X$. If the length is negative, then PxPlus uses it as the number of characters preceding the offset. That is, MID("ABCD",-1,-1) returns C (the first character preceding the last character) and MID("abcde",-2,-4) yields abc.

    By default, if this function is passed an invalid offset, it returns a null string. If passed an invalid length, then it returns the rest of the string.

    Example
    F_KSZ=DEC($00$+MID(FID(0),11,1))

    ------------------------------
    Bill Pfahnl
    Nims & Associates
    ------------------------------



  • 3.  RE: Help finding a Visual Integrator function

    Posted 02-15-2019 20:53
    Thank you Bill for the quick response.

    ------------------------------
    Dan Isaacson
    Bennett Porter
    ------------------------------



  • 4.  RE: Help finding a Visual Integrator function

    Posted 02-15-2019 21:01
    Something like mid(imp$[2] , len(imp$[2])-4,5). Doing this from a bar on my iPhone so ....

    You may need to play with the numbers and syntax and I’m sure there are other (better) ways to do this

    Jeff

    Sent from my iPhone

    ------Original Message------

    Does anyone know how to tell VI to look at the right 6 characters of a field?

    For example ---
    The source file has the following values
    AI000002483
    RIN000005123

    And I want to bring in the right 6 characters of the source field:
    002483
    005123

    Currently, I have the starting position and length set, but that only works if the field length is consistent.  However, the source field is not always consistently the same length.  I am currently getting the following results:
    002483
    000512

    Does anyone know of a function in Visual Integrator that would accomplish this task?



    ------------------------------
    Dan Isaacson
    Bennett/Porter & Associates, Inc.
    ------------------------------


  • 5.  RE: Help finding a Visual Integrator function

    Posted 02-15-2019 23:10
    Another way: MID(IMP$[x], - 6)

    Replace x with the column number in source file. But if it's in a Temp field then Temp00x$ instead of IMP$[x]

    ---------------------------------
    Alnoor Cassim

    Free Agent Developer and Consultant
    CallForHelp.biz
    Email: alnoor@callforhelp.biz
    Orange County, CA
    ---------------------------------





  • 6.  RE: Help finding a Visual Integrator function

    Posted 02-18-2019 16:30
    Thank you Jeff and Alnoor for your input.

    ------------------------------
    Dan Isaacson
    Bennett Porter
    ------------------------------