From f5669af1d90fc8bfec2c5d9bccce80d6026e54be Mon Sep 17 00:00:00 2001 From: Raymond Date: Sat, 27 Mar 2010 13:12:06 +0100 Subject: [PATCH] Filling the core now actually works :-).. Still needs someway to do this after the formcreate, kinda slows down the program :(. --- Units/MMLAddon/PSInc/pscompile.inc | 10 +++++----- Units/MMLAddon/mmlpsthread.pas | 8 ++++---- Units/Misc/PSDump.pas | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Units/MMLAddon/PSInc/pscompile.inc b/Units/MMLAddon/PSInc/pscompile.inc index 21ec23d..5fca769 100644 --- a/Units/MMLAddon/PSInc/pscompile.inc +++ b/Units/MMLAddon/PSInc/pscompile.inc @@ -21,11 +21,11 @@ PSCompile.inc for the Mufasa Macro Library } -Sender.Comp.AddConstantN('AppPath','string').SetString(CurrThread.AppPath); -Sender.Comp.AddConstantN('ScriptPath','string').SetString(CurrThread.ScriptPath); -Sender.Comp.AddConstantN('IncludePath','string').SetString(CurrThread.IncludePath); -Sender.Comp.AddConstantN('PluginPath','string').SetString(CurrThread.PluginPath); -Sender.Comp.AddConstantN('FontPath','string').SetString(CurrThread.FontPath); +Sender.Comp.AddConstantN('AppPath','string').SetString(Self.AppPath); +Sender.Comp.AddConstantN('ScriptPath','string').SetString(Self.ScriptPath); +Sender.Comp.AddConstantN('IncludePath','string').SetString(Self.IncludePath); +Sender.Comp.AddConstantN('PluginPath','string').SetString(Self.PluginPath); +Sender.Comp.AddConstantN('FontPath','string').SetString(Self.FontPath); Sender.Comp.AddTypeS('TReplaceFlag', '(rfReplaceAll, rfIgnoreCase)'); Sender.Comp.AddTypeS('TReplaceFlags','set of TReplaceFlag'); Sender.Comp.AddTypeS('StrExtr','(Numbers, Letters, Others);'); diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index e3e6a9a..3983c46 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -591,22 +591,22 @@ begin {$I PSInc/pscompile.inc} Fonts := Client.MOCR.GetFonts; for i := fonts.count - 1 downto 0 do - PSScript.Comp.AddConstantN(Fonts[i].Name,'string').SetString(Fonts[i].Name); + Sender.Comp.AddConstantN(Fonts[i].Name,'string').SetString(Fonts[i].Name); for i := high(PluginsToLoad) downto 0 do for ii := 0 to PluginsGlob.MPlugins[PluginsToLoad[i]].MethodLen - 1 do - PSScript.AddFunctionEx(PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[ii].FuncPtr, + Sender.AddFunctionEx(PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[ii].FuncPtr, PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[ii].FuncStr, Muf_Conv_to_PS_Conv(PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[ii].FuncConv)); for i := 0 to high(VirtualKeys) do - PSScript.Comp.AddConstantN(Format('VK_%S',[VirtualKeys[i].Str]),'Byte').SetInt(VirtualKeys[i].Key); + Sender.Comp.AddConstantN(Format('VK_%S',[VirtualKeys[i].Str]),'Byte').SetInt(VirtualKeys[i].Key); // Here we add all the Consts/Types to the engine. //Export all the methods for i := 0 to high(ExportedMethods) do if ExportedMethods[i].FuncPtr <> nil then - PSScript.AddFunctionEx(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl, + Sender.AddFunctionEx(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl, {$ifdef PS_StdCall}cdStdCall{$else}cdRegister {$endif}); end; diff --git a/Units/Misc/PSDump.pas b/Units/Misc/PSDump.pas index dc84e5f..92fb877 100644 --- a/Units/Misc/PSDump.pas +++ b/Units/Misc/PSDump.pas @@ -247,7 +247,7 @@ procedure TPSScriptExtension.GetCodeProps; btSingle: Result := FloatToStr(v.tsingle); btDouble: Result := FloatToStr(v.tdouble); btExtended: Result := FloatToStr(v.textended); - btString: Result := tbtString(v.tstring); + btString: Result := MakeString(tbtString(v.tstring)); {$IFNDEF PS_NOINT64} btS64: Result := IntToStr(v.ts64); {$ENDIF}