Use of global variables

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Intexso
Posts: 84
Joined: Mon Sep 10, 2018 3:19 pm

Use of global variables

Post by Intexso »

Hello,

I my VO application I am using some global variables.

For example I have in Xide an application. In the file 'Global Variables.prg' I declare: GLOBAL lShare := FALSE as LOGIC.

In the same application, but another file I am using the global variable lShare.

The compiler gives the error:
error XS0246: The type or namespace name 'lShare' could not be found (are you missing a using directive or an assembly reference?) 8543,18 Database.prg


Do I have to declare a using directive? And if, what must be the directive name?

Thanks in advance.

Eric
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Use of global variables

Post by robert »

Eric,

I think your code looks like this:
IF lShare.AND. another condition.

VO has no problem with that but X# thinks that you are accessing the AND property in the lShare class.
If you put a space between lShare and .AND. then it should compile without problems.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Intexso
Posts: 84
Joined: Mon Sep 10, 2018 3:19 pm

Use of global variables

Post by Intexso »

Yes, how simple it can be.
Thanks
Eric
Post Reply