Forum Discussion

blearyeye's avatar
blearyeye
Contributor
13 years ago

Name mapping expansion

In the TC editor (I'm using JScript), I can type

DDT.

and autocomplete gives a list of items. I can choose CSVDriver and press enter. What comes up is

DDT["CSVDriver"]()

rather than

DDT.CSVDriver()



I prefer the latter as being easier to read. The same thing is happening with name mapping. I can type

 frmParent.

(mapped to a form named frmParent) and a list of mapped objects comes up. I can choose frmEditCodes and what comes up is

frmParent["frmEditCodes"]

whereas what I'd prefer is

frmParent.frmEditCodes



Any idea how to change it?

4 Replies

  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Hello Bill

    Are you sure that JScript was selected as the project's scripting language? The square bracket syntax is specific to C#Script or C++Script.

    The scripting language is specified when creating a project and cannot be changed later. You can create a new JScript project and check whether autocomplete still suggests the square bracket syntax.



    Tip: You can set JScript as the default scripting language for every new project via the Project Options Dialog.

    Regards, Artem.
  • I remember choosing JScript as default when creating the project. When I look at Tools | Options | General | Project, I see the default set to JScript. When I create a new script, JScript is what's assumed. So I don't see that this is what explains it ... 
  • I did create a new project, confirming that JScript was the default. Now things are showing up ok. Odd



    However, on my new project, when I right click on a function, the option to "Run Current Routine" is greyed out so I can't actually run a function (yes, it is a function with no arguments). Ideas?


  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Hello Bill,



    Glad to hear you resolved the autocompletion issues.



    As for the "Run Current Routine" command, it can be disabled in three cases:

    1. The selected routine requires input arguments.

    2. Some test or routine is already running.

    3. The script unit where the routine is implemented contains syntax errors.



    The latter is likely to be your case. See Checking Syntax to learn how to find the problematic lines.



    Regards, Artem.