[Stackoverflow] [Progress OpenEdge ABL] What is the equivalent of Java's System.out.println() in Progress ABL?

Status
Not open for further replies.
W

W0lfw00ds

Guest
I'm trying to implement Java's System.out.println() method in Progress ABL.

I've pieced together the following:

Code:
METHOD STATIC PUBLIC VOID println(i_cText AS CHAR):
    IF i_cText = ? THEN i_cText = "".
    
    /* Unix */
    IF OPSYS = "UNIX" THEN DO:
        IF SESSION:BATCH THEN DO:
            UNIX VALUE("echo " + QUOTER(i_cText)).
            PAUSE 0.
        END.
        ELSE DO:
            MESSAGE i_cText SKIP.
            PAUSE 0.
        END.
    END.
    
    /* Windows 32/64 */
    ELSE IF OPSYS = "WIN32" THEN DO:
        IF SESSION:BATCH THEN DO:
            OS-COMMAND VALUE("echo " + QUOTER(i_cText)).
            PAUSE 0.
        END.
        ELSE DO:
            MESSAGE i_cText SKIP.
            PAUSE 0.
        END.
    END.
    
    /* Else unsupported system */
    ELSE UNDO, THROW NEW Progress.Lang.AppError(SUBST("&1: Unsupported operating system '&2'!", PROGRAM-NAME(1), OPSYS)).
END.

The MESSAGE statements work fine both in Unix and Windows. However, the OS-COMMANDs are not outputting anything in Windows (Not tested in Unix).

I started the prowin in batch mode with the following in Powershell:

Code:
C:\dlc117\bin\prowin -p test.p -b

test.p:

Code:
OS-COMMAND SILENT VALUE("echo " + QUOTER("test1")).
OS-COMMAND VALUE("echo " + QUOTER("test2")).
DOS VALUE("echo " + QUOTER("test3")).
PAUSE 10 NO-MESSAGE.

Continue reading...
 
Status
Not open for further replies.
Top