AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   For what is ; exactly (https://forums.alliedmods.net/showthread.php?t=117131)

KadiR 01-29-2010 12:16

For what is ; exactly
 
I like to know, what an
PHP Code:



makes exactly in a code, I've got this:

PHP Code:

        {
            
client_print(idprint_chat"Hey Dude!")
            
set_task(0.1,"hey_dude")
            
HeyDude(id);
        } 

What will happen, if I make this:

PHP Code:

        {
            
client_print(idprint_chat"Hey Dude!");
            
set_task(0.1,"hey_dude");
            
HeyDude(id);
        } 


01101101 01-29-2010 12:17

Re: For what is ; exactly
 
This has been asked soooooooooooooooooooooooooooooo many times. Its just the same.

Mxnn 01-29-2010 14:05

Re: For what is ; exactly
 
In C++ executed the function.
Example:
PHP Code:

client_print(idprint_chat"lala"); 

The semi-colon will execute the client_print. In C++ you must put at the end of all the functions (excepts if, for, while and others statements).
In Pawn you don't have to put the semi-colon.

V I R U S 01-29-2010 14:15

Re: For what is ; exactly
 
If you're putting semicolon, you can write two functions in a single line.
PHP Code:

client_print(idprint_chat"lala"); client_print(idprint_chat"lala"); 

Without semicolon, each call must be on a new line.
PHP Code:

client_print(idprint_chat"lala")
client_print(idprint_chat"lala"


VMAN 01-29-2010 18:09

Re: For what is ; exactly
 
It is a good habit though, especially if you are familiar with PHP and those kinds of languages

V I R U S 01-29-2010 18:15

Re: For what is ; exactly
 
Just set it after your code and it will be much easier for you later if you will learn other languages where semicolon must be set!

joropito 01-29-2010 18:29

Re: For what is ; exactly
 
Semicolon it's the way to tell for some parser that a sentence finish.

In C, C++ and others languajes it's mandatory.
In Pawn is optional unless you use pragma semicolon option.

Forget about the semicolon, it's just for people who know other languajes and used to put semicolons in their code.

ConnorMcLeod 01-29-2010 18:36

Re: For what is ; exactly
 
Quote:

Originally Posted by joropito (Post 1072185)
Forget about the semicolon

+1

fysiks 01-29-2010 18:58

Re: For what is ; exactly
 
Quote:

Originally Posted by KadiR (Post 1071751)
I like to know, what an
PHP Code:



makes exactly in a code.

Wow, search much?


All times are GMT -4. The time now is 07:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.