|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
display var valueHi,
i want to display a value of a variabile, type into a textbox. for example num=1234 varx=763 if i type in textbox "num" i want to dispay 1234 if i type in textbox "varx" i want to display 763 who can i help???? On 26 mei, 11:57, Clax <claxc***@gmail.com> wrote:
> Hi, walk trou the controls collection and if found use the text proprety> i want to display a value of a variabile, type into a textbox. > > for example > > num=1234 > varx=763 > > if i type in textbox "num" i want to dispay 1234 > > if i type in textbox "varx" i want to display 763 > > who can i help???? Jan On May 26, 12:30 pm, JR <jan.sch***@gmail.com> wrote:
Show quoteHide quote > On 26 mei, 11:57, Clax <claxc***@gmail.com> wrote: can you explain more about this> > > Hi, > > i want to display a value of a variabile, type into a textbox. > > > for example > > > num=1234 > > varx=763 > > > if i type in textbox "num" i want to dispay 1234 > > > if i type in textbox "varx" i want to display 763 > > > who can i help???? > > walk trou the controls collection and if found use the text proprety > > Jan Am 26.05.2010 11:57, schrieb Clax:
Show quoteHide quote > i want to display a value of a variabile, type into a textbox. That's not possible because the names of local variables are not > > for example > > num=1234 > varx=763 > > > if i type in textbox "num" i want to dispay 1234 > > if i type in textbox "varx" i want to display 763 > > > who can i help???? available at runtime. You may, however, want to store the values in a dictionary/collection object and use the variable name as key. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Herfried,
I had the same idea like you, but my other thought was it is VBS. However, this answer came in the General forum on this double post from Claxian ------------------ Simply use ToString() method for getting string representation. You had not specified the type of num,varz and i , if they are int then following willl work; if in textbox1.text="num" in msgbox write num.ToString(); if in textbox1.text="varx" in msgbox write varx.ToString(); if in textbox1.text="i" in msgbox write the actuale value of variabile i.ToString(); ------------------------------------------------- I think that this answer meets the question the most (we were both thinking about the type names, which is of course impossible with the overloaded ToString from value types. Cor Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:OxnklmM$KHA.980@TK2MSFTNGP04.phx.gbl... > Am 26.05.2010 11:57, schrieb Clax: >> i want to display a value of a variabile, type into a textbox. >> >> for example >> >> num=1234 >> varx=763 >> >> >> if i type in textbox "num" i want to dispay 1234 >> >> if i type in textbox "varx" i want to display 763 >> >> >> who can i help???? > > That's not possible because the names of local variables are not available > at runtime. You may, however, want to store the values in a > dictionary/collection object and use the variable name as key. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Am 26.05.2010 11:57, schrieb Clax:
Show quoteHide quote > Hi, http://en.wikipedia.org/wiki/Compiler> i want to display a value of a variabile, type into a textbox. > > for example > > num=1234 > varx=763 > > > if i type in textbox "num" i want to dispay 1234 > > if i type in textbox "varx" i want to display 763 > > > who can i help???? -- Armin On May 26, 2:45 pm, Armin Zingler <az.nos***@freenet.de> wrote:
Show quoteHide quote > Am 26.05.2010 11:57, schrieb Clax: i explain more with example.> > > Hi, > > i want to display a value of a variabile, type into a textbox. > > > for example > > > num=1234 > > varx=763 > > > if i type in textbox "num" i want to dispay 1234 > > > if i type in textbox "varx" i want to display 763 > > > who can i help???? > > http://en.wikipedia.org/wiki/Compiler > > -- > Armin -------------------- num=1234 varx=763 i=23 while ---- istruction i+=1 end while msgb***@textbox1.text) ----------------- if in textbox1.text="num" in msgbox write 1234 if in textbox1.text="varx" in msgbox write 763 if in textbox1.text="i" in msgbox write the actuale value of variabile i in visual dbase 5.5 il i write @inputtext for this Am 26.05.2010 15:34, schrieb Clax:
Show quoteHide quote >> http://en.wikipedia.org/wiki/Compiler Is visual dbase a compiler?>> > > i explain more with example. > -------------------- > num=1234 > varx=763 > i=23 > while > > ---- istruction > i+=1 > end while > > msgb***@textbox1.text) > > ----------------- > > if in textbox1.text="num" in msgbox write 1234 > if in textbox1.text="varx" in msgbox write 763 > if in textbox1.text="i" in msgbox write the actuale value of variabile > i > > > in visual dbase 5.5 il i write @inputtext for this You're asking the user to enter a name known to the programmer only. How can the user know? Variable names are placeholders for memory addresses. When the native code is executed, there are no names anymore, just addresses. Maybe you are looking for this: http://msdn.microsoft.com/en-us/library/xfhwa508(VS.90).aspx -- Armin On 26/05/2010 10:57, Clax wrote:
> i want to display a value of a variable, type into a textbox. Can't be done. Not directly anyway.By the time your code runs, most variables names are long gone. You could create a Hashtable or Dictionary(Of String,String) to hold values that you want to access by name and interrogate that: Dim dict as new Dictionary(Of String, String) dict.Add( "num", "1234" ) dict.Add( "varx", "763" ) ....then... ' Me.TextBox1.Text = "num" Me.TextBox2.Text = dict( Me.TextBox1.Text ) HTH, Phill W. Hi,
> i want to display a value of a variabile, type into a textbox. It really depends what you are trying to do. It could be as simple as testing the name to get the corresponding value or as similar to adding scripting capabilities like in Office applications etc... > if i type in textbox "num" i want to dispay 1234 Is the user allowed to enter num+varx and you would like to output 1997 ? > > if i type in textbox "varx" i want to display 763 Or is he allowed to enter just a name from a limited set of variables ? -- Patrice
Maximum index on a list is less than the list size
Umm.... How to pass a sub into a class...... How do I get back deleted Tab Page DataTable - set a specific row. keep changes are made on datasource. an attempt was made to load a program with an incorrect format Crystal Reports in VB.NET Express Edition Re:Date Time Format Problem RE: Dockable windows Problems with ReportViewer and RDLC |
|||||||||||||||||||||||