April 5, 2007
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)
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.
Filed by Tomasz Janeczko at 5:27 am under AFL
8 Comments
[…] 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… […]
[…] 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… […]
[…] 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… […]
[…] 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… […]
[…] 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… […]
[…] 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… […]
[…] 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… […]
[…] 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… […]