Go to Post FIRST itself is simply a mechanism, not the real goal. - msd [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 30-01-2004, 15:17
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Lookup table generation tool

EDIT: I had earlier attached a .xls file, but I just tried to open it and got garbly-gook. Here it is zipped up; this should work better. Also, In the example I've attached, it's just a linear transformation (y=x) and is basically useless as is. But you can change the spreadsheet formulas to generate whatever lookup table you like.


If you've been generating lookup tables for your program, you know that it's not much fun to have to manually type all of the raw values into your code.

I generate all of my lookup tables in Excel, and I wrote this Excel macro to export the data to a text file so that it's much easier to just cut and paste the lookup table declarations from the text file into the C code.

Enable macros when you open up the .xls file, and use the Excel spreadsheet/math functions to create your lookup table. Then just specify the filename and hit the Export button. If you want to customize the VBA code for the macro, from Excel just go to View-Toolbars-Visual Basic and then click on the Visual Basic Editor button. The VBA code is pretty self-explanatory.

Maybe this will save you a few minutes of tedious typing...

EDIT: I had earlier attached a .xls file, but I just tried to open it and got garbly-gook. Here it is zipped up; this should work better. Also, In the example I've attached, it's just a linear transformation (y=x) and is basically useless as is. But you can change the spreadsheet formulas to generate whatever lookup table you like.
Attached Files
File Type: zip LookupTableGenerator.zip (13.8 KB, 257 views)

Last edited by WillyC : 30-01-2004 at 17:06. Reason: .xls file viewing problem
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Your favorite/most useful tool? f22flyboy General Forum 154 13-03-2011 00:51


All times are GMT -5. The time now is 20:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi