This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' * 実行中のプログラムのハンドルを取得 | |
' * | |
Private Declare Function OpenProcess Lib "kernel32" ( _ | |
ByVal Access As Long _ | |
, ByVal Handle As Long _ | |
, ByVal taskId As Long _ | |
) As Long | |
' * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Sample() | |
Dim buf As String | |
On Error GoTo myError | |
Open "C:\Sample.dat" For Input As #1 | |
Line Input #1, buf | |
Range("A1") = buf | |
Close #1 | |
Worksheets("Sheet2").Name = "合計" | |
Exit Sub | |
ErrorHandler1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim max | |
Dim min | |
'=============================================================================== | |
':: 最大(max)・最小(min)のパスワード長を設定してください | |
max = 10 | |
min = 3 | |
'=============================================================================== | |
':: ここから下はいぢらないでください |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="Windows-31J"?> | |
<project name="builSample" default="main" basedir="."> | |
<property name="path.lib" location="./lib"/> | |
<property name="path.out" location="./dest"/> | |
<property name="path.bin" location="${path.out}/bin"/> | |
<property name="path.src" location="./src"/> | |
<property name="path.test" location="./srctest"/> | |
<property name="path.doc" location="${path.out}/javadoc"/> | |
<property name="compiler" value="JAVA_HOME\bin\javac"/> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* mainメソッド実装クラスをテストする基底クラス。 | |
*/ | |
public abstract class AbstractMainTester { | |
private static final String ARGS_DELIMITER = " "; | |
protected static final String LINE_SEPARATOR = System.getProperty("line.separator"); | |
private static final PrintStream stdOut = System.out; | |
private static final PrintStream stdErr = System.err; | |
private static final SecurityManager securityManager = System.getSecurityManager(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 実行可能クラス雛形 | |
*/ | |
public class SampleMain() { | |
private boolean readyToRun = false; | |
private String sampleValue = ""; | |
/** | |
* コンストラクタ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ | |
'指定したエクセルファイルの全てのシートのセルをA1セルへ移動するスクリプト | |
'エクセルの指定はダイアログ、D&Dをサポート | |
'/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ | |
Call ActivateA1 | |
Private Sub ActivateA1() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
CreateFolder | |
Private Sub CreateFolder() | |
Dim path | |
' path = "C:\CreTest\a\b\c" | |
path = InputBox("作成するフォルダを入力してください。",,Replace(WScript.ScriptFullName,WScript.ScriptName,"")) | |
Dim objExcel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Const msoFileDialogFolderPicker = 4 | |
Const EXTENSION = ".xlsx" | |
Call MargeSheet | |
'Excelファイルマージ | |
Sub MargeSheet() | |
Dim scriptPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PrintStream source = System.out; | |
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
System.setOut(new PrintStream(out)); | |
// version < java7 | |
assertEquals("expect" + System.getProperty("line.separator"),out.toString()); | |
// version >= java7 | |
assertEquals("expect" + System.lineSeparator,out.toString()); |