Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Q. How can I modify a System gmSL routine?

A. Add a gmSL block replacing the method to your translation Script as described below.

A typical gmStudio translation is directed by several things:

  • Your source code
  • The gmPL and gmSL commands in rule files and scripts that you integrate with your upgrade solution
  • The system metalanguage files that define VB6/ASP language elements 
  • The system gmSL scripts that provide common dynamic processing 
  • The logic in the gmBasic executable 

...

This effectively overrides the default implementation with the one provided.  The effect on the csproj file can be seen in this difference report:


Overriding AuthorText routines with dependencies

In many situations you may want to override AuthorText routines that have dependencies.  For example lets say you want to override the ClassFile, AssemblyFile, and EndNewcProject routines.  You would start by copying these methods into a text file (e.g. DCOMAuthorText.gmsl) and place it in your workspace\usr folder.  Next modify your copy  so that any references to symbols still in the original AuthorText.gmsl are prefixed by AuthorText (i.e. the authortext.gmsl Class name). 


Code Block
*****DCOMAuthorText.gmsl
      Write.Line("!)(!");
      int StartupIsForm = AuthorText.hasStartupForm(); <==
      if (StartupIsForm)
***** \installdir\support\METALANG\AuthorText.gmsl
      Write.Line("!)(!");
      int StartupIsForm = hasStartupForm();
      if (StartupIsForm)

Once this is done, you can direct the transaltor to use your overrides by adding a <gmsl > command to your translation script prior to the Compile command:

Code Block
<gmSL NameSpace="gmSL" Source="..\usr\DCOMAuthorText.gmsl" />
...
<Compile ...>