DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does diadem intellisense not work when using scriptinclude or for global object

I have a script with a different classes in it (scripted 1).  When I create an object of a class in the script 1 intellisense works.  Intellisense is when you type name of the object created from a class it shows all the possible variables and functions contained in that object.  But when I write another script and use scriptinclude(scripted 1) the intellisense does not work.  I also tried a global object and intesllisense does not work.  Is there a way to get intellisense to work when using scriptinclude?  I am working with version 2012. 

0 Kudos
Message 1 of 6
(5,320 Views)

Here is more information on the issue.

 

I have a script with a different classes in it (scripted 1).  When I create an object of a class in the script 1 intellisense works.  Intellisense is when you type name of the object created from a class it shows all the possible variables and functions contained in that object.  But when I write another script and use scriptinclude(scripted 1) the intellisense does not work.  I also tried a global object and intesllisense does not work.  Is there a way to get intellisense to work when using scriptinclude?  I am working with version 2012. 

 

'Test.vbs

class test

    public function test1()

         msgbox("test1")

    end function

    public function test2()

         msgbox("test2")

    end function

end class

'now create a object of the class

dim oTest

set oTest=new Test

'now when you type oTest. you get the following functions to choose from

oTest.test1

        .test2

 

Now if you remove the object from Test.vbs and create a main program with scriptinclude(Test.vbs) it will not show the two functions

 

'Main.vbs
Option Explicit  'Forces the explicit declaration of all the variables in a script.
call scriptinclude("c:\1atmp\Test.vbs")
dim oTest
set oTest=new test

'now when you type oTest. it shows none of the functions in the object oTest
oTest.

 

 

 

0 Kudos
Message 2 of 6
(5,292 Views)

James,
ScriptInclude binds a script to another script, but it does it dynamically at runtime, not edit time.


As far as I can tell, there is not a way to force the IntelliSense into looking to this script for autocomplete options.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 6
(5,289 Views)

I am new at scripting in DIAdem but how to people get around this?  I can't see everybody only having one big script for every function they want to use or just cutting and pasting the functions into each new script.

0 Kudos
Message 4 of 6
(5,284 Views)

James,
According to the DIAdem 2012 Help: CodeCompletion (towards the end of the page), "If you define a class in a script, you can use CodeCompletion for this class."


CodeCompletion will only work inside the .vbs file that you create the class in. I am surprised this has not been submitted to the DIAdem Idea Exchange. I would encourage you to post it there, as R&D actively looks at this list to implement new features in DIAdem.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 6
(5,269 Views)

Hi James,

 

Intellisense has only been a feature in the DIAdem SCRIPT editor since DIAdem 2010, so most experienced DIAdem programmers are used to not having any Intellisense.  The short answer is that it's not there yet because it's not implemented.  R&D knows about the gap and would like to address it, but it turns out it's not a trivial tweak, so it has to wait in the priority list.  Adding votes to the DIAdem Idea Exchange would help it move up the list.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 6
(5,229 Views)