←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

[ROZWIĄZANE] funkcja exit


Best Answer DarkGL 26.10.2013 13:24

Z tego co pamiętam to w C++ jest jakimś mniej optymalnym odpowiednikiem return

 

Nie.

http://www.cplusplus...e/cstdlib/exit/

 

Co do exit

exit expression
Abort the program. The expression is optional, but it must start
on the same line as the exit statement if it is present. The exit
instruction returns the expression value (plus the expression tag) to
the host application, or zero if no exit expression is present. The
significance and purpose of exit codes is implementation defined.

Go to the full post
Locked

GT Team's Photo GT Team 26.10.2013

Wpisując w amxxsutdio 'exit' podświetla mi się to słowo na zielono, czy ono jest w ogóle używane i jakie ma zadanie? Takie jak w Cpp i C ?
Quote

  • +
  • -
Ogen Dogen's Photo Ogen Dogen 26.10.2013

Z tego co pamiętam to w C++ jest jakimś mniej optymalnym odpowiednikiem return , ale w nie spotkałem się z tym w amxx :o

Quote

  • +
  • -
Best Answer DarkGL's Photo DarkGL 26.10.2013

Z tego co pamiętam to w C++ jest jakimś mniej optymalnym odpowiednikiem return

 

Nie.

http://www.cplusplus...e/cstdlib/exit/

 

Co do exit

exit expression
Abort the program. The expression is optional, but it must start
on the same line as the exit statement if it is present. The exit
instruction returns the expression value (plus the expression tag) to
the host application, or zero if no exit expression is present. The
significance and purpose of exit codes is implementation defined.

Quote

GT Team's Photo GT Team 26.10.2013

Wiem wiem, mogę tego używać w pluginie ? ( i dawać:EXIT_SUCCESS, failure ?)
Quote

  • +
  • -
DarkGL's Photo DarkGL 26.10.2013

A nie możesz tego po prostu sprawdzić ?

 

Kod się kompiluje op cody wydają się ok sama obsługa halt jest w maszynie wirtualnej zaimplementowana

op_halt:
    GETPARAM(offs);
    if (retval!=NULL)
      *retval=pri;
    /* store complete status (stk and hea are already set in the ABORT macro) */
    amx->frm=frm;
    amx->pri=pri;
    amx->alt=alt;
    amx->cip=(cell)((unsigned char*)cip-code);
    if (offs==AMX_ERR_SLEEP) {
      amx->reset_stk=reset_stk;
      amx->reset_hea=reset_hea;
      return (int)offs;
    } /* if */
    ABORT(amx,(int)offs);
Quote

GT Team's Photo GT Team 26.10.2013

dużo mi to mówi :D, dzięki, temat do zamknięcia, to była tylko czysta Ciekawość :P
Quote
Locked