Coding with a Spreadsheet...

Blitz3D Forums/Blitz3D Programming/Coding with a Spreadsheet...

Techlord(Posted 2005) [#1]
I've found myself using Micro$oft Excel as I code way too often... So much so, that its spark an idea for a new type of IDE.

Anyone else guilty of using Spreadsheets?


Rook Zimbabwe(Posted 2005) [#2]
Obviously not... I was looking for someothing similar... A way to do cells in Blitz...


Amanda Dearheart(Posted 2005) [#3]
What exactly do you mean by using Excel?
I know that Excel is a mathematical package that you can wirte math equations in, and have the package calculate those formulas for you.
So what type of apps are you using Excel for?
And how is it better than using Blitz3D's math functions?


Rook Zimbabwe(Posted 2005) [#4]
Excel is a Spreadsheet program that calculates values based on cell indices and custom formulas contained therein... numbers or $data can be entered. Complex calculations can be made effortlessly with built in functions... All in all a very neat program.

I need it to do something... I haven't really developed the idea yet as Blitz cannot access the excel dll (to the best of my knowledge) and cannot open a small excel style window ala VB.

BUT I am working on BlitzUI to do this... not getting very far but hey... this one is truly a "hobby idea" : )

RZ


_PJ_(Posted 2005) [#5]
When I first started using Blitz, and I want too aware of how it worked etc back then, I had the database for a RPG (i.e all the spell data, weapon/item data, skill information etc etc) all in M$ Access tables. I asked on here if there was a way to import the data at all, but unfortunately not. So there was me, not wanting to write it all out again, I had the amazing brainstorm:

Export tables to Excel format.

By using Extra Columns in Excel spreadsheet, and the COncatenate function, I could change something like:

(please excuse bad format)

__________________________
|WEAPON|COST|WEIGHT|MAGIC|
|______|____|______|_____|
|SWORD_|100_|50____|____1|
|AXE___|200_|75____|____1|

to the following:

DATA "SWORD",100,50,1

This was a great way to then get something that could be Copy & Paste-ed into Blitz no problem!

:)


Rob Farley(Posted 2005) [#6]
Would it not have been easier to export as CSV files then just read them into blitz? That way you've got nice soft coding going on too.

You'd end up with code something like

using my Entry function.

filein = readfile("weapons.csv")
repeat
l$ = readline filein ; read the line
l$ = replace(l$,chr(34),"") ;remove the quotes
w.weapon = new weapon
w\name = entry(1,l$,",")
w\cost= entry(2,l$,",")
w\weight = entry(3,l$,",")
w\magic = entry(4,l$,",")
until eof(filein)
closefile filein


Rook Zimbabwe(Posted 2005) [#7]
DANG!!! Good ideas all!!!


mrmango(Posted 2005) [#8]
Interesting..

I write SQL in my work place and always end up with Excel sheets with data to insert. So I concatenate the sql statements around the data and run the script.

Never thought anyone else would do that sort of thing. But suppose for Blitz, CSV would be easier.

Mango


_PJ_(Posted 2005) [#9]
Yeah Rob, that was, of course before you pointed out your Entry Function to me (in my other thread in fact!) and also before I'd used the Read & Write file commands. Although certainly a CSV export would be excellent for this.


___________

mrmango:
Yeah I have had to do the same thing with Excel to turn an Export into an update script for SQL. Apparently it's a popular method for many Report coding practices!


big10p(Posted 2005) [#10]
Some guy has written Pac-Man for Excel. :O