|
|
import myswing.*;
import java.awt.event.*;
import javax.swing.*;
JAVA_MAIN
MyClass Window = new MyClass();
Window.setVisible(true);
JAVA_END
#include "hm010.h"
| |
|
|
' ******************************************************
' Java
' ******************************************************
function JavaBuild()
Dim SrcCode,ErrText
SrcCode = document.all("Src").value
if Trim( SrcCode ) = "" then
alert( "ソースコードがありません " )
exit function
end if
' ソースコード構築
Call Initialize( )
Call ReplaceMacro( )
SrcCode = document.all("Src").value
SrcCode = "#include ""head\JAVA.H""" & vbCrLf & SrcCode
Dim Cpp
Set Cpp = Fs.CreateTextFile( "CLCOMP.CPP", True )
Cpp.WriteLine( SrcCode )
Cpp.Close()
' プリプロセス実行
if document.all("Cygwin").checked then
Call WshShell.Run( "CMD.EXE /C bat\PPGCC.BAT", 0, True )
else
Call WshShell.Run( "CMD.EXE /C bat\PP.BAT", 0, True )
end if
Dim strWork,StdText,OutSw
Set StdText = Fs.OpenTextFile("CLCOMP.i", 1)
Set Cpp = Fs.CreateTextFile( "CLCOMP.java", True )
OutSw = False
Do While not StdText.AtEndOfStream
strWork = StdText.ReadLine
if Left( strWork, 1 ) <> "#" then
Cpp.WriteLine strWork
end if
Loop
StdText.Close()
Cpp.Close()
document.all("Bytes").length = 0
Set CppText = Fs.OpenTextFile("CLCOMP.java", 1)
Do While not CppText.AtEndOfStream
strWork = CppText.ReadLine
document.all("Bytes").length = document.all("Bytes").length + 1
document.all("Bytes").options(document.all("Bytes").length-1).text = Len(strWork)
Loop
CppText.Close()
' Java コンパイル
Call WshShell.Run( "CMD.EXE /C bat\JAVABUILD.BAT", 0, True )
Set ErrText = Fs.OpenTextFile("ERR", 1)
strWork = ""
Do While not ErrText.AtEndOfStream
strWork = strWork & ErrText.ReadLine
Loop
if strWork = "" then
DoJavaExec( )
else
DispJavaErr( )
end if
end function
| |
|
|
|
|
Private Sub Command1_Click()
Dim Cn As New ADODB.Connection
Dim Rs As New ADODB.Recordset
ConnectString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\lightbox\My Documents\販売管理B.mdb;"
Cn.Open ConnectString
Query = "select * from 商品マスタ"
Rs.Open Query, Cn
Grid.Cols = Rs.Fields.Count + 1
Do While Not Rs.EOF
For I = 0 To Rs.Fields.Count - 1
Grid.TextMatrix(Grid.Rows - 1, I + 1) = Rs.Fields(I).Value & ""
Next
Rs.MoveNext
If Not Rs.EOF Then
Grid.Rows = Grid.Rows + 1
End If
Loop
Rs.Close
Cn.Close
End Sub
| |
|
|
|
|
<?
#$doc = DOMDocument::load('book.xml');
#echo $doc->saveXML();
#$doc = new DOMDocument('book.xml');
#$doc->load('book.xml');
#echo $doc->saveXML();
$dom = domxml_open_file("book.xml");
#$temp = $dom->get_elements_by_tagname("a");
#foreach($a as $nexta) {
# echo $nexta->get_content();
#}
$ctx = xpath_new_context($dom);
$obj = $ctx->xpath_eval( "//book/title" );
$nodeset = $obj->nodeset;
print $nodeset[0]->get_content();
#$ctx =
$nodes = $dom->get_elements_by_tagname("book");
#print $nodes[0]->get_content();
print "<hr>";
print "<pre>";
echo htmlentities($dom->dump_mem(true));
print "</pre>";
?>
| |
|
|
|
|
# **********************************************************
# 更新処理
# **********************************************************
function UpdateData( &$SQL ) {
global $ErrMessage,$Message;
global $Target,$KeyField,$KeyName;
if ( $_POST['send'] != '更新' ) {
return;
}
foreach( $_POST as $Key => $Value ) {
if ( substr( $Key, 0, 3 ) == 'IUL' ) {
$Renban = str_replace( 'IUL', '', $Key );
$Query = 'update メニューマスタ';
$Query .= " set URL = '$Value'" ;
$Query .= " where id = {$_POST['id']}" ;
$Query .= " and 連番 = $Renban";
$SQL->Execute( $Query );
}
if ( substr( $Key, 0, 3 ) == 'ITL' ) {
$Renban = str_replace( 'ITL', '', $Key );
$Query = 'update メニューマスタ';
$Query .= " set タイトル = '$Value'" ;
$Query .= " where id = {$_POST['id']}" ;
$Query .= " and 連番 = $Renban";
$SQL->Execute( $Query );
}
if ( substr( $Key, 0, 3 ) == 'IUM' ) {
$Renban = str_replace( 'IUM', '', $Key );
$Query = 'update メニューマスタ';
$Query .= " set URL2 = '$Value'" ;
$Query .= " where id = {$_POST['id']}" ;
$Query .= " and 連番 = $Renban";
$SQL->Execute( $Query );
}
if ( substr( $Key, 0, 3 ) == 'ITM' ) {
$Renban = str_replace( 'ITM', '', $Key );
$Query = 'update メニューマスタ';
$Query .= " set タイトル2 = '$Value'" ;
$Query .= " where id = {$_POST['id']}" ;
$Query .= " and 連番 = $Renban";
$SQL->Execute( $Query );
}
if ( substr( $Key, 0, 3 ) == 'IUR' ) {
$Renban = str_replace( 'IUR', '', $Key );
$Query = 'update メニューマスタ';
$Query .= " set URL3 = '$Value'" ;
$Query .= " where id = {$_POST['id']}" ;
$Query .= " and 連番 = $Renban";
$SQL->Execute( $Query );
}
if ( substr( $Key, 0, 3 ) == 'ITR' ) {
$Renban = str_replace( 'ITR', '', $Key );
$Query = 'update メニューマスタ';
$Query .= " set タイトル3 = '$Value'" ;
$Query .= " where id = {$_POST['id']}" ;
$Query .= " and 連番 = $Renban";
$SQL->Execute( $Query );
}
}
return TRUE;
}
| |
|
|
|
|
<SCRIPT language=VBScript src=excel.vbs></SCRIPT>
<SCRIPT language=VBScript>
Dim MyBook
' ************************************************
' 開く
' ************************************************
function XlsOpen()
Target = document.all("Excel").value
if Trim(Target) = "" then
alert("Excel ブックを選択して下さい ")
Exit Function
end if
Set MyBook = ExcelOpen( Target )
Call ExcelVisible( true )
ExcelApp.Width = 380
document.all("OpenButton").disabled = True
document.all("QuitButton").disabled = False
document.all("SheetListButton").disabled = False
document.all("SheetList").disabled = False
document.all("RangeButton").disabled = False
end function
' ************************************************
' 終了
' ************************************************
function XlsQuit()
Call ExcelQuit(MyBook)
document.all("OpenButton").disabled = False
document.all("QuitButton").disabled = True
document.all("SheetListButton").disabled = True
document.all("SheetList").disabled = True
document.all("SheetList").options.length = 0
document.all("RangeButton").disabled = True
end function
' ************************************************
' シート一覧
' ************************************************
function XlsSheetList()
Call ExcelSheetList(MyBook,"SheetList")
end function
' ************************************************
' シート選択
' ************************************************
function XlsSelectSheet()
Target = document.all("SheetList").value
Call ExcelSelectSheet(MyBook, Target)
end function
' ************************************************
' 範囲選択
' ************************************************
function XlsRange()
Target = document.all("SheetList").value
if Target = "" then
alert("シートを選択して下さい ")
Exit Function
end if
Call ExcelSelectSheet(MyBook, Target)
X1 = Cint(document.all("RangeX1").value)
Y1 = Cint(document.all("RangeY1").value)
X2 = Cint(document.all("RangeX2").value)
Y2 = Cint(document.all("RangeY2").value)
Call ExcelRange(MyBook, Target, X1, Y1, X2, Y2 )
end function
</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
<TITLE>excel専用</TITLE>
<STYLE>
.MyCell {
background-color:silver
}
.MyButton {
width:200
}
</STYLE>
</HEAD>
<BODY>
<INPUT type=file name=Excel style='width:400'>
<BR>
<INPUT
class=MyButton
name=OpenButton
type=button
value="開く"
onClick='Call XlsOpen()'
><BR>
<INPUT
class=MyButton
name=QuitButton
type=button
value="終了"
onClick='Call XlsQuit()'
disabled
><BR>
<INPUT
class=MyButton
name=SheetListButton
type=button
value="シート一覧"
onClick='Call XlsSheetList()'
disabled
><BR>
<SELECT
class=MyButton
name=SheetList
disabled
onChange='Call XlsSelectSheet()'
></SELECT><BR>
<INPUT
class=MyButton
name=RangeButton
type=button
value="範囲選択"
onClick='Call XlsRange()'
disabled
><BR>
<SELECT
name=RangeX1
>
<OPTION value=1>1<OPTION value=2>2<OPTION value=3>3<OPTION value=4>4
<OPTION value=5>5<OPTION value=6>6<OPTION value=7>7<OPTION value=8>8
<OPTION value=9>9<OPTION value=10>10<OPTION value=11>11
<OPTION value=12>12<OPTION value=13>13<OPTION value=14>14
</SELECT>
<SELECT
name=RangeY1
>
<OPTION value=1>1<OPTION value=2>2<OPTION value=3>3<OPTION value=4>4
<OPTION value=5>5<OPTION value=6>6<OPTION value=7>7<OPTION value=8>8
<OPTION value=9>9<OPTION value=10>10<OPTION value=11>11
<OPTION value=12>12<OPTION value=13>13<OPTION value=14>14
</SELECT>
<SELECT
name=RangeX2
>
<OPTION value=1>1<OPTION value=2>2<OPTION value=3>3<OPTION value=4>4
<OPTION value=5>5<OPTION value=6>6<OPTION value=7>7<OPTION value=8>8
<OPTION value=9>9<OPTION value=10>10<OPTION value=11>11
<OPTION value=12>12<OPTION value=13>13<OPTION value=14>14
</SELECT>
<SELECT
name=RangeY2
>
<OPTION value=1>1<OPTION value=2>2<OPTION value=3>3<OPTION value=4>4
<OPTION value=5>5<OPTION value=6>6<OPTION value=7>7<OPTION value=8>8
<OPTION value=9>9<OPTION value=10>10<OPTION value=11>11
<OPTION value=12>12<OPTION value=13>13<OPTION value=14>14
</SELECT>
<BR>
</BODY>
</HTML>
<SCRIPT for=window event=onload language="VBScript">
window.focus()
top.resizeTo screen.width / 2, screen.height - 32
top.moveTo screen.width / 2, 0
</SCRIPT>
<SCRIPT for=window event=onunload language="VBScript">
Call ExcelQuit(MyBook)
</SCRIPT>
| |
|
|
|
|
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace rename("EOF", "EndOfFile")
inline void TESTHR(HRESULT x) {if FAILED(x) _com_issue_error(x);};
_ConnectionPtr pCn = NULL;
void PrintProviderError(_ConnectionPtr pConnection)
{
ErrorPtr pErr = NULL;
if( (pConnection->Errors->Count) > 0)
{
printf("ProviderError\n");
long nCount = pConnection->Errors->Count;
for(long i = 0; i < nCount; i++)
{
pErr = pConnection->Errors->GetItem(i);
printf("\tError number: %x\n", pErr->Number );
printf("\tDescription: %s\n", (LPTSTR)pErr->Description);
}
}
}
void PrintComError(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
// Print Com errors.
printf("ComError\n");
printf("\tCode = %08lx\n", e.Error());
printf("\tCode meaning = %s\n", e.ErrorMessage());
printf("\tSource = %s\n", (LPCSTR) bstrSource);
printf("\tDescription = %s\n", (LPCSTR) bstrDescription);
}
char *ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\Documents and Settings\\lightbox\\My Documents\\db.mdb;";
int main( )
{
CoInitialize(NULL);
try {
TESTHR(pCn.CreateInstance(__uuidof(Connection)));
_bstr_t ConString;
ConString.operator = ( ConnectionString );
printf( "%s\n", (LPTSTR)ConString );
pCn->Open(ConString, "", "", adConnectUnspecified);
// ここにコードを書く
pCn->Close();
pCn.Release();
}
catch (_com_error &e)
{
PrintProviderError(pCn);
PrintComError(e);
}
CoUninitialize();
return 0;
}
| |
|
|
|
|
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace rename("EOF", "EndOfFile")
inline void TESTHR(HRESULT x) {if FAILED(x) _com_issue_error(x);};
_ConnectionPtr pCn = NULL;
void PrintProviderError(_ConnectionPtr pConnection)
{
ErrorPtr pErr = NULL;
if( (pConnection->Errors->Count) > 0)
{
printf("ProviderError\n");
long nCount = pConnection->Errors->Count;
for(long i = 0; i < nCount; i++)
{
pErr = pConnection->Errors->GetItem(i);
printf("\tError number: %x\n", pErr->Number );
printf("\tDescription: %s\n", (LPTSTR)pErr->Description);
}
}
}
void PrintComError(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
// Print Com errors.
printf("ComError\n");
printf("\tCode = %08lx\n", e.Error());
printf("\tCode meaning = %s\n", e.ErrorMessage());
printf("\tSource = %s\n", (LPCSTR) bstrSource);
printf("\tDescription = %s\n", (LPCSTR) bstrDescription);
}
#define ADO_MAIN(constring) \
int main( ) \
{ \
CoInitialize(NULL); \
try { \
TESTHR(pCn.CreateInstance(__uuidof(Connection))); \
_bstr_t ConString; \
ConString.operator = ( constring ); \
printf( "接続文字列は[%s]です\n", (LPTSTR)ConString ); \
pCn->Open(ConString, "", "", adConnectUnspecified);
#define ADO_END pCn->Close(); pCn.Release(); } catch (_com_error &e) \
{ \
PrintProviderError(pCn); \
PrintComError(e); \
} \
CoUninitialize(); \
return 0; \
}
#define ADO_EXECUTE(Command) \
pCn->Execute(Command, NULL, adExecuteNoRecords);
| |
|
|
|
|
#include <stdio.h>
#include "myado.h"
char *ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\Documents and Settings\\lightbox\\My Documents\\db1.mdb;";
ADO_MAIN(ConnectionString)
_bstr_t Command;
Command.operator = ("insert into TEST (AAA) values('1234567890')");
ADO_EXECUTE(Command)
ADO_END
| |
|
|
|
|
char *ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=D:\\lightbox\\db1.mdb;";
ADO_MAIN(ConnectionString)
FILE *fp;
fp = fopen("D:\\lightbox\\27osaka\\27OSAKA.CSV","rt");
char buff[1024];
fgets( buff, 1024, fp );
printf( "%s\n", buff );
fclose(fp);
LboxString LWork;
LWork = "ABCDE";
printf( "%s\n", LWork.szLboxString );
_bstr_t BBuff;
BBuff = "insert into aaa (a,b,c) values(10,'abcd','2005/1/1')";
//ADO_EXECUTE(BBuff)
ADO_END
| |
|
|
|
|
char *ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=D:\\lightbox\\db1.mdb;";
ADO_MAIN(ConnectionString)
_variant_t VBuff;
VBuff = "select * from sample3";
ADO_QUERY(VBuff)
char szBuff[1024];
QUERY_LOOP
QUERY_GET("x5",szBuff)
printf("%s\n",szBuff);
QUERY_END
ADO_END
| |
|
|
|
|
DBCC CHECKIDENT (EXP_社員マスタ, RESEED, 1000)
| |
|
|
|
|
<SCRIPT language=JavaScript>
function getFlashVarsion() {
var objFlash,i;
var description,flashPlugin;
if ( document.all ) {
for( i = 10; i >= 5; i-- ) {
try {
objFlash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i );
break;
}
catch( e ) {
if ( i == 5 ) {
i = 0;
break;
}
}
}
}
else {
i = 0;
if ( navigator.plugins && navigator.plugins.length > 0) {
flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') {
description = flashPlugin.description;
for( i = 10; i > 4; i-- ) {
if (description.indexOf(i+'.') != -1) {
break;
}
}
if ( i == 4 ) {
i = 0;
}
}
}
}
return i;
}
</SCRIPT>
<HTML>
<BODY>
<INPUT type="button" value="実行" onClick="alert(getFlashVarsion())">
</BODY>
</HTML>
| |
|
|
|