DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Obsolete Functions 2017

Hello

 

I have noticed that there are a few function I use extensively through my applications that appear to be obsolete in 2017 64bit version of DIAdem.

 

To name a few they are as follows; CHDX, GROUPDEFAULTGET, CHT, CHNPROPGET, GROUPDEL, GROUPCREATE. to name a few.

 

These functions still work in my 2017 version of DIAdem however when coding them they no longer change color. 

I was wondering what does this mean in the future?   Will scripts with these functions, at some point, no longer work?

 

Thanks

Tim
0 Kudos
Message 1 of 8
(3,422 Views)

Hi Tim

Many of the obsolete commands and variable are still working in DIAdem 2017, some of them might also work in DIAdem 2018, but you can't be sure. Typically we wait one or two revision to remove them completely, but at one point they will no longer work. For most obsolete command or variable you find a note in the help how to replace them. In 2017 we also add an "example" to search for obsolete names. It is linked from each obsolete command or variable in the help.

Please run this example from the help to find all the obsolete names in your scripts and replace them with new functions. As you mention the obsolete names are no longer highlighted in your code.

 

Winfried

0 Kudos
Message 2 of 8
(3,410 Views)

Hi Tim,

I would like to explain a bit the background regarding the obsolete functions and variables. We get frequently feedback from our customers, that most every year the number of test and the amount of data increases and with that the time and effort customer’s must invest to make their job.

 

Therefore, we investigate and research for optimized and faster functionality in DIAdem. The outcome can be a new strategy to analyze data, like the new mathematical EventFunctions of DIAdem 2015 and 2017, or new interfaces for data and object handling like the REPORT-API (DIAdem 2012) and DATA-API (DIAdem 11.1).

Having for example a new API doesn’t mean that the old technology doesn’t work anymore. Quite the contrary. As you can see for the DATA- and REPORT-API we are compatible for a long time – the old commands are still working in DIAdem 2017. But supporting the old technology and the new one in parallel also means the DIAdem may not work as fast as it could if we just support the new technology.

 

Consequentially, it is necessary to get rid of these old commands, one day. This is a process which will be realized step by step. For DIAdem 2018 this means that most of the commands still work. The biggest exception are the REPORT commands GraphObj… . These commands are no longer supported in 2018.

The example “Searching for Obsolete Commands and Variables” is designed to help you finding the old commands in your scripts and make the converting process a bit easier.

 

Even if you must invest time to convert your scripts, it is not necessary to do this right now - you can take time. But in the end, you get a benefit in having a better script structure and a much better performance.

 

Greetings

Walter

0 Kudos
Message 3 of 8
(3,389 Views)

That's Walter

 

Just trying to get in front of this.

Tim
0 Kudos
Message 4 of 8
(3,369 Views)

Hi Walter and others,

I tried to use the Searching for Obsolete Commands and Variables example you mentioned to check if my scripts are obsolete. Since I have them in many subfolders, I made this routine to check them all:

Dim sTargetFolder
Call ScriptInclude(ProgramDrv & "\Examples\Documents\ObsoleteVarCmdCheck")
If PathDlgShow("Select output path", "") = "IDOk" Then
	sTargetFolder = OutPutPath
	If Right(sTargetFolder, 1) <> "\" Then sTargetFolder = sTargetFolder & "\"

	Call AnalyzeFolder(sTargetFolder, sTargetFolder & "_LogFile.TXT")
End If

Sub AnalyzeFolder(sPath, sLog)
	Dim oFso, oFolder
	Dim sFileExtension
	
	LogFileWrite "Analysis of folder: " & sPath
	Set oFso = CreateObject("Scripting.FileSystemObject")
	
	For Each oFolder In oFso.GetFolder(sPath).SubFolders
		Call ScanScriptsForObsoleteVariableAndCommands(sLog, oFolder.Path)
		Call AnalyzeFolder(oFolder.Path, sLog)
	Next
	
	Set oFolder = Nothing
	Set oFso = Nothing
End Sub

I have two problems with this:

1. Each time a folder is processed the log file is erased, so I can't see what the previous folder outputs were

2. Each time a folder is processed there are many "ok" buttons to click.

 

Do you have a different subroutine in the "ObsoleteVarCmdCheck" file I could use?

Thanks!

Franco

 

0 Kudos
Message 5 of 8
(2,974 Views)

From what I can see that is the only available function for searching. You may have to open the log after each loop and save the information in another location that can be appended on with each loop

 

Matthew C

0 Kudos
Message 6 of 8
(2,953 Views)

Hi franco__

With each call of "ScanScriptsForObsoleteVariableAndCommands" a new log file is created. So you must consider that in your for loop.

The message box in the end can be changed not before DIAdem 2019.

Greetings

Walter

0 Kudos
Message 7 of 8
(2,939 Views)

Hi Walter and Matthew,

 

I modified the script to output a single, merged log. I'm putting it here in case someone may find it interesting:

Dim sTargetFolder

Call ScriptInclude(ProgramDrv & "\Examples\Documents\ObsoleteVarCmdCheck")
If PathDlgShow("Select output path", "") = "IDOk" Then
	sTargetFolder = OutPutPath
	If Right(sTargetFolder, 1) <> "\" Then sTargetFolder = sTargetFolder & "\"

	Call AnalyzeFolder(sTargetFolder, sTargetFolder & "_LogFile.TXT", sTargetFolder & "LogFile.TXT")
End If

Sub AnalyzeFolder(sPath, sLogTemp, sLog)
	Dim oFso, oFolder
	Dim sFileExtension
	
	LogFileWrite "Analysis of folder: " & sPath
	Call ScanScriptsForObsoleteVariableAndCommands(sLogTemp, sPath)
	Call AppendLog(sLogTemp, sLog)
	
	Set oFso = CreateObject("Scripting.FileSystemObject")
	For Each oFolder In oFso.GetFolder(sPath).SubFolders
		Call AnalyzeFolder(oFolder.Path, sLogTemp, sLog)
	Next
	
	Set oFolder = Nothing
	Set oFso = Nothing
End Sub

Sub AppendLog(sLogTemp, sLog)
	Dim oFSO, oFile
	Dim sText
	
	If FilEx(sLogTemp) Then 
		Set oFSO = CreateObject("Scripting.FileSystemObject")
		
		Set oFile = oFSO.OpenTextFile(sLogTemp, 1) 'for reading
		sText = oFile.ReadAll
		oFile.Close
		
		If Not FilEx(sLog) Then 
			Set oFile = oFSO.CreateTextFile(sLog)
		Else
			Set oFile = oFSO.OpenTextFile(sLog, 8) 'for appending
		End If
		oFile.WriteLine sText
		oFile.Close
		
		oFSO.DeleteFile(sLogTemp)
	End If
	
	Set oFSO = Nothing
	Set oFile = Nothing
End Sub

Thanks,

Franco

 

0 Kudos
Message 8 of 8
(2,932 Views)