PC Review


Reply
Thread Tools Rate Thread

display var value

 
 
Clax
Guest
Posts: n/a
 
      26th May 2010
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????


 
Reply With Quote
 
 
 
 
JR
Guest
Posts: n/a
 
      26th May 2010
On 26 mei, 11:57, Clax <claxc...@gmail.com> wrote:
> 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
 
Reply With Quote
 
Clax
Guest
Posts: n/a
 
      26th May 2010
On May 26, 12:30*pm, JR <jan.sch...@gmail.com> wrote:
> On 26 mei, 11:57, Clax <claxc...@gmail.com> wrote:
>
> > 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


can you explain more about this
 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      26th May 2010
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/>
 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      26th May 2010
Am 26.05.2010 11:57, schrieb Clax:
> 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
 
Reply With Quote
 
Clax
Guest
Posts: n/a
 
      26th May 2010
On May 26, 2:45*pm, Armin Zingler <az.nos...@freenet.de> wrote:
> Am 26.05.2010 11:57, schrieb Clax:
>
> > 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


i explain more with example.
--------------------
num=1234
varx=763
i=23
while

---- istruction
i+=1
end while

msgbox(@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
 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      26th May 2010
Am 26.05.2010 15:34, schrieb Clax:
>> http://en.wikipedia.org/wiki/Compiler
>>

>
> i explain more with example.
> --------------------
> num=1234
> varx=763
> i=23
> while
>
> ---- istruction
> i+=1
> end while
>
> msgbox(@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


Is visual dbase a compiler?

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
 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      26th May 2010
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



"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:OxnklmM$(E-Mail Removed)...
> 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/>


 
Reply With Quote
 
Phill W.
Guest
Posts: n/a
 
      26th May 2010
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hidden application dual display > single display problem Troy Windows XP Work Remotely 2 21st Jun 2008 07:34 PM
Vista Business wont retain my display settings (on multiple display setup) Jim Lally Windows Vista General Discussion 0 27th Jun 2007 04:11 PM
Switching Projector Display and LCD Display to Single Display onLaptop W. Watson Windows XP General 2 15th Oct 2006 04:54 PM
Can the display mirror driver call into the original display card's DrvEnablePDEV? lucy Windows XP Drivers 2 26th Aug 2004 07:11 PM
Problem: Blank display after fiddling with primary/secondary display settings Rasmus Paetau ATI Video Cards 2 17th Jun 2004 01:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:15 AM.