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
Function arguments and numbers
Author Message
Feeh
Sphere Developer
*****

Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4



Post: #4
RE: Function arguments and numbers
Sorry but I think I did not understand what you mean...
What Alaric said makes sense

[function f_test1]
f_test2 02 3

[function f_test2]
serv.log <argn1> -- <dargn1>//will output 02 -- 2
serv.log <argn2> -- <dargn2>//will output 03 -- 3

Anything that starts with a '0' and contains ONLY 0~9 and/or a~f is treated as hex
Anything that contains ONLY 0~9 is treated as decimal
hex and decimal are both numbers with different notation but same values and range. AFAIK sphere prefers to always store them as number, unless internally pointed to treat them as decimal
Anything else is a string


Your script logic must know what to do. If you may pass a number AND string to the same function, it must know what to do
http://wiki.sphere.torfo.org/index.php/C..._Functions

Try using <ARGS> then STRARG/STREAT it for your needs

You can force it to be treated as string by adding a non-number element on it
f_myfunc :2 :02
then remove the first char

Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
(This post was last modified: 05-04-2014 06:29 AM by Feeh.)
05-04-2014 06:27 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Function arguments and numbers - karma - 05-04-2014, 05:24 AM
RE: Function arguments and numbers - karma - 05-04-2014, 05:52 AM
RE: Function arguments and numbers - Feeh - 05-04-2014 06:27 AM
RE: Function arguments and numbers - karma - 05-04-2014, 07:51 AM
RE: Function arguments and numbers - karma - 05-04-2014, 09:41 AM
RE: Function arguments and numbers - karma - 05-04-2014, 09:58 AM
RE: Function arguments and numbers - karma - 05-04-2014, 07:25 PM

Forum Jump:


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