function Test_Read_Only_Properties(nDocID, strNoteID)
local nReadOnlyNote = Nc_Note_Flag_ReadOnly_Get(nDocID, strNoteID)
local nReadOnlyDoc = Nc_Doc_ReadOnly_Get(nDocID)
-- Declare these as locals
local strMessage
local bTerminate
if nReadOnlyNote == 0 and nReadOnlyDoc == 0 then
strMessage = "" -- both read/write
bTerminate = false
end
if nReadOnlyNote == 0 and nReadOnlyDoc == 1 then
strMessage = "ERROR: The document is read-only. Cannot make requested change(s). Terminating script. To proceed, open the Document Properties dialog and change its read-only setting. Then try again."
bTerminate = true
end
if nReadOnlyNote == 1 and nReadOnlyDoc == 0 then
strMessage = "ERROR: The note is read-only. Cannot make requested change(s). Terminating script. To proceed, open the Note Properties dialog and change its read-only setting. Then try again."
bTerminate = true
end
if nReadOnlyNote == 1 and nReadOnlyDoc == 1 then
strMessage = "ERROR: Both the document and note are read-only. Cannot make requested change(s). Terminating script. To proceed, open the Document Properties dialog and change its read-only setting. Open the Note Properties dialog and change its read-only setting. Then execute the script again."
bTerminate = true
end
return strMessage, bTerminate
end -- function