Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Script Language: Active Field on Screen

Script Language: Active Field on Screen

Script Language: Active Field on Screen


Does the Scripting Language (Mintscript or Smartgui script) have a command that can be used to designate the "active" field on the screen?

The background to may question is: on MSM14SA there are 2 stock code fields and I need the script to link to an external MS Word document that has information on the stock code designated by the active field   

RE: Script Language: Active Field on Screen

MINT and SmartGUI Mims Scripting

I can't remember ever writing a script which tested cursor position (generally the error message number was specific to an individual field only which was sufficient), but the doco says you can test a MIMS field for cursor positioning or field protection.
This would require a long-winded approach to test each field on the screen to find out which field is active.
In the following example:



If the cursor is in the field @FIELD1 the variable CURF1 is set to '!'.

Also (if you are interested)



If the field @FIELD1 is protected then the variable PROF1 is set to '#'.

Mincom Connector

When using the MSO interface of Mincom connector, you can reference the ActiveField property.

In the following example:


sFldName = Trim$(oMimsx.Screen.MSO.ActiveField.Name)
sFldValue = Trim$(oMimsx.Screen.MSO.ActiveField.Value)

sFldName will return the Name of the field which is Active
sFldValue will return the Value of the field which is Active

MSQ000 Scripting (Ellipse VB Scripts)

I haven't yet written an Ellipse VB Script needing this functionality (mostly doing Mincom Connector scripting), but the doco says you can get the Active Field using GetCursor.

In the following example:


sFldName = msq000.GetCursor

sFldName will return the Name of the field which is Active

RE: Script Language: Active Field on Screen

Thank you for your valuable posting
I had to code for SmartGui, and although I dug up the current field concept from the doco, it did not seem to work ok, ie simply by placing the cursor on the field would not recognise it as the the current field, that appeared to happen only after <enter> was pressed.
I would say 'appeared' because my code might be buggy, or maybe composed with bugs in my user exit on the back end code. I gave that solution up, and replaced with "menu" where the user actually selects the required stock-code from a pop-up list of the two fields on the screen, which is lame but it works.

Checking on the 'active' field would have been more elegant and it was not at all long-winded as you say, because we were only interested in checking 2 fields on the screen. Here is my code  


/*example using the concept of 'current field'
/*If the cursor is in the field @PART_NO1I1 the variable CUR_PROT is set to ‘!’.
/*If the field is protected, the variable CUR_PROT is set to ‘#’.
/* Abort subroutine if cursor is not in field or if field is empty:
  ABORT IF NOT ( CUR_PROT1 = '!' )
  ABORT IF ( DOCNO1 = '' )
/* else system call to display the material safety data sheet
  SYSTEM 'WINEXEC SHOWMAXIMIZED C:\PROGRA~1\INTERN~1\IEXPLORE.EXE http:\\server-here\mims41\doclink\doclink.asp?doctype=3&docno='DOCNO1

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close