リファレンス 12 ドキュメント 2 サンプル 18
basic 38 comobj 15 d3m 24 demo 1 game 12 hgimg 12 hgimg3 19 hsp3imp 1 hspcl 9 hspcv 5 hspda 10 hspdb 3 hspdx 5 hspext 16 hspinet 5 hspsock 5 new 29 ssaver 1

hspcl

Path : sample\hspcl , sample\hspcl\cgi
cl_dirlist.hsp
#runtime "hsp3cl" a="Console HSP Test" mes "["+a+"]" dirlist buf,"*.*",1 notesel buf mes "カレントディレクトリの内容("+notemax+"ファイル):" repeat notemax noteget fname,cnt mes ""+cnt+":"+fname loop notesave "dir.txt" stop
sample\hspcl\cl_dirlist.hsp - 2007/07/31
cl_getenv.hsp
#include "mod_getenv.as" mes "環境変数を表示します。
sample\hspcl\cl_getenv.hsp - 2007/07/31
cl_getpath.hsp
#runtime "hsp3cl" コマンドラインに指定されたファイル名を取り出す a="Console HSP Test" mes "["+a+"]" a = dir_cmdline if a="" : mes "コマンドライン文字列がありません。" : end b = getpath(a,0) mes "すべて取り出す。" mes b b = getpath(a,1) mes "拡張子を除いた部分を取り出す。" mes b b = getpath(a,2) mes "拡張子を取り出す。
sample\hspcl\cl_getpath.hsp - 2007/07/31
cnt.hsp
カウンタCGI URLリクエストの例 http: localhost/cgi-bin/cnt.exe #runtime "hsp3cl" HSPCLランタイムを使用する sdim s,64 文字変数sを64バイトで用意 fnm="cnt.txt" カウンタファイル名を変数fnmに入れる bload fnm,s 文字変数sにカウンタファイルの内容を読み込む s=int(s) 文字変数sを数値変数にする s+ 数値変数sに1加算 s=strf("%08d",s) 数値変数sを8桁の文字変数にする
sample\hspcl\cgi\cnt.hsp - 2007/07/31
cookie_get.hsp
#include "mod_getenv.as" mes "Content-type: text/html\n" 出力先をHTMLページに指定 sdim a,256 文字変数aを256バイトで用意 getenv a,"HTTP_COOKIE" クッキーの内容を変数aに取得 mes "環境変数を表示します。
sample\hspcl\cgi\cookie_get.hsp - 2007/07/31
cookie_set.hsp
クッキーの書き込みCGI URLリクエストの例 http: localhost/cgi-bin/cookie_set.exe #runtime "hsp3cl" HSPCLランタイムを使用する mes "Set-Cookie: hspauthor=onitama&HSP3.0 expires=Sunday, 31-Dec-2010 23:59:59 GMT\n" ここでは"hspauthor=onitama&HSP3.0"という部分がクッキーに保存される文字列になっています。
sample\hspcl\cgi\cookie_set.hsp - 2007/07/31
hello.hsp
最も簡単なCGIプログラム URLリクエストの例 http: localhost/cgi-bin/hello.exe #runtime "hsp3cl" HSPCLランタイムを使用する mes "Content-type: text/html\n" 出力先をHTMLページに指定 mes "HSP-CGIの世界へようこそ!" メッセージを表示
sample\hspcl\cgi\hello.hsp - 2007/07/31
hensu.hsp
#include "mod_getenv.as" mes "Content-type: text/html\n" 出力先をHTMLページに指定 文字変数を用意 sdim a,256 sdim b,256 sdim c,256 sdim d,256 sdim e,256 環境変数の内容を文字変数に取得 getenv a,"REMOTE_HOST" getenv b,"REMOTE_ADDR" getenv c,"HTTP_USER_AGENT" getenv d,"REQUEST_METHOD"
sample\hspcl\cgi\hensu.hsp - 2007/07/31
postval.hsp
#include "form_decode.as" mes "Content-type: text/html\n" 出力先をHTMLページに指定 sdim ss,256 文字変数ssを256バイトで用意 sdim s,256 文字変数sを256バイトで用意 input s,256 標準入力から値を取得 form_decode ss,s,1 送信用コードを元の日本語に変換する(ついでに&を改行に変換) mes "<b>POSTされた値:</b>" mes "<pre>"+ss+"</pre> "
sample\hspcl\cgi\postval.hsp - 2007/07/31