Announcement

Collapse
No announcement yet.

Variable in macro will not work

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Variable in macro will not work

    Hallo

    I use the function sc_field_style.
    So I change depending on the status of the value of the background color of a value.

    see:
    sc_field_style (LiefDat {}, '#FF0000', '12px', '#FFFFFF', 'Arial, sans-serif', 'bold');

    I would now like to pass the color value as a variable:
    like this:

    $red = '#FF0000';
    sc_field_style (LiefDat {}, $red, '12px', '#FFFFFF', 'Arial, sans-serif', 'bold');

    But it will not just work.

    regards

    Kai

  • #2
    Originally posted by kai@schaefers-net.de View Post
    Hallo

    I use the function sc_field_style.
    So I change depending on the status of the value of the background color of a value.

    see:
    sc_field_style (LiefDat {}, '#FF0000', '12px', '#FFFFFF', 'Arial, sans-serif', 'bold');

    I would now like to pass the color value as a variable:
    like this:

    $red = '#FF0000';
    sc_field_style (LiefDat {}, $red, '12px', '#FFFFFF', 'Arial, sans-serif', 'bold');

    But it will not just work.

    regards

    Kai
    Unfortunately sc_field_style does not accept variables as parameter. Besides that LiefDat{} ??
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Hallo aducom

      LiefDat{} was am mistake from me. I mean {LiefDat}

      Comment


      • #4
        Try a global variable.

        [colour] = '#FFFF80';

        :-)

        jsb

        Comment


        • #5
          @jsb: see reaction of Bartho: http://www.scriptcase.net/forum/show...sc_field_style
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment


          • #6
            Nevertheless, global variable works. At least in my case.

            onRecord:
            if ({status} == "overdue" )
            {
            [colour] = 'red';
            sc_field_style("status",[colour]);
            }

            jsb

            Comment

            Working...
            X