Is it possible to declare functions in WDPro?

Moderator: Moderator Group

Is it possible to declare functions in WDPro?

Postby claude.rivet » Fri Jan 24, 2014 5:53 pm

Hello, I was wondering if it was possible to declare functions in WDPro. I am not sure I use the right terms so let me explain:

I was wondering if there was a way I could write a macro that would have arguments so that when I call the macro I specify (or not) values that the macro will use. Let's figure a script that changes the tint of all customscript on a given page, rather than calling the macro the following way:

WDMacro,changetint

And have to specify the color values in the script itself or in variables I would simply write:

WDMacro,changetint,255,0,0

the macro changetint has been created so that it knows there are 3 arguments, in the script itself it would look like:

WDCustomScriptTint,arg1,arg2,arg3


Makes sense?
I sure hope there is a way to do this it would make my code so much cleaner and easily reusable.

Thanks, regards.
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm

Re: Is it possible to declare functions in WDPro?

Postby Dennis Kuypers » Fri Jan 24, 2014 5:59 pm

Hi,

You can not create functions. Only parameter-less macros. I tend to create a bunch of variables that I use:

Code: Select all
VInt,i1,0
VInt,i2,0
VInt,i3,0
VInt,i4,0
VString,s1,
VString,s2,
VString,s3,
VString,s4,
VDouble,d1,0
VDouble,d2,0
VDouble,d3,0
VDouble,d4,0


Make sure you have no concurrent operations when using those as parameter arguments or temporary storage.

Best regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: Is it possible to declare functions in WDPro?

Postby claude.rivet » Fri Jan 24, 2014 6:05 pm

Thanks

that's what I currently do but it gets tedious as I have a few hundreds variables, some of which are taken from textbox inputs or buttons presses so the operator can quickly reconfigure the scripts or input custom values. Arguments would have cut the amount of variables and screen estate but a large amount.

Maybe in the future :)

regarsd
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm

Re: Is it possible to declare functions in WDPro?

Postby Dennis Kuypers » Wed Feb 12, 2014 4:02 pm

Hey,

User definable functions is a feature that is being worked on. It might already be available in the next release.

Update: Release Candidate can be downloaded from our website!

Best regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: Is it possible to declare functions in WDPro?

Postby claude.rivet » Mon Feb 17, 2014 5:39 pm

Found it! Awesome, thanks much :)
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 36 guests

cron