Book a Demo

Author Topic: Actionscript 2.0 Interface bug with fix  (Read 2641 times)

sunetos

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Actionscript 2.0 Interface bug with fix
« on: February 08, 2006, 12:03:59 pm »
By the way, the Actionscript Code Generation Templates do not correctly handle Interfaces: they include empty {} for the body of methods in Interfaces, which is incorrect, and causes at least the mtasc compiler to fail.  To quick-fix, simply paste the following into the top of the Template "Operation Body" for ActionScript:

Code: [Select]
%if elemType=="Interface"%
;
%endTemplate%


And to get that semicolon on the same line as the method declaration, update the "Operation" template for ActionScript to be:

Code: [Select]
%OperationNotes%
%OperationDeclaration%%OperationBody%


Interface methods should only be declarations: they should not contain defined method bodies.
« Last Edit: February 08, 2006, 12:04:46 pm by sunetos »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Actionscript 2.0 Interface bug with fix
« Reply #1 on: February 09, 2006, 02:05:18 pm »
Thanks for reporting the problem.

I've just modified the default templates with the following.

Operation Template
Code: [Select]
%OperationNotes%
%if elemType=="Interface"%
%PI=""%
%endIf%
%OperationDeclaration%
%OperationBody%

Operation Body Template
Code: [Select]
%if elemType=="Interface"%
;
%endTemplate%

{
$wrap = %genOptWrapComment=="-1" ? "-1" : "40"%
$behaviour = %WRAP_LINES(opBehaviour, $wrap, "\t//", "")%
%if $behaviour != ""%
$behaviour\n\n
%endIf%
%if opCode != ""%
%WRAP_LINES(opCode, "-1", "\t", "")%
%elseIf opStereotype == "property get" and opTag:"attribute_name" != ""%
\treturn %opTag:"attribute_name"%;
%elseIf opStereotype == "property set" and opTag:"attribute_name" != ""%
\t%opTag:"attribute_name"% = newVal;
%endIf%
}

sunetos

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Actionscript 2.0 Interface bug with fix
« Reply #2 on: February 24, 2006, 07:02:44 am »
Thanks!  I was glad to see the Actionscript updates in build 787.