RUN Command

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Neale
Posts: 24
Joined: Sat Mar 25, 2017 10:40 pm
Location: United Kingdom

RUN Command

Post by Neale »

Hello

Using XVIDE the RUN Command will not work, code example;
METHOD ShowOpenReportEditor() AS VOID
//Purpose.......: Open report RP editor.
//Notes.........:
RUN ReportEditor.exe

RETURN

Error returned;
error XS0103: The name 'RUN' does not exist in the current context

There is a note in the Xsharp help file;
Note This command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available.

I have not checked 'Ignore XSharpDefs.vh' in XVIDE, but I cannot see the RUN command in the header file? Should another reference be included?

Probably doing something wrong?

Neale
User avatar
Chris
Posts: 4871
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

RUN Command

Post by Chris »

HI Neale,

Looks like we have forgotten to implement this command, will log a bug report for this. Are you using it in a lot of places? If yes, I will send you some info how to include support for it now, but if you are only using it once or twice, I think it's better to replace the command with a call to System.Diagnostics.Process.Start() (which is what RUN will call internally anyway), which will also give you better control over the arguments and the way the process is run anyway.

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Neale
Posts: 24
Joined: Sat Mar 25, 2017 10:40 pm
Location: United Kingdom

RUN Command

Post by Neale »

Hello Chris
Thanks for your help, didn't think about the .net way.
Had a quick look at System.Diagnostics.Process.Start() and as you say has a lot more control with arguments etc.

Best
Neale
User avatar
robert
Posts: 4497
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

RUN Command

Post by robert »

Neale,
You can also try this

_RUN("ReportEditor.exe")

That works in VO too.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply