Results 1 to 10 of 10

Thread: JDE Object Browser and concatenating mismatched strings

  1. #1
    Member
    Join Date
    Nov 2000
    Location
    Denver, Colorado
    Posts
    629

    JDE Object Browser and concatenating mismatched strings

    Hi Gurus,

    I have been using JDE Object Browser to test functions to vet them for use in an NER.

    I have the need to take "'' (double-double quotes), and other variations, out of an interface flat file string. I have tested the functions "Is String In String" (B0500690) and "Replace String In String" (B0500725) in JDE Object Browser with full success. However, when I go to insert this logic in an NER, I get the compiler error:

    N55AVON.c
    C:\E920\DV920\source\N55AVON.c(182) : error C2308: concatenating mismatched strings
    Concatenating wide "" with narrow ""
    jdertdll.c

    Any thoughts on how I can do this logic? - I'm guessing I'll have to write it in C.....
    How has that cleric Craig Welton managed to NOT have errors from this?

    Thanks In Advance,
    Ben again

    Currently working in:
    E920 Tools Release: 9.2.2.5

  2. #2
    Senior Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    1,003
    Hi Ben,

    The problem appears to be how the NER code generator is working, i.e. creating the C source. Have you reviewed the N55AVON.c source file? Maybe the quotes need to be escaped? like "

    Craig
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace, NERDup and BusBuild+ Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  3. #3
    Senior Member Larry_Jones's Avatar
    Join Date
    Nov 2000
    Location
    Spokane, WA, USA
    Posts
    3,240
    Use the Hex equivalents - try B46R0210
    Larry Jones
    E1 9.2 - TR 9.2.2.6 on Win 2016 R2. SQL Server 2016
    Wintel, BI Publisher

  4. #4
    Member
    Join Date
    Nov 2000
    Location
    Denver, Colorado
    Posts
    629
    Hi Craig,

    Not sure what you are suggesting. Are you suggesting passing in "" or something like that? I just tried setting a string to just that and get the compile error. So the compile error is just in the setting of the string.

    I even tried setting the string to just " and compiled to get:
    N55AVON.c
    C:\E920\DV920\source\N55AVON.c(147) : error C2001: newline in constant
    C:\E920\DV920\source\N55AVON.c(147) : fatal error C1057: unexpected end of file in macro expansion
    jdertdll.c

    Regards,
    Ben again,

  5. #5
    Member
    Join Date
    Nov 2000
    Location
    Denver, Colorado
    Posts
    629
    Hi Larry,

    I've looked at this function, and are you suggesting that in an NER, I can pass in a hex value into either of the functions "Is String In String" (B0500690) or "Replace String In String" (B0500725) and it will know that I am passing the hex representation? and not the characters themselves?

    Regards,
    Ben again,

  6. #6
    Senior Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    1,003
    Sorry Ben, I should have previewed my post. I meant to escape the double quotes with a backlash character (which needs to be escaped itself in a post). \"

    Craig
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace, NERDup and BusBuild+ Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  7. #7
    Senior Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    1,003
    This appears to work fine

    Code:
    00001 IsStringInString(B0500690.IsStringInString)
               "\"\"" -> szStringToFind [DL01]
               "testing\"\"testing" -> szFromString [DESC2000]
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace, NERDup and BusBuild+ Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  8. #8
    Member
    Join Date
    Nov 2000
    Location
    Denver, Colorado
    Posts
    629
    Hi Craig,

    I would love to better understand what you are doing. I can't replicate this.

    Not sure if I did this correctly, but as soon as I set my variable VA evt_szWorkingFindString_DL01 to anything that contains a double quote (see snippet hopefully attached), I get the compiler error (see err hopefully attached).

    Regards,
    Ben again,
    Attached Images Attached Images

  9. #9
    Senior Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    1,003
    Maybe it's the TR, I'm on 9.0 right now. My simple NER has 2 lines, and it compiles without an error.
    Attached Images Attached Images
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace, NERDup and BusBuild+ Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  10. #10
    Member
    Join Date
    Nov 2000
    Location
    Denver, Colorado
    Posts
    629
    Well, thanks both of you for your help. I have discovered a possible solution that I want to document here so I can look it up in 5 years because I've forgotten it.

    Instead of setting the search string to a value with double quotes in it and then calling the "Replace String In String", I have created a custom "Replace Special String In String" which is essentially a copy of the standard BSFN with an additional parameter and code to default the Find and Replace strings from within the C function itself. Therefore, I don't have to set a variable to anything with a double quotes (just refer to it with {'A', 'B', etc.}) and thus avoid the NER compiler error. I think this is similar to ?dereferencing?

    Regards,
    Ben

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company and, or Oracle.