StringReplace

edited 10:44AM in FastScript
Hi,
Does have anyway to use stringreplace function in fastscript ?

I try to use "Addmethod" but I don't know how to use it, can you teach me.

Regards,
Alex

Comments

  • edited 10:44AM
    you must read help file ;)
    this method work for instance:
    procedure MyCallMethod(Instance: TObject; ClassType: TClass;
          const MethodName: String; var Params: Variant): Variant; 
    begin
    ........
    if MethodName='STRINGREPLACE' then//MethodName return name of method in upeercase, independently from that you write this method in AddMEthod
       Result:=.............;//you can use Params
    .......
    end;
    
    procedure MyProc;
    begin
    fsScript.AddMethod('function StringReplace(......): string', MyCallMethod);
    end;
    
    i'm sorry, if i've very bad english ;)

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.