Let’s see how to call a macro function within the script. We will build the function “Inc()” which will increment by 1 the passed parameter and return the result to the script.
In the macro editor write:
function Inc(Value)
Inc = Value+1
end function
Now, in the script, we will use a variable to receive the function result and display it in the interface:
LET _VAR1 = Inc(1);
Remember, you can call functions, not subroutines. And inside the functions, don’t call interface elements since they are not available during the load.
Good to know, but is there any chance calling a VB function from an Expression!?
No chance. The only way is to compute the data in the script.
how can i call not a function but a SUB VBScript from Load Script?
Create a FUNCTION that calls your SUB…
hello, could you please give me an example about creating a function that calls a SUB?
thanks a lot
Leonardo
FUNCTION MyFunction()
MySub
END FUNCTION
SUB MySub
Msgbox(“Hello world”)
END SUB
Hello,
thank you so much for your reply.
I still have some problem, because it doesn’t work in the script…
probably I’m still doing some mistakes…
Hello, could you please send a qvw example file?
thanks
Hi, I m trying to do the same.. but not able to call the function from script.. I have just pasted the exact on module and script.. but getting no result.