Represents the data of the local variable.
Syntax
| C# | |
|---|
public interface ILocalVariable |
Remarks
Example
The following code using
ILocalVariable Interface for getting information about local variable.
| C# | Copy Code |
|---|
// get local variable
ILocalVariable lv = project.Variables["VariableName"];
// get comment for current local variable
string comment = lv.Comment;
// if value is empty then set comment for local variable
if (String.IsNullOrWhiteSpace(comment)) lv.Comment = "Set the comment for this local variable";
// get name of local variable
string name = lv.Name;
// get group of local variable
string @group = lv.Group.ToString();
// get value of local variable
object value = lv.Value;
// show message about variable
System.Windows.Forms.MessageBox.Show(String.Format("Local variable: value is {0}; comment {1}", value, comment),
String.Format("Information about variable {0} from group {1}", name, @group)); |
| PHP | Copy Code |
|---|
// get local variable
$lv = $project->Variables->get_Item("VariableName");
// get comment for current local variable
$comment = $lv->Comment;
// if value is empty then set comment for local variable
if (String::IsNullOrWhiteSpace($comment)) $lv->Comment = "Set the comment for this local variable";
// get name of local variable
$name = $lv->Name;
// get group of local variable
$group = $lv->Group->ToString();
// get value of local variable
$value = $lv->Value;
// show message about variable
System\Windows\Forms\MessageBox::Show(String::Format("Local variable: value is {0}; comment {1}", $value, $comment),
String::Format("Information about variable {0} from group {1}", $name, $group)); |
Requirements
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven
See Also