I have to put my .vml file in DB table. For that I have to keep this file in a single line.
Is there any way to format the velocity template file (.vm file) ?
Also it is difficult to troubleshoot with vm file when its not formatted.
Regards
jetbrain java IDE Intellig IDEA can be a choice for you
Related
I am using freemarker templates to automatically generate files. While this works fine so far - including changing the names of files - I have one additional feature I need. The name of some directories within the virtual file path have to be changed according to a template, for example:
/${flow.name}_design/...
/${flow.name}_implementation/...
Is there a way to achieve this with the template engine? Thanks for your help and best regards.
FMPP only creates output directories as needed. Since you can rename output files, and the directory can be part of the new name, you can influence if in what directory the output file will be created.
I often have the need to store a certain file version in a non-exe file, just the way I give a file version to an .exe, for example "1.0.392"
However, I have not found a way to do that for non-exe-files (such as .db files, etc.)
Is there are way to do that in a simple way?
Thank you!
I have an application that references two databases. The issue is, every time the database changes, I have to change the database string in the source code and recompile the exe. Is there a better way to do this? I was thinking I could save the strings to a file and have the application read from the file. Is this a good approach?
Yes, most common way to handle this is with a config file.
I need to create a text file for a game designer to edit variables in my C# script. I would like to be able to write the variable in the text file and the designer can put in a value and hten it would change in my script.
However, after much searching I have not been able to find a solution to my problem and was hoping someone with some experience in this method could help me.
I'm using Visual Studio for writing my scripts and the designer would require Notepad.
Thanks,
Chris
You can try using this class that will allow you to use ini files to hold your configuration.
I'm assuming your designer wouldn't like to use XML (which is the .NETy way of doing things); making humans edit XML is a form of torture anyway.
Here's the link to the CodeProject page: An INI file handling class using C#.
You can also use some other (relatively simple) format like JSON if ini files are too flat for you.
Is there a way in Visual Studio (any version) to embed the content of a file in another file upon compiling? For instance, if one wanted to embed an xml file in a vb code file how would it best be done?
Add the file to your project, right click on the file and select its properties. Under "Build Action" change it to "Embedded Resource". Now when you compile the file is automatically embedded as a resource.
Here is an example showing how to access an embedded bitmap resource.
Have a look at Resources. You can create a string resource that has your xml. This is then compiled into your application image.
Brian beat me about the embeded resource as I was looking for the resource URL :)
If you don't mind it actually being in your code, you can use an XML Literal.
I was about to mention using the #include preprocessor directive (for C and C++), but then you mentioned VB. I don't think VB supports such a thing.
I have no idea on how to go about doing this. But the first thought that came to my mind was that of Build Providers (the thing that generate classes from xml file in case of an ORM).
I searched & found 1 more thing called Custom Tools, which can act on a file existing in your solution and can be used to generate code file.
See if this link helps at all - http://www.drewnoakes.com/snippets/WritingACustomCodeGeneratorToolForVisualStudio/
What I've done in the past is write a simple .bat file that concatenates 3 different sources into a final source file that actually gets compiled. The .bat file is run as part of the Pre-Build event.
Project
SourceTop.vb
Source.xml
SourceBottom.vb
All of these files have a Build Action of "None"
Merged.vb
merge.bat
type SourceTop.vb > Merged.vb
type Source.xml >> Merged.vb
type SourceBottom.vb >> Merged.vb