Custom_Code.c coding help:Perl script
Custom_Code.c coding help:Perl script
Hello
I alread posted my script in the Component vote thread, but am not quite sure if every one has seen it, or I may be the only one who forgets to set the code right or makes typing errors.
Anyway, I coded a script, that sets inside the Custom_Code.c file the corresponding MacroReturns, MacroNames and so on, so that YOU do not need to care about them while implementing new functions to the file. I sometimes was tired of editing these descriptions when I tried to implement different things and finally wrote a Perl script that now does the job for me, so I can concentrate on ONLY writing the C code and nothing else, an easy "perl set_code.pl" on the command line does the job and you're done with it.
well, it may not be for everyone, but it helps me from now on in new projects so that I don't have to care about how many functions I am writing and so on. now it is coding -> perl script -> flowcode implementation -> done! and no more fiddling with spelling errors.
for setting things up, there is a short description at the beginning of the script.
cheers and have fun,
Nils
PS: you get a free Perl version for windows @ activestate.com
PPS: if you find bugs or have ideas what to implement next, write it down in this thread and I try to figure it out.
PPPS: I WILL POST NEW VERSIONS EVERY ONCE IN A WHILE, SO LOOK FOR THE LATEST ONE IN THIS THREAD AS I WILL NOT UPDATE THE DOWNLOAD LINKS
I alread posted my script in the Component vote thread, but am not quite sure if every one has seen it, or I may be the only one who forgets to set the code right or makes typing errors.
Anyway, I coded a script, that sets inside the Custom_Code.c file the corresponding MacroReturns, MacroNames and so on, so that YOU do not need to care about them while implementing new functions to the file. I sometimes was tired of editing these descriptions when I tried to implement different things and finally wrote a Perl script that now does the job for me, so I can concentrate on ONLY writing the C code and nothing else, an easy "perl set_code.pl" on the command line does the job and you're done with it.
well, it may not be for everyone, but it helps me from now on in new projects so that I don't have to care about how many functions I am writing and so on. now it is coding -> perl script -> flowcode implementation -> done! and no more fiddling with spelling errors.
for setting things up, there is a short description at the beginning of the script.
cheers and have fun,
Nils
PS: you get a free Perl version for windows @ activestate.com
PPS: if you find bugs or have ideas what to implement next, write it down in this thread and I try to figure it out.
PPPS: I WILL POST NEW VERSIONS EVERY ONCE IN A WHILE, SO LOOK FOR THE LATEST ONE IN THIS THREAD AS I WILL NOT UPDATE THE DOWNLOAD LINKS
- Attachments
-
- set_code.pl.zip
- (3.68 KiB) Downloaded 876 times
Last edited by nils on Sat Feb 23, 2008 12:28 pm, edited 1 time in total.
Custom_Code.c help needed? -> http://tinyurl.com/2y2mzq
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Custom_Code.c coding help:Perl script
Hello Nils
I had thought of creating a Perl or PHP script to do this but never managed to get around to it.
Thanks for your input. I hope you will be happy in the knowledge that your code will aid us to creating new components.
If I find bugs, incompatibilities or problems with the code then I will let you know here.
Thanks again.
I had thought of creating a Perl or PHP script to do this but never managed to get around to it.
Thanks for your input. I hope you will be happy in the knowledge that your code will aid us to creating new components.
If I find bugs, incompatibilities or problems with the code then I will let you know here.
Thanks again.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Custom_Code.c coding help:Perl script
I thought you would
it is not completely bug proven, but it works for me. unfortunately it does not contain compatibility to your style of coding i.e.
in contrast to mine that is
but maybe you have the excellent solution and can contribute on the script
it is not completely bug proven, but it works for me. unfortunately it does not contain compatibility to your style of coding i.e.
Code: Select all
void something()
{
some code;
more code;
}
Code: Select all
void something(){
some code;
more code;
}
Custom_Code.c help needed? -> http://tinyurl.com/2y2mzq
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Re: Custom_Code.c coding help:Perl script
dupe, double post
Last edited by nils on Wed Feb 13, 2008 5:36 pm, edited 1 time in total.
Custom_Code.c help needed? -> http://tinyurl.com/2y2mzq
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Re: Custom_Code.c coding help:Perl script
so if anyone is interested in what my script is doing (in a brief explanation + flowchart), I wrote up a little LaTeX document to introduce my script and the "Macro" definitions I am altering/generating with it.
hope it helps people that were a bit helpless like me seeing the Custom_Code.c file for the first time
cheers,
nils
hope it helps people that were a bit helpless like me seeing the Custom_Code.c file for the first time
cheers,
nils
- Attachments
-
- Custom_Code.pdf
- (116.46 KiB) Downloaded 966 times
Custom_Code.c help needed? -> http://tinyurl.com/2y2mzq
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Custom_Code.c coding help:Perl script
Hello Nils
Just had a look through your PDF. It's fantastic, thanks for all the work you have put into this. I have yet to verify the script itself but the next coding that I do I will try it out.
Thanks again.
Ben
Just had a look through your PDF. It's fantastic, thanks for all the work you have put into this. I have yet to verify the script itself but the next coding that I do I will try it out.
Thanks again.
Ben
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Custom_Code.c coding help:Perl script
version 1.1b_2
hi there
this evening I tweaked a bit the code for supporting different styles of braces, as I know that you folks of MM do it another way as I do, and maybe others out there too. now following things are possible:
there are a few things missing, but I hope you like it anyway.
I used it a few times this week while adding/deleting functions and it worked like a charm
edit: added support for closing curly braces, wherever they may be. only thing with braces not working is some weird stuff like the following code, but this is REALLY ugly IMO:
PS: comments and bug reports are always welcome.
hi there
this evening I tweaked a bit the code for supporting different styles of braces, as I know that you folks of MM do it another way as I do, and maybe others out there too. now following things are possible:
Code: Select all
void something1(){
some code;
more code;
}
void something2()
{
some code;
more code;
}
void something3()
{ some code;
more code;
}
void something4()
{ some code;
more code;}
I used it a few times this week while adding/deleting functions and it worked like a charm
edit: added support for closing curly braces, wherever they may be. only thing with braces not working is some weird stuff like the following code, but this is REALLY ugly IMO:
Code: Select all
void Test(short Foo){int Bar;
more code;
}
- Attachments
-
- set_code.pl_1.1b_2.zip
- (4.29 KiB) Downloaded 701 times
Last edited by nils on Sat Feb 23, 2008 2:48 pm, edited 1 time in total.
Custom_Code.c help needed? -> http://tinyurl.com/2y2mzq
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Re: Custom_Code.c coding help:Perl script
version 1.2
changed recognition of functions, so that ugly things like this one
will result in
and now time stamps of the backups are a bit nicer than before e.g. Custom_Code.c.Sat_Feb_23_13-43-23_2008.
regards,
nils
changed recognition of functions, so that ugly things like this one
Code: Select all
void Test(char Foo, short Bar){ugly code; do not try to do so;}
Code: Select all
void Test(char Foo, short Bar){
/*Macro_Test_Start*/
ugly code; do not try to do so;
/*Macro_Test_End*/
}
regards,
nils
- Attachments
-
- set_code.pl_1.2.zip
- (4.32 KiB) Downloaded 677 times
Custom_Code.c help needed? -> http://tinyurl.com/2y2mzq
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Re: Custom_Code.c coding help:Perl script
Hi there
new updated version of the documentation:
- changed flowchart
- added a short description how to invoke the script in Win/Lin/Uni/Mac environments
have fun with it
nils
new updated version of the documentation:
- changed flowchart
- added a short description how to invoke the script in Win/Lin/Uni/Mac environments
have fun with it
nils
- Attachments
-
- Custom_Code.pdf
- (150.38 KiB) Downloaded 920 times
Custom_Code.c help needed? -> http://tinyurl.com/2y2mzq
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx
Flowchart high quality vector graphic output =>>http://tinyurl.com/6sx2sx