PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Run Code Block outside a Window?
Run Code Block outside a Window?
Iniciado por guest, 24,may. 2016 02:55 - 6 respuestas
Publicado el 24,mayo 2016 - 02:55
Hi,

How do I run a block of code outside of a window such as this? The code has nothing to do with windows.

Value is int
SelectionResult is boolean
Value = RGB(10, 17, 69)
Info("Initial color: " + Value)
SelectionResult = SelectColor(Value, scInit)
Info("Final color: " + Value)

Thanks, Stanley
Publicado el 24,mayo 2016 - 06:58
Hello Stanley

Having dot prompt withdrawal symptoms ?

A simple trick is to have a blank window open with a few button controls on it.
Paste the code into the button click event
Use the "small go" option (f9) to run the window and click the button to execute the code.
If there are mutliple lines to look at, the start with a "STOP" command toi start the debugger and step through the code.

The debugger will also execute code if you paste it from an executing code window into the debugger.

Regards
Al
Publicado el 24,mayo 2016 - 08:22
Hi Al,

OK, your work around is doable, thanks...

What do you mean by: "Having dot prompt withdrawal symptoms ?"

I do know I'm having VFP withdrawal symptoms...

Thanks again, Stanley
Publicado el 24,mayo 2016 - 08:38
Hello Stanley

I think I am showing my age Dbase/Foxpro had the ability to drop into a command window, type in some code, execute it it to see if it worked as expected and then paste it back into the program and that window was know as the "dot prompt"
It was probably called something different in VFP.

It was one of the hardest things do do without in the early days of moving to Windev

Regards
Al
Publicado el 24,mayo 2016 - 12:12
if it's in the development process the debug is your best friend as explained above if it's in production you can use Compile and execute functions to run whatever code you generate in one string.

http://doc.windev.com/en-US/…
Publicado el 25,mayo 2016 - 12:54
Hi,

You can also put this in a global procedure and press the GO button. Windev wil then ask for any parameters of the global function and runs the code.

You can run any window or global function with the GO button

So you could easily make a global test function and put your code in it and run.

Danny
Publicado el 25,mayo 2016 - 13:10
Further...
If you condition this using IF InTestMode() = True THEN //Call your procedure here END
You can safely leave this in any executable you you generate