A question, please.
I switched to version 6.20.1.
Previously version 6.10
I searched the site for the question that I have but I did not find a complete explanation.
My question is how the user snippets from version 6.10 can be inserted in version 6.20.1.
I suspect that simple cutting and pasting does not work here.
Does anyone have specific information whether and if so, how that can be done without causing problems?
There are two files located in AmiBroker directory that hold snippets:
CodeSnippets.xml - these are snippets shipped with AmiBroker installation (and can be replaced in subsequent installations, so don’t modify it!)
UserSnippets.xml - these are user-definable snippets. This file is NOT present in the installation and user can create it by him/herself.
Shortly, if this is a new installation (and there is no UserSnippets.xml file present in AB folder), you should copy this file from your previous installation to the new one.
Besides *.xml are human readable files, so if you need to, you can preview and edit such files.
Thanks for your reply.
Some of your information was known to me by reading some information on the former Yahoo user group, but I may have been insufficiently clear to explain what I am really not getting ahead of.
Cutting and pasting is usually easy, but is that also true with xml files?
When I click on UserSnippets-file she opens with Explorer. But I can not manage to paste the selection from my previous file. Copy can be made from one file (6.10) but I see no possibility to paste in the second file (6.20.1). If I use the F-12 key, then I will end up in a programming environment. Too complex for me right now.
I tried to do the exercise with Excel 2016 but for one file I manage to import, for the second file I get an error message.
The last sentence of Milosz’s previous answer gives perspective. Only, the question is how it is to be done.
Can someone advise with what program and / or how the cut and paste exercise can be made in a simple way?
I would be grateful!
First of all, if you just want to have your old code snippets in the new installation, you don’t need to edit this file. Just copy UserSnippets.xml to the new location.
If you have already created some new Code Snippets in the new Installation and want to have both old and new ones, you need to merge those two files into one by editing these files and copy-pasting some parts of the code. Before you do that - close all opened instances of Amibroker.
You don’t need any fancy software to edit txt or xml files. Just locate this file in Windows Explorer, right-click on it and choose Edit. After editing save the file.
Remember to make a backup first (before you modify anything) just in case something goes wrong…
It was your last sentence that helped me over the line. I have done a copy and paste operation and as far as I can see, both files are merged. And all Snippets can be used.
It can be that simple. But your information was needed to dare to do it. My thanks for it.
I thought I could now focus on the real work with Amibroker and a number of other programs.
But..., in my country they say: a train usually hides another ...
So, what's up? The previous configuration (Imac, Parrallels, Windows10) was not always stable. I switched to a fully-fledged Windows PC recently.
New installation done and now, suddenly, I notice that I became a 'local User'. This was not so during a couple of weeks. I guess since a re-install of Amibroker and Norgate because the last program had a small issue.
Some data now are written (sometimes) on the OneDrive folder, sometimes on my C:\ drive, sometimes at the bottom of my Local User account where a folder "Program Files (x86) has been created - unintentionally and unasked- under the folder" VirtualStore " With underneath ... a brochure "Amibroker", Amiquote, Data, Formulas, ... etc!
I hope that this evolution will not be the beginning of some difficulties...
To resume, thank you very much for you help, Dear Milosz.
In AmiBroker things are done in the simplest possible way. Pretty much all files except raw data files are text and can be edited. Binary is only used for quotes because we need speed and text is slow to process.
The very first thing I did after Windows 10 install is to wipe out "OneDrive".
Always run INSTALLER, do not copy files. Running FULL setup is essential to avoid "VirtualStore" as by default Windows Vista, 7, 8, and 10 does not allow you to write to Program Files subfolder UNLESS you are "setup" program. If you copy files to Program FIles dir instead of running setup, Windows would move your files to "VirtualStore".
@Tomasz I would like to ask you (and other users) whether installing some programs in user folder (in my case C:\Users\Milosz\Amibroker) instead of default location (like C:\Program files or C:\Program files (x86) is in general good idea or not? Usually when I install a program in user folder, most config or log files are saved by the program in the installation folder (or some subfolder in this location) and later are easy to find when I need to edit or copy such files. If the program is installed in a default location, config or log files are often saved in some distant locations and for this reason are much more difficult to find.
Are there any disadvantages or security precautions when installing software in user folder?
AmiBroker always saves all its files in its OWN folder, for precisely this reason: to have everything in one place (one folder), it worked so since 1995 Amiga days. But this is exception from the rule. Microsoft mantra is different, they spread files everywhere in dozens of locations.
So as far as AmiBroker is concerned you can install it to ANY folder. Myself, I install it in F:\AmiBroker (F: is my partition for programs). I can move the folder without worrying about Microsoft doing their "protection" via User Access Control and VirtualStore.
Other programs are other story. Many programs save data in "ProgramData" some save in "My documents" and many other locations creating typical Windows mess.
Just one important question. Is installing programs (other than AmiBroker) in User folder more dangerous (for any reason) than in default (C:\Program files) location - assuming for example (the worst case scenario) that such program contains some malicious code?
If program contains malicious code and you installed it, then no matter in which folder it is, you have trouble. It really does not make any difference if virus is executing from drive C, D, E or G.
Microsoft thinks that if they protect "Program Files" from writing without UAC prompt it will be "safe", but at the same time they implement VirtualStore mechanism which circumvents their own protection
I was suspecting that installing program in user folder might for example give it some higher privileges or access rights, but from your replies I draw conclusion that it is not the case.
Regardless of folder program is run with same privileges.
Normally it is run as regular user (i.e. lower privilege).
It can be run as elevated user (higher privilege), if and only if
you run it "as administrator" (right click or choosing "Run as admininstrator" in shortcut properties) - then you will see UAC prompt if UAC is enabled
program itself has "requireAdministrator" stored in program's manifest - then you will also see UAC prompt if UAC is enabled
This works the same regardless of folder where program is stored.
Your intervention, in response to my reply to Milosz's information, was concise, enlightening and, above all: resolving!
I have done exactly what you writed and since then your program runs perfectly. From itself and within a collaboration with a number of some relevant investment-software.
I can be less short: I will need a book to thank you enough!
I inform you when writing the last page.
With kind regards,
Laurent
P.s. As sole user of this PC, I have administrator rights since the beginning of the installation. Hopefully no chunks will come of that ...!!