Is there any way to use self Execute functions in vb6?

0

In javascript we can write this in several ways:

(function () {
    console.log("Olá");
})();

(function () {
    console.log("Olá");
}());

! function () {
    console.log("Olá");
}();

void function () {
    console.log("Olá");
}();

I'm working on a project in vb6, and I wanted to use something like a self-invoke function so I do not need to declare a function in the global scope of my form, so I want to call a function that I'll only use once inside this function and will not use more.

Does anyone know if there is a way to do this without using gambiarra?

    
asked by anonymous 17.12.2018 / 17:51

1 answer

0

Unfortunately, VB6 only accepts Functions or Subs declared in the scope of the form. I worked with VB6 for some time and have never seen anything like it.

More information: link

    
17.12.2018 / 17:56