DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Class Import Error when importing class created/saved in DIAdem 2017

Dear NI-AE,

 

currently I am facing a problem in DIAdem 2017 when I am using a particular way to import a class. I try to import a class with the following code:

 

Sub Include(sInstFile)
    Dim f, s, oFSO
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    On Error Resume Next
    If oFSO.FileExists(sInstFile) Then
        Set f = oFSO.OpenTextFile(sInstFile)
        s = f.ReadAll
        f.Close
        ExecuteGlobal s
    End If
End Sub

 

In Diadem 2012 this method worked very well. The fun fact is that this method still works if I import a file (class.vbs) that had been saved in DIAdem 2012. As soon as I copy the text of this file (class_old.vbs) to a new file (class_new.vbs) and save it in the exact same way in DIAdem 2017 the filesize is bigger than in the 2012 version. I guess this additional information makes it impossible to use the above mentioned method to include classes into an existing script.

 

I have attached an example so you can see it yourself.

 

It would be very nice to know what additional information DIAdem 2017 is saving in the file and of course why the old method to include the class does not work anymore.

 

 

 

Thank you and kind regards,

Dani 😉

 

 

0 Kudos
Message 1 of 2
(2,786 Views)

Hello Dani,

 

The difference in the file size is due to supporting Unicode since 2014 for kinds of DIAdem files. I have tested your attachment with DIAdem 2017 SP1. This seems to work fine.

 

Greetings

Walter

0 Kudos
Message 2 of 2
(2,758 Views)