You are here

Saving text files with Scheme script


I want to write a script that would gather information on some pixel colors and save it in a preformatted text file. Is it possible with Scheme scripting? All the file procedures I have seen were related to dedicated formats, there is no general-purpose file handling...

I know about Perl Fu, which would make it quite easy, but I am working with Windows...

For tasks like this it is usually much better to tell what information you do need (and for what purpose). Chances are that there might be better approaches towards your goal.

I will describe what I need in detail: I want to create an automatic sequence in SPIN language for LED Painter (created by Brilldea). For that purpose I need to gather the values of colors of some pixels (every second pixel in every fourth row - i.e. 64 steps for 16 channels, about 3000 values) and save them in a text file in the form of "128, 255, 0" or "$80, $FF, $00". The data might be on a one very long line, fortunately SPIN is very forgiving about that. Of course, the data itself do not constitute the whole program, therefore they should be preceded and followed by several lines of code (which is always the same). It would be perfect if this could be done from the script level. It would be also very useful if the script asked for a total time of running and put that information in the relevant place in the SPIN code. I hope this makes it clearer, if not, I can explain further. Naturally, I know that this could be rather trivial to do in a different programming language - if fact, I have already written such a program (unfortunately, I have chosen a piece of bloatware called Visual Studio Express - never again!). However, as the pattern images themselves are best done in GIMP (for its excellent gradient functions) and I have a template for that, doing everything in GIMP would be much more elegant...

I know about Perl Fu, which would make it quite easy, but I am working with Windows... This is also a easy task for Python-fu and it's available under Windows.

Deleted. I already posted to this thread.
Subscribe to Comments for "Saving text files with Scheme script"