28_strwmid.hsp

sample\hspint64.dll\28_strwmid.hsp » Plain Format

// hsp3_64.as → hspint64.as の順にインクルードしてください。
// また、varptr や callfunc をマクロで置き換えている都合上、
// hspint64.as のインクルードは なるべく上に書いておくことをお勧めします。
// なお、varptr や callfunc をマクロの置換をしない場合は、以下のコメントを解除してください。
// #define CANCEL_UNDEF_HSPINT64 

#include "hsp3_64.as"
#include "hspint64.as"

// strwmid
// Unicode(UTF-16)文字列の一部を取り出す

b = _T("ABCDEF")
mes b

a = strwmid( b, -1, 3 )   ; 右から3文字を取り出す
mes a

a = strwmid( b, 1, 3 )    ; 左から2文字目から3文字を取り出す
mes a