Jose,
It depends on compatibility options / dialect:
G:\skatests\cobol>cobc -x zrun3.cbl
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.42 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cob7A77.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
/out:zrun3.exe
zrun3.obj
g:\open-cobol\build_windows\x64\debug\libcob.lib
g:\open-cobol\build_windows\x64\debug\gmp.lib
G:\skatests\cobol>zrun3
x = 9
x after the add = 9
G:\skatests\cobol>cobc -x -std=mf zrun3.cbl
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.42 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cob7A7A.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
/out:zrun3.exe
zrun3.obj
g:\open-cobol\build_windows\x64\debug\libcob.lib
g:\open-cobol\build_windows\x64\debug\gmp.lib
G:\skatests\cobol>zrun3
x = 9
x after the add = 0
----- Original Message -----
From: "Jose Vilmar Estacio de Souza" <address@hidden>
To: <address@hidden>
Sent: Thursday, January 26, 2006 11:59 AM
Subject: [open-cobol-list] what happens in case of overflow?
Hi all.
I've the following program:
------
identification division.
program-id. t4.
environment division.
data division.
working-storage section.
77 x pic 9(1) value 9.
procedure division.
display "x = " x
add 1 to x
display "x after the add = " x
stop run.
------
Executing the program I receive the following result:
$ ./t4
x = 9
x after the add = 9
$
When executing the same program in my old micro focus cobol environment,
I'm receiving the following result:
$ cobrun t4
x = 9
x after the add = 0
$
Thanks. -------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 1/24/2006