0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

炎ほのおの型かた工房 こうぼうScratchとDartでゲームプログラム入門にゅうもん Advent Calendar 2016
の記事きじです

Scratchと比較ひかくしてみよう

main(List<String> args) {
  print('Dart Love');
}

を、Scratchと比較ひかくしてみましょう。

v001.png
  • 「旗はたがクリックされたとき」と main(List args) {} は同おなじよなもの
    アプリの起動時きどうじに呼よばれます。
  • 「xxxと言いう」とprint('xxx'); は似にたようなもの
    文字もじを表示ひょうじします。

argsとは何なにでしょうか?

Dartでは、アプリ起動時きどうじに文字列もじれつを渡わたす事ことができます。
コードを書かいて、試ためしてみましょう。

1. 以下いじょうのようなコードを書かく

main(List<String> args) {
  print('Dart Love ${args}');
}

2. コマンドラインから実行じっこうしてみよう!!

c:\tools\dart-sdk-1.21\bin\dart.exe .\bin\main.dart test01 test02

Dart Love [test01,test02]
と表示ひょうじされましたね!!

Thanks

ここまで、読よんでくれてありがとう!!

では、次回じかい会あえることを、楽たのしみにしています。

ではでは

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?