I have lots of COBOL to convert to C, not C++, but standard C.
I think I know how to do this, but I would like some advice.
The first of no-doubt many questions is how to emulate the COBOL 88 level variables in the C language. In COBOL there are whats know as 88 level variables, subordinate to an actual variable of any type. The 88 level variable is kind of a Boolean look at the actual variable. I need to do the same in C, suggestions of another method are very welcome.
/* In COBOL:
So that in the procedure code I would write:Code:01 NOOP-SW PIC X VALUE "0". 88 NOOP VALUE "1".
NOW (Im a C newbie),Code:MOVE "0" TO NOOP-SW. * Maybe during other processing "1" would be moved into NOOP-SW. Then I would test this condition in COBOL as follows: If NOOP GO TO OP-EXIT.
In C, would I predefined the following:
Then in the function I would also have the following char:Code:#DEFINE NOOP (strcmp(NOOP-SW,"1")==0)
Same scenario, to test if we have a "1" or "0" in NOOP-SW, in C:
I really need to convert the COBOL with minimal changes in design, because it amounts to many thousands of lines of COBOL code. The COBOL code actually runs on Windows, and Linux, but it's not very portable, and that's why I need to re-write it in C.Code:if NOOP return(0);