SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 13/12/2017, 08:33 PM   #221
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,723
Reputation: 780
Default Re: Tips & Tricks

Quote:
Originally Posted by Logic_ View Post
Sorry for the bump, but shouldn't this
PHP Code:
for(new strlen(string); != EOSi--) 
be the most fastest string loop?
EOF is value 0 so you are stoping at index 1! Its 0 in c/c++.

Here, without the use of strlen:
PHP Code:
for (new istring[i] != EOFi++) {

__________________
Gammix is offline   Reply With Quote
Old 13/12/2017, 08:46 PM   #222
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: NL-RP
Posts: 1,391
Reputation: 241
Default Re: Tips & Tricks

Quote:
Originally Posted by Gammix View Post
EOF is value 0 so you are stoping at index 1! Its 0 in c/c++.

Here, without the use of strlen:
PHP Code:
for (new istring[i] != EOFi++) {

Yep right, I mis-typed my code
__________________
Developer @ <enter your roleplay server name here>
Disclaimer: Affiliate of PrestigeSteve
Providing SA-MP, G-MOD, Web hosting and Hosted tab listing for cheap @ www.prestigesteve.com.
Logic_ is offline   Reply With Quote
Old 14/12/2017, 09:35 AM   #223
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,540
Reputation: 552
Default Re: Tips & Tricks

EOS is '\0', that is: 0. So, use the one you feel is right in the context.
Misiur is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Needs Scripting Tips! KomplettMaster General 12 26/12/2012 04:04 PM
[Tutorial] [InfiniTuts - Tutorials for beginners] Tips and Tricks regarding 'logical thinking' - Making your own script Infinity Tutorials 6 29/04/2012 11:34 PM
Motor Tricks by D12 D12Mr Screenshots and Videos 6 24/05/2009 06:04 PM


All times are GMT. The time now is 09:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.