Friday, 31 January 2014

codechangecom.exe What is this?

codechangecom.exe is a slimer provided to you in your client system\bin32 dir which can be used to convert existing single byte “C” BSFN’s to unicode compliant code.

That is nice!

C:\E910_1\system\bin32>codechangecom.exe

Expected the following parameters
<input File> <outputfile> <mode>

So, what do we put in the parameters – please see https://support.oracle.com/epmos/faces/DocContentDisplay?_afrLoop=109554459225750&id=626598.1&_afrWindowMode=0&_adf.ctrl-state=76dfd0sjx_77 for all of the details, but I’ll summarise

Parameter 1:
CommandFile is a filename which contains commands for CodeChangeCom. It is not the name of a file you wish to convert. Commands in the file tell CodeChangeCom what files to convert. There are four formats for each command. Each command is a single line in the file. Here is an example command:
C:\fun\in\the\sun –r
This tells CodeChangeCom to find every .h, .c, .cpp, .hpp file in the directory c:\fun\in\the\sun, plus all the files in every subdirectory under that directory. Here is another example:
! C:\fun\in\the\sun\sunblock.c
This tells CodeChangeCom to not change the file sunblock.c in the given directory. Here is another example:
C:\fun\in\the\
This tells CodeChangeCom to change every file in the directory c:\fun\in\the\, but not any of the subdirectories of that directory. Here is the last example:
! C:\fun\in\the\sun\sand\
This tells CodeChangeCom to skip the entire directory c:\fun\in\the\sun\sand, regardless of how many files are in that directory.

Parameter 2:

This is a simple filename, which will contain the results of the operations after it has finished. If the program just reports on changes – but doesn’t actually do them, then the results are in this file.

Parameter3:
This is the word “audit” or the word “convert”. If it is “audit” then only results will be reported, no changes will be made. If it is “convert” then the code will be converted, but what is actually changed will not be recorded anywhere.

 

Wow, talk about a complicated way of doing things!  Why not param 1: filename in param 2: filename out param3: mode ????

So, I’ll create a commands.txt file with the following contents (I just want the include and the source checked)

C:\e910_1\dv910\source\b5801002.c

C:\e910_1\dv910\include\b5801002.h

Then I’ll run codechangecom.exe commands.txt changes.txt audit

 

The output I get:

========>Parsing File: \e910_1\dv910\source\b5801002.c <=======

   66: jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, "4363", (LPVOID) NULL);
----->                                         1
       1. Literal string requires enclosure in appropriate macro.

   73: memset((void *)&dsD5801000T, (int)('\0'), sizeof(dsD5801000T));
----->                                    1
       1. Literal string requires enclosure in appropriate macro.

   80:                   (char *)NULL,
----->                    1
                               (char *)NULL,
----->                          2
       1. 'JCHAR' replaces 'char'.
       2. 'JCHAR' replaces 'char'.
========>Parsing File: \e910_1\dv910\include\b5801002.h <=======

   89: char              szFunctionName[33];
-----> 1
       1. 'JCHAR' replaces 'char'.

Note that the source and include I’m parsing is VERY simple.  I don’t think that it’s important that I list the source and include – you can see  the good work that it’s done.

Next is to run it in convert mode!

Great, my code is ALL unicode – lets try a compile!

Compile works first time.  this is why you use the JD Edwards provided functions and you get to use utilities like this!

No comments:

Extending JDE to generative AI