0
I have several forms in my application, and I can start the call by some of them running partial for testing (not necessarily START from the main form).
In addition to the public variables that are in a module, I tried to do the same with public routines and functions, so that they were not spread in codes of several forms or concentrated in one, because in either case the partial call of the application would not load all functions and routines that could be requested.
You can do it?
For example, I want a public routine that puts the "default" values in public variables, but not in a form code.
Public Sub InicializaVariaveisPublicas()
VersaoATual = "2.03.017"
QuantidadeMaximaProjetos = 2
QuantidadeMaximaItens = 10
ArrastoMouse = False
MaximoTentativas = 3
...
...
End Sub
HICCUP
See answer below
What went wrong when you put her in the module? That’s how you do it.
– Ricardo
Syntax error occurs when calling the routine, I checked name, parameters, but found nothing. I will try again
– Leo
A question, I call one of the public routines as the first command of a Form, ie in Form_activate. This may be the error?
– Leo
Put in the answer as it gets inside the module, with the signature of the whole module and as you are calling the function, test call the function in a click and not active too
– Ricardo
Ricardo, the mistake was that I was calling the routine with parentheses to put two arguments, Rotina(a,b), just take them off and it worked, even if it was the first call from Ctivate. Routine a,b I will put in question. Grateful
– Leo
In VB subs vc calls without () and functions with ()
– Ricardo
Okay, it was distraction, because before I had done as a function and then changed to routine without having tested. Thanks!
– Leo
Create an answer to your question, in which case you answer and accept the answer yourself. Abs
– Ricardo
@Leo see here a short explanation of how the parentheses work.
– Omni
Okay, that’s exactly what happened... thanks
– Leo