class console{ version 1

2021/04/14 01:27 by fdasfas
  :追加された部分   :削除された部分
(差分が大きい場合、文字単位では表示しません)
class console{
  static log(...args){ WScript.Echo(...args) }
}

class fs{
  static readFileSync(file, encoding) {
    if (typeof encoding === 'object') encoding = encoding.encoding

    const stream = new ActiveXObject('adodb.stream')
    stream.Type = encoding ? 2 : 1
    stream.Open()

    encoding = encoding || 'utf-8'
    stream.Charset = encoding
    stream.LoadFromFile(file)

    const fileContent = new String(stream.ReadText())
    fileContent.Charset = encoding
    stream.Close()

    return fileContent.toString()
  }

  static writeFileSync(file, data, encoding) {
    if (typeof encoding === 'object') encoding = encoding.encoding

    encoding = encoding || 'utf-8'
    const stream = new ActiveXObject('adodb.Stream')
    stream.Open()

    try {
      stream.Position = 0
      stream.CharSet = encoding
      stream.WriteText(data)
      stream.SetEOS()

      stream.Position = 0
      stream.Type = 1

      if (encoding === 'utf-8') {
        // Remove BOM
        stream.Position = 3
      }

      const binData = stream.Read(-1)

      stream.Position = 0
      stream.Write(binData)
      stream.SetEOS()

      stream.SaveToFile(file, 2)
    } finally {
      stream.close()
    }
  }
}

function fetchSync(url){
  const http = WScript.CreateObject("Msxml2.ServerXMLHTTP")
  http.open("GET", url, false)
  http.send()
  return http.responseText
}

console.log(111, 22)
	
cscript //nologo /E:{1b7cd997-e5ff-4932-a7a6-2a9e636da385} main.js
	
Dim winshell As Object
Set winshell = VBA.CreateObject("WScript.Shell")
Dim waitReturn As Boolean: waitReturn = True
Dim windowStyle As Integer: windowStyle = 1
winshell.Run "java MainClass", windowStyle, waitReturn
	
https://tonari-it.com/excel-vba-utf8-write/
	
https://vba-labo.rs-techdev.com/archives/92
https://www.tipsfound.com/vba/18014
http://officetanaka.net/excel/vba/speed/s15.htm

https://www.redmine.org/projects/redmine/wiki/Rest_Issues      

class console{
static log(...args){ WScript.Echo(...args) }
}

class fs{
static readFileSync(file, encoding) {
if (typeof encoding === 'object') encoding = encoding.encoding

const stream = new ActiveXObject('adodb.stream')
stream.Type = encoding ? 2 : 1
stream.Open()

encoding = encoding || 'utf-8'
stream.Charset = encoding
stream.LoadFromFile(file)

const fileContent = new String(stream.ReadText())
fileContent.Charset = encoding
stream.Close()

return fileContent.toString()

}

static writeFileSync(file, data, encoding) {
if (typeof encoding === 'object') encoding = encoding.encoding

encoding = encoding || 'utf-8'
const stream = new ActiveXObject('adodb.Stream')
stream.Open()

try {
  stream.Position = 0
  stream.CharSet = encoding
  stream.WriteText(data)
  stream.SetEOS()

  stream.Position = 0
  stream.Type = 1

  if (encoding === 'utf-8') {
    // Remove BOM
    stream.Position = 3
  }

  const binData = stream.Read(-1)

  stream.Position = 0
  stream.Write(binData)
  stream.SetEOS()

  stream.SaveToFile(file, 2)
} finally {
  stream.close()
}

}
}

function fetchSync(url){
const http = WScript.CreateObject("Msxml2.ServerXMLHTTP")
http.open("GET", url, false)
http.send()
return http.responseText
}

console.log(111, 22)

cscript //nologo /E:{1b7cd997-e5ff-4932-a7a6-2a9e636da385} main.js

Dim winshell As Object
Set winshell = VBA.CreateObject("WScript.Shell")
Dim waitReturn As Boolean: waitReturn = True
Dim windowStyle As Integer: windowStyle = 1
winshell.Run "java MainClass", windowStyle, waitReturn

https://tonari-it.com/excel-vba-utf8-write/

https://vba-labo.rs-techdev.com/archives/92
https://www.tipsfound.com/vba/18014
http://officetanaka.net/excel/vba/speed/s15.htm

https://www.redmine.org/projects/redmine/wiki/Rest_Issues