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
first letter in the string
Author Message
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #2
RE: first letter in the string
STRSUB will do this you can learn more about strings @ http://wiki.sphere.torfo.org/index.php/C..._10#STRSUB

Example from my Bank Check

Code:
ON=check*
IF (!(<ISEMPTY <STREAT <ARGS>>>))
    IF (!(<ISNUM <STREAT <ARGS>>>))
    SAY @946,3,1 You must say a value for your check.
    ELSE
        LOCAL.VALUE=<STREAT <ARGS>>
        IF (<LOCAL.VALUE> > 10000000)
        SAY @,,2 1010007
        ELIF (<LOCAL.VALUE> < 10000)
        SAY @,,2 500383
        ELIF (<SRC.GOLD> < <LOCAL.VALUE>)
        SAY @,,2 500380
// ^^ Checks for the Check
        ELIF (<LOCAL.VALUE> >= 10000) && (<LOCAL.VALUE> <= 99999)
        LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
// Amount check so we know where to place comma
        ELIF (<LOCAL.VALUE> >= 100000) && (<LOCAL.VALUE> <= 999999)
        LOCAL.NEWHALF=<STRSUB 0 3 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 3 3 <dLOCAL.VALUE>>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
// Amount check so we know where to place comma
        ELIF (<LOCAL.VALUE> >= 100000) && (<LOCAL.VALUE> <= 9999999)
        LOCAL.NEWHALF=<STRSUB 0 1 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 1 3 <dLOCAL.VALUE>>
        LOCAL.NEWHALF3=,<STRSUB 3 3 <dLOCAL.VALUE>>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
// Amount check so we know where to place comma
        ELIF (<LOCAL.VALUE> == 10000000)
        LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
        LOCAL.NEWHALF3=,<STRSUB 3 3 <dLOCAL.VALUE>>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
// incase i forgot something..
        ELSE
        SAY @946,3,1 A check must be made in the amount between 10,000 and 10,000,000 Gold.
        ENDIF
    ENDIF
ENDIF
04-21-2012 08:43 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
first letter in the string - Art - 04-21-2012, 07:56 PM
RE: first letter in the string - Reflex - 04-21-2012 08:43 PM
RE: first letter in the string - Art - 04-21-2012, 11:56 PM
RE: first letter in the string - Shaklaban - 04-22-2012, 05:11 AM

Forum Jump:


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