Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!titan!drack From: drack@titan.tsd.arlut.utexas.edu (Dave Rackley) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: Basic BASICA question Message-ID: Date: 6 Dec 90 17:08:28 GMT References: Sender: news@titan.tsd.arlut.utexas.edu Organization: Applied Research Laboratories, University of Texas at Austin. Lines: 43 In-reply-to: ko0g+@andrew.cmu.edu's message of 6 Dec 90 15:34:35 GMT In article ko0g+@andrew.cmu.edu (Kevin O'Neill) writes: > I may be in the wrong place, but I'll give it a try anyway. > I am trying my hand at writing a program in IBM BASICA that I had previously > done for an Apple, and I'm having a problem figuring out the routine for > saving the data created in the program to a file. The problem is that about > 50 variables are defined by the program, but I haven't figured out how to > get the FIELD statements to work properly. For example, I try ... > 100 OPEN "DATAFILE" > 200 FIELD #1,3 AS MN$, 4 AS AP$, 4 AS RG$, {etc.} > 300 LSET MN$=NM$: AP$=A1$: RG$=R1$: {etc.} > 400 PUT #1,1 > 500 CLOSE > I cannot get the fields set for all of the variables on a single line; I've > tried a second FIELD line, but it overwrites the variables from part of the > first line. > What am I doing wrong, and how do I correct it? It seems to me that your open statement is causing the problem. Try the following: 100 open "datafile" for random as #1 len=your_rec_len Without setting 'your_rec_len' basica defaults to 128 bytes, which may not be large enough for your records. Hope this helps! -- DISCLAIMER? I don't know anything 'bout any ol' disclaimer! +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+ | David Rackley | | | Applied Research Laboratories | Remember, you can tuna fish, | | The University of Texas | But you can't tuna piano! | | Austin, TX. 78758 | | +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+