HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2012
0403
大富豪A; 2010-04-247解決


大富豪A

リンク

2012/4/3(Tue) 16:59:08|NO.45743

 

; 2010-04-24 ; メイク時点で上書き保存するように仕様変更した ; 上書き保存を追加するなら ; line 154, 246 辺りを書き換える必要有り ; #uselib "Footy2.dll" #include "Footy2.as" #include "ckeyword.as"; db_name data ; B G R に注意 #define COLOR_COMMENT 0x00aa00; //... /* ... */ #define COLOR_FUNC 0xdd5555; printf etc #define COLOR_SYSVAR 0xdd0000; int,char etc #define COLOR_STRING 0x5555ff; "文字列" etc #define COLOR_MACRO 0xff5555 #define COLOR_COMMAND 0xcc00cc #define COLOR_PREPROCESS 0xffcc00 #define COLOR_LABEL 0xffff00 ; メニュー関連関数 #uselib "user32.dll" #func CreateMenu "CreateMenu" #func CreatePopupMenu "CreatePopupMenu" #func AppendMenu "AppendMenuA" int, int, int, str #func SetMenu "SetMenu" int, int #func DrawMenuBar "DrawMenuBar" int #func PostMessage "PostMessageA" int, int, sptr, sptr ; メニューアイテムIDを定義 #const CMD_OPEN 1 ; [開く]アイテムのID #const CMD_SAVE 2 ; [保存]アイテムのID #const CMD_QUIT 3 ; [終了]アイテムのID #const CMD_MESS 4 ; [表示]アイテムのID #const CMD_MAKE 5 ; [メイク]アイテムのID #const CMD_EXEC 6 ; [実行]アイテムのID ; pipe 関連関数 #uselib "kernel32.dll" #func CreatePipe "CreatePipe" sptr,sptr,sptr,sptr #func CloseHandle "CloseHandle" sptr #func CreateProcessA "CreateProcessA" sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr #func ReadFile "ReadFile" sptr,sptr,sptr,sptr,sptr #cfunc GetEnvironmentVariable "GetEnvironmentVariableA" var,var,int ; STARTUPINFO構造体パラメータ #const SIZE_SUP_INFO 68 ; STARTUPINFO構造体サイズ #const STARTF_USESHOWWINDOW 0x001 ; パラメータ使用フラグ(ウィンドウ表示状態) #const STARTF_USESTDHANDLES 0x100 ; パラメータ使用フラグ(標準出入力ハンドル) #const SW_HIDE 0 ; 起動時ウィンドウを表示しない ;{ 2010-04-23 add ファイル位置検索の為の関数 #uselib "imagehlp.dll" #cfunc SearchTreeForFile "SearchTreeForFile" sptr, sptr, sptr ;} #define global tmpfname "ebcctmp" ;標準なら bccpath="C:\\borland\\bcc55\\Bin\\" #module ;{ bcc install path を引数にした 2010/04/22 - 23 #deffunc makemakefile str makefilename, str bccpath sdim makebuf, 5000 notesel makebuf noteadd "# "+tmpfname noteadd "CC = "+bccpath+"bcc32.exe" noteadd "LINKER = "+bccpath+"ilink32.exe" noteadd "" noteadd "INCLUDE = -I\""+bccpath+"Include\"" noteadd "LIB = -L\""+bccpath+"lib\"" noteadd "" noteadd "#コンソールアプリケーションのためのコンパイルオプション" noteadd "CFLAGS = -O1 -w -tWC" noteadd "# -w 警告表示ON" noteadd "# -tWC コンソールアプリケーション" noteadd "# -O2 高速のコードを生成 -O1 小さいコードを生成" noteadd "" noteadd "LFLAGS = /Tpe" noteadd "" noteadd "TARGET = "+tmpfname+".exe";ebcctmp.exe" noteadd "OBJS = "+tmpfname+".obj";ebcctmp.obj" noteadd "" noteadd "ALL : $(TARGET)" noteadd "" noteadd "# -- objファイルの作成" noteadd tmpfname+".obj: "+tmpfname+".cpp" noteadd " $(CC) $(CFLAGS) -c "+tmpfname+".cpp";ebcctmp.cpp" noteadd "" noteadd "# -- exeファイルの作成" noteadd "$(TARGET): $(OBJS)" noteadd " $(LINKER) $(LFLAGS) $(LIB) $(OBJS) c0x32.obj,$(TARGET),,cw32.lib import32.lib" noteadd "" notesave tmpfname+".mak" sdim makebuf, 0 return ;} ;---------------------------------------------------------- #deffunc makebatfile str makefilename sdim makebuf, 5000 notesel makebuf noteadd "@echo off"; @はecho off そのものを表示させないため noteadd tmpfname+".exe";制作したプログラムを実行 noteadd "pause"; 終了後キーボード入力を待つ notesave tmpfname+".bat" sdim makebuf, 0 return ;---------------------------------------------------------- #deffunc makesourcefile str cppfilename sdim makebuf, 5000 notesel makebuf noteadd "// C++ sample file" noteadd "#include <stdio.h>" noteadd "" noteadd "int main( void )" noteadd "{" noteadd " printf( \"Hellow easybcc!!\\n\" );" noteadd " return 0;" noteadd "}" notesave tmpfname+".cpp" sdim makebuf, 0 return #global #const SIZE_BUF 1024 ; ReadFile読み取りサイズ上限 #define MAX_PATH 260 ; 各種定数 #const TRUE 1 #const FALSE 0 #const NULL 0 #define ctype RGB(%1,%2,%3) (%1|(%2<<8)|(%3<<16)) ; 実行ファイルの自動作成でのファイル名 ; 2008-10-18add #packopt name "easybcc"; 実行ファイル名 "easybcc.exe" #define titlemsg "EasyBcc Developer v0.92 " ;------------------------------------------------------ ; main script ;------------------------------------------------------ screen 0,600,495;555;460 syscolor boxf title titlemsg+"(2008/10 - 2010/04)" objmode 1, 0 ; TABによるフォーカス移動を無効化する ; これがないとエディター画面でTABキー ; を押すとメニューにフォーカスが移り ; カーソルが消えてしまう ; ポップアップメニューの作成 ; [ファイル]メニュー CreatePopupMenu hfilemenu = stat AppendMenu hfilemenu, 0, CMD_OPEN, "開く(&O)" ; 開く AppendMenu hfilemenu, 0, CMD_SAVE, "保存(&S)" ; 保存 AppendMenu hfilemenu, 0x800, NULL, "" ; セパレータ AppendMenu hfilemenu, 0, CMD_QUIT, "終了(&Q)" ; 終了 ; [プロジェクト]メニュー CreatePopupMenu hhelpmenu = stat ; AppendMenu hhelpmenu, 0, CMD_MESS, "表示(&M)" ; 表示 AppendMenu hhelpmenu, 0, CMD_MAKE, "メイク(&M)" ; メイク AppendMenu hhelpmenu, 0, CMD_EXEC, "実行(&E)" ; 実行 ; メニューバーの作成 トップメニュー CreateMenu hmenu = stat AppendMenu hmenu, 0x10, hfilemenu, "ファイル(&F)" ; ファイル Alt+F AppendMenu hmenu, 0x10, hhelpmenu, "プロジェクト(&P)"; プロジェクト ALT+P AppendMenu hmenu, 0, CMD_QUIT, "終了(&Q)" ; 終了 SetMenu hwnd, hmenu ; メニューをウィンドウに割り当てる DrawMenuBar hwnd ; メニューを再描画 ;{ 2010-04-22 add bccpath = "" ;} ;====cmdpath===================================================== sdim cmdpath,MAX_PATH+2 env = "Comspec"; 環境変数(COMSPEC)を設定 ret = GetEnvironmentVariable(env,cmdpath,MAX_PATH) if ret == 0 : dialog "Comspec 取得エラー!", 1, "終了" : end ; exist tmpfname+".mak": if strsize==-1 : makemakefile tmpfname;"easybcc" exist tmpfname+".mak" if strsize==-1 {; ---> 2010/04/23 sdim TargetFilePath,200 // バッファ ret = SearchTreeForFile( "C:\\", "bcc32.exe", varptr(TargetFilePath) ) if ret==0 : title "BCC がインストールされていない" : stop bccpath = getpath(TargetFilePath,32) makemakefile tmpfname, bccpath }; <--- exist tmpfname+".bat": if strsize==-1 : makebatfile tmpfname exist tmpfname+".cpp" : if strsize==-1 : makesourcefile tmpfname ;------------------------------------------------------ Footy2Create hwnd, 0, 0, 600, 350, VIEWMODE_NORMAL ; Footy2Create hwnd, 0, 20, ginfo_winx, ginfo_winy-20, VIEWMODE_NORMAL if ( stat == FOOTY2ERR_ARGUMENT || stat == FOOTY2ERR_MEMORY ) : end idFooty = stat ; 表示設定の変更 ; 背景色を変えてみた Footy2SetColor idFooty, CP_BACKGROUND, RGB ($ff, $ff, $fe);($ff, $ee, $ee) ; TAB 半角スペース 改行 記号を表示させる Footy2SetMetrics idFooty, SM_MARK_VISIBLE, EDM_TAB|EDM_HALF_SPACE|EDM_LINE, 1 pos 0,350 objsize 600,50; listbox listno, 80, "メッセージが表示されます"; 50+80 が実際のサイズとなる idlistbox = stat hlistbox = objinfo(stat,2) objprm idlistbox, -1 ; ファイルを読み込む fileName = tmpfname+".cpp"; "ebcctmp.cpp" ;------------------------------------------------------ Footy2TextFromFile idFooty, fileName, CSM_AUTOMATIC if ( stat != FOOTY2ERR_NONE ) : end ; キーワード等の色分けを反映 gosub *enphasis ; メッセージ割り込み oncmd gosub *OnCommand, 0x0111;WM_COMMAND ; コピー・ペースト等の実装2008-06-07 onkey gosub *onPushKey onexit *exit stop *exit ;------------------------------------------------------ Footy2Delete idFooty end stop; これ以降にあるreturnでエラーが発生しないようにあるstop ; この部分を最後部に持って行けば問題はないのではあるが。 ;-------------------------------------------------------------------- ; メッセージの処理 *OnCommand switch (wparam & 0xFFFF) case CMD_OPEN ; 開く dialog "*.C;*.CPP", 16; 2010-04-21 add if stat = 1 : Footy2TextFromFile idFooty, refstr, CSM_AUTOMATIC: gosub *enphasis title titlemsg+refstr; 2010-04-22 add swbreak case CMD_SAVE ; 保存 dialog "*.C;*.cpp", 17 if stat = 1 : Footy2SaveToFile idFooty, refstr, CSM_AUTOMATIC, CSM_AUTOMATIC swbreak case CMD_QUIT ; 終了 goto *exit swbreak ; case CMD_MESS ; 表示 ; swbreak case CMD_MAKE ; メイク ;{ 2010-04-24 make時に上書き保存するように変更する Footy2SaveToFile idFooty, tmpfname, CSM_AUTOMATIC, CSM_AUTOMATIC ;} goto *make swbreak case CMD_EXEC ; 実行 goto *execute swbreak default ; 2008-05-30 wNotifyCode = (wParam>>16)&0xFFFF hwndControl = lParam if (hwndControl=hlistbox) & (wNotifyCode=2) : gosub *doubleclick swbreak swend return ;-------------------------------------------------------------------- ; 2008-05-30 マウスのダブルクリック時の処理 *doubleclick sdim bbuf,3000 sendmsg hlistbox,0x189,listno,varptr(bbuf); 0x189=LB_GETTEXT sdim buf1,1000 getstr buf1,bbuf,0,':'; デリミタは : 文字を用いた getstr node0, buf1, 0, ' '; 空白文字で分解 if node0 == "エラー" || node0 == "警告" : else : return i = 0 sdim msg,2000; errlineno=-1 node="" repeat getstr node, buf1, i, ' '; 空白文字で分解 if strsize == 0 : break errlineno=int(node) i = i + strsize loop ; カーソル移動 ;------------------------------------------------------ ; 行番号 列番号 Footy2SetCaretPosition idFooty, errlineno-1, 0; キャレット移動 Footy2SetFocus idFooty; キャレットを表示する return // ショートカットキー *onPushKey keycode = iparam getkey ctrl, 17;17=CTRL が押されているかどうかを ctrl 変数に代入 if ctrl==1 { switch keycode case 'A'; CTRL + 'A' Footy2SelectAll idFooty swbreak case 'C'; CTRL + 'C' Footy2Copy idFooty swbreak case 'V'; CTRL + 'V' Footy2Paste idFooty swbreak case 'X'; CTRL + 'X' Footy2Cut idFooty swbreak case 'Y'; CTRL + 'Y' Footy2Redo idFooty swbreak case 'Z'; CTRL + 'Z' Footy2Undo idFooty swbreak default swbreak swend } return ;-------------------------------------------------------------------- *make SavefileName = tmpfname+".cpp"; "ebcctmp.cpp" Footy2SaveToFile idFooty, SavefileName, CSM_AUTOMATIC, CSM_AUTOMATIC wait 10 ; パイプの書き込み側を標準出力につないでcmdlineを起動 cmdline = cmdpath+" /c C:\\borland\\bcc55\\Bin\\make.exe -f./"+tmpfname+".mak "+tmpfname+".exe";ebctmp.exe" ;"c:\\windows\\system32\\cmd.exe /c C:\\borland\\bcc55\\Bin\\make.exe -f./test.mak test.exe ; 名無しパイプ作成 ; 12, 0, 1 secAttr = SIZE_SEC_ATTR, NULL, TRUE ; SECURITY_ATTRIBUTES構造体 CreatePipe varptr(hRead),varptr(hWrite),varptr(secAttr),0 if stat=FALSE { dialog "CreatePipe error!", 1, "終了" goto *exit } ; STARTUPINFO構造体 startInfo = SIZE_SUP_INFO, NULL, NULL, NULL; 68, 0, 0, 0 startInfo(4) = 0, 0, 0, 0 startInfo(8) = 0, 0, NULL, STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES startInfo(12) = SW_HIDE, NULL, NULL, hWrite, NULL ; PROCESS_INFOMATION構造体 dim procInfo, 4 ; cmdline を実行 CreateProcessA NULL,cmdline,0,0,TRUE,NULL,NULL,NULL,varptr(startInfo),varptr(procInfo) ; 起動のエラーチェック if stat=FALSE { CloseHandle hWrite ; パイプの書き込み側ハンドルを閉じる dialog cmdline + "起動エラー!", 1, "終了" goto *exit } ; パイプの書き込み側ハンドルを閉じる(スクリプトでは使わない) CloseHandle hWrite ; cmdline 関連のハンドルを閉じる(スクリプトでは使わない) CloseHandle procInfo(0) CloseHandle procInfo(1) ; パイプから cmdline の出力を読み取る sdim outputbuf,6000 outputbuf = "" ; 出力受け取り用バッファ size = 0 ; ReadFile読み取りサイズ repeat sdim buf,SIZE_BUF+1 // ReadFile用バッファ ReadFile hRead,varptr(buf),SIZE_BUF,varptr(size),NULL if stat { ; ReadFile成功 if size=0 { ; 読み取り完了 break } outputbuf += buf }else{ ; ReadFile失敗 break } loop ; パイプの読み取り側ハンドルを閉じる 一時的に使用したハンドル? CloseHandle hRead ; 結果表示 ; 2008-05-31 72文字毎に区切る ; 無理矢理なので日本語文字のところで折り返すとおかしくなる筈 notesel outputbuf nlines = noteinfo(0) sdim notebuffa, 1000 sdim bbbuf, 5000 repeat nlines noteget notebuffa, cnt nchar = strlen(notebuffa) ncolumn=1 repeat nchar ii = peek( notebuffa, cnt ) bbbuf += strf("%c",ii) if ncolumn\100 == 0: bbbuf += "\n" ; if ncolumn\72 == 0: bbbuf += "\n" ncolumn ++ loop bbbuf += "\n" loop objprm idlistbox, bbbuf stop ;-------------------------------------------------------------------- *execute exec tmpfname+".bat"; バッチファイルを実行 stop ;-------------------------------------------------------------------- *enphasis db_num= length(db_name) repeat db_num if cnt<270 { ; 関数型 ;------------------------------------------------------ Footy2AddEmphasis idFooty, db_name.cnt, 0, EMP_WORD, 0, 1, 1, EMP_IND_BLANKS | EMP_IND_PARENTHESIS, COLOR_FUNC }else : if cnt < 310 { ; システム変数 ;------------------------------------------------------ Footy2AddEmphasis idFooty, db_name.cnt, 0, EMP_WORD, 0, 1, 1, EMP_IND_BLANKS | EMP_IND_PARENTHESIS | EMP_IND_OTHER_ASCII_SIGN, COLOR_SYSVAR }else { ; マクロ ;------------------------------------------------------ Footy2AddEmphasis idFooty, db_name.cnt, 0, EMP_WORD, 0, 1, 1, EMP_IND_BLANKS | EMP_IND_PARENTHESIS | EMP_IND_OTHER_ASCII_SIGN, COLOR_MACRO } loop ; そのほかの色分け ;------------------------------------------------------ Footy2AddEmphasis idFooty, "/*", "*/", EMP_MULTI_BETWEEN, 0, 1, 1, EMP_IND_ALLOW_ALL, COLOR_COMMENT Footy2AddEmphasis idFooty, "\"", "\"", EMP_MULTI_BETWEEN, 0, 2, 1, EMP_IND_ALLOW_ALL, COLOR_STRING;2008-06-04 ; 2008-06-07 * 変更コメント内で色分けされないようにするため ; Footy2AddEmphasis idFooty, "\"", "\"", EMP_MULTI_BETWEEN, 0, 2, -1, EMP_IND_ALLOW_ALL, COLOR_STRING;2008-06-04 Footy2AddEmphasis idFooty, "//", 0, EMP_LINE_AFTER, 0, 1, 1, EMP_IND_ALLOW_ALL, COLOR_COMMENT ; 色分けを反映 ;------------------------------------------------------ Footy2FlushEmphasis idFooty ; カーソル移動 ;------------------------------------------------------ Footy2SetCaretPosition idFooty, 0, 0; 8 行 4 文字目の前にキャレットを移動 Footy2SetFocus idFooty; キャレットを表示する ; フォントサイズを12ポイントに設定 ;------------------------------------------------------ Footy2SetFontSize idFooty, 12, 1 return ;--------------------------------------------------------------------
を実行すると固まってしまいます
これは僕だけですか?



この記事に返信する


大富豪A

リンク

2012/4/3(Tue) 17:01:24|NO.45744

 ckeywordは

;"関数" db_name.0="abort","abs","acos","asctime","asin","assert","atan","atan2","atexit","atof" db_name.10="atoi","atol","bsearch","btowc","cabs","cabsf","cabsl","cacos","cacosf","cacosh" db_name.20="cacoshf","cacoshl","cacosl","calloc","carg","cargf","cargl","casin","casinf","casinh" db_name.30="casinhf","casinhl","casinl","catan","catanf","catanh","catanhf","catanhl","catanl","ccos" db_name.40="ccosf","ccosh","ccoshf","ccoshl","ccosl","ceil","cexp","cexpf","cexpl","cimag" db_name.50="cimagf","cimagl","clearerr","clock","clog","clogf","clogl","conj","conjf","conjl" db_name.60="cos","cosh","cpow","cpow","cpowf","cpowl","cproj","cprojf","cprojl","creal" db_name.70="crealf","creall","csin","csinh","csinhf","csinhl","csinf","csinl","csqrt","csqrt" db_name.80="csqrtf","csqrtl","ctan","ctanf","ctanh","ctanhf","ctanhl","ctanl","ctime","difftime" db_name.90="div","exit","exp","fabs","fclose","feof","ferror","fflush","fgetc","fgetpos" db_name.100="fgets","fgetwc","fgetws","floor","fmod","fopen","fprintf","fputc","fputs","fputwc" db_name.110="fputws","fread","free","freopen","frexp","fscanf","fseek","fsetpos","ftell","fwide" db_name.120="fwrite","getc","getchar","getenv","gets","getwc","getwchar","gmtime","isalnum","isalpha" db_name.130="iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","iswalnum","iswalpha" db_name.140="iswcntrl","iswctype","iswdigit","iswgraph","iswlower","iswprint","iswpunct","iswspace","iswupper","iswxdigit" db_name.150="isxdigit","labs","ldexp","ldiv","localeconv","localtime","log","log10","longjmp","malloc" db_name.160="mbrlen","mbrtowc","mbsinit","mbsrtowcs","memchr","memcmp","memcpy","memmove","memset","mktime" db_name.170="modf","perror","pow","printf","putc","putchar","puts","putwc","putwchar","qsort" db_name.180="raise","rand","realloc","remove","rename","rewind","scanf","setbuf","setjmp","setlocale" db_name.190="setvbuf","signal","sin","sinh","sprintf","sqrt","srand","sscanf","strcat","strchr" db_name.200="strcmp","strcoll","strcpy","strcspn","strerror","strftime","strlen","strncat","strncmp","strncpy" db_name.210="strpbrk","strrchr","strspn","strstr","strtod","strtok","strtol","strtoul","strxfrm","system" db_name.220="tan","tanh","time","tmpfile","tmpnam","tolower","toupper","towctrans","towlower","towupper" db_name.230="ungetc","ungetwc","va_arg","va_end","va_start","vfprintf","vprintf","vsprintf","wcrtomb","wcscat" db_name.240="wcschr","wcscmp","wcscoll","wcscpy","wcscspn","wcsftime","wcslen","wcsncat","wcsncmp","wcsncpy" db_name.250="wcsrtombs","wcspbrk","wcsrchr","wcsspn","wcsstr","wcstod","wcstol","wcstok","wcstoul","wcsxfrm" db_name.260="wctob","wctrans","wctype","wmemchr","wmemcmp","wmemcpy","wmemmove","wmemset","___268","___269" ;"キーワード" db_name.270="auto","break","case","char","const","continue","default","do","double","else db_name.280="enum","extern","float","for","goto","if","int","long","register","return" db_name.290="short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void" db_name.300="volatile","while","___302","___303","___304","___305","___306","___307","___308","___309" ; マクロ db_name.310="#define","#elif","#else","#endif","#error","#if","#ifdef","#ifndef","#import","#include" db_name.320="#line","#pragma","#undef","___323","___324","___325","___326","___327","___328","___329" ;API関連 db_name.330="BOOL","BOOLEAN","BYTE","CHAR","COLORREF","DWORD","HWND","HDC","HICON","HANDLE" db_name.340="HBITMAP","HBRUSH","HCURSOR","HGDIOBJ","HGLOBAL","HIMAGELIST","HINSTANCE","HMENU","INT","LANGID" db_name.350="LCID","LONG","LONGLONG","LPARAM","LPBOOL","PBOOL","LPBYTE","PBYTE","LPCSTR","PCSTR" db_name.360="LPCTSTR","PCTSTR","LPCVOID","LPCWSTR","PCWSTR","LPDWORD","PDWORD","LPHANDLE","PHANDLE","LPINT" db_name.370="PINT","LPLONG","PLONG","LPSTR","PSTR","LPTSTR","PTSTR","LPVOID","PVOID","LPWORD" db_name.380="PWORD","LPWSTR","PWSTR","PBOOLEAN","SHORT","TCHAR","UINT","ULONG","ULONGLONG","VOID" db_name.390="WCHAR","WORD","WPARAM","___393","___394","___395","___396","___397","___398","___399"
です



KA

リンク

2012/4/3(Tue) 18:10:42|NO.45749

転載元を書かずに転載しても大丈夫なの?
各種ファイルは作った時と同じなのかな?
入手方法も解らないし。



大富豪A

リンク

2012/4/3(Tue) 22:03:52|NO.45773




大富豪A

リンク

2012/4/3(Tue) 22:13:05|NO.45774

 
#uselib "Footy2.dll"
#include "Footy2.as"
はググればありますよ
http://www.hpp.be/Download/FileDetail.aspx?id=55



大富豪A

リンク

2012/4/3(Tue) 22:15:09|NO.45775

 ckeyword.asはNO.45744のをhspのcommonに入れればフツーに出来ます。



大富豪A

リンク

2012/4/4(Wed) 15:02:04|NO.45789

ほかのスレをたてたいので解決にします。
あとからこれを見た人はスミマセン。



大富豪A

リンク

2012/4/4(Wed) 15:02:43|NO.45790

解決するのわすれてました



ONION software Copyright 1997-2021(c) All rights reserved.