Shape paint color from a registered bank

Hello everybody,
How do I paint a Shape passing the color that is registered in the database? I'm trying so, but it did not work.

Shape1.Color:=StrToColor(<frxDBDataset1."COR">);

grateful,

Ilano

Comments

  • edited 9:07AM
    ilanocf wrote: »
    ...
    Shape1.Color:=StrToColor(<frxDBDataset1."COR">);
    ...
    Shape1.Color is Interger value, and there is no StrToColor function in FR.
    But you may write your own in FR script using below example.
    Notice It depends how colors are kept in your table in "COR" field.
    var  myColor :int;
    begin
       case <frxDBDataset1."COR"> of
       'yellow' :  myColor := clYellow;
       'black'   :  myColor := clBack;
       'apple'  :  myColor := clGreen;
       'sky'     :  myColor := clBlue;
       else        myColor := clRed;
       end;
       Shape1.Color := myColor;
    end;
    
    Regards
    Mick

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.