10-22-2012 07:01 AM
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.
10-23-2012 02:02 PM
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.
10-23-2012 02:25 PM
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.
10-23-2012 10:09 PM
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.
10-24-2012 09:48 AM
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.
10-30-2012 01:25 PM
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