User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Concactinating Strings

  1. #11
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    My code has a semicolon . When I copied it in I must have accidentially removed it.

    If there was no semicolon, the code itself would not compile.

  2. #12
    No Products Registered

    Join Date
    May 2008
    Location
    California
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    I know that, just pointing it out

  3. #13
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    EnigmaWave's Avatar
    Join Date
    Jul 2006
    Location
    Russellville, AR, USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    Code:
    EXPRESSION(
    	/* ID */			0,
    	/* Name */			"Name(",
    	/* Flags */			EXPFLAG_STRING,
    	/* Params */		(1,EXPPARAM_STRING,"Parameter")
    ) {
    	char * str1 = (char *)"1st String";
    	char * str2 = (char *)ExParam(TYPE_STRING);
    	char * str3 = rdPtr->rRd->GetStringSpace(strlen(str1) + strlen(str2) + 1);
    	strcpy(str3, str1);
    	strcat(str3, str2);
    	ReturnString(str3);
    }

  4. #14
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    Raw strings in C are a pain...
    But you could also use C++ CStrings like this:
    Code:
    EXPRESSION(
    	/* ID */			0,
    	/* Name */			"Name(",
    	/* Flags */			EXPFLAG_STRING,
    	/* Params */		(1,EXPPARAM_STRING,"Parameter")
    ) {
    	CString str1 = "1st String";
    	CString str2 = (char *)ExParam(TYPE_STRING);
    	CString str3 = str1 + str2;
    	ReturnStringSafe(str3.c_str());
    }

  5. #15
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    With Dynasoft's code my extension does not compile. It seems like CString has not been included. How can I include it?

  6. #16
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    Can you tell I haven't used them for a while :P
    I got CString (a microsoft specific thing) and string (the C++ standard one) confused. Replace all the CString in my code with string, and add:
    Code:
    #include <string>
    EDIT: So this:
    EDIT: No + operator, only += apparently, so change like this:
    EDIT3: Scratch that last edit
    Code:
    #include <string>
    
    EXPRESSION(
    	/* ID */			0,
    	/* Name */			"Name(",
    	/* Flags */			EXPFLAG_STRING,
    	/* Params */		(1,EXPPARAM_STRING,"Parameter")
    ) {
    	string str1 = "1st String";
    	string str2 = (char *)ExParam(TYPE_STRING);
    	string str3 = str1 + str2;
    	ReturnStringSafe(str3.c_str());
    }

  7. #17
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    There is a + operator for std::string.

  8. #18
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    It wasn't listed in the online c++ help I looked at.
    EDIT: Changed my post back.

  9. #19
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Concactinating Strings

    Thanks everyone (Especially Dynasoft for his code)! It works now.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Value of all strings is zero?
    By RayRayTea in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th September 2011, 03:38 AM
  2. Scan Global Strings and Other strings
    By Ausomeman in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th May 2010, 04:01 PM
  3. Using Global Strings embedded in larger strings
    By Mudstick in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th May 2008, 01:23 PM
  4. Help me with strings! =)
    By gum in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th November 2006, 06:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •