amibroker

HomeKnowledge Base

New keywords in AFL and possible conflict with user-defined variables

AmiBroker 4.91.0 BETA introduced the following new keywords:

switch, case, break, continue, default

You have to make sure that your formulas do not use them as variable names. The above words are now reserved AFL keywords and if you use them for your own variables you need to replace this identifiers with names that do not conflict with the reserved keywords.

This article shows how to perform multiple-file text replace very quickly.

To quickly update all your AFL files you can use this freeware tool:

TextRep 2.0 from:

http://www.no-nonsense-software.com/cgi-bin/redirect/cgirdir.exe?texrep

More info:
http://www.no-nonsense-software.com/freeware/

Instructions:

1. Download from http://www.no-nonsense-software.com/cgi-bin/redirect/cgirdir.exe?texrep
and unzip

2. Run setup program (from inside zipped folder)

3. Run TextRep 2.0 program

4. Switch to “Scan folder(s)” page

5. Enter AmiBroker Formulas folder (by default it is C:\Program Files\AmiBroker\Formulas),
mark “Include subfolders” and enter *.afl into “File types” as shown in the picture

6. Enter “switch” in the “Text to find” box and “switchvar” in the “Replace with” field.
“Case sensitive” should remain UNchecked. (Texts should be entered without quotation marks)

Text Rep 2.0 screen

7. Press Start to go on with replacing

8. Repeat steps 6 and 7 with the following word pairs:
“case” -> “casevar”
“break” -> “breakvar”
“continue” -> “continuevar”
“default” -> “defaultvar”

9. Run AmiBroker 4.91 and check if everything works fine. If so, you may delete .bak (backup) files created during replace process.

8 Responses to “New keywords in AFL and possible conflict with user-defined variables”

  1. April 5th, 2007 | 1:18 pm

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

  2. April 15th, 2007 | 4:01 am

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

  3. April 22nd, 2007 | 5:18 am

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

  4. May 3rd, 2007 | 11:24 am

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

  5. May 23rd, 2007 | 9:43 am

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

  6. July 21st, 2007 | 10:23 am

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

  7. August 11th, 2007 | 3:52 pm

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

  8. September 13th, 2007 | 8:57 pm

    […] If your formula uses the following names: switch, case, break, continue, default as user-defined variable identifier then you would need to rename them. To do so follow the instructions in this article: http://www.amibroker.com/kb/2007/04/05/new-keywords-in-afl-and-possible-conflict-with-user-defined-v… […]

Leave a reply