Cecil
19+ years progress programming and still learning.
OE: 11.7.2
OS: Windows 10 Pro 64
If I execute the curl command on Windows command line, I get an error 6 code as expected.
However, If I execute the same command in the ABL using INPUT-OUTPUT THROUGH, it returns 0 (zero). This is not the expected result. Normally I do this kind of thing on Linux without a problem. What I'm I missing.?
OS: Windows 10 Pro 64
If I execute the curl command on Windows command line, I get an error 6 code as expected.
Code:
C:\Users\James>curl somerandomdomainnamehere.com & echo %errorlevel%
curl: (6) Could not resolve host: lkjksdf.com
6
However, If I execute the same command in the ABL using INPUT-OUTPUT THROUGH, it returns 0 (zero). This is not the expected result. Normally I do this kind of thing on Linux without a problem. What I'm I missing.?
Code:
DEFINE STREAM curlStream.
INPUT-OUTPUT STREAM curlStream THROUGH "curl somerandomdomainnamehere.com & echo %errorlevel%".
DEFINE VARIABLE serverResponseLineImport AS CHARACTER NO-UNDO.
DEFINE VARIABLE errorLevel AS CHARACTER NO-UNDO.
REPEAT:
serverResponseLineImport = "".
IMPORT STREAM curlStream UNFORMATTED serverResponseLineImport.
errorLevel = serverResponseLineImport.
END.
INPUT-OUTPUT STREAM curlStream CLOSE.
MESSAGE errorLevel.