From: "Michael Nöthe" Newsgroups: comp.os.msdos.djgpp Subject: Problem with while-loop Date: Sat, 04 Sep 1999 23:56:31 +0200 Organization: T-Online Lines: 120 Message-ID: <37D1958F.FEA86502@t-online.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------377512DB1B00FD386346978D" X-Trace: news05.btx.dtag.de 936482056 30354 320029096275-0001 990904 21:54:16 X-Complaints-To: abuse AT t-online DOT de X-Sender: 320029096275-0001 AT t-dialin DOT net X-Mailer: Mozilla 4.08 [de]C-DT (Win95; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Dies ist eine mehrteilige Nachricht im MIME-Format. --------------377512DB1B00FD386346978D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit First of all, I'm a beginner in C++ and I hope I am at the right place in this newsgroup. I bought a book on learning C++ and along with it I got a copy of the GNU-C++ Compiler V. 2.7.2.1 for DOS from DJGPP. In the book there was a sample program introducing encapsulated while-loops. A turning line (\|/-) should be shown on the screen. Now my problem is, the program doesn't seem to do anything ! It compiles without any problems, but when I execute it, it shows nothing on the screen. After I finally use to stop the programm, only the last charakter (e.g.: "\") is shown. I took the source code right from the CD I got with my book, so there can't be any typing errors. On the CD there is also an executable program, which runs perfectly ! Does anybody have a clue what might be the problem ? I enclosed the following things : - my environment variables environ.lst - compiler startup messages go32.lst - the problematic source code rotsl.cpp --------------377512DB1B00FD386346978D Content-Type: text/plain; charset=us-ascii; name="Environ.lst" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Environ.lst" COMSPEC=A:\COMMAND.COM PROMPT=$p$g PATH=C:\DOS;C:\MOUSE;C:\NC;C:\RAR;D:\MAPLE\BIN;C:\DJGPP\BIN DJGPP=C:\DJGPP\DJGPP.ENV GO32_V2_DEBUG=y TEMP=C:\TEMP TMP=C:\TEMP TMPDIR=I: MAPLELIB=D:\MAPLE\LIB --------------377512DB1B00FD386346978D Content-Type: text/plain; charset=us-ascii; name="Go32.lst" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Go32.lst" go32/v2 version 2.0 built Aug 12 1996 22:27:23 Usage: go32 coff-image [args] Rename this to go32.exe only if you need a go32 that can run v2 binaries as well as v1 binaries (old makefiles). Put ahead of the old go32 in your PATH but do not delete your old go32 - leave it in the PATH after this one. Set GO32_V2_DEBUG=y in the environment to get verbose output. DPMI memory available: 15155 Kb DPMI swap space available: 130397 Kb --------------377512DB1B00FD386346978D Content-Type: text/plain; charset=us-ascii; name="Rotsl.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Rotsl.cpp" /*------------------------------ ROTSL.CPP ------------------------------* | | | ROTSL erzeugt einen rotierenden Strich mit Hilfe einer Endlos- | | Schleife. Die Ablaufgeschwindigkeit wird durch Pausen in Form | | von Z„hlschleifen reduziert. | | | *-----------------------------------------------------------------------*/ #include // printf void main() { double cnt; while(1) // Endlosschleife { printf ("|"); // Zeichen ausgeben cnt = 0.0; // Z„hlvariable initialisieren while(cnt < 100000.0) // Pause cnt++; printf("\b"); // Ausgabe-Position 1 Zeichen zurcksetzen printf ("/"); // Zeichen ausgeben cnt = 0.0; // Z„hlvariable initialisieren while(cnt < 100000.0) // Pause cnt++; printf("\b"); // Ausgabe-Position 1 Zeichen zurcksetzen printf ("-"); // Zeichen ausgeben cnt = 0.0; // Z„hlvariable initialisieren while(cnt < 100000.0) // Pause cnt++; printf("\b"); // Ausgabe-Position 1 Zeichen zurcksetzen printf ("\\"); // Zeichen ausgeben cnt = 0.0; // Z„hlvariable initialisieren while(cnt < 100000.0) // Pause cnt++; printf("\b"); // Ausgabe-Position 1 Zeichen zurcksetzen } // Ende while } // Ende main /*=========================== ENDE ROTSL ===============================*/ --------------377512DB1B00FD386346978D--