Browse Source

* Use hostconfig provided wasm file

Michaël Van Canneyt 11 months ago
parent
commit
f1af18918c
1 changed files with 13 additions and 1 deletions
  1. 13 1
      demo/wasienv/regexp/regexphost.lpr

+ 13 - 1
demo/wasienv/regexp/regexphost.lpr

@@ -46,8 +46,20 @@ Type
   end;
   end;
 
 
 procedure TMyApplication.DoRun;
 procedure TMyApplication.DoRun;
+var
+  wasm : String;
+
 begin
 begin
-  StartWebAssembly('wasmregexpdemo.wasm');
+  Terminate;
+  if Assigned(HostConfig) and isString(HostConfig.wasmFilename) then
+    Wasm:=HostConfig.wasmFilename
+  else
+    begin
+    Wasm:=ParamStr(1);
+    if Wasm='' then
+      Wasm:='wasmregexpdemo.wasm';
+    end;
+  StartWebAssembly(wasm);
 end;
 end;
 
 
 procedure TMyApplication.HandleLogClick(Event : TJSEvent);
 procedure TMyApplication.HandleLogClick(Event : TJSEvent);