Problems with location of layout files

0 votes
asked Jul 9 in AmiBroker by TheDoc
I sorted my layouts to make them easier to locate and select, with particular attention to the local layouts. All worked fine until I copied all to computer B and found that the local layouts did not transport.- old local layouts persisted. I returned to computer A and found that although local layouts appear as they should in Amibroker, their files do not appear in the layout directory. A search for the layout names or even the word 'local' through the Amibroker directory produces nothing. Where have they gone ? What precautions should I take in moving them back to the layout directory. (assuming I can find them !)

1 Answer

0 votes
answered Jul 13 by anonymous

You don't copy layout files that way.

Layouts are SMALL and incomplete part of chart setup

To properly copy chart you have to follow the manual:

http://www.amibroker.com/guide/h_sheets.html

To copy chart setup from one computer to another you need to save your chart into "Chart template, complete (.chart)" file.

To Save chart into new format do the following:

image

  1. Click with RIGHT MOUSE button over the chart and select Template->Save...
  2. In the file dialog, "Files of type" combo select "Chart Template, Complete (*.chart)"
  3. Type the file name and click Save.

To load previously saved complete chart do the following:

  1. Click with RIGHT MOUSE button over the chart and select Template->Load...
  2. In the file dialog, select previously saved *.chart file and press "Open"

Note: The procedure AmiBroker does internally is as follows: When you save the chart into new format it saves XML file with:

  • names of all sheets, panes, their sizes, locations and other settings
  • paths to all formulas used by all panes
  • the text of formulas themselves

When you load the chart in new format AmiBroker:

  • sets up the sheets/panes according to information stored in the file
  • for each formula stored in the file it checks if the same formula exists already on target computer:
    • if it does not exist - it will create one
    • if it exists and the contents is identical to the formula stored in .chart file it will do nothing
    • if it exists and the contents is different then it will create NEW formula file with _imported.afl suffix (so old file is not touched) and will reference the pane to the _imported.afl formula instead.

IMPORTANT NOTE: if you use any #include files AmiBroker will store the contents of include files as well inside chart file and will attempt to recreate them on target machine. Please note that in case of includes it will check if it exists and if it is different. If both conditions are met (different file exists already) it will ask to replace or not. If you choose to replace - it will replace and make backup of existing one with .bak extension. If you are using any files in "standard include files" and include them using <> braces, AmiBroker will restore files in target machine standard include folder as well (even if the standard include folder path is different on the source machine).

A new .chart format is intended to be used to port charts between different computers. For storing layouts/templates on local computer you should rather use old formats as they consume much less space (they store only references,not the formulas themselves). One may however use new format for archiving purposes as it keeps formulas and all references in one file that is very convenient for backups.

commented Jul 17 by anonymous
Thanks heaps Anonomous. Very comprehensive answer
...