www.digitalmars.com         C & C++   DMDScript  

c++.dos.16-bits - Clipper

reply "Ryan Barber" <rfb bookmanager.com> writes:
I'm working on extending a Clipper app, and after searching for a recent
compiler that will do 16bit, I found Digital Mars. now, A couple days of
struggle, and alot of learning, I've got my simple C library compiled with
dm to link with a Clipper test.

my problem lies in printf(), if I put a newline in format, clipper will
'Stack Overflow'.

So I'm wondering what sort of special somethings going on when I put a
newline in printf's format.

printf("hello world"); works
printf("hello world\n"); blows up

any suggestions or experiences?
-ryan
Mar 10 2002
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Ryan Barber" <rfb bookmanager.com> wrote in message
news:a6gg9g$i4f$1 digitaldaemon.com...
 I'm working on extending a Clipper app, and after searching for a recent
 compiler that will do 16bit, I found Digital Mars. now, A couple days of
 struggle, and alot of learning, I've got my simple C library compiled with
 dm to link with a Clipper test.

 my problem lies in printf(), if I put a newline in format, clipper will
 'Stack Overflow'.

 So I'm wondering what sort of special somethings going on when I put a
 newline in printf's format.

 printf("hello world"); works
 printf("hello world\n"); blows up

 any suggestions or experiences?
 -ryan
I use it all the time. Can you post a complete example? Be aware that problems like this are common under DOS, as it has no memory protection and a bug in one part of the program can step all over code & data anywhere in memory, causing havoc. The best way is to debug the code in protected mode, using a 286 DOS extender or OS/2 before trying it in real mode DOS.
Mar 10 2002
parent reply "Ryan Barber" <rfb bookmanager.com> writes:
cliplib.c --

#include <extend.h>
#include <stdio.h>

CLIPPER  test_one() {
 printf("test\n");
}

clipprg.prg --

func testclip()
? "running test_one"
? test_one()
return nil

test.lnk --

STACK 16384
MIXCASE
BLINKER INCREMENTAL OFF
BLINKER EXECUTABLE NODELETE

FILE clipprg
FILE cliplib

SEARCH C:\ver8\CL52D\LIB\clipper
LIB C:\ver8\CL52D\LIB\extend
LIB C:\ver8\CL52D\LIB\terminal
LIB C:\ver8\CL52D\LIB\dbfntx
LIB C:\dev\dm\lib\sdl

OUTPUT test.exe

c.bat --

\dev\CL52D\BIN\CLIPPER.EXE clipprg.prg /a /m /n /w
\dev\dm\bin\sc -Iinclude -ml -c cliplib.c
\dev\BL310\BLINKER.EXE  test

I took the blinker settings off a post I found on comp.lang.c

you use Clipper too?

-Ryan

"Walter" <walter digitalmars.com> wrote in message
news:a6h5vr$po0$1 digitaldaemon.com...
 "Ryan Barber" <rfb bookmanager.com> wrote in message
 news:a6gg9g$i4f$1 digitaldaemon.com...
 I'm working on extending a Clipper app, and after searching for a recent
 compiler that will do 16bit, I found Digital Mars. now, A couple days of
 struggle, and alot of learning, I've got my simple C library compiled
with
 dm to link with a Clipper test.

 my problem lies in printf(), if I put a newline in format, clipper will
 'Stack Overflow'.

 So I'm wondering what sort of special somethings going on when I put a
 newline in printf's format.

 printf("hello world"); works
 printf("hello world\n"); blows up

 any suggestions or experiences?
 -ryan
I use it all the time. Can you post a complete example? Be aware that problems like this are common under DOS, as it has no memory protection
and
 a bug in one part of the program can step all over code & data anywhere in
 memory, causing havoc.

 The best way is to debug the code in protected mode, using a 286 DOS
 extender or OS/2 before trying it in real mode DOS.
Mar 11 2002
next sibling parent reply "Walter" <walter digitalmars.com> writes:
I've never heard of clipper before this.

"Ryan Barber" <rfb bookmanager.com> wrote in message
news:a6iqrh$1gjl$1 digitaldaemon.com...
 cliplib.c --

 #include <extend.h>
 #include <stdio.h>

 CLIPPER  test_one() {
  printf("test\n");
 }

 clipprg.prg --

 func testclip()
 ? "running test_one"
 ? test_one()
 return nil

 test.lnk --

 STACK 16384
 MIXCASE
 BLINKER INCREMENTAL OFF
 BLINKER EXECUTABLE NODELETE

 FILE clipprg
 FILE cliplib

 SEARCH C:\ver8\CL52D\LIB\clipper
 LIB C:\ver8\CL52D\LIB\extend
 LIB C:\ver8\CL52D\LIB\terminal
 LIB C:\ver8\CL52D\LIB\dbfntx
 LIB C:\dev\dm\lib\sdl

 OUTPUT test.exe

 c.bat --

 \dev\CL52D\BIN\CLIPPER.EXE clipprg.prg /a /m /n /w
 \dev\dm\bin\sc -Iinclude -ml -c cliplib.c
 \dev\BL310\BLINKER.EXE  test

 I took the blinker settings off a post I found on comp.lang.c

 you use Clipper too?

 -Ryan

 "Walter" <walter digitalmars.com> wrote in message
 news:a6h5vr$po0$1 digitaldaemon.com...
 "Ryan Barber" <rfb bookmanager.com> wrote in message
 news:a6gg9g$i4f$1 digitaldaemon.com...
 I'm working on extending a Clipper app, and after searching for a
recent
 compiler that will do 16bit, I found Digital Mars. now, A couple days
of
 struggle, and alot of learning, I've got my simple C library compiled
with
 dm to link with a Clipper test.

 my problem lies in printf(), if I put a newline in format, clipper
will
 'Stack Overflow'.

 So I'm wondering what sort of special somethings going on when I put a
 newline in printf's format.

 printf("hello world"); works
 printf("hello world\n"); blows up

 any suggestions or experiences?
 -ryan
I use it all the time. Can you post a complete example? Be aware that problems like this are common under DOS, as it has no memory protection
and
 a bug in one part of the program can step all over code & data anywhere
in
 memory, causing havoc.

 The best way is to debug the code in protected mode, using a 286 DOS
 extender or OS/2 before trying it in real mode DOS.
Mar 11 2002
parent "Ryan Barber" <rfb bookmanager.com> writes:
Yea, I had to wonder, why would you be using Clipper if wrote compilers?

Clippers is an X-Base style application development system for DOS. newer
projects are Harbour, (www.harbour-project.org), but I'm not sure if my boss
is willing to go thru the pain of upgrading to it.

My C knowledge is pretty limited, but I'm working on it, until now I've only
really done server side perl and paint by numbers C++/MFC.

-Ryan

"Walter" <walter digitalmars.com> wrote in message
news:a6j37m$1k0j$1 digitaldaemon.com...
 I've never heard of clipper before this.
Mar 11 2002
prev sibling parent bob <bob bob.com> writes:
neebles test neebles
Feb 24 2011
prev sibling parent reply Jan Knepper <jan smartsoft.cc> writes:
Could you try the same thing with puts or fputs?
Jan



Ryan Barber wrote:

 I'm working on extending a Clipper app, and after searching for a recent
 compiler that will do 16bit, I found Digital Mars. now, A couple days of
 struggle, and alot of learning, I've got my simple C library compiled with
 dm to link with a Clipper test.

 my problem lies in printf(), if I put a newline in format, clipper will
 'Stack Overflow'.

 So I'm wondering what sort of special somethings going on when I put a
 newline in printf's format.

 printf("hello world"); works
 printf("hello world\n"); blows up

 any suggestions or experiences?
 -ryan
Mar 11 2002
parent reply "Ryan Barber" <rfb bookmanager.com> writes:
mm, same result. maybe Clippers handling stdout diffrently?

-Ryan

"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3C8D12C6.9B5D1534 smartsoft.cc...
 Could you try the same thing with puts or fputs?
 Jan



 Ryan Barber wrote:

 I'm working on extending a Clipper app, and after searching for a recent
 compiler that will do 16bit, I found Digital Mars. now, A couple days of
 struggle, and alot of learning, I've got my simple C library compiled
with
 dm to link with a Clipper test.

 my problem lies in printf(), if I put a newline in format, clipper will
 'Stack Overflow'.

 So I'm wondering what sort of special somethings going on when I put a
 newline in printf's format.

 printf("hello world"); works
 printf("hello world\n"); blows up

 any suggestions or experiences?
 -ryan
Mar 11 2002
parent Jan Knepper <jan smartsoft.cc> writes:
try '\n' with putc/putchar/fputc

Jan



Ryan Barber wrote:

 mm, same result. maybe Clippers handling stdout diffrently?

 -Ryan

 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3C8D12C6.9B5D1534 smartsoft.cc...
 Could you try the same thing with puts or fputs?
 Jan



 Ryan Barber wrote:

 I'm working on extending a Clipper app, and after searching for a recent
 compiler that will do 16bit, I found Digital Mars. now, A couple days of
 struggle, and alot of learning, I've got my simple C library compiled
with
 dm to link with a Clipper test.

 my problem lies in printf(), if I put a newline in format, clipper will
 'Stack Overflow'.

 So I'm wondering what sort of special somethings going on when I put a
 newline in printf's format.

 printf("hello world"); works
 printf("hello world\n"); blows up

 any suggestions or experiences?
 -ryan
Mar 11 2002