Lev_Landau Posted December 16, 2013 Share Posted December 16, 2013 (edited) My variable stores a string: [email protected] = "UpperToLower" I need a function, that does the upper case to lower case conversion trick, something like: 0AB1: call_scm_func @CONVERT 4 [email protected] [email protected] [email protected] [email protected] return [email protected] Now variable [email protected] stores this string: [email protected] == "uppertolower" Any help is really appreciated, Thank You Edited December 16, 2013 by Lev_Landau Link to comment Share on other sites More sharing options...
fastman92 Posted December 16, 2013 Share Posted December 16, 2013 :LowerString { Description: Returns string with all alphabetic characters converted to lowercase. Type: SET Parameters: Passed: [email protected], [email protected], [email protected], [email protected] ([email protected]) - long string to lower [email protected] - type of variable to return (2 - short var, 4 - long var) Example: 0AB1: call_scm_func @LowerString 5 string [email protected] [email protected] 0 0 return_type 2 [email protected] [email protected] } 0A9F: [email protected] = current_thread_pointer [email protected] += 60 // [email protected] adress :LowerStringLoop 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 if [email protected] <> 0x00 else_jump @LowerStringReturn if and [email protected] >= 65 [email protected] <= 90 then [email protected] += 32 0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect 0 end [email protected] += 1 jump @LowerStringLoop :LowerStringReturn if [email protected] == 4 then 0AB2: ret 4 [email protected] [email protected] [email protected] [email protected] else 0AB2: ret 2 [email protected] [email protected] end Link to comment Share on other sites More sharing options...
Wesser Posted December 16, 2013 Share Posted December 16, 2013 (edited) Simple as hell (untested): CLEO3: const //_convertStringToUpcase = 0x00718710 _convertStringToLowcase = 0x00718740end0A9F: [email protected] = [email protected] += 0x3C // CScriptThread.m_aiLocalVars//0A90: [email protected] = 0 * 0x04 // LVAR_ID * sizeof(CScriptThread.m_aiLocalVars[0])//005A: [email protected] += [email protected]//0AA5: call _convertStringToUpcase num_params 1 pop 1 pszString [email protected]: call _convertStringToLowcase num_params 1 pop 1 pszString [email protected] CLEO4 (correction by ): const //_convertStringToUpcase = 0x00718710 _convertStringToLowcase = 0x00718740end//0AA5: call _convertStringToUpcase num_params 1 pop 1 pszString [email protected]: call _convertStringToLowcase num_params 1 pop 1 pszString [email protected] SCM functions look ugly here. Edited December 16, 2013 by Wesser DK22Pac 1 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
DK22Pac Posted December 16, 2013 Share Posted December 16, 2013 (edited) Or even using directly [email protected] as paramter for 0AA5 with CLEO4 0AA5: call _convertStringToLowcase num_params 1 pop 1 pszString [email protected] Edited December 16, 2013 by _DK Link to comment Share on other sites More sharing options...
Wesser Posted December 16, 2013 Share Posted December 16, 2013 Heh, I'm not quite familiar with CLEO4. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now