PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD] variable out of scope
[WD] variable out of scope
Iniciado por guest, 14,oct. 2016 00:54 - 2 respuestas
Publicado el 14,octubre 2016 - 00:54
Hi

I have just encountered a (so far) seemingly strange thing...

I created a new project - and imported global procedures from an existing project. [WD19]

(The existing project is a standard 64 bit configuration - the new project is configured as a webservice)

The new (WD webservice project) gives compile errors for out of scope variables. The variables "are" out of scope in that they are declared within an IF-ELSE-END block - then used/referenced outside the block (below the declaration).

However, this code does not flag any errors in the existing Windows project - and seemingly works fine.

I am trying to figure out how and why the compiler works differently with different configurations. So far, I am just assuming that that is the way it is - and that as a 'webservice' it is being compiled with a different compiler - perhaps for compatibility with the application server?

Anyone have any insights as to what is actually happening?


Regards
Derek
Publicado el 14,octubre 2016 - 09:46
Hello !

See option in WinDev (Project -> Compilation -> Scope of local variables limited to the current block)

[attachment 2193 Picture1.jpg]
Publicado el 17,octubre 2016 - 03:34
Ah! Yes. Thank you!