E9.2 JDE Object Browser and concatenating mismatched strings

BBritain

VIP Member
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
 
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
 
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,
 
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,
 
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
 
This appears to work fine

Code:
00001 IsStringInString(B0500690.IsStringInString)
           "\"\"" -> szStringToFind [DL01]
           "testing\"\"testing" -> szFromString [DESC2000]
 
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,
 

Attachments

  • 2019-08-06 09_12_10 NER Snippet.png
    2019-08-06 09_12_10 NER Snippet.png
    7.9 KB · Views: 15
  • 2019-08-06 09_10_53 Compile Err.png
    2019-08-06 09_10_53 Compile Err.png
    5.1 KB · Views: 14
Maybe it's the TR, I'm on 9.0 right now. My simple NER has 2 lines, and it compiles without an error.
 

Attachments

  • Capture.JPG
    Capture.JPG
    28 KB · Views: 13
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
 
Back
Top