Cant store Listbox.selecteditem in Variable

Hi Everybody,
im build a littl Powershell Programm, and thought everything was going well, but now i hit a wall.
Im Trying to store the selected item of 3 Listboxes in 3 variables but it wont work. if i Close the form and look into listbox11.selecteditem for example it Shows the value but while the form is open it wont store the value in the variable.
I tryed so many sollutions but just cant seem to get it to work. maybe i dont see the error after looking at the script for so Long, i hope you can help me :-)
$id=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal=new-object System.Security.Principal.WindowsPrincipal($id)
if(!$principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) {
$powershell=[System.Diagnostics.Process]::GetCurrentProcess()
$psi=new-object System.Diagnostics.ProcessStartInfo $powershell.path
$Script=$MyInvocation.MyCommand.Path
$prm=$script
foreach($a in $args) {
$prm+=' '+$a
$psi.Arguments=$prm
$psi.Verb="runas"
[System.Diagnostics.Process]::Start($psi) | Out-Null
return;
$Network = Get-NetAdapter | where status -eq up | Select-Object -ExpandProperty Name
Function GetIP {
Get-NetIPAddress -InterfaceAlias $Network | where IPaddress -Like *.*.*.*|
select-object -Property ipaddress,interfacealias
$Interfaces = getip
$IPS = $interfaces.ipaddress
$Adapters = $interfaces.interfacealias
Function GetHost {
$GetHost = [System.Net.Dns]::GetHostEntry($IP).hostname
$GetHost
$DNSHost = GetHost
Function GetLocalHost{
$GetlocalHost = Get-Content env:computername
$GetlocalHost
$LOKHost = GetLocalHost
Function Setip {
$InterIndex = Get-NetIPAddress -InterfaceAlias $Network | select-object -exp InterfaceIndex | Select-Object -First 1
Remove-NetIPAddress -IPAddress $IP
new-NetIPAddress -Interfaceindex "$InterIndex" -IPAddress $EnterIP -PrefixLength 24
Function GetDesc{
$GetDesc = Get-WmiObject -Class Win32_OperatingSystem |Select Description
$GetDesc | Select-Object -ExpandProperty Description
$Desc = Getdesc
Function SetDesc {
$SetDesc = Set-ItemProperty -Path HKLM:\system\ControlSet001\Services\LanmanServer\Parameters -name srvcomment -value $NEWDesc
Function Sethost{
Rename-Computer $newlokHost
$wscDefinition =@”
// WSC_SECURITY_PROVIDER as defined in Wscapi.h or http://msdn.microsoft.com/en-us/library/bb432509(v=vs.85).aspx
[Flags]
public enum WSC_SECURITY_PROVIDER : int
WSC_SECURITY_PROVIDER_FIREWALL = 1, // The aggregation of all firewalls for this computer.
WSC_SECURITY_PROVIDER_AUTOUPDATE_SETTINGS = 2, // The automatic update settings for this computer.
WSC_SECURITY_PROVIDER_ANTIVIRUS = 4, // The aggregation of all antivirus products for this computer.
WSC_SECURITY_PROVIDER_ANTISPYWARE = 8, // The aggregation of all anti-spyware products for this computer.
WSC_SECURITY_PROVIDER_INTERNET_SETTINGS = 16, // The settings that restrict the access of web sites in each of the Internet zones for this computer.
WSC_SECURITY_PROVIDER_USER_ACCOUNT_CONTROL = 32, // The User Account Control (UAC) settings for this computer.
WSC_SECURITY_PROVIDER_SERVICE = 64, // The running state of the WSC service on this computer.
WSC_SECURITY_PROVIDER_NONE = 0, // None of the items that WSC monitors.
// All of the items that the WSC monitors.
WSC_SECURITY_PROVIDER_ALL = WSC_SECURITY_PROVIDER_FIREWALL | WSC_SECURITY_PROVIDER_AUTOUPDATE_SETTINGS | WSC_SECURITY_PROVIDER_ANTIVIRUS |
WSC_SECURITY_PROVIDER_ANTISPYWARE | WSC_SECURITY_PROVIDER_INTERNET_SETTINGS | WSC_SECURITY_PROVIDER_USER_ACCOUNT_CONTROL |
WSC_SECURITY_PROVIDER_SERVICE | WSC_SECURITY_PROVIDER_NONE
[Flags]
public enum WSC_SECURITY_PROVIDER_HEALTH : int
WSC_SECURITY_PROVIDER_HEALTH_GOOD, // The status of the security provider category is good and does not need user attention.
WSC_SECURITY_PROVIDER_HEALTH_NOTMONITORED, // The status of the security provider category is not monitored by WSC.
WSC_SECURITY_PROVIDER_HEALTH_POOR, // The status of the security provider category is poor and the computer may be at risk.
WSC_SECURITY_PROVIDER_HEALTH_SNOOZE, // The security provider category is in snooze state. Snooze indicates that WSC is not actively protecting the computer.
WSC_SECURITY_PROVIDER_HEALTH_UNKNOWN
// as defined in http://msdn.microsoft.com/en-us/library/bb432506(v=vs.85).aspx
[DllImport("wscapi.dll")]
private static extern int WscGetSecurityProviderHealth(int inValue, ref int outValue);
// code to call our interop function and return the relevant result based on what input value we provide
public static WSC_SECURITY_PROVIDER_HEALTH GetSecurityProviderHealth(WSC_SECURITY_PROVIDER inputValue)
int inValue = (int)inputValue;
int outValue = -1;
int result = WscGetSecurityProviderHealth(inValue, ref outValue);
foreach (WSC_SECURITY_PROVIDER_HEALTH wsph in Enum.GetValues(typeof(WSC_SECURITY_PROVIDER_HEALTH)))
if ((int)wsph == outValue) return wsph;
return WSC_SECURITY_PROVIDER_HEALTH.WSC_SECURITY_PROVIDER_HEALTH_UNKNOWN;
$wscType=Add-Type -memberDefinition $wscDefinition -name “wscType” -UsingNamespace “System.Reflection”,“System.Diagnostics” -PassThru
$Virstat = if ($wscType[0]::GetSecurityProviderHealth($wscType[1]::WSC_SECURITY_PROVIDER_ANTIVIRUS) -eq $wscType[2]::WSC_SECURITY_PROVIDER_HEALTH_GOOD)
“Anti-virus running and up-to-date.”
else
"Antivirus disabled or not up-to-Date"
#function GenerateForm {
# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0
# Generated On: 10.10.2014 14:43
# Generated By: Markus.Soeller
#region Import the Assemblies
[System.Reflection.Assembly]::loadwithpartialname("System.Drawing") | Out-Null
[System.Reflection.Assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
#endregion
#region Generated Form Objects
$form1 = New-Object System.Windows.Forms.Form
$button1 = New-Object System.Windows.Forms.Button
$ListBox12 = New-Object System.Windows.Forms.ListBox
$ListBox13 = New-Object System.Windows.Forms.ListBox
$ListBox11 = New-Object System.Windows.Forms.ListBox
$label8 = New-Object System.Windows.Forms.Label
$label7 = New-Object System.Windows.Forms.Label
$textBox3 = New-Object System.Windows.Forms.TextBox
$textBox2 = New-Object System.Windows.Forms.TextBox
$textBox1 = New-Object System.Windows.Forms.TextBox
$listBox5 = New-Object System.Windows.Forms.ListBox
$listBox4 = New-Object System.Windows.Forms.ListBox
$listBox3 = New-Object System.Windows.Forms.ListBox
$listBox2 = New-Object System.Windows.Forms.ListBox
$button3 = New-Object System.Windows.Forms.Button
$button2 = New-Object System.Windows.Forms.Button
$statusBar1 = New-Object System.Windows.Forms.StatusBar
$label6 = New-Object System.Windows.Forms.Label
$label5 = New-Object System.Windows.Forms.Label
$label4 = New-Object System.Windows.Forms.Label
$label3 = New-Object System.Windows.Forms.Label
$label2 = New-Object System.Windows.Forms.Label
$label1 = New-Object System.Windows.Forms.Label
$panel1 = New-Object System.Windows.Forms.Panel
$button4 = New-Object System.Windows.Forms.Button
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
#endregion Generated Form Objects
#Generated Event Script Blocks
#Provide Custom Code for events specified in PrimalForms.
$button1_OnClick=
$form1.Close()
$handler_label3_Click=
#TODO: Place custom script here
$handler_textBox1_TextChanged=
#TODO: Place custom script here
$button4_OnClick=
$SelectIp | out-host
$selectInterface | out-host
$selecttype | out-host
$handler_label2_Click=
#TODO: Place custom script here
$handler_label6_Click=
#TODO: Place custom script here
$handler_label5_Click=
#TODO: Place custom script here
$handler_label4_Click=
#TODO: Place custom script here
$button2_OnClick=
$NEWDesc = $textBox2.Text
$Listbox2.items.RemoveAt(0)
setdesc
$desc=getdesc
$Listbox2.items.add($Desc)
$handler_label7_Click=
#TODO: Place custom script here
$handler_label1_Click=
#TODO: Place custom script here
$button3_OnClick=
$NewlokHost = $textbox3.Text
$Listbox3.items.RemoveAt(0)
sethost
$LOKHost = GetLocalHost
$Listbox3.items.add($LOKHost)
$OnLoadForm_StateCorrection=
{#Correct the initial state of the form to prevent the .Net maximized form issue
$form1.WindowState = $InitialFormWindowState
#region Generated Form Code
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 512
$System_Drawing_Size.Width = 1010
$form1.ClientSize = $System_Drawing_Size
$form1.DataBindings.DefaultDataSourceUpdateMode = 0
$form1.ForeColor = [System.Drawing.Color]::FromArgb(255,0,0,0)
$form1.Name = "form1"
$form1.Text = "After Deployment Check"
$button1.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$button1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 786
$System_Drawing_Point.Y = 421
$button1.Location = $System_Drawing_Point
$button1.Name = "button1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 49
$System_Drawing_Size.Width = 169
$button1.Size = $System_Drawing_Size
$button1.TabIndex = 24
$button1.Text = "Exit Deployment Check"
$button1.UseVisualStyleBackColor = $False
$button1.add_Click($button1_OnClick)
$form1.Controls.Add($button1)
$ListBox12.DataBindings.DefaultDataSourceUpdateMode = 0
$ListBox12.FormattingEnabled = $True
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 162
$System_Drawing_Point.Y = 295
$ListBox12.Location = $System_Drawing_Point
$ListBox12.Name = "ListBox12"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 49
$System_Drawing_Size.Width = 133
$ListBox12.Size = $System_Drawing_Size
$ListBox12.TabIndex = 22
$form1.Controls.Add($ListBox12)
Foreach ($IP in $IPs) {
$ListBox12.items.add($IP)
$ListBox12.add_click({$SelectIP = $ListBox12.SelectedItem})
$ListBox13.DataBindings.DefaultDataSourceUpdateMode = 0
$ListBox13.FormattingEnabled = $True
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 300
$System_Drawing_Point.Y = 295
$ListBox13.Location = $System_Drawing_Point
$ListBox13.Name = "ListBox13"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 49
$System_Drawing_Size.Width = 133
$ListBox13.Size = $System_Drawing_Size
$ListBox13.TabIndex = 24
$form1.Controls.Add($ListBox13)
Foreach ($Adapter in $Adapters) {
$Listbox13.items.add($Adapter)
$listbox13.add_click({$selectinterface = $Listbox13.SelectedItem})
$ListBox11.DataBindings.DefaultDataSourceUpdateMode = 0
$ListBox11.FormattingEnabled = $True
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 160
$System_Drawing_Point.Y = 357
$ListBox11.Location = $System_Drawing_Point
$ListBox11.Name = "ListBox1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 49
$System_Drawing_Size.Width = 278
$ListBox11.Size = $System_Drawing_Size
$ListBox11.TabIndex = 20
$form1.Controls.Add($ListBox11)
$InterfaceAliases="Internal","External"
Foreach ($Interfacealias in $Interfacealiases) {
$Listbox11.items.add($Interfacealias)
$ListBox11.add_click({$selecttype = $listbox11.selecteditem})
$label8.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label8.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 357
$label8.Location = $System_Drawing_Point
$label8.Name = "label8"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 49
$System_Drawing_Size.Width = 142
$label8.Size = $System_Drawing_Size
$label8.TabIndex = 19
$label8.Text = "Neuer Interface Name:"
$form1.Controls.Add($label8)
$label7.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label7.DataBindings.DefaultDataSourceUpdateMode = 0
$label7.ForeColor = [System.Drawing.Color]::FromArgb(255,0,0,0)
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 421
$label7.Location = $System_Drawing_Point
$label7.Name = "label7"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 27
$System_Drawing_Size.Width = 142
$label7.Size = $System_Drawing_Size
$label7.TabIndex = 18
$label7.Text = "Neue IP Adresse:"
$label7.add_Click($handler_label7_Click)
$form1.Controls.Add($label7)
$textBox3.DataBindings.DefaultDataSourceUpdateMode = 0
$textBox3.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",12.75,0,3,0)
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 634
$System_Drawing_Point.Y = 137
$textBox3.Location = $System_Drawing_Point
$textBox3.Name = "textBox3"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 27
$System_Drawing_Size.Width = 321
$textBox3.Size = $System_Drawing_Size
$textBox3.TabIndex = 17
$form1.Controls.Add($textBox3)
$textBox2.DataBindings.DefaultDataSourceUpdateMode = 0
$textBox2.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",12.75,0,3,0)
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 634
$System_Drawing_Point.Y = 98
$textBox2.Location = $System_Drawing_Point
$textBox2.Name = "textBox2"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 27
$System_Drawing_Size.Width = 321
$textBox2.Size = $System_Drawing_Size
$textBox2.TabIndex = 16
$form1.Controls.Add($textBox2)
$textBox1.DataBindings.DefaultDataSourceUpdateMode = 0
$textBox1.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",12.75,0,3,0)
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 160
$System_Drawing_Point.Y = 421
$textBox1.Location = $System_Drawing_Point
$textBox1.Name = "textBox1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 27
$System_Drawing_Size.Width = 278
$textBox1.Size = $System_Drawing_Size
$textBox1.TabIndex = 15
$textBox1.add_TextChanged($handler_textBox1_TextChanged)
$form1.Controls.Add($textBox1)
$listBox5.DataBindings.DefaultDataSourceUpdateMode = 0
$listBox5.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",12.75,0,3,0)
$listBox5.FormattingEnabled = $True
$listBox5.ItemHeight = 20
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 160
$System_Drawing_Point.Y = 216
$listBox5.Location = $System_Drawing_Point
$listBox5.Name = "listBox5"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 24
$System_Drawing_Size.Width = 276
$listBox5.Size = $System_Drawing_Size
$listBox5.TabIndex = 14
$form1.Controls.Add($listBox5)
$Listbox5.items.add($VIRStat)
$listBox4.DataBindings.DefaultDataSourceUpdateMode = 0
$listBox4.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",12.75,0,3,0)
$listBox4.FormattingEnabled = $True
$listBox4.ItemHeight = 20
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 160
$System_Drawing_Point.Y = 178
$listBox4.Location = $System_Drawing_Point
$listBox4.Name = "listBox4"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 24
$System_Drawing_Size.Width = 277
$listBox4.Size = $System_Drawing_Size
$listBox4.TabIndex = 13
$form1.Controls.Add($listBox4)
$Listbox4.items.add($DNSHost)
$listBox3.DataBindings.DefaultDataSourceUpdateMode = 0
$listBox3.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",12.75,0,3,0)
$listBox3.FormattingEnabled = $True
$listBox3.ItemHeight = 20
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 160
$System_Drawing_Point.Y = 137
$listBox3.Location = $System_Drawing_Point
$listBox3.Name = "listBox3"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 24
$System_Drawing_Size.Width = 277
$listBox3.Size = $System_Drawing_Size
$listBox3.TabIndex = 12
$form1.Controls.Add($listBox3)
$Listbox3.items.add($LOKHost)
$listBox2.DataBindings.DefaultDataSourceUpdateMode = 0
$listBox2.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",12.75,0,3,0)
$listBox2.FormattingEnabled = $True
$listBox2.ItemHeight = 20
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 161
$System_Drawing_Point.Y = 97
$listBox2.Location = $System_Drawing_Point
$listBox2.Name = "listBox2"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 24
$System_Drawing_Size.Width = 278
$listBox2.Size = $System_Drawing_Size
$listBox2.TabIndex = 11
$form1.Controls.Add($listBox2)
$Listbox2.items.add($Desc)
$button3.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 445
$System_Drawing_Point.Y = 135
$button3.Location = $System_Drawing_Point
$button3.Name = "button3"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 32
$System_Drawing_Size.Width = 183
$button3.Size = $System_Drawing_Size
$button3.TabIndex = 9
$button3.Text = "Set Host Name"
$button3.UseVisualStyleBackColor = $True
$button3.add_Click($button3_OnClick)
$form1.Controls.Add($button3)
$button2.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 445
$System_Drawing_Point.Y = 97
$button2.Location = $System_Drawing_Point
$button2.Name = "button2"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 30
$System_Drawing_Size.Width = 183
$button2.Size = $System_Drawing_Size
$button2.TabIndex = 8
$button2.Text = "Set Computer Description"
$button2.UseVisualStyleBackColor = $True
$button2.add_Click($button2_OnClick)
$form1.Controls.Add($button2)
$statusBar1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 0
$System_Drawing_Point.Y = 490
$statusBar1.Location = $System_Drawing_Point
$statusBar1.Name = "statusBar1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 22
$System_Drawing_Size.Width = 1010
$statusBar1.Size = $System_Drawing_Size
$statusBar1.TabIndex = 6
$statusBar1.Text = "Deployment Check"
$form1.Controls.Add($statusBar1)
$label6.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label6.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 216
$label6.Location = $System_Drawing_Point
$label6.Name = "label6"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 30
$System_Drawing_Size.Width = 142
$label6.Size = $System_Drawing_Size
$label6.TabIndex = 5
$label6.Text = "Antiviren Status:"
$label6.add_Click($handler_label6_Click)
$form1.Controls.Add($label6)
$label5.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label5.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 178
$label5.Location = $System_Drawing_Point
$label5.Name = "label5"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 30
$System_Drawing_Size.Width = 142
$label5.Size = $System_Drawing_Size
$label5.TabIndex = 4
$label5.Text = "Hostname [DNS]:"
$label5.add_Click($handler_label5_Click)
$form1.Controls.Add($label5)
$label4.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label4.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 137
$label4.Location = $System_Drawing_Point
$label4.Name = "label4"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 32
$System_Drawing_Size.Width = 142
$label4.Size = $System_Drawing_Size
$label4.TabIndex = 3
$label4.Text = "Hostname [Lokal]:"
$label4.add_Click($handler_label4_Click)
$form1.Controls.Add($label4)
$label3.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label3.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 97
$label3.Location = $System_Drawing_Point
$label3.Name = "label3"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 30
$System_Drawing_Size.Width = 142
$label3.Size = $System_Drawing_Size
$label3.TabIndex = 2
$label3.Text = "Computer Description:"
$label3.add_Click($handler_label3_Click)
$form1.Controls.Add($label3)
$label2.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label2.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 295
$label2.Location = $System_Drawing_Point
$label2.Name = "label2"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 49
$System_Drawing_Size.Width = 142
$label2.Size = $System_Drawing_Size
$label2.TabIndex = 1
$label2.Text = "IP Adresse:"
$label2.add_Click($handler_label2_Click)
$form1.Controls.Add($label2)
$label1.BackColor = [System.Drawing.Color]::FromArgb(255,153,180,209)
$label1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 12
$System_Drawing_Point.Y = 9
$label1.Location = $System_Drawing_Point
$label1.Name = "label1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 20
$System_Drawing_Size.Width = 143
$label1.Size = $System_Drawing_Size
$label1.TabIndex = 0
$label1.Text = "Deployment Check"
$label1.add_Click($handler_label1_Click)
$form1.Controls.Add($label1)
$panel1.BackColor = [System.Drawing.Color]::FromArgb(255,0,102,204)
$panel1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 12
$System_Drawing_Point.Y = 261
$panel1.Location = $System_Drawing_Point
$panel1.Name = "panel1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 209
$System_Drawing_Size.Width = 754
$panel1.Size = $System_Drawing_Size
$panel1.TabIndex = 23
$form1.Controls.Add($panel1)
$button4.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 433
$System_Drawing_Point.Y = 34
$button4.Location = $System_Drawing_Point
$button4.Name = "button4"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 49
$System_Drawing_Size.Width = 183
$button4.Size = $System_Drawing_Size
$button4.TabIndex = 21
$button4.Text = "Set Network Adapter"
$button4.UseVisualStyleBackColor = $True
$button4.add_Click($button4_OnClick)
$panel1.Controls.Add($button4)
#endregion Generated Form Code
#Save the initial state of the form
$InitialFormWindowState = $form1.WindowState
#Init the OnLoad event to correct the initial state of the form
$form1.add_Load($OnLoadForm_StateCorrection)
#Show the Form
$form1.ShowDialog()| Out-Null
#} #End Function
#Call the Function
#GenerateForm
best regards markus

CE is a bit of an abandoned product but it will generate forms.
TO return a form just create a global in the onload call.
$global:ThisForm=$form1
Now the form is available after it has closed.  Do not remove the function wrapper.
Avoid wrapping everythingin functions as it make the code unmaintainable and leads to subtle, difficult to find, errors.
Example - this is all of the code needed to replace 30 + lines of poorly written code:
$adapters=Get-NetAdapter |?{$_.Status -eq 'Up'}|Get-NetIPAddress -AddressFamily IPv4
$IPAddress=$adapters.IPAddresss
$Adapters=$IPAddress.InterfaceAlias
$DNSHost = [System.Net.Dns]::GetHostEntry($IP).hostname
$LOKHost = Get-Content env:computername
All of this should be in the "onload" and the results should be directly assigned to form objects.  Avoid interceding variables.
¯\_(ツ)_/¯
thanks i will go trough my script and clean it up, at the beginning i thought building functions was a good idea but i quickly realised that its not really helpful in this scenario so i will stop doing so in the future for similar projects. :-)

Similar Messages

  • Double click and get and store the value in variable.

    Hi,
    My intention is when i double click a particular record on a tabular, i want to capture or store the particular value of record into a variable and call that variable in print/preview button PLSQL code.
    Below i show the screenshot which contain a tabular and print preview button. After populating the data. the user will double click on the agent code LC354 and click the print/preview button it should display report for only the
    agent code of LC354(this is what i want). But normally when i click the print preview button it wil show the report of agent code of LC354 and LC325(this what i dont want).
    http://imageshack.us/photo/my-images/811/printpb.png/
    My problem is how to capture the value((*LC354*)) of particular record after double click the agent code(*LC354*)?
    i tried to store agent code in variable AG_CNT in mouse double click trigger with following plsql code. but it dosent work.
    declare
    AG_CNT varchar2(10);
    begin
    *AG_CNT* :=GET_ITEM_PROPERTY('RFQ_AGENT_DETAILS.AGENT_CODE',CURRENT_RECORD);
    end;after that pass that AG_CNT value in *:AG_CODE*. below code is in print/preview button.
         cursor c1 is select nvl(count(ENQUIRY_NO),0) from scott.EXP_QUOTE_STATUS
         where ltrim(rtrim(upper(job_status))) like 'APPROVED%' and ENQUIRY_NO = :REQ_FOR_QUOT.ENQUIRY_NO
    AND AGENT_CODE=*:AG_CODE* ;how to do this?
    skud.

    Hi skud
    i juast want to store the agent code to variable.if i did get ur point...
    Why don't u just use a simple assign statment for example...
    DECLARE
    V_VALUE  NUMBER;
    BEGIN
    V_VALUE := LC354 ; -- IF it was a value as LC354 static i mean
    -- or u could use any value
    V_VALUE := :ur_form_item_name; --- if it was dynamic
    END;That's it .
    Hope this helps...
    Regards,
    Ammatu Allah.

  • How to Use Transient View Objects to Store Session-level Global Variables

    hi
    Please consider section "40.8.5 How to Use Transient View Objects to Store Session-level Global Variables"
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    Based on this documentation I created the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.01.zip
    It behaves as show in the screencast at http://screencast.com/t/qDvSQCgpvYdd
    Its Application Module has a Transient View Object instance "MyEmployeesContextVOVI", as master for the child View Object instance "EmpInCtxJobVI".
    On rollback the Transient View Object instance keeps its row and attribute values.
    Also when passivation and activation is forced (using jbo.ampool.doampooling=false ) the Transient View Object instance seems to keep its row and attribute values.
    questions:
    - (q1) Why does the expression #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty} evaluate as true when a Transient View Object instance attribute value is changed (as shown in screencast at http://screencast.com/t/qDvSQCgpvYdd )?
    - (q2) What would be a robust approach to make a Transient View Object instance more self-contained, and manage itself to have only one single row (per instance) at all times (and as such removing the dependency on the Application Module prepareSession() as documented in "5. Create an empty row in the view object when a new user begins using the application module.")?
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    q1) Does sample 90 help ? http://blogs.oracle.com/smuenchadf/examples/
    Yes, the sample from Steve Muench does help, "90. Avoiding Dirtying the ADF Model Transaction When Transient Attributes are Set [10.1.3] "
    at http://blogs.oracle.com/smuenchadf/examples/#90
    It does point out a difference in marking transactions dirty by different layers of the framework, "... When any attribute's value is changed through an ADFM binding, the ADFM-layer transaction is marked as dirty. ...".
    This can be illustrate with a small change in the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.02.zip
    It now shows the result of both these expressions on the page ...
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty}
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.dataProvider.transaction.dirty}... where one can be true and the other false respectively.
    See also the screencast at http://screencast.com/t/k8vgNqdKgD
    Similar to the sample from Steve Muench, another modification to the example application introduces MyCustomADFBCDataControl
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.03.zip
    public class MyCustomADFBCDataControl
      extends JUApplication
      @Override
      public void setTransactionModified()
        ApplicationModule vApplicationModule = (ApplicationModule)getDataProvider();
        Transaction vTransaction = vApplicationModule.getTransaction();
        if (vTransaction.isDirty())
          super.setTransactionModified();
    }Resulting in what seems to be more consistent/expected transaction (dirty) information,
    see also the screencast at http://screencast.com/t/756yCs1L1
    Any feedback on why the ADF Model layer is so eager to mark a transaction dirty is always welcome.
    Currently, question (q2) remains.
    regards
    Jan

  • How to store data in a variable in select query

    Hi,
    Below is the select query in which i want to store the data in variable but i am getting runtime error as the fields are more as compared to variable,the declaration is necessary for it due to the reteriving for data.
    Please provide me guidelines how to do it.
    DATA: BEGIN OF ITSC01 OCCURS 0,
          PRUEFLOS LIKE QALS-PRUEFLOS,
          MBLNR LIKE QAMB-MBLNR,
          LGORT LIKE MSEG-LGORT,
          END OF ITSC01.
    IF STIT-MGEIG GE 0.
    LOOP AT STIT." WHERE PRUEFLOS EQ STIT-PRUEFLOS.
        SELECT A~PRUEFLOS B~MBLNR C~LGORT FROM QALS AS A
               INNER JOIN QAMB AS B ON B~PRUEFLOS = A~PRUEFLOS
               INNER JOIN MSEG AS C ON C~MBLNR = B~MBLNR AND C~MJAHR = B~MJAHR
               INTO SLOC WHERE A~PRUEFLOS EQ STIT-PRUEFLOS.
    *           INTO TABLE ITSC01 WHERE A~PRUEFLOS EQ STIT-PRUEFLOS AND A~MATNR EQ STIT-MATNR AND C~LGORT EQ 'SC03'.
        SORT ITSC01 BY PRUEFLOS.
         READ TABLE ITSC01 WITH KEY PRUEFLOS = ITSC01-PRUEFLOS.
          IF ITSC01-LGORT EQ 'SC03'.
          STIT-MGEIG = 0.
          ENDIF.
    MODIFY STIT.
    ENDLOOP.
    ENDIF.

    hmm..
    try this:
    DATA: l_PRUEFLOS LIKE QALS-PRUEFLOS,
              l_MBLNR LIKE QAMB-MBLNR,
             l_LGORT LIKE MSEG-LGORT,
    IF STIT-MGEIG GE 0.
    LOOP AT STIT." WHERE PRUEFLOS EQ STIT-PRUEFLOS.
        SELECT APRUEFLOS BMBLNR C~LGORT FROM QALS AS A
               INNER JOIN QAMB AS B ON BPRUEFLOS = APRUEFLOS
               INNER JOIN MSEG AS C ON CMBLNR = BMBLNR AND CMJAHR = BMJAHR
               INTO ( l_PRUEFLOS , l_MBLNR, l_LGORT )
          WHERE A~PRUEFLOS EQ STIT-PRUEFLOS.
              INTO TABLE ITSC01 WHERE APRUEFLOS EQ STIT-PRUEFLOS AND AMATNR EQ STIT-MATNR AND C~LGORT EQ 'SC03'.
        SORT ITSC01 BY PRUEFLOS.
         READ TABLE ITSC01 WITH KEY PRUEFLOS = ITSC01-PRUEFLOS.
          IF ITSC01-LGORT EQ 'SC03'.
          STIT-MGEIG = 0.
          ENDIF.
    MODIFY STIT.
    ENDLOOP.
    ENDIF.

  • What is the datatype to store the value of variable of  UTL_HTTP.resp

    Hello,
    I am using Oracle 11g R2 SOE.
    I have table Called SMS consists of two columns (TEXT , RESPONSE) to store the value of variable of type UTL_HTTP.resp
    the datatype of TEXT column is varchar2.
    What should be the datatype of the column RESPONSE that is supposed to store the value of a variable of type UTL_HTTP.resp ????
    Please see the following example if it was not clear;
    Declare
      l_url2 SMS.RESPONSE%TYPE;
      l_http_request2   UTL_HTTP.req;
      l_http_response2  UTL_HTTP.resp;
    begin
      l_http_request2  := UTL_HTTP.begin_request(l_url2);
      l_http_response2 := UTL_HTTP.get_response(l_http_request2);
      insert into SMS (text,response) values (l_url2,l_http_response2);
      UTL_HTTP.end_response(l_http_response2);
    end;Regards,
    Fateh

    Fateh wrote:
    Hello,
    I am using Oracle 11g R2 SOE.
    I have table Called SMS consists of two columns (TEXT , RESPONSE) to store the value of variable of type UTL_HTTP.resp
    the datatype of TEXT column is varchar2.
    What should be the datatype of the column RESPONSE that is supposed to store the value of a variable of type UTL_HTTP.resp ????
    Please see the following example if it was not clear;
    Declare
    l_url2 SMS.RESPONSE%TYPE;
    l_http_request2   UTL_HTTP.req;
    l_http_response2  UTL_HTTP.resp;
    begin
    l_http_request2  := UTL_HTTP.begin_request(l_url2);
    l_http_response2 := UTL_HTTP.get_response(l_http_request2);
    insert into SMS (text,response) values (l_url2,l_http_response2);
    UTL_HTTP.end_response(l_http_response2);
    end;Regards,
    Fatehutl_http.resp is a record type Its defined like this
    TYPE resp IS RECORD (
       status_code    PLS_INTEGER,
       reason_phrase  VARCHAR2(256),
       http_version   VARCHAR2(64));http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_http.htm#i1012713
    I would suggest in your table you split the RESPONSE column into 3 different column and store the fields STATUS_CODE, REASON_PHARSE and HTTP_VERSION accordingly.

  • Why we cant store asiciative array in DB

    hi,
    plz provide me vaild reason for below query. its a complex question for me as i tried a lot to find suitable answer in net also but not satisfied.
    1- why we cant store asiciative array in datbase?and we can store netted table in database how?

    >
    why we cant store asiciative array in datbase?and we can store netted table in database how?
    >
    From oracle reference manual.
    >
    Because associative arrays are intended for temporary data rather than storing persistent data, you cannot use them with SQL statements such as INSERT and SELECT INTO. You can make them persistent for the life of a database session by declaring the type in a package and assigning the values in a package body.
    >
    It cannot be made to persist in the db because it's designed in that fashion as mentioned above.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/collections.htm
    Regards
    Raj

  • Cant get function to use variable!

    hi I have created an actionscript function which stops an animation on a specific frame which works fine. I have then loaded in a php file with a variable which will contain the number for the frame i want the animation to stop on. This has loaded in fine and i have loaded it in a function. what i cant seem to do is to get the variable into the function which tells the animation to stop playing.
    here is my code:
    //load variables
    varReceiver = new LoadVars(); // create an object to store the variables
    varReceiver.load("http://playground.nsdesign6.net/percentage/external.php");
    //load variables
    //function1
    varReceiver.onLoad = function() {
        //value is the var that is created.   
        var paul = this.percentage;
    //function1
    //function2
    this.onEnterFrame = function() {   
    if(this._currentframe==(paul)) {
    this.stop();
    this.onEnterFrame = undefined;
    play();
    //function2

    One problem lies in that you are declaring the variable within a function.  This limits the scope of that variable to within the function. So your enterFrame function cannot see it.  One other thing you should consider is not activating the enterFrame function until the variable is read in.  So while I would have suggested you move the variable declaration out of the function, maybe moving the enterFrame into the function will have a similar effect...
    varReceiver.onLoad = function() {
        //value is the var that is created.   
        var paul = this.percentage;
        this.onEnterFrame = function() {   
            if(this._currentframe==(paul)) {
              this.stop();
              this.onEnterFrame = undefined;
    play();
    If that doesn't work, then just try moving the variable declaration outside of the function and only assign its value within it.  That way paul is visible to the second function...
    var paul;
    //function1
    varReceiver.onLoad = function() {
        //value is the var that is created.   
        paul = this.percentage;
    //function1

  • How To Capture A Column Value In A Report And Store It In A Variable?

    Portal Version: 3.0.6.6.5
    RDBMS Versjion: 8.1.7.0.0
    OS/Vers. Where Portal is Installed:: SunOS 5.8
    I have a Portal report where I added a checkbox for each row of data that is being displayed. The user can select checkbox for as many rows as he/she wants. The user can then click a button, which iteratively passes the value of a column as a parameter to a procedure.
    I am using the Portal field that ends with a ".FIELD#>" For example, if my report is based on the following SQL statement:
    SELECT EMP_UNID FROM EMPLOYEES WHERE STATUS = 'E'
    Then the field I am using to capture the value is <#EMP_UNID.FIELD#>
    So the <INPUT> looks like:
    <TD>
    <INPUT TYPE="checkbox" NAME="checkboxSelect" value="<#EMP_UNID.FIELD#>">
    </TD>
    And the Javascript code looks like:
    htp.p('<SCRIPT LANGUAGE="JavaScript1.1">');
    htp.p('<!--');
    htp.p('function runAccept() {');
    htp.p('for (var i=0; i<20; i++)');
    htp.p('if (document.formSelect.checkboxSelect.checked == true)');
    htp.p('{');
    htp.p('myRegExp = /"/gi;');
    htp.p('parameter = document.formSelect.checkboxSelect[i].value.replace(myRegExp, "z");');
    htp.p('parameter = parameter.substring(parameter,parameter.indexOf(">")+1,parameter.lastIndexOf("<")-1)');
    htp.p('alert(parameter);');
    -- htp.p('CallableStatement cstmt = null;');
    -- htp.p('cstmt = conn.prepareCall("{call --runAcceptRecord(parameter)}")');
    -- htp.p('cstmt.execute ();');
    htp.p('}');
    htp.p('}');
    htp.p('//-->');
    htp.p('</SCRIPT>');
    The problem, however, is that Portal stores not only the actual value in <#EMP_UNID.FIELD#>, but also some HTML tags, most of which can be removed via the Display Options page. There are some tags that cannot be removed in this fashion, because Portal does not allow nulls in those. So we are stuck with an HTML tag (i.e. <FONT SIZE>) that is stuffed in that variable along with the value. The problem is further complicated by the existence of double quotes within that tag that undesirably terminates the VALUE assignment.
    So for instance, what you might get from Portal is this:
    <TD><INPUT TYPE="checkbox" NAME="checkboxSelect" value="<FONT SIZE="+0">219</FONT>"> </TD><TD ALIGN="RIGHT"><FONT SIZE="+0">219</FONT></TD>
    <TD ALIGN="LEFT"><FONT SIZE="+0">E</FONT></TD>
    It is in the value="<FONT SIZE="+0">219</FONT>" part of the code where the extra double quote is terminating the Javascript code. I have tried escape() and replace() to remove the extra double quotes, but have not got it to work. The problem is happening too early at this point, and what I have tried is after the fact.
    Obviously, the problem is that I shouldn't be using <#EMP_UNID.FIELD#> since the intent of this is to add html tags for display purposes. That is done by Portal, and I thus have no control over it unless I take drastic means and modify Portal's innerworkings, which I don't care to do.
    My question therefore is, what other variable can I use in Reports to capture just the value? I am hoping that there is a variable in Reports like the ones for Forms which has a prefix of A_. Or is there another method for doing this?
    Thanks in advance
    Fred

    I found htf.formcheckbox function which was what I needed. With that, my javascript code was cut down to just a few lines. Didn't need to strip away the html tags. This function will just return the value.
    Refer to:
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=116534.1 for specific example of this function.
    http://technet.oracle.com/doc/appsrvr4082/guides/plsql_r.pdf for a reference list of all htp's.

  • Store a value in variable from Java using Jython

    Hi all,
    I want to send some arguments to a java program and a small logic will be applied there and it will return a value.I need to capture that result in a variable and to store that in a target column.
    For Ex:
    I wrote a java program which handles the arguments and applies the logic and it will return a string.Then i made a jar out of this java class and placed in ODI Drivers:
    I have done the following at Stored Procedure using Jython Technology selected.I am passing the column data using a variable created at ODI.
    Logic is my Java Class and result is the method which does the logic process
    import Logic
    arg1=#arg1
    arg2=#arg2
    arg3=#arg3
    arg4=#arg4
    result
    Logic lop= new Logic()
    result=lop.result(arg1,arg2,arg3,arg4)
    Now i want the result to be applied to a particular column at target table.how can i a store that result in a variable.am i going right or any other suitable way is there ?
    Plz guide me

    Use AddResource to add Javascript in your BackingBean Code and pass the value to your javascript code.
    JSCookMenu and other dynamic adding of javascript to a JSF-JSP page is done using AddResource....

  • Store object reference in variable resolved by other variable

    Hi everyone,
    In my test setup I use a Thread and I want to store an object ref to that Thread in a variable (type: object reference).
    In the sequence call settings I can provide a variable where I want to store this.
    I've done this before and it all worked fine. When I stop the thread I'm able to use a wait step that waits for the thead to stop by providing the reference I stored when the thread was started.
    Now I want to store the reference in a variable that is based on another variable. In my situation the following construction works. This is way I've entered in the Sequence call settings:
    #NoValidation = True, Evaluate("FileGlobals.ModuleConfig." + Parameters.ModuleInstance + ".ThreadRef")
    As you can see Parameters.ModuleInstance determines in which container the thread ref should be stored. But since this parameter is empty by default the evaluation fails so I have to use #NoValidation.
    This seems a bit ugly to me so I also tried:
    FileGlobals.ModuleConfig.GetPropertyObject(Parameters.ModuleInstance + ".ThreadRef")
    According to teststand this construction is OK, however my thread ref is not stored in this case...
    Is the first option I mentioned the only possible way for my problem? Or are there other, more elegant ways?

    Hi Kayr,
    I agree that the second approach you mention is the more elegant way to accomplish this.  I was able to successfully use this method on my end to access a propertyObject.  Can you send a sample sequence file so I can take a look?
    Al B.
    Staff Software Engineer - TestStand
    CTA/CLD

  • How to store the value to variable?

    hi
    plz c the below code...
    my prblm is i want to store the value of wa_final-preis into new_xeipa-preis if there is only one ebeln...
    if there are more procss orders then i want to save the first value to new_xeipa-preis wn second record comes then new_xeipa-preis should be replaced by new value and old_xeipa-preis replaced by old value....
    how to do this?
    LOOP AT xeipa INTO wa_xeipa.
      idx = sy-tabix.
      CLEAR: wa_xeina.
        READ TABLE xeina INTO wa_xeina WITH KEY infnr = wa_xeipa-infnr.
        IF sy-subrc is INITIAL.
        wa_final-infnr = wa_xeipa-infnr.
        wa_final-ebeln = wa_xeipa-ebeln.
        wa_final-bedat = wa_xeipa-bedat.
        wa_final-matnr = wa_xeina-matnr.
        wa_final-lifnr = wa_xeina-lifnr.
        wa_final-peinh = wa_xeipa-peinh.
        wa_final-preis = wa_xeipa-preis.        "net price
        wa_final-bprme = wa_xeipa-bprme.
        wa_final-bwaer = wa_xeipa-bwaer.
        IF ( wa_final-infnr is NOT INITIAL ) AND ( wa_final-ebeln is NOT INITIAL ) .
        ABWEICHUNG = ( new_xeipa-preis / old_xeipa-preis ) * 100 .
        ENDIF.
        append wa_final to it_final.
        ENDIF.

    Hi Smitha,
    Check the below given code.
    LOOP AT xeipa INTO wa_xeipa.
      idx = sy-tabix.
      CLEAR: wa_xeina.
        READ TABLE xeina INTO wa_xeina WITH KEY infnr = wa_xeipa-infnr.
        IF sy-subrc is INITIAL.
        wa_final-infnr = wa_xeipa-infnr.
        wa_final-ebeln = wa_xeipa-ebeln.
        wa_final-bedat = wa_xeipa-bedat.
        wa_final-matnr = wa_xeina-matnr.
        wa_final-lifnr = wa_xeina-lifnr.
        wa_final-peinh = wa_xeipa-peinh.
        wa_final-preis = wa_xeipa-preis.        "net price
        wa_final-bprme = wa_xeipa-bprme.
        wa_final-bwaer = wa_xeipa-bwaer.
    " First time this value is not populated. When the second value comes in,
    " New value gets populated in OLD variable and New value is replaced with the latest.
        *IF idx NE 1.*
          *old_xeipa-preis = new_xeipa-preis.*
        *ENDIF.*
        *new_xeipa-preis = wa_xeipa-preis.*
      IF ( wa_final-infnr is NOT INITIAL ) AND ( wa_final-ebeln is NOT INITIAL ) .
        ABWEICHUNG = ( new_xeipa-preis / old_xeipa-preis ) * 100 .
        ENDIF.
        append wa_final to it_final.
        ENDIF.
    ENDLOOP.
    I hope this is what you were looking for.
    Thanks & Regards,
    Ram.
    Edited by: ram Kumar on Jun 12, 2009 5:16 PM

  • Get all parameters pass to a powershell script and store it in a variable

    Hi,
    Test.ps1 A B C D E F
    1. How may I get how many parameters was pass to the commandline?
    2. I would like storing A B C D E F in a variable and store Test.ps1 $arguments in VariableWithCommandLine.
    New-Item -path $path -Name test2.ps1 -type file -Value "VariableWithCommandLine"
    Thanks,

    Why this is not working?
    [CmdletBinding()]
    Param (
     [Parameter(Mandatory=$True)]   
     [ValidateSet('Install','Repair','Uninstall', 'MAJ')]  
     [string]$DeploymentType = 'Install',
     [Parameter(Mandatory=$false)]   #Paramètre obligatoire? $True $False
     [ValidateSet('Interactive','Silent','NonInteractive')] #Silent = No dialogs (progress and balloon tip notifications are supressed)
     #NonInteractive = Very silent, i.e. no blocking apps. Noninteractive mode is automatically set if an SCCM task sequence or session 0 is detected.
     [string]$DeployMode = 'Interactive'
    $args

  • Store Column-Name into variable

    Hello from germany
    I got stuck with following:
    How is it possible to store the name of a column into a variable or is it possible to put an index "on" a column?
    The reason for this: I need to fill and check a complete column!
    Thanks for Your help!
    Best regards
    Marlon

    Those sure are unrelated questions. Lets say we have a table like this:
    SQL> CREATE TABLE t (
      2    a  number,
      3    b  varchar2(8),
      4    c  date );
    Table created.You can get a column name like this:
    SQL> set serveroutput on
    SQL> DECLARE
      2    second_col   VARCHAR2 (30);
      3  BEGIN
      4    SELECT column_name
      5      INTO second_col
      6      FROM user_tab_columns
      7     WHERE table_name = 'T'
      8       AND column_id = 2;
      9    DBMS_OUTPUT.PUT_line(second_col);
    10  END;
    11  /
    B
    PL/SQL procedure successfully completed.
    SQL> You can put an index on a column like this:
    SQL> CREATE INDEX t_n1 ON t(b);
    Index created.And you can add data to the table like this:
    SQL> insert into t(a, b) values (4, 'asdf');
    1 row created.
    SQL> select * from t;
             A B        C
             4 asdf
    SQL>

  • Binding an object to Listbox.SelectedItem

    I have this code:
    Binding ContactBinding = new Binding("Conversation");
            ContactBinding.Source = lstContacts.SelectedItem;
            BindingOperations.SetBinding(txtRecieve, TextBlock.TextProperty, ContactBinding);
    Is there a way to set the ContactBinding.Source to the SelectedItem so that when SelectedItem is changed txtRecieve is going to get the new object?

    >>Is there a way to set the ContactBinding.Source to the SelectedItem so that when SelectedItem is changed txtRecieve is going to get the new object?
    You should bind the Text property of the TextBlock to the Conversation property of the SelectedItem of the ListBox:
    Binding ContactBinding = new Binding("SelectedItem.Conversation") { Source = lstContacts };
    BindingOperations.SetBinding(txtRecieve, TextBlock.TextProperty, ContactBinding);
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • How to store values in session variables for use later

    I am trying to read user input from a form, lookup some values from a database,
    store the combined data into session to retrieve later in the subsequent pages
    in a pageflow application. Could someone guide me as to how exactly to do this?
    The documentation doesn't seem to be of much help.
    Thanks,
    Krishna K

    Krishna,
         If you will be using the data within the course of the same page flow
    or nested page flows then you should store the data in the page flow
    itself. Simply declaring variables in the .jpf will do this. The page
    flow is stored in the session for you and it is deleted when the user
    exits the page flow. This is good because it keeps down session size.
         If you have data that you want to use across page flows then you will
    need to store in the session or globalApp.
         Here is a link to "Using Data Binding in Page Flows" it has an example
    of storing data into the session and it goes into the pros and cons of
    using each data binding scope.
    http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/netui/guide/conDatabindingXScript.html
    - john
    Krishna Kuchibhotla wrote:
    I am trying to read user input from a form, lookup some values from a database,
    store the combined data into session to retrieve later in the subsequent pages
    in a pageflow application. Could someone guide me as to how exactly to do this?
    The documentation doesn't seem to be of much help.
    Thanks,
    Krishna K

Maybe you are looking for

  • Can we create a (RAC) db service to assign a conc mgr to an instance

    Hi Everyone, Can we create a rac db service to for EBusiness? For example, can we create a service for AP module to run on instance1 of a two nodes RAC, and a service for PO to run on instance2. I know i can assign a node to a conc mgr and use the sp

  • Mail fails to import messages after 10.8.5 update

    After the update Mail fails to import my messages and then quits. First screen says: Welcome to Mail. To use the new features your existing Mail messages need to be imported.... Then when I click continue it says: The import failed. An error occurred

  • Updated iPod software & all songs disappeared

    I plugged my iPod 40G into my father's computer and he updated the software on my iPod. Now, none of the songs I had on my iPod show up either in iTunes or on the iPod itself. The memory shows that there is only 34.87 gigs remaining (the same amount

  • Auto log out

    I am not sure why this is happening but it seems in the last couple weeks, my PB will log out after a period of inactivity. It's only happened a couple times, and I haven't sat around to determine the sequence of events. I just leave the computer alo

  • Keepalive problem on CSS11506

    Greeting One of application which using my CSS has problem to work with my CSS11506 after the application upgrade. It does not regconize CSS' keepalive check and give error "broken pipe" on the backend server. (it treat the keepalive traffic as sessi