BBC BASIC for Windows
« excel spreadsheet »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:42pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: excel spreadsheet  (Read 704 times)
craven
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx excel spreadsheet
« Thread started on: May 8th, 2011, 10:43am »

i use bb4w to run a basic pbm game, all my data is saved/loaded using the A=openin a$ and A=openout a$ commands and this is perfect for my needs but can anyone tell me if there is a simple way of getting microsoft excell to read these data files as well?

below is the open in format i am using at present

31600 A=OPENIN A$
31610 FOR J=1TO 40
31620 INPUT#A,ANAME$(J)
31630 INPUT#A,AAGE$(J)
31640 INPUT#A,APOS$(J)
31650 INPUT#A,AINJ$(J)
31660 INPUT#A,ALEVEL(J)
31670 INPUT#A,AMAX(J)
31680 INPUT#A,AQUAL(J)
31690 INPUT#A,ADP(J)
31700 INPUT#A,APLD(J)
31710 INPUT#A,AGOAL(J)
31720 INPUT#A,AGOALP(J)
31730 INPUT#A,MANAGER$(2)
31740 INPUT#A,RECA$(2)
31750 INPUT#A,RECG$(2)
31760 INPUT#A,GOALR$(2)
31770 INPUT#A,RECDPPLAYER$(2)
31780 INPUT#A,CASH(2)
31790 INPUT#A,DPTOT(2)
31800 INPUT#A,GPPTOT(2)
31810 INPUT#A,VPTOT(2)
31820 INPUT#A,FANS(2)
31830 INPUT#A,RECA(2)
31840 INPUT#A,RECG(2)
31850 INPUT#A,GOALR(2)
31860 INPUT#A,RECDPTOT(2)
31870 INPUT#A,RECDPPLAYER(2)
31880 INPUT#A,RECCASH(2)
31890 INPUT#A,RECTL(2)
31900 INPUT#A,CURTL(2)
31910 NEXT J
31920 CLOSE#A

any help would be most welcom
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: excel spreadsheet
« Reply #1 on: May 8th, 2011, 5:37pm »

on May 8th, 2011, 10:43am, craven wrote:
can anyone tell me if there is a simple way of getting microsoft excell to read these data files as well?

Excel can read CSV (Comma Separated Value) files, so if you output your data file in that format Excel will be able to open it.

You can create a CSV file either by writing the code yourself, which is easy enough, or by using the code in this Wiki article:

http://bb4w.wikispaces.com/Reading+and+writing+CSV+files

Richard.
User IP Logged

craven
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: excel spreadsheet
« Reply #2 on: May 10th, 2011, 8:58pm »

thanks richard but i do not understand it being the simpleton that i am!! i need to understand it before i can write it and i do not understand it!!
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: excel spreadsheet
« Reply #3 on: May 10th, 2011, 9:44pm »

on May 10th, 2011, 8:58pm, craven wrote:
i need to understand it before i can write it and i do not understand it!!

If you prefer not to write your own code you can just copy-and-paste the PROCwriteCSV procedure from the Wiki; you do not need to understand it! The only disadvantage of simply taking the code from the Wiki is that it assumes your data will be in the form of a 2-dimensional string array:

Code:
      DIM array$(rows%,columns%) 

so if your data isn't already in a suitable form you will need to convert it.

The advantage of writing your own code would be that you get to decide the format in which the data is held. If you need more information on the Comma Separated Value file format this Wikipedia article has details:

http://en.wikipedia.org/wiki/Comma-separated_values

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls