Could use some help to find the error in this code.
Code is to make all elements on the form to become Read Only. I have added an AskUser to help test by turning on/off. Final version will use an IF condition for User/Group. Also added Message Box to help troubleshoot. MsgBox does seem to indicate that program is executing when it should, and that all of the elements are being identified correctly.
Program is in section to execute On Form Entry. It is generic and should be able to be plugged into any form.
I am using Version 1.0.5 Beta.
Hmmm....just got an idea to include @ReadOnly and MsgBox before the line to change to ReadOnly......stay tuned.........
OK, I just added a few more lines to check ReadOnly status and it shows that ReadOnly condition is not changing.
Quote:// To make all elements to Read Only
var vStr as string
var vName as string
var vLoop as int
var vCnt as int
IF @ASKUSER("Do you want this to be READ ONLY?","","")
{
// Initialize the list to all the LEs
vStr = @StringArrayElementList()
// Count the total set of all LEs
vCnt = @CountStringArray(vStr)
FOR vLoop = 1 TO vCnt
// Get the name
vName = @AccessStringArray(vStr, vLoop)
//Get Current Read Only Status
@MSGBOX("Current ReadOnly value for " + vName,"is: " + @STR(@ReadOnly(vName)),"")
// Set this element to Read Only
ReadOnly(vName,1)
@MsgBox("Total of " + vCnt + "elements","Element " + vLoop + "is named: " + vName,"ReadOnly status is: " + @STR(@ReadOnly(vName)))
NEXT
}
//=========================================