The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About strings
Author Message
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #1
About strings
Hello guys, I'am making my vendor system and i cant find any way to check if string contains only numbers (0-9). Is there a way to check for it ? (i need this one for prices.
03-19-2013 08:11 AM
Find all posts by this user Like Post Quote this message in a reply
Fahrenait
Apprentice
*

Posts: 3
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jan 2013
Reputation: 0

Elpida

Post: #2
RE: About strings
for 0 <eval strlen(<argtxt[1]>) -1>
if !strmatch('[0-9]','<strsub <eval <local._for>> 1 <argtxt[1]>>')
sysmessage just number..
return 1
endif
endfor

// argtxt from dialog
03-19-2013 08:36 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: About strings
if strregex(^[0-9]+$,<argtxt[1]>)

[Image: 2nis46r.jpg]
(This post was last modified: 03-19-2013 08:56 AM by Mordaunt.)
03-19-2013 08:55 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #4
RE: About strings
(03-19-2013 08:55 AM)Mordaunt Wrote:  if strregex(^[0-9]+$,<argtxt[1]>)

I dont really understand tht line, but thanks Smile It works Smile
03-19-2013 10:36 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #5
RE: About strings
what about
if <isnum <args>>
???
03-19-2013 11:03 PM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: About strings
It's new to me also, used it for the first time last weekend.

http://wiki.sphere.torfo.org/index.php/C...0#STRREGEX

[Image: 2nis46r.jpg]
03-19-2013 11:04 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #7
RE: About strings
Yes, but why not using ISNUM?
Then a conditional if <ARGS> < 0 or > 10?

That line with strregx is amazing, but the easy way is also useful. xD
03-20-2013 12:40 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)