Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 1 Jahr, 5 Monaten
Letzter Beitrag:
vor 1 Jahr, 5 Monaten
Beteiligte Autoren:
StanleyBarnett, Al, DerekT, Paulo Oliveira, Danny Lauwers

Run Code Block outside a Window?

Startbeitrag von StanleyBarnett am 24.05.2016 00: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

Antworten:

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

von Al - am 24.05.2016 04:58
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

von StanleyBarnett - am 24.05.2016 06:22
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

von Al - am 24.05.2016 06:38
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/?3013015

von Paulo Oliveira - am 24.05.2016 10:12
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

von Danny Lauwers - am 25.05.2016 10:54
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

von DerekT - am 25.05.2016 11:10
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.