Special Discussion.
#1

Well, I've noticed something, you can use strings like "this and that" or #this and that.

Example:
pawn Код:
printf(#Number %d and string %s, 57, #Hello );
Which will print:
pawn Код:
Number 57 and string Hello
Which works great but doesn't support { } ( ) [ ], but there is a way arround it by doing "[ ]"#continued string.
It also doesn't support , but you could do ","#continue string.

This code:
pawn Код:
printf(#This is %d and this is %s","# putting a "[ ]"# works, 56, #Lol);
Will successfully print:
pawn Код:
This is 56 and this is Lol, putting a [ ] works

~ My question is, which is faster, or which is recommended?


-----
I've also checked PAWN documents and saw that you can use integers like 1_000_000 which will print 1000000.
They said using _ will make you read the number better, works however you like.

123456 - 1_23_4_56 -> Will print 123456.

Example:

pawn Код:
new Int = 1_34___67_000;
printf( #Number %d, Int );

Will print:
pawn Код:
Number 13467000
Reply
#2

assuming the following I'd say:
assumed that the compiler searches for symbols.

It searches for symbol " till it meets another "
it searches for symbol # till it meets {}[]() or ,

The criteria it needs to search the string's end is bigger, meaning it needs to compare more string indexes per character. Tho I hardly doubt it will make any real difference with normal reasonable coding.

Not to mention, if you are used to the original string indication styles, it is easier to just stick with that.
I second that because in different languages, this symbol, #, is used to start a comment.

greets
Reply
#3

Quote:
Originally Posted by maij
Посмотреть сообщение
assuming the following I'd say:
assumed that the compiler searches for symbols.

It searches for symbol " till it meets another "
it searches for symbol # till it meets {}[]() or ,

The criteria it needs to search the string's end is bigger, meaning it needs to compare more string indexes per character. Tho I hardly doubt it will make any real difference with normal reasonable coding.

Not to mention, if you are used to the original string indication styles, it is easier to just stick with that.
I second that because in different languages, this symbol, #, is used to start a comment.

greets
I would be using # to induce credits stealers into error!

I want complicate my script so hard that they will want to just close the program and go out.
Reply
#4

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
I would be using # to induce credits stealers into error!

I want complicate my script so hard that they will want to just close the program and go out.
Well this might work for amateurs. however for expert programmers/scripters it doesn't make a difference.
So I wish you much luck on your quest to do that.
Reply
#5

Quote:
Originally Posted by maij
Посмотреть сообщение
Well this might work for amateurs. however for expert programmers/scripters it doesn't make a difference.
So I wish you much luck on your quest to do that.
Expert scripters don't steal credits, that's for sure, that's why i said credits stealers as all they know to do is change credits.

And thanks for your answer, it pretty much cleared everything for me.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)