• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

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
 

craig_welton

Legendary Poster
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
 

BBritain

VIP Member
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,
 

BBritain

VIP Member
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,
 

craig_welton

Legendary Poster
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

Legendary Poster
This appears to work fine

Code:
00001 IsStringInString(B0500690.IsStringInString)
           "\"\"" -> szStringToFind [DL01]
           "testing\"\"testing" -> szFromString [DESC2000]
 

BBritain

VIP Member
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
 
Top