STR DEFINE to INTEGER
So this is irritating. Why doesn't this work, and is there an alternative?
Code:
|
Re: STR DEFINE to INTEGER
Define it as an integer? o.o
|
Re: STR DEFINE to INTEGER
Quote:
PHP Code:
|
Re: STR DEFINE to INTEGER
Quote:
|
Re: STR DEFINE to INTEGER
Quote:
|
Re: STR DEFINE to INTEGER
The function I use requires a string for the entire system of plugins I am coding, and I don't feel like editing through 1000's of lines of code changing it over, and unnecessarily converting over each number to a string before use just because I need just this one define as an integer.
|
Re: STR DEFINE to INTEGER
Quote:
PHP Code:
|
Re: STR DEFINE to INTEGER
Quote:
|
Re: STR DEFINE to INTEGER
Problem is that you can only use str_to_num(A_SG_Marines_3_val) in a function, and other problem is that you can only set an array size with a const.
That's why Bugsy took the problem in the other way, so you build the string from the const integer instead of retrieve the integer from the string. |
Re: STR DEFINE to INTEGER
Use Bugsy code, is better than mine, cuz my code is only an example starting with string (only to understand why your code doesn't work):
Code:
Also, maybe the num_to_str() is useless, depends on where you will use the string num... where? maybe in the function that you want to the num as string, you can use %d. Sry for my english. |
| All times are GMT -4. The time now is 05:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.