Shares information between all clients using a particular NSP based application. An NSP based application is basically a set of NSP files that are stored in a virtual directory and sub directories. The application object can be locked and unlocked to prevent simultaneous alteration by multiple clients.
Returns the contents object.
Object.Contents(Key)
Contents object.
Read-only.
See sample in Example.
Returns the file name of the application object.
Object.Filename
String.
Read-only.
See sample in Example.
Retrieves the value of the application variable Key.
object.GetValue(
Key As String)
Corresponds to the name of a application variable.
String.
To use this method, the application variable must have been previously set in the application object.
See sample in Example.
Deletes all application variables that have been added to the application object.
object.RemoveAll()
None.
Boolean.
This example sets the values for the fields book name and price. It locks the application for edit and returns the details of the book. It then unlocks the application for edit and removes all the fields and the values.
<% ’Sets the value for the keys bookname and price
Application.Setvalue("Book Name","Beauty and the Beast" )
Application.Setvalue("Price","10 USD") %>
<% ’Locks the application for edit
Application.Lock() %>
<% ’Returns the details of the book
Response.write ("The price of "&Application.getvalue("Book
Name") &" is" &Application.getvalue("price") & "<br>"%>
<% ’Unlocks the application for edit
Application.Unlock() %>
<% ’Removes the specifies key from the contents collection and
returns the result
If Session.Removeall() Then
Response.write ("deleted successfully")
Else
Response.write ("unable to delete")
End If %>
Deletes a specific item from the application object.
object.RemoveValue(
Key As String)
Name of the session variable.
Boolean.
This example sets the fields username and company, deletes the field username and displays the result.
<% ’Sets the value for the keys username and company
Application.Setvalue("User ID","user 1" )
Application.Setvalue("Context","Novell") %>
<% ’Removes the specifies key from the contents collection and
returns the result
If Application.RemoveValue("userID") Then
Response.write ("deleted successfully")
Else
Response.write ("unable to delete")
End If %>
Sets the value of the application variable Key.
Object.SetValue(
Key As String,
Value As String)
String. Name of the session variable.
String. Value of the session variable.
Boolean.
If the application variable is already present, the existing value will be overwritten.
This example sets the values for the fields product name and product Id.It returns the product ID corresponding to a particular product name and the name of the file from which it is extracted. It then lock the script for edit.
<% ’Sets the value for the keys prodname and prodid
Application.Setvalue("prodname","Novell Script for NetWare")
Application.Setvalue("prodid","NSN") %>
<% ’Returns the Product ID for each product in the collection
For each prodname in Application.contents
Response.write ("The product id is "
&Application.getvalue("prodid") &"<br>")
Next %>
<% ’Returns the Filename
Response.write ("The File name is "&Application.Filename
&"<br>"%>
<% ’Locks the Application and returns the result
If Application.Lock() Then
Response.write ("The application is locked for edit")
Else
Response.write ("The session is not locked for edit")
End If %>
Blocks the other clients from modifying the variables stored in the application object.
Object.Lock()
None.
Boolean.
If Unlock method is not called explicitly, the server automatically unlocks the locked application object once the NSP file ends or is timed out or after completion of one minute, which ever is earlier.
See sample in Example.
Allows the other clients to modify the variables of the application that was locked using the Lock method.
Object.Unlock()
None.
Boolean.
If Lock method is not called explicitly, the server automatically locks the unlocked application object once the NSP file ends or is timed out or after completion of one minute, which ever is earlier.
See sample in Example.