なぜ日本では「市民運動」が格好ワルイいのか?
HPの英断。日本のメーカーは?

iPadアプリ開発日誌:計算アプリ(その3)

開発中のiPad/iPhone向けの計算アプリだが、「計算式と結果をメールで送りたい」という相棒の要望に答えて実装した。各行のラベル・計算式・結果からHTMLのテーブルを作りそれをメーラーに渡すだけ。

"1+1"の計算をした結果をメールで送ると、こんなテーブルが作られる。

M1 1 + 1 2.00

"M1"は一行目に自動的に付けられるラベル(行の名前)である。その結果にさらに "+2"を足した場合、こうなる。

M1 1 + 1 2.00
M2 M1 + 2 4.00

二行目が一行目の結果(M1)を参照していることが分かると思う。ラベルは自由に書き換えることができるので、それを応用して以下のような表を簡単に作る事ができる。

放射線強度 3.8 3.80
屋外活動時間 8 8.00
屋内被曝率 40 % 0.40
終日被曝量 放射線強度 × (屋外活動時間 + (24 − 屋外活動時間) × 屋内被曝率) 54.72
年間被曝量 終日被曝量 × 365 19,972.80

だいぶ形になって来た。来週ぐらいにはアップルの審査に提出できると思うので、乞うご期待!

Comments

beerdog

なるほど…。A1とかの縦横指定ではなく、文字(ラベル)指定で、値を指定できるということでしょうか?わかりやすいですよね。完成を楽しみにしております。

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name is required. Email address will not be displayed with the comment.)