Raised This Month: $ Target: $400
 0% 

regex constants


Post New Thread Reply   
 
Thread Tools Display Modes
zerak
Senior Member
Join Date: Feb 2008
Old 11-22-2008 , 19:37   Re: regex constants
Reply With Quote #11

I am sorry but I don't understand what you mean, the compiler can detect that and/or const would otherwise have solve it but it does not. Static is like global but only in local scope like you state, and apparently one cannot do that kind of assignment on globals either (not a big surprise). But I don't understand why

But like befored why doesn't \. work ?
zerak is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-22-2008 , 20:35   Re: regex constants
Reply With Quote #12

\. doesn't work because \ is the escape character. It thinks you're trying to escape ., which you can't do. So putting \\. escapes the \, making it do what you want.
bl4nk is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 11-22-2008 , 20:39   Re: regex constants
Reply With Quote #13

Quote:
Originally Posted by zerak View Post
I am sorry but I don't understand what you mean, the compiler can detect that and/or const would otherwise have solve it but it does not. Static is like global but only in local scope like you state, and apparently one cannot do that kind of assignment on globals either (not a big surprise). But I don't understand why

But like befored why doesn't \. work ?
Static variables can't be initialized cause you can't determine if the assignment is done once, as in global variables, or every time the function is called. Therefore you can't initialize them like this. And you can't assign non-const data into globals because there is no 'global code' in Pawn. You can't do anything unless you're inside a function. And globals are obviously not.
__________________

Community / No support through PM
danielkza is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 21:50.


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