Now it just works fine with the ValueChanged as i original tried. I must have made some mistake before, and and confused me into a lot of other approaches.
Thanks.
void SystemTagCurrentUser_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
if(Globals.Tags.SystemTagCurrentUser.Value == "")
// MessageBox.Show("0");
Globals.Tags.TestBit.Value = 0;
if(Globals.Tags.SystemTagCurrentUser.Value != "")
// MessageBox.Show("1");
Globals.Tags.TestBit.Value = 1;
}
Setting tag if user is logged in.
Re: Setting tag if user is logged in.
Hi,
I would like a script that changes to 'screen 2' after a user is logged in.
My (failed) scripting attempts are as follows:
void SystemTagCurrentUser_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
if(Globals.Tags.SystemTagCurrentUser.Value == "")
Globals.screen1.Show();
if(Globals.Tags.SystemTagCurrentUser.Value != "")
Globals.screen2.Show();
}
Any suggestions/corrections?
Thanks
I would like a script that changes to 'screen 2' after a user is logged in.
My (failed) scripting attempts are as follows:
void SystemTagCurrentUser_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
if(Globals.Tags.SystemTagCurrentUser.Value == "")
Globals.screen1.Show();
if(Globals.Tags.SystemTagCurrentUser.Value != "")
Globals.screen2.Show();
}
Any suggestions/corrections?
Thanks
Re: Setting tag if user is logged in.
Hi Sarah,
Your code works great, are you sure that you have spelled the name of the two screens right? Should the S in screen1/2 be capitalized?
Best Regards
Your code works great, are you sure that you have spelled the name of the two screens right? Should the S in screen1/2 be capitalized?
Code: Select all
void SystemTagCurrentUser_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
if(Globals.Tags.SystemTagCurrentUser.Value == "")
Globals.Screen1.Show();
if(Globals.Tags.SystemTagCurrentUser.Value != "")
Globals.Screen2.Show();
}
Re: Setting tag if user is logged in.
Hi,
I'm trying to make use of this script.
I've created a tag called: UserLoggedIn
I've pasted the code like this:
Unfortunately code doesn't work.
I can see the value change of the tag SystemTagCurrentUser in an AnalogNumeric field but nothing happens with the other tag.
How to make it work.
Thanks in advance!
I'm trying to make use of this script.
I've created a tag called: UserLoggedIn
I've pasted the code like this:
Code: Select all
//--------------------------------------------------------------
// Press F1 to get help about using script.
// To access an object that is not located in the current class, start the call with Globals.
// When using events and timers be cautious not to generate memoryleaks,
// please see the help for more information.
//---------------------------------------------------------------
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
public partial class Hem
{
void SystemTagCurrentUser_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
if(Globals.Tags.SystemTagCurrentUser.Value == "")
Globals.Tags.UserLoggedIn.Value = 0;
if(Globals.Tags.SystemTagCurrentUser.Value != "")
Globals.Tags.UserLoggedIn.Value = 1;
}
}
}
I can see the value change of the tag SystemTagCurrentUser in an AnalogNumeric field but nothing happens with the other tag.
How to make it work.
Thanks in advance!
Re: Setting tag if user is logged in.
Hi
It took only 1,5 months to get my post approved here.
My problem is solved.
It seems that sometimes when the code is pasted one has to "switch on" the code for the tag action even I the tree structure.
I even get random yellow marks beside code sometimes.
Seems that there is a bit of work for program developers here.
It took only 1,5 months to get my post approved here.
My problem is solved.
It seems that sometimes when the code is pasted one has to "switch on" the code for the tag action even I the tree structure.
I even get random yellow marks beside code sometimes.
Seems that there is a bit of work for program developers here.