Create .c-files and .h-files - atmel

How do I create simple .c-files and .h-files in Atmel studio? I know that this is a really simple question but that is kind of the problem, al questions regarding this topic seems to be special cases and exceptions. This is just concerning ordinary files. I have a few files that is included but I need to add a few more files.

Use File -> New (or Ctl+N) to bring up the new file dialog. From there you should be able to select "C/C++" from the Installed templates area on the left to then select "C File" for a blank .C file or "Include File" for a blank .H file.

Related

How do I exactly search a file in my project with atom?

I know I have a file called 'mwc-fab' in my dependency,
so How can I search this file with the file name?
In vscode, i just type mwc with my node_modules file select and I get the file I want.
If you're using a Windows computer the command is Ctrl+T or Ctrl+P and on Mac Cmd+T or Cmd+P
https://flight-manual.atom.io/getting-started/sections/atom-basics/
There is an Atom package named incremental search that you can use to search thru open files. After installing incremental-search you can type command-i and this opens a text box near bottom of screen where you can input your search string. After that you can command-i repeatedly to go to next matching string. Be sure to read the directions for more useful commands.

Customize IBM DiffMerge to export a custom Report

I am using IBM DiffMerge to generate a Report that shows all differences between two .cls files or .sbs files. I was playing with it and I saw that there is a filed in option menu that allows you to change the format of the report, but it implies some keywords, like $elemname to print the element's name or $elemtype to print its type $leftonly or $rightonly which show how many differences are in the left diagram or in the right one.
Now, I was wondering if there are more variables like those above, especially one that can print a component's GUID (unique ID in Rhapsody).
Thanks,
Daniel
I would expect that $GUID will give you what you're looking for.
Under the ReporterPlus installation folder there is a folder named Templates. In it you'll find a file named DiffReport.dpl which you can load it into ReporterPlus for editing like any other template. You must run Rep+ with a command line option so that it loads with the Diffmerge specific schema:
Reporter.exe /mode=dfm
After that you can load the Diffmerge template, and edit it to customize the output of DiffMerge reports. When you do, try adding $GUID into the output.
Regards, Simon

How to create a link that downloads a new file instead of opening the source file (rmarkdown)

My rmarkdown code produces a html document. This document lists out the process that needs to be followed by front line staff at month end. The process flow requires users to open xl files, update a few fields (such as report month etc) and then run macros.
I have used hyperlink to the original XL files as follows
[click to opel xl file](path/and/file names)
The above link opens the original file and the user is able to
overwrite the original file, I don’t want this to happen.
I want the hyperlink to generate a new file that would be downloaded
so that nothing happens to the original file. How to do this?
Please could you kindly help me out.
Thanks in advance
After extensive research, this can't be done using conventional rmarkdown!

Batch file write to txt

I want to make a batch file that will ask user for input, than write that input to a specific position in an already written txt file(called commands.txt which contains query) and call sqlite3 < commands.txt
I need this so inside the commands.txt where the query is, in LIKE 'userinput' i will add the users choice (parameter)
Although your question is not really specific enough and verging on the kind of inappropriate question that for stackoverflow (it does not include code), as hinted at by the comment, I'll take it at face value and assume there is much you need help with.
First let me deal with the question "I need to make a batch file"
A batch file is a simple text file with the extension .bat. You can create it with a text editor like notepad. We do not know what kind of system you have (Windows, linux, Mac etc) but lets assume Windows as you asked for a batch file. We do not know which version of windows (7 or 8 etc), So I'll try and be generic.
All windows machines come with a simpe text file editor called notepad. You can open this by typing notepad into the search box on windows 7 or 8. Lets start with a simple batch file:
:: This is a batch file
#echo off
echo Hello World
exit /b
Type (or paste) those 4 lines into notepad. Now select the file menu and select Save As, now in the Save As Type: selector choose All Files. In the File name: box type the desired name with the bat extension, such as doit.bat. Ensure you choose a suitable directory to place your new batch file. Leave the encoding as ASCII. Click Save. You have now made your first batch file.
Now you need to execute that batch file. Using the Windows File Explorer find the folder where you saved that batch file. While viewing the folder, hold down the shift key on the keyboard and then right click in the background of the folder and select Open Command window here. You will now have a command prompt window. You can now execute your new batch file by typing its name doit. It will display:
Hello World
OK - Now you have created your first working batch file.
Now for the next part; Asking the user for input. This is done with the set /p command. Add this to your batch file (before the exit line):
Set /P Like="Give me your input: "
echo Your input was: %Like%
That has solved the second part. Now the third part, edit the commands.txt file. If you do an internet search for a similar problem (editing files in batch files) you might find this help page: http://www.ousob.com/ng/edlin/ng96d9.php. This shows a generic way of changing any text string to any other in a file using EDLIN from a batch file; unfortunately EDLIN (and EDIT) are no longer included in windows so these batch files are not much help.
A search of stackoverflow finds similar queries which contain an answer for you.
So now you have all the parts of the answer:
How to make a batch file
How to prompt the user for input
How to replace lines of text in the commands.txt
You should be able to put it together and get it to work....

How can I programmatically add build files to Xcode4?

I've been trying to figure out how to programmatically add files to an Xcode4 project and it seemed like AppleScript would be the way to go, however I'm running into "missing value" errors.
Here's the code I've got:
tell application "Xcode"
set theProject to first project
set theTarget to first target of theProject
set theBuildPhase to compile sources phase of theTarget
tell first group of theProject
set theFileRef to make new file reference with properties {full path:"/Users/jeff/Projects/XcodeTest/XcodeTest/MyViewController.h", name:"MyViewController.h", path:"XcodeTest/MyViewController.h", path type:group relative}
add theFileRef to theProject
end tell
--tell theBuildPhase to make new build file with properties {build phase:theBuildPhase, name:"MyViewController.h", file reference:theFileRef, target:theTarget, project:theProject}
end tell
I've tried the commented-out line instead of the add-command as well, but that doesn't work either (I get "missing value").
The 'add' error is:
error "Xcode got an error: file reference id \"251AD3431432472E006E300F\" of Xcode 3 group id \"251AD32C14324645006E300F\" of project \"XcodeTest\" of workspace document \"XcodeTest.xcodeproj/project.xcworkspace\" doesn’t understand the add message." number -1708 from file reference id "251AD3431432472E006E300F" of Xcode 3 group id "251AD32C14324645006E300F" of project "XcodeTest" of workspace document "XcodeTest.xcodeproj/project.xcworkspace"
The "make new reference" does add the file to the list of files in Xcode, but I also need it to be added to the project target so that I can add actions and outlets to the file from Xcode w/o having to first check the checkbox to add it to the "target membership".
I ended up sending this question to the devs on the xcode developer list and the response I got was effectively "you can't".
This appears to be completely broken in Xcode4, but I've seen a project that does it. I think what they are doing is parsing and modifying the "project.pbxproj" file directly. (this file is hidden inside the xcodeproj bundle)
The file is a GUID soup, but once you look at it for a while it seems possible to safely modify it, especially if you are only adding stuff.
Edit:
Found this stackoverflow answer that might help.
Tutorial or Guide for Scripting XCode Build Phases
There is a poorly documented user defined build setting that can be added. Files can be both excluded and included from compilation
Go to your target's Build Settings > Tap the + button > Add User-Defined Setting
The key is either INCLUDED_SOURCE_FILE_NAMES or EXCLUDED_SOURCE_FILE_NAMES
The value is a space separated list of file paths
See reference:
http://lists.apple.com/archives/xcode-users/2009/Jun/msg00153.html

Resources