Главное меню  

   

Авторизация  

   
   
Хостинг в Украине
   


52.1%Russian Federation Russian Federation
21.1%Ukraine Ukraine
16%United States United States
1.9%Belarus Belarus
1.2%Romania Romania
1.1%United Kingdom United Kingdom
0.9%Czech Republic Czech Republic
0.9%Kazakhstan Kazakhstan
0.6%Kuwait Kuwait
0.6%Republic Of Moldova Republic Of Moldova

Сегодня: 8
Вчера: 311
На этой неделе: 619
На прошлой неделе: 1872
В этом месяце: 3246
В прошлом месяце: 8478
Всего: 25455


   

Учитель информатики Бамбуркин С.П.

Записи

  • Главная
    Главная Страница отображения всех блогов сайта
  • Категории
    Категории Страница отображения списка категорий системы блогов сайта.

Making & Calling Function

Добавлено : Дата: в разделе: Соревнования

If the same code need to be repeated multiple times, or if the code needs to be distinguished according to its role,  you can make the code as a function, and can all the function whenever necessary.  This is similar to the concept of a function in C language.  The only difference is that there are no return values and input parameters. When used properly, you can easily figure out  the flows of the program,  and can avoid to write the same command lines again and again.  Functions are executed by calling them. After a called function ends, execution will be returned to the point of the calling and started from the next command line.

Usage

  • The following rules apply when making a function:
    • There cannot be duplicate function names.
    • A function must exist outside another function or program body.  
    • Spaces and special characters(!, @, #, $ etc.) are not allowed in function names.
    • Function names cannot start with numbers.
  • While inputting function names, press Esc to cancel.
  • Otherwise, press Enter to save.
  • While selecting the function to call, press ESC to cancel.
  • Otherwise, click the appropriate function or press Enter while the function is highlighted to save.
  • A function cannot call itself.

Example

  • The program will continuously call the functions to move forward, backward, right and left.

Редактировалось Дата:

Добавить комментарий


Защитный код
Обновить

   
© 2012 fordus.