Yoko

All sides of Injection
It is currently 2025-12-09 12:34:11

All times are UTC+02:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: return
PostPosted: 2007-10-15 01:05:11 
Offline

Joined: 2007-02-24 20:40:31
Posts: 17
Подскажите плз, что за команда, как ее используют. В хелпе Йоко не нашел((


Top
   
 Post subject:
PostPosted: 2007-10-15 04:49:17 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
viewtopic.php?t=805

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-10-15 14:56:13 
Offline

Joined: 2007-02-24 20:40:31
Posts: 17
Там только 1 упоминание return в контексте примера объявления функции без всяких пояснений


Top
   
 Post subject:
PostPosted: 2007-10-15 14:59:15 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
В основном используется для проверки результативности условия.
Во второстепенной функции проверяется условие,-если выполняется то вернуть 1, иначе вернуть 0. А в основной проверяется то, что вернёт эта функция (если возвращает 1, значит второстепенная функция выполняется и делается одно, иначе другое).


Code:
sub Ret_Value()
  if uo.InJournal('put') then
    return 1
  else
    return 0
end sub

sub Script()
  if Ret_Value()==1 then
    uo.Print('We put something...')
  else
    if Ret_Value()==0 then
      uo.Print('There are no msg.')
    end if
  end if
end sub


Top
   
 Post subject:
PostPosted: 2007-10-15 16:29:51 
Offline

Joined: 2007-02-24 20:40:31
Posts: 17
Scripts Writer wrote:
...

Спасибо за ответ.
P.S.: еще этой командой можно перезапустить функцию, внутри которой она находится
Code:
 
sub func()
<тело функции>
if <условие> then
    return func
endif
<тело функции>
end sub


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited