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


HSPTV!掲示板


未解決 解決 停止 削除要請

2017
0409
名無し入力ダイアログボックス6解決


名無し

リンク

2017/4/9(Sun) 16:17:59|NO.79043

HSPで入力ダイアログボックスを表示させるにはどうすればいいですか?
http://www.pct.co.jp/wp-content/themes/pct/images/techcolumn/2015/11/VBScript04.jpg



この記事に返信する


名無し

リンク

2017/4/9(Sun) 16:38:39|NO.79044

input機能、mesbox機能を使ってください。
使い方はヘルプ参照という事で。



名無し

リンク

2017/4/9(Sun) 17:03:33|NO.79046

このようにしてみたのですが、うまくいきません。
どうすればいいですか?

newcom objVBsc, "ScriptControl" objVBsc("Language")="VBScript" objVBsc->"AddCode" "inputbox \"文字を入力してください。\"" objVBsc->"Run" "vbcmd" mes refstr delcom objVBsc



tds12

リンク

2017/4/9(Sun) 17:11:00|NO.79048

過去ログ参照と思ったら、これは見つけづらい。
http://hsp.tv/play/pforum.php?mode=pastwch&num=58035



名無し

リンク

2017/4/9(Sun) 18:44:28|NO.79049

このようにソースを改造してみたのですがエラーが出てできません。
どうすればいいですか?

#module "mod_VBS_InputBox" //変数 = InputBox(prompt_str, title_str, default_str, xpos, xpos, helpfile_str , context) //パラメータは http://msdn.microsoft.com/ja-jp/library/cc410238.aspx を参照 //戻り値がint型の0ならキャンセルされた、文字列型変数ならOKされた #define global ctype InputBox(%1="",%2="",%3="",%4=$80000000,%5=$80000000,%6="",%7=0) _InputBox(%1,%2,str(%3),%4,%5,%6,%7) #deffunc _InputBox str prompt_str,str title_str,str default_str,int xpos,int ypos,str helpfile_str ,int context,local f if vartype(objVBsc)=4 { newcom objVBsc, "ScriptControl" objVBsc("Language")="VBScript" //毎回"AddCode"すれば良いんだろうけど、一度にパラメータ省略に合わせたFunctionを登録 vbs = {" Function inBox0(m,t,d,x,y,h,c) inBox0 = InputBox(m,t,d,x,y,h,c) End Function Function inBox3(m,t,d,x,y,h,c) inBox3 = InputBox(m,t,d) End Function Function inBox2(m,t,d,x,y,h,c) inBox2 = InputBox(m,t,d,x,y) End Function Function inBox1(m,t,d,x,y,h,c) inBox1 = InputBox(m,t,d,,,h,c) End Function "} objVBsc->"AddCode" vbs } if helpfile_str="" {f | 2} if xpos=$80000000 or ypos=$80000000 {f | 1}//X,Yどちらか省略されたら両方省略として処理 comres res objVBsc->"Run" "inBox"+f ,prompt_str, title_str, default_str, xpos, ypos, helpfile_str, context return res #deffunc InputBox_end onexit delcom objVBsc return #global InputBox "InputBoxテスト","VBS InputBox","default"



tds12

リンク

2017/4/9(Sun) 19:19:08|NO.79050

命令として使いたいなら
#defineのところのctypeを外しましょう。
あと同じく#defineのところで_InputBoxが関数として呼ばれているので、
かっこを消して命令として呼びましょう。



 

リンク

2017/4/9(Sun) 19:45:41|NO.79052

ありがとうございます!!
このようにしたらできました!!

#module "mod_VBS_InputBox" //変数 = InputBox(prompt_str, title_str, default_str, xpos, xpos, helpfile_str , context) //パラメータは http://msdn.microsoft.com/ja-jp/library/cc410238.aspx を参照 //戻り値がint型の0ならキャンセルされた、文字列型変数ならOKされた #define global InputBox(%1="",%2="",%3="",%4=$80000000,%5=$80000000,%6="",%7=0) _InputBox %1,%2,str(%3),%4,%5,%6,%7 #deffunc _InputBox str prompt_str,str title_str,str default_str,int xpos,int ypos,str helpfile_str ,int context,local f if vartype(objVBsc)=4 { newcom objVBsc, "ScriptControl" objVBsc("Language")="VBScript" //毎回"AddCode"すれば良いんだろうけど、一度にパラメータ省略に合わせたFunctionを登録 vbs = {" Function inBox0(m,t,d,x,y,h,c) inBox0 = InputBox(m,t,d,x,y,h,c) End Function Function inBox3(m,t,d,x,y,h,c) inBox3 = InputBox(m,t,d) End Function Function inBox2(m,t,d,x,y,h,c) inBox2 = InputBox(m,t,d,x,y) End Function Function inBox1(m,t,d,x,y,h,c) inBox1 = InputBox(m,t,d,,,h,c) End Function "} objVBsc->"AddCode" vbs } if helpfile_str="" {f | 2} if xpos=$80000000 or ypos=$80000000 {f | 1}//X,Yどちらか省略されたら両方省略として処理 comres res objVBsc->"Run" "inBox"+f ,prompt_str, title_str, default_str, xpos, ypos, helpfile_str, context return res #deffunc InputBox_end onexit delcom objVBsc return #global InputBox "InputBoxテスト","VBS InputBox","default" mes refstr



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