HDTenEightyP/NetNews huggingface dataset:
Newsgroups: comp.lang.fortran
Subject: Re: [HELP] what's wrong with the following simple code?
From: mdlcpgs@lhn.gns.cri.nz (Phil Scadden)
Date: 30 Sep 92 08:53:46 +1200
Organization: Institute of Geological and Nuclear Sciences, Lower Hutt, New Zealand

Well you have a lousy unforgiving compiler. VAX F77 only objects
to      read (21, end=2) i,(R(j),j=1,abs(2*i))
because you refer to statement 2 but it is not defined.

Error on line 8 of tt.f: unbalanced quotes; closing quote supplied
Error on line 8 of tt.f: unbalanced parentheses, statement skipped
Error on line 8 of tt.f: Execution error unclassifiable statement
	Cant fathom the above. - except that opening a file with
 status='NEW' and then reading from it is guaranteed to fail.
 Check your language reference manual for examples of OPEN statement.
 I suspect you may have specify key words in upper case.

Error on line 10 of tt.f: Execution error unclassifiable statement
Error on line 27 of tt.f: Execution error unclassifiable statement
  These two above are because it is not going to wear a lower case
'C' as a valid comment indicator, Change to upper case.
Error on line 31 of tt.f: missing statement number 2
	No statement 2 anywhere in the scope.

      subroutine test 
      common c, isize,irc,sw,refHz,refpt,sf,iax,ph0,ph1
      complex c(65536)
      real r(131072)
      integer ip(131072)

      equivalence (c,r), (c,ip)        !share data memory
      open (21, file='ftnmr.dat', form='unformatted',status='new')
      read (21) i,(R(j),j=1,abs(2*i))
c       interpret 1D parameters
      if (i.gt.0) then           !this was a data record
        isize = i                !size, number of data
        irc = 1                  !data are complex by default
        close (21)
        write (*,'(a)') ' there were no parameters.'
        return
      end if
      isize = float(ip(1))         
      irc = ip(2)                  
      sw = r(17)                   
      refHz = r(20)                
      refpt = r(19)                
      sf = r(18)                   
      iax = ip(4)                  
      ph0 = r(22)                  
      ph1 = r(23)                  
c       read the next record of data
      read (21, end=2) i,(R(j),j=1,abs(2*i))
      close (21)
      return
      end
         
f77 -c tt.f

Compilation exited abnormally with code 1 at Tue Sep 29 10:50:37

							duc
From: duong@chestnut.chem.upenn.edu (-3612)
Newsgroups: comp.lang.fortran
Subject: [HELP] what's wrong with the following simple code?
Date: 29 Sep 92 11:46:51 GMT
Organization: University of Pennsylvania

I'm a fortran novice here. I couldn't figure out what's wrong with the
following subroutine so could anyone give me a hint? Thank you..

							duc

              subroutine test 
               common c, isize,irc,sw,refHz,refpt,sf,iax,ph0,ph1
               complex c(65536)
               real r(131072)
               integer ip(131072)

               equivalence (c,r), (c,ip)        !share data memory
               open (21, file='ftnmr.dat', form='unformatted',status='new')
               read (21) i,(R(j),j=1,abs(2*i))
          c    interpret 1D parameters
               if (i.gt.0) then           !this was a data record
                 isize = i                !size, number of data
                 irc = 1                  !data are complex by default
                 close (21)
                 write (*,'(a)') ' there were no parameters.'
                 return
               end if
               isize = float(ip(1))         
               irc = ip(2)                  
               sw = r(17)                   
               refHz = r(20)                
               refpt = r(19)                
               sf = r(18)                   
               iax = ip(4)                  
               ph0 = r(22)                  
               ph1 = r(23)                  
          c    read the next record of data
               read (21, end=2) i,(R(j),j=1,abs(2*i))
               close (21)
               return
               end





Newsgroups: comp.lang.fortran
From: FC138001@ysub.ysu.edu (Phil Munro)
Subject: Re: What are pointers
Organization: Youngstown State University
Date: Mon, 5 Oct 1992 21:13:05 GMT

>In article <3OCT199222373032@rosie.uh.edu> math1rb@rosie.uh.edu (92F07486) writes:
>>For one of my classes, we need to manipulate some matrices and the prof.
>>said to use pointers. What are pointers?
>>
>Uh... if this is a Fortran class, your prof needs to have his head examined.
>Fortran doesn't _have_ pointers.  At least standard Fortran doesn't.  If it's
>a C class, you should re-direct your question to a more appropriate
>newsgroup.
>
>Jon Bell (jtbell@presby.edu)
  Could it be that the prof just wanted something like
      Y(I,J)=X(I,J)
where I and J are "pointers"?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  FC138001@ysub.ysu.edu  Phil Munro       Youngstown State University
  Electrical Engineering Department           Youngstown  Ohio  44555
Newsgroups: comp.lang.fortran
From: aswx266@chpc.utexas.edu (Michael Lemke)
Subject: Re: Quickie
Organization: The University of Texas System - CHPC
Distribution: usa
Date: Tue, 6 Oct 92 05:35:06 GMT

In article <25960@oasys.dt.navy.mil> mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill) writes:
>Silly fortran question 980678
>
>      integer n
>      n=1
>      write(*,n)
>    1 format(2x,'my brain hurts')
>    2 format(.....
>    .
>    .
>    .
>
>
>Does not work.  How to fix?  Suggest IF statements and I bite you.

Because I don't want to be bitten by you and I am silly enough to post 
the answer, here it goes (but *never* ever do this in real programs or
it will bite *you* sooner or later; it is perfectly standard Fortran
though but the one of the worst parts there are [use IF's or whatever]):

      integer n
      assign 1 to n
*     ^^^^^^^^^^^^^
      write(*,n)
    1 format(2x,'my brain hurts')
    2 format(.....
    .


-- 
Michael Lemke
Astronomy, UT Austin, Texas
(michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
From: k-krag@hsr.no (Kjetil Krag)
Newsgroups: comp.lang.c
Subject: Sample-converting
Date: 6 Oct 92 09:03:48 GMT
Organization: Rogaland University Centre

Hi there!

I'm looking for a C-routine for converting samples of one sample rate to another.
I am going to make a program that converts samples (ex. from soundcards) from any
samplerate to 8kHz.

If you have such a routine or know where to find any, please tell.

Thanks in advance!

-- 
|/jetil
|\rag            k-krag@hsr.no
Newsgroups: comp.lang.c
From: hermann@uran.informatik.uni-bonn.de (Hermann Stamm)
Subject: Re: Re: C-formattors (problems with very long lines)
Followup-To: comp.std.c
Reply-To: hermann@uran.informatik.uni-bonn.de (Hermann Stamm)
Organization: Praktische Informatik III
Date: Wed, 30 Sep 1992 08:10:21 GMT


tomc@siesoft.co.uk (Tom Crossland) writes:
> 
> hermann@uran.informatik.uni-bonn.de (Hermann Stamm) writes:
> :    - insert a '\n' after each ';' found
> 
> What about things like for(a=1; a<MAX; a*=2)...
> would become
> 
> for(a=1;
> a<MAX;
> a*=2)...
> 
> It should still compile, but it's hardly "beautified"
> 

Perhaps this is not beautified, but it 
  a) works even on C-Sources with very long lines 
  b) can be beautified by a standard beautifier in
     a second step
and it is a great help in debugging of lines with length
greater than i.e. xterm can capture.

Is there any fixed upper limit for line-length in the 
ANSI-C-standard ?

The more important question I think, is, what is the reason for 
standard C-beautifiers to break -> in the middle for long lines
(resulting in a compiler-error).
Do they use a fixed length buffer for handling logical lines?

--------------------------------------------------------------

fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
> hermann@uran.informatik.uni-bonn.de (Hermann Stamm) writes:
> 
> >I wrote my own simple "C-beautifier", which simply does the
> >following:
> >
> >   - discard empty lines
> >   - insert a '\n' after each ';' found
> >
> >This works fine, but now I have 2 questions:
> >
> >  1. Is this a correct transformation of any C-Source ?
> 
> No. You need to make sure that you don't insert newlines into string
> or character literals that may contain semi-colons.

Sorry, you are right!
Below you can find the little prog I am using. It detects both,
if a ; is inside "..." and inside ' ' . If so, it doesn't insert
the '\n' after the ; otherwise it does.

The question now is, does the below program correctly transforms
any compilable C-source into also compilable C-source.


Bye,

   Hermann.

---------------------------------------------------------------

#include <stdio.h>
#include <stdlib.h>

int main(int argc,char *argv[])
  {
  FILE *source,*target;
  char c;
  long z1,z2,l;

  if (argc!=3)
    {
    fprintf(stderr,"Formtat:  cb infile outfile\n");
    exit(1);
    }

  if (NULL == (source = fopen(argv[1],"r")))
    {
    fprintf(stderr,"file not found !\n");
    exit(2);
    }

  if (NULL == (target = fopen(argv[2],"w")))
    {
    fprintf(stderr,"target cannot be created !\n");
    exit(3);
    }

  z1=z2=l=0;
  while ((c=getc(source))!=-1)
    {
    if (c==34) z1^=1;
    if (c==39) z2^=1;
    if (c=='\n')
      {
      if (l>0)
        {
        putc(c,target);
        l=0;
        }
      }
    else
      {
      putc(c,target);
      l++;
      if ((c==';') && (z1==0) && (z2==0))
        {
        putc('\n',target);
        l=0;
        }
      }
    }

  fclose(target);
  fclose(source);

  return(0);
  }


Newsgroups: comp.lang.c,news.answers
From: mayr@risc.uni-linz.ac.at (Herwig Mayr)
Subject: 64 bit arithmetics on 32 bit archtecture 
Organization: RISC, J.K. University of Linz, Austria
Date: Tue, 29 Sep 1992 11:38:00 GMT

The subject says it all: is there good PD software
for doing  64 bit arithmetics on 32 bit archtecture
(particularly division) available?

herwig
(mayr@risc.uni-linz.ac.at
Newsgroups: comp.lang.c
From: bibhas@pico.engr.mun.ca (Bibhas Bhattacharya)
Subject: Re: Calling FORTRAN from C; Losing sleep.
Keywords: FORTRAN
Organization: Memorial University of Newfoundland
Date: Sun, 4 Oct 1992 15:16:26 GMT


Here's an update; I think I'll have to link a fortran library.
> 
> Did cc say that "sum" was undefined or "sum_"?  Some FORTRAN compilers
> append an underscore to all external names.  If that is the problem,
> replacing "sum" with "sum_" in your C program should solve it.
> 
> 					Yours truly,
That seemed to help, at least the function was resolved. Now the error
message is: (forlib is the library I created):

cc fortran.c forlib
ld:
Undefined:
for__rtl_version_string
for_u__rtl_version_string
cvt__rtl_version_string
ots__rtl_version_string
for_stop

I followed the right options with f77 to create the .o file and then used
"ar" and "ranlib" to create the library.
Any pointers.
Bibhas.
From: david@gdstech.grumman.com (David Nettles)
Newsgroups: comp.lang.c
Subject: ** PROBLEMS WITH TurboC v1.0/v2.0 **
Date: 6 Oct 92 14:49:46 GMT
Reply-To: david@gdstech.UUCP (David Nettles)
Organization: Grumman Data Systems-Woodbury


Whenever I try use TurboC on my current computer, it appears that it
crashes the computer during the link.

On my old computer, an Amstrad XT portable with 2-720K floppies, I
have been using both compilers successfully for quite a while.  But on
my "new" computer they both crash during the link.

Also, the Borland INSTALL.EXE utility that comes with this programs
always crashes during installation complaining about error in its
GETKEY.C routine.

The computer that is giving me trouble is configured as follows:

-	*original* IBM/PC-XT with SOTA286 daughter-board
-	640K RAM
-	21.5Mb hard drive

Is there something about my config?
Does is the system trying to make PC-AT calls in my hyped-up PC-XT
because I have the 80286 and, thus, hanging itself?

Oh!  By the way, Turbo Pascal v5.0 and v5.5 work perfectly on both
systems.
-- 
****************************************************************************
   David E. Nettles
   Internet: david@gdstech.grumman.com
   Grumman Data Systems
From: mxa11@po.CWRU.Edu (Madhavi Ahuja)
Newsgroups: comp.lang.c
Subject: sprintf
Date: 1 Oct 1992 16:35:41 GMT
Organization: Case Western Reserve University, Cleveland, Ohio (USA)
NNTP-Posting-Host: thor.ins.cwru.edu


Hi Netters
I have seen sprintf being used in the following ways

1>
char s1[10];
char s2[5];
sprintf(s1, s2);

2>
sprintf(s1, "ABCD");

The above examples produce the correct result in s1 even
though the format is missing. Can such a usage result in any serious
side effects ??
Thanks
Madhavi
ma@acqdev.eeg.ccf.org
From: hartman@ulogic.UUCP (Richard M. Hartman)
Newsgroups: comp.lang.c
Subject: Re: C-formattors (problems with very long lines)
Date: 30 Sep 92 21:59:15 GMT
Article-I.D.: ulogic.344
Organization: negligable

In article <1992Sep29.073835.29459@olymp.informatik.uni-bonn.de> hermann@uran.informatik.uni-bonn.de (Hermann Stamm) writes:
>
>Hello all!
>
>I am programming a big project implementing polymorphism
>and (upgradable) generic data-types in ANSI-C.

Is this a personal project?  If you aren't doing this for the 
experience you might just want to move to C++, which is essentially
ANSI-C (actually ANSI-C got a lot of it's ideas from C++, including
if I remember correctly, function prototypes) with object extensions.

When you say "upgradable generic data-types with polymorphism" that
sounds to me like you want to re-create C++.....

(And lest I be called a chauvinist, there is also Objective-C, but
 except for NeXT machines I don't know that it has been widely
 used....)


		-Richard Hartman
		hartman@ulogic.COM

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Fosters!  It's Australian for beer, mate!"
From: hartman@ulogic.UUCP (Richard M. Hartman)
Newsgroups: comp.lang.c
Subject: Re: Determining variable type at run-time (followup q.)
Date: 2 Oct 92 17:22:23 GMT
Article-I.D.: ulogic.369
Organization: negligable

In article <1992Oct1.173644@is.morgan.com> berlin@is.morgan.com (Alexander Berlin) writes:
>In article <359@ulogic.UUCP>, hartman@ulogic.UUCP (Richard M. Hartman) writes:
>
>|> Safer would be:
>|> 	
>|> 		x.type = 2;
>|> 		x.value = malloc(strlen(str));
>|> 		strcpy(x.value, str);
>|> 		OutPut(x);
>|> 
>Doesn't look very safe to me.

Sorry.  Third most common error in C.

	x.value = malloc(strlen(str)+1);
	strcpy(x.value, str);

		-Richard Hartman
		hartman@uLogic.COM

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Extensive studies have shown that 93% of all statistics are meaningless.
Newsgroups: comp.lang.c
From: cs125b52@ih-nxt01 (cs125 student)
Subject: Please help me with child graphics program... Borland C
Organization: University of Illinois at Urbana
Date: Wed, 30 Sep 1992 18:54:22 GMT
Keywords: C, graphics, child

    I need help with my programming.  I am doing a graphics program which 

needs to run a child program (I used execv) in Borland C.  I installed a 

new BGI driver and initialized the program with initgraph.  I wrote the

child program to draw on parts of the screen but the compiler says I need

to use initgraph before I do any graphics.  The problem is I can't use 

initgraph or the palette and screen resets.  What do I do?  I mean..

the main program already uses initgraph and does some graphics.. I don't

want to lose that when I paint in the child program!!  

    Also, I need to know if the driver I'm using (SVGA256.BGI by Jordan

Hargraphix) is copyrighted, protected, shareware, public domain?  And if

I need permission to use it... where do I get permission?  

    How do I get the .OBJ for this .BGI?  BGIOBJ.EXE won't convert the 

driver for some reason.


Thanks alot... Please mail me as I don't read this group often..

Bor-Tyng Lin
(cs125b52@ih-nxt01.cso.uiuc.edu)
From: glenn@cis.ksu.edu (Glenn S Goldstein)
Newsgroups: comp.lang.c
Subject: files
Keywords: file,c
Date: 29 Sep 92 21:45:39 GMT
Article-I.D.: depot.glenn.717803189
Distribution: world
Organization: Kansas State University, Dept of Computing & Information Sciences
NNTP-Posting-Host: depot.cis.ksu.edu
Originator: glenn@cis.ksu.edu


I am having trouble understanding how to work with files in C.  Specifically, I
want to read from a file into a structure.  One line of the file has an integer,
string, and six pointers to the same type of structure, and one pointer to a
different sturcture.  Any of the pointers can be NULL.
If this is a FAQ, then I apologize.  However, I had to 'catch up' this topic
because there were something over 10,000 posts waiting.
I read K&R's C Book, but I'm still unsure of how to implement this problem.
Please respond by email...............Thanks
Xref: sparky comp.lang.c:14428 comp.lang.c++:14435 comp.os.msdos.programmer:9700
From: ccsmh@gdr.bath.ac.uk (Mark Harding)
Newsgroups: comp.lang.c,comp.lang.c++,comp.os.msdos.programmer
Subject: [Stack Overflow] How do I find cause using Turbo Debugger?
Date: 2 Oct 92 11:18:36 GMT
Organization: Bath University Computing Services, UK

My program recently bombed out with a 'Stack Overflow!' message on the screen.
I have stopped it doing so by increasing _stklen but I'd really like to
find the point in my program that caused the overflow in the first place.

Can this be done easily? Any suggestions welcome.

Cheers, Mark
-- 
+------------------------------------------------------------------------------+
|>  Mark Harding, Most excellent & triumphant programmer.  044  0225 826057   <|
+------------------------------------------------------------------------------+
From: karl@ima.isc.com (Karl Heuer)
Newsgroups: comp.lang.c
Subject: Re: Common C errors (was Strange memory allocation...)
Date: 27 Sep 92 18:25:45 GMT
Article-I.D.: ima.1992Sep27.182545.19324
Organization: Formerly of Interactive Systems, Cambridge, MA

In article <717558228snx@Wellspring.COM> elliot@Wellspring.COM writes:
>b == a;            /* an attempted assignment */
>This statement does nothing, but cannot be flagged as a warning.

Wrong.  Not only *can* it, but in the usual AT&T implementation, it *does*
generate a warning.  (I find this fortunate, because for whatever reason, I
seem to make this typo more often than its opposite.)  If your system doesn't
flag this, then you might consider suggesting to your vendor that they upgrade
the implementation, or else find a new vendor.

Of course, if your vendor *does* provide this warning but you've chosen to
suppress it, perhaps by invoking only half the compiler, then it's not the
vendor's fault.  Note that "the usual AT&T implementation" that I mentioned
is properly invoked with a command like "cc *.c; lint *.c".

Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint
From: wright@staff.tc.umn.edu (Mark Wright)
Newsgroups: comp.lang.c
Subject: What is Curses?
Date: 3 Oct 92 16:51:56 GMT
Organization: University of Minnesota


	Just what in the heck is curses?  I come from the dos world, and I
have little experience with unix environments.  I've gathered it's some sort
of C gui library, and I've noticed some mention of it in DJGPP's doc's.  Is
it available for dos?  Should I care if it is?

-- 
Mark Wright
wright@epx.cis.umn.edu
From: sander@kozmix.hacktic.nl (Sander van Malssen)
Newsgroups: comp.lang.c
Subject: Re: Turbo C++ problem 
Date: Sun, 27 Sep 92 08:35:21 GMT
Organization: Kozmic Egg Productions

abutler@ariel.demon.co.uk (Tony Butler) writes:

> Thanks, I'm, using Turbo C v2, which doesn't have a setmode() function.
> I know how to call int 10, the problem is that any documentation I have
> read (even regarding int 10) does *not* mention 43/50 line modes, just
> the 25 line modes & other graphic modes. Obviously there must be *some*
> way to do it apart from having ansi.sys installed.

You can have lots of different line modes all within the same video
mode, just by loading font with different resolutions into memory (e.g.
you'd load a 8x8 font to get 50 lines). I /think/ it's done through int
10. Sorry, I don't have any detailed information or code for this, but
this should be the way to go.

Bye,
Sander



Sander van Malssen  |  sander@kozmix.hacktic.nl  |  Fido 2:285/101.6
From: sgcraw@CS.ColoState.EDU (stewart crawford)
Newsgroups: comp.lang.c
Subject: Re: What is RPG ???
Date: 6 Oct 92 21:31:59 GMT
Organization: Colorado State University, Computer Science Department

In article <1992Oct2.015817.183@wsuhub.uc.twsu.edu> ckcheng@wsuhub.uc.twsu.edu writes:
>     Hey, does anybody heard of RPG (language or system?, NOT role playing game
>) ?  Can anyone talk about it in this category or open a new category ?


From the paucity of responses and the negative tone of those posted,
please let me shed some light on this poor language based on my two
years of programming with it...

TRUE, RPG was the first 4GL when it came to file processing.
File handling was basically transparent; RPG read files in a line
at a time, breaking the data fields out into the variable names you
defined, and then gave a chance to use the data before continuing
on to the next line.  Sounds a bit like AWK, eh?  Except you got to
use real variable names...

For hierarchically oriented data (i.e. fields exist to identify
progressivly larger entities, such as individual, group, department, etc...),
RPG makes report writing a breeze, automatically providing interrupt
mechanisms when entity id's change, thus transparently supporting
subtotals, etc.  It was the precursor of group-functions in SQL.

When it came to mathematical manipulations, however, it was a brave
step back toward assembler-level primitives, hence the "love" engendered
into most RPG programmers.  One nice touch, though, was the capturing
of condition-code info after each mathematical operation, enabling you
to set software switches to capture this logical info.  Succeding statements
could then be preceeded by these switches, and their execution was conditioned
by the switch setting.  GUARDED CONSTRUCTS, anyone ???

Many other DP-style needs were addressed transparently, such as input
file sorting, matching of master & transaction files records, in-core
(and I do mean core) b-tree indices to speed random file access, etc.

My one claim to RPG fame was writing a routine to calculate cube-roots
in this DP language, once again proving that given a strong enough screwdriver,
I can hack anything to bits...

	Stew Crawford
	sgcraw@cs.colostate.edu
From: dalessan@clam.rutgers.edu (Gene Dalessan)
Newsgroups: comp.lang.c
Subject: C help...pretty please.
Date: 29 Sep 92 06:35:35 GMT
Organization: Rutgers Univ., New Brunswick, N.J.


#include <math.h>
#include <stdio.h>
main()
{
double val=-1.0;

do {
 printf("hyperbolic cos %f is %f\n",val,cosh(val));
 val +=0.1;
 } while (val<=1.0);
}


PLEASE help...Why do I get undefined _cosh?

I'm learning C know and this example is out of the book.
I need the cosh for a numerical meth problem.

Gene
From: ren@function.mps.ohio-state.edu (Liming Ren)
Newsgroups: comp.lang.c
Subject: about foo and bar
Date: 5 Oct 1992 08:14:53 -0400
Organization: Department of Mathematics, The Ohio State University
Distribution: usa
NNTP-Posting-Host: function.mps.ohio-state.edu


Pardon my igronace!

I see many c book authors using the function names such as foo and bar.
Any story about them ? They must be some funy meaning associated with them.
What are they?
Newsgroups: comp.lang.c