Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / can dark basic save spreadsheet files?

Author
Message
silvergolem
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 10th Mar 2003 00:33
is it possible to save something in darkbasic then open the file as a spreadsheet?
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 10th Mar 2003 00:40
No. You can save a file as anything, but it will not work unless the internal format is correct. I guess its possible, but would require a outside dll.

"All programmers are playwrights and all computers are lousy actors."
-Anon.
Xoid
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 10th Mar 2003 04:05
depends what you want to do, if you want to save simple recording of your data from DB to Excel, e.g.

you could save the data as a CSV(Comma Separated Values) File.

use DB to Save As test.CSV or whatever and keep the formatting like so.

1,6
2,7
3,8
4,9
5,10

this is a very simple case but you can import spreadsheet data using DarkBASIC if formatted correctly as Andrew11 suggested.
Xoid
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 10th Mar 2003 04:23
Hi, just thought I'd give u a better example,


If you use DB's file system to save data, for examplr if someone plays your game you could record the results to a spreadsheet using CSV format, like so.

Copy data below and save as test.CSV, assuming you are using Excel it should import nicely into the spreadsheet.

again it's a simple case, but I hope it helps you out a little

Name,Score,
Person1,10,
Person2,20,
Person3,30,
Person4,40,
Person5,50,

,Total:,=SUM(B2:B6)
Xoid
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 10th Mar 2003 04:38
some code to go with my explaination, I'll stop now coz I'm babbling abit

again, I hope it helps you out

filename$="c:\gamedata.CSV"

if file exist(filename$) then delete file filename$

open to write 1,filename$

write string 1,"Name,Scores"
write string 1,"Person1,10"
write string 1,"Person2,20"
write string 1,"Person3,30"
write string 1,"Person4,40"
write string 1,"Person5,50"
write string 1,",Total:,=SUM(B2:B6)"

close file 1
Xoid
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 13th Mar 2003 01:15
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 14th Mar 2003 22:12
How do you use the ftp commands to save and load files from the internet? The manual doesn't really describe it fully enough.

Visit the Mad Matt Games Website
http://www.geocities.com/madmattgames/index.htm
Home of Magic Cube, Witch Bomber and Pinball Football (and a lame website)
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 14th Mar 2003 22:19
It's quite simple really.

You first start the download. Then you go into a WHILE loop that repeats every time until the download has completed. Each time in this loop you grab another bit of the file until you have grabbed all of it.

Here is an extract from my FTP program:



You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 14th Mar 2003 22:44
But how do you integrate that with the file commands to use "open to read" and "open to write", "write string" etc?

Visit the Mad Matt Games Website
http://www.geocities.com/madmattgames/index.htm
Home of Magic Cube, Witch Bomber and Pinball Football (and a lame website)
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 14th Mar 2003 22:45
I'm trying to make a universal hiscores spreadsheet and I've got all the code working for a local version so it just saves it to my computer but I need to convert it to a version that works with ftp.

Visit the Mad Matt Games Website
http://www.geocities.com/madmattgames/index.htm
Home of Magic Cube, Witch Bomber and Pinball Football (and a lame website)
xtom
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 15th Mar 2003 00:49
You could also save your data as a html file with all your data in a table which is easy to view through your browser and the likes of excel can easily import the file also.
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 22nd Mar 2003 23:35
Yeah that's what I just did. It's quite simple. Once you've done the main html stuff its just "<tr>" + data + "</tr>"

Visit the new Madd Matt Games Website
http://www.madamattgames.o-f.com/index.htm
Home of Witch Bomber,Magic Cube and Pinball Football(and a lame website)

Login to post a reply

Server time is: 2024-11-24 06:08:38
Your offset time is: 2024-11-24 06:08:38