fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Wait?

Wait? 6 months 2 weeks ago #6926

  FFF's Avatar Topic Author FFF Offline Posts: 574
Using a X#/Core app (build from the "Basic" sample, no references, no vo switches set) i was looking for an equivalent for Vo's "Wait" for Console.
Typing "Wait" and F9, i got error XS0103: The name '_Wait' does not exist in the current context.
Switching to "Wait()" it changed to error XS9002: Parser: unexpected input '_Wait( ()'
Obviously, there's some trickery at work ;)?

Now, to hinder my console to dissappear, i used System.Console.ReadLine(), but this is inconvenient: hitting any key, it writes to the screen, hitting Enter i get "type any key...", so to close the console i have first to target the Enter and then need another hit...

There used to be something (a switch?) for an implicit wait, but i can't find this anymore?

Please Log in or Create an account to join the conversation.

Wait? 6 months 2 weeks ago #6927

  Chris's Avatar Chris Offline Posts: 1163
Hi Karl,

You can use System.Console.ReadKey() instead :)

Regarding WAIT, this gets translated to a call to _Wait() by a preprocessor directive found in XSharpDefs.xh (in \XSharp\Include)

#xcommand WAIT [<msg>] => _Wait( <msg> )

So you just need to include references to the (any) runtime, where this function is implemented.

Or, if you want, you can implement the function yourself in your code. Or you can modify the directive, to generate something else that you prefer instead, for example

#xcommand WAIT [<msg>] => System.Console.ReadKey()
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

  • Page:
  • 1