Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the source code written in VBScript with JScript #2098

Merged
merged 69 commits into from
Feb 19, 2024

Conversation

sdottaka
Copy link
Member

@sdottaka sdottaka commented Nov 8, 2023

This PR rewrites scripts written in VBScript with JScript.
This is because VBScript has been deprecated.
(https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features-resources#vbscript)

VBScript was used a lot in plugins.
This is because it is easier to operate Office applications, it has functions that JScript does not have, such as InputBox, and it is possible to return values with arguments.

The following changes have been made to enable writing plugins in JScript.

  • For example, in the Prediffer plugin interface PrediffBufferW, in VBScript, the values were returned using the arguments as shown below.
    In JScript, instead set the values in SAFEARRAY and return it as the return value. (SAFEARRAY can be created via a Dictionary object.)

VBScript

Function PrediffBufferW(text, size, bChanged)
   ...
   text = ...
   size = ...
   bChanged = True
   PrediffBufferW = True
End Function


JScript

function PrediffBufferW(text, size, bChanged) {
   ...
   var result = new ActiveXObject("Scripting.Dictionary");
   result.Add(0, true);
   result.Add(1, text);
   result.Add(2, size);
   result.Add(3, bChanged);
   return result.Items();
  • Added InputBox, MsgBox to mergeApp object passed in PluginOnEvent method.

@sdottaka sdottaka marked this pull request as ready for review February 19, 2024 23:16
@sdottaka sdottaka merged commit b133ce2 into master Feb 19, 2024
2 of 3 checks passed
@sdottaka sdottaka deleted the remove_vbscript branch February 19, 2024 23:19
@sdottaka sdottaka added this to the v2.16.39 milestone Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant