Read tool parameters from a file

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
nathani
Posts: 7
Joined: Mon Jun 26, 2006 2:02 pm

Read tool parameters from a file

Post by nathani »

I'm having a problem, I am using tools to run compilers for C source code. The problem I am having is that depending on the processor and other variables the parameters that are required for the tool are different. Is there any way that I can read these parameters out from a file, that way I can consolidate all my tools into one and have different read files for each source code. This would be preferable to have multiple tools. Also there are multiple users in our group and the tools need to be set up for each user and if the parameters change or we need a new tool created then some users are using the old parameters.

An example of my tool looks like this:

Code: Select all

Command: cmd.exe
Parameters: pic30-gcc.exe -mcpu=30F6010A -c -x c $filename -o $BaseName.o -g -Wall -save-temps  && pic30-objdump -S $BaseName.o >$BaseName.lst && pic30-gcc.exe -Wl,"$BaseName.o",-L"%PROJECTS%\CommonCode\PIC",-L"%PROJECTS%\CommonCode\SlideoutCommonFiles",--script="$BaseName.gld",-o"$BaseName.cof",-Map="$BaseName.map",--report-mem,--no-isr && pic30-bin2hex.exe $BaseName.cof -a
Initial Folder: $FileDir
Lostclown
Posts: 8
Joined: Fri Oct 15, 2004 1:12 pm
Location: Iceland

Post by Lostclown »

For something like this I think you would need to write a intermediate script/tool that would receive your current filename from Textpad.

This script could detect the filetype from the filename parameter and use this to find the correct parameters from the corresponding file and finally execute the "real" tool.

(I believe Textpad can also send both filename and extension as separate parameters to the script so it will not need to detect/parse the extension).
Post Reply