Announcement

Collapse
No announcement yet.

Write on label

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

  • Write on label

    I am new to the environment and I am trying to figure out which is the best method to develop my applications, I am trying the visi genie magic but I can not do an apparently very simple thing:
    I have a button and a label (Strings) and I would like that when I press the button a text is written in the label, I have created the event and if I write on the display everything is fine but I do not find out how to write in the label.

  • #2
    Hi Pier,

    Please check the application note below as a reference.
    ViSi-Genie Labels, Texts, and Strings

    Or if it is ok for you to share your project here for us to see.
    Go to File > Zip Project then save as type to zip and attached it here.

    Thank you.

    Best Regards,
    Ferdinand

    Comment


    • #3
      writing from host I have no problems, what I can not do is writing the label using magic code

      Comment


      • #4
        Hi Pier,

        Try Magic Event then use the code below and set as button event.
        Code:
        func MagicEvent0(var newval)
        WriteObject(tStrings, 0, 1);
        endfunc
        Use WriteObject() function to set the value of the strings.
        On the above code, I use parameters tString as object type, 0 as the object index of the string and 1 as new value.

        You can check Genie Magic Callable functions on ViSi-Genie Reference Manual for additional information.

        Best Regards,
        Ferdinand

        Comment


        • #5
          i tried with

          func MagicEvent0(var newval)
          WriteObject(tStrings, 0, "Hello");
          endfunc

          and

          func MagicEvent0(var newval)
          var a :="Hello"
          var b :=str_ptr(a);
          WriteObject(tStrings, 0, &b);
          endfunc

          but nothing appears on the label

          the only way to write in the label is this but I don't understand why it doesn't work with the other methods:

          func MagicEvent0(var newval)
          var a :="Hello"
          var b :=str_ptr(a);
          WriteObject(tStrings, 0, &b);
          str_Printf(&b,"%s")
          endfunc

          Comment

          Working...
          X