Need code help-4GL to Linux Conversion
Posted in 2001
I am presently trying to determine how much work its going to be to convert a massive amount of 4gl code to Linux. Linux is RedHat 6.1, I have checked for the correct version of GLIB, etc. Thousands of lines of code have compiled succesfully into .a file. I have compiled and linked one .4ge using the my libraries. Here is the code that fails immediately on executing by .4ge . .. Oh, by the way. I have taken this function and used I4GL to create a little program that does just this code and IT WORKS. It FAILS in the large program with my libaries linked in. **FAILS marks the spot in the code SQL Statement error number -481 Invalid statement name of statement was not PREPAREd [since this code works using I4GL, I am suspecting that [it is some sort of variable naming problem on the Linux [so i have been changing all of the names and retrying [with no success Any input would be greatly appreciated. Thanks DATABASE lib GLOBALS "CdGlob.4gl" FUNCTION codeSqlSelect(Code) DEFINE Code LIKE lib_code.code # DEFINE Buf CHAR(256), LibCode RECORD LIKE lib_code.*, LStatus INTEGER, i INTEGER # # ----- load this code ----- # LET Code = upshift(Code) LET Buf = "SELECT *", " FROM ", GCodeLib.CodeTable CLIPPED, " WHERE code_query = ", ASCII(34), Code CLIPPED, ASCII(34) IF GCodeLib.CodeGroup IS NOT NULL THEN LET Buf = Buf CLIPPED, " AND code_group = ", ASCII(34), GCodeLib.CodeGroup CLIPPED, ASCII(34) ELSE LET Buf = Buf CLIPPED, " AND code_group IS NULL " END IF FOR i = 1 TO 2 WHENEVER ERROR CONTINUE PREPARE CodeSelectPrep FROM Buf LET LStatus = status WHENEVER ERROR STOP IF LStatus != 0 THEN IF i == 1 THEN CALL CodeCreateTable() ELSE CALL HsAlertOpen("FATAL ERROR") CALL HsAlertSetRow(1, "CODE TABLE") CALL HsAlertSetRow(2, GCodeLib.CodeTable) CALL HsAlertSetRow(3, "DOES NOT EXIST") CALL HsAlertSetRow(4, "") CALL HsAlertDisplay() CALL HsAlertBeep() CALL HsAlertAnyKey() CALL HsAlertClose() EXIT PROGRAM END IF ELSE EXIT FOR END IF END FOR **** FAILS HERE DECLARE CodeSelectCur CURSOR FOR CodeSelectPrep OPEN CodeSelectCur FETCH CodeSelectCur INTO LibCode.* LET LStatus = status CLOSE CodeSelectCur FREE CodeSelectPrep IF LStatus != 0 THEN INITIALIZE LibCode.* TO NULL END IF -- mkuhn@rhlab.com