今朝 N 君に改良版を教えてもらった。こっちの方がスマートなのと、且つ入力チェックもしているので勝手に紹介 (^^;
@関数で10進数を16進数に変換する
dec := @Prompt([OkCancelEdit];"Lotus Notes - Dec to Hex conversion";"10進数の値を入力してください";"");■ 関連記事
@If(
@Matches(dec;"+{0-9}"); "";
@Do(
@Prompt([Ok];"Lotus Notes - Dec to Hex conversion";"ERROR: 数値を入力して下さい");
@Return("")
)
);
n := @TextToNumber(dec);
hex := "";
@DoWhile(
r := @Modulo(n;16);
hex := @If( r >= 10 ; @Char( 55 + r) + hex ; @Text(r) + hex);
n := @Integer(n / 16);
n >= 16);
hex := @If( n >= 10 ; @Char( 55 + n) + hex ; n = 0 ; ""+ hex ;@Text(n) + hex);
tmp:=@Prompt([OkCancelEdit];"Lotus Notes - Dec to Hex conversion";"16進数変換結果";hex);
@関数で10進数を16進数に変換する