User Tag List

Results 1 to 2 of 2

Thread: Returning string from expression

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Returning string from expression

    Hi,

    I am having trouble returning a string to Fusion from an expression using EDIF. The string in question is a TCHAR* stored in the Extension class. Nothing I have tried gets the string back to Fusion. I've tried all manner of conversions (long like in the rSDK, LPCWSTR, WideCharToMultiByte) and Runtime.CopyString. It either returns nothing or is messed up. I am able to display the string using MessageBox, so I know the string is valid.

    Thanks.

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,911
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    In Edif/DarkEdif, to return a string:
    1) Make sure the expression's "Returns" is "Text" in the JSON file.
    2) Next, the return type of the expression should be const TCHAR *.
    3) Next, make sure you link the expression with LinkExpression(ID, FunctionName) in Extension.cpp, in Extension's constructor, which should be the top function in the file.
    4) In your return statements, use return Runtime.CopyString(str); where str is your variable/text to return.
    If returning a literal text, "like that", use _T("like that").

Similar Threads

  1. Replies: 3
    Last Post: 3rd May 2016, 07:24 AM
  2. Get height of string as an expression
    By JDWB in forum Fusion 2.5
    Replies: 4
    Last Post: 19th June 2015, 08:33 AM
  3. String Parser returning wrong value
    By mobichan in forum Android Export Module 2.5
    Replies: 9
    Last Post: 16th March 2015, 04:48 PM
  4. Can't resize the text of an string with expression. What should I do?
    By NaitorStudios in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 9th September 2013, 06:08 PM
  5. How to write " in a string using Expression Editor
    By MelliGeorgiou in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 15th August 2006, 01:58 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
  •