Sign in to follow this  
Followers 0
Automaton

Citect Cicode Drop down menu

2 posts in this topic

Hello I am trying to make my own user login form using a drop down menu to select the user name The idea is 3 users, Operator, Supervisor and Engineer. The customer wants to be able to select the role from a combo box menu ( that's why I cant use the default screen), for ease of testing I have set all 3 roles with the same password of "Test" The code that I have tested here creates a pop up screen with a drop down menu no problem, the catch is that the value selected in the drop down menu is not updated when the Yes button is pressed ( the variable sBuf contains the default value of "Role" instead of the value that I selected in the drop down menu) I used the LoginForm command just so that you can see the value of sBuf when the Yes button is clicked. It seems that the combo box selection is not been written to sBuf even though I select it in the combo box Does anybody have any advice as to where I have gone wrong? Any help would be greatly appreciated STRING sBuf = "Role"; INT hForm; FUNCTION TestLog() STRING Msg; Msg = "User Name: " ; hForm = FormNew("",44,3,16); FormButton(15,1," Yes ",LoginNow,0); FormButton(24,1," No ",0,1); FormComboBox(2 ,2, 15, 5, sBuf, 1); FormAddList("Operator"); FormAddList("Supervisor"); FormAddList("Engineer"); FormRead(0); END INT FUNCTION LoginNow() LoginForm(sBuf,"Test"); RETURN 0; END

Share this post


Link to post
Share on other sites
This is a strange one If I write sBuf to a local variable and run the above code it works fine. It must be related to how the form and combobox objects are instantiated

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0