1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SETVAR_ fails when using variable values that contain a space

Discussion in 'Bugs' started by Spinner, May 24, 2015.

  1. Spinner

    Spinner Potential Patron

    Joined:
    Apr 28, 2015
    Messages:
    56
    Likes Received:
    0
    SETVAR_ fails when using variable values that contain a space. Example:

    initial_settings:{"varA":"a", "varB":"some text", "varC":"sometext"}

    [SETVAR_varA_*varB*] Will fail (with the literal string "[SETVAR_varA_some text]" being displayed).
    [SETVAR_varA_*varC*] Will work.

    If you're wondering why not use SETVARBYNAME ?
    The answer is that it won't do the job if you want to do this: [SETVAR_targetVar_fixedText*variableText*]
     
  2. Faceless

    Faceless Club Regular Content Creator

    Joined:
    Jun 12, 2011
    Messages:
    1,118
    Likes Received:
    22
    Try using a backslash to escape the space? That works on Unix systems anyway.
     
  3. Spinner

    Spinner Potential Patron

    Joined:
    Apr 28, 2015
    Messages:
    56
    Likes Received:
    0
    Thanks for the thought Faceless... Doesn't work though (and nor does %20). :-\
     
  4. Macnagum

    Macnagum Vivacious Visitor

    Joined:
    Jan 17, 2015
    Messages:
    48
    Likes Received:
    5
    SDT does not accept spaces in triggers, so [SETVAR_varA_some text] and [SETVARBYNAME_varA_some text] don't work.

    SETVAR add a value to a variable, SETVARBYNAME add the value of a variable to a variable. So [SETVAR_varA_*varB*] is not egal to [SETVARBYNAME_varA_varB]. With SETVAR, the content of the variable "varB" is written in the trigger, not with SETVARBYNAME - which allows use of variables that have spaces. However it is not possible to include a variable in a variable like [SETVARBYNAME_varA_var1*var2*] - but it is clear that it would be practical...
     
  5. Pim_gd

    Pim_gd Swell Supporter

    Joined:
    Jan 25, 2013
    Messages:
    721
    Likes Received:
    50