get the value from option filed

MRQMRQ Member Posts: 73
hi

how can i assing the string of the option field to string var
i try this but still error.
note:class is a option filed,ClassVar is a string
classVar:=Class::OptionString;

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    You can try
    Text := FORMAT(Optionfield);
    
  • garakgarak Member Posts: 3,263
    The code in your case:
    //This give back the option identifer No (Starts with 0)
    classVar := format(Class::OptionString);
    message(classVar);
    
    //This gives back the Optionstring
    Class := 1; //the second Option, or Class := Class::"YOUR OPTION"
    
    classVar := format(Class);
    message(classVar);
    

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.