Quantcast
Channel: PC-DMIS User Forum - Forums
Viewing all articles
Browse latest Browse all 11658

Setting variables as string in .NET

$
0
0
Hi all I'm back with another .NET question....

I am setting up a form that will run prior to all our programs and I have it loading all of the variables from PC DMIS in, and that is working fine. However I also need this form to set variables upon closing..... This is where the trouble starts, ideally I'd like to set the variables with a string value (this can be worked around if not possible) but every time i get an error telling me I can't convert String to variable (the same goes for integers and boolean). I've tried every which way I can think of and its driving me insane.

Does anyone have any experience with setting PC DMIS variables through .NET that can shed some light?

This method pops up the error:

Code:
 Dim testop As PCDLRN.Variable
            testop = OpBox1.SelectedValue

            If Not testop Is Nothing Then
                pcpart.SetVariableValue("OPNO", testop)
            End If
This method doesn't error out however it changes nothing:

Code:
   Dim testop As PCDLRN.Variable
            testop = OpBox1.SelectedItem.ToString

            If Not testop Is Nothing Then
                pcpart.SetVariableValue("OPNO", testop)
            End If

Viewing all articles
Browse latest Browse all 11658

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>