Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSScript-related function generates an EXE.
#1
Running the macro CSreplace_T in QM works fine, but after compiling it into an EXE, the following error occurs.

Warning (RT) in <open "CSreplace /41">CSreplace:  script empty.    <help #IDP_OPT>?
Error (RT) in <open "CSreplace /41">CSreplace:  0x80131600, 
    Public class  not found.    <help #IDP_ERR>?


Is there any way to resolve this issue?
Thanks in advance for any suggestions and help.

Function CSreplace_T
Code:
Copy      Help
out

str s =
;aaa 123 ccc

str p =
;\d+

str t =
;BBB

mes CSreplace(s, p, t)

Function CSreplace
Code:
Copy      Help
function~ str's str'p str't

str code
ret CsFunc(code s p t)

#ret
using System.Text.RegularExpressions;

string replace(string s, string p, string t)
{
,Regex rx = new Regex(p);
,return Regex.Replace(s, p, t);
}

Using the above approach to create C# functions is very concise. For example:
many `using` directives can be omitted, there's no need to create a class, function modifiers can be left out, and so on.
However, the only issue is that generating an `.exe` results in an error. I noticed the following in the help documentation:

1. When the `code` variable is empty, the code after `#ret` is used automatically.
2. The `csscript` class supports `.exe`.


Messages In This Thread
CSScript-related function generates an EXE. - by Davider - 06-04-2025, 09:28 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)