User Tag List

Results 1 to 4 of 4

Thread: Expressions in expression parameters

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Expressions in expression parameters

    Hello. I've recently been busy with Scintilla 2, and always had some crash issues with some expressions, e.g. getting a range of the text. The problem is not the expression itself, though. It crashes when I pass a Scintilla Expression as parameter.
    I'm using rSDK, maybe that's a problem, Mathias aka DarkKiller reported that he had the same problem before.
    For example, I have the two expressions
    Range$(first,second) returning a range of the text
    Caret() returning the current caret position

    Caret will return 3 in this example.
    The text is "Hello, world".

    Range$(3,6) will return "lo,"
    Range$(Caret(),6) will crash.

    It crashes when calling ExParam():

    PHP Code:
    int min ExParam(TYPE_INT);
    int max ExParam(TYPE_INT); 
    Pretty much all expressions, including these, call window messages via SendMessage and return the result.

    It also crashes with Substr$ as well. Two int parameters, returns string. It doesn't crash with Line$, only one int parameter, returns string as well.

    Does anybody have any clue how to fix this? Thanks.

  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    Umeň, Sweden
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expressions in expression parameters

    Use the old methods from the original SDK to retrieve the expression parameters, works fine!

  3. #3
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expressions in expression parameters

    I assume you're using rSDK. The problem in rSDK is that the nested expression causes the first expression to use the GetFirstExpressionParameter function twice. I solved this in Phizix by making the EXPRESSION macro, found in rTemplate.h, keep track of the P_GetExpressionParameter pointer and restore it after the expression has executed.

    Here's what my current EXPRESSION macro looks like:
    Code:
    // Macro for an expression in main.cpp
    #define EXPRESSION(num, name, flags, params) \
    	long WINAPI DLLExport ExpressionFunc##num(LPRDATA rdPtr, long param1); \
    	long IExpressionFunc##num(LPRDATA, long); \
    	ExtFunction ExpressionClass##num((LPEXPRESSION)ExpressionFunc##num, flags, name, param_list##params); \
    	long WINAPI DLLExport ExpressionFunc##num(LPRDATA rdPtr, long param1) { \
    	long (* cur)(LPRDATA rdPtr,short param1,long type) = rdPtr->rRd->P_GetExpressionParameter; \
    	rdPtr->rRd->P_GetExpressionParameter=G_GetFirstExpressionParameter; \
    	long ret = IExpressionFunc##num(rdPtr,param1); \
    	rdPtr->rRd->P_GetExpressionParameter = cur; \
    	return ret; \
    	} inline long IExpressionFunc##num(LPRDATA rdPtr,long param1)
    Try replacing yours with this one and see if it solves the problem.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Expressions in expression parameters

    Thanks a lot guys. That worked perfectly.
    A special thanks to you Werbad, for this very handy macro. I hope you're having a happy birthday!

Similar Threads

  1. HELP!! Transfer Parameters
    By tomtom in forum SWF/Flash Export Module Version 2.0
    Replies: 7
    Last Post: 19th January 2011, 08:28 PM
  2. Bug Demonstration: Lua Plus can't do parameters
    By Code6 in forum File Archive
    Replies: 4
    Last Post: 1st January 2008, 08:34 PM
  3. MfxDoc 0.06 (now supports expression parameters)
    By TwiTerror in forum Extension Development
    Replies: 0
    Last Post: 14th December 2007, 02:12 AM
  4. Cursor Parameters
    By Morthian in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th January 2007, 07:01 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
  •