|
-
May 17th, 2000, 10:13 AM
#1
Thread Starter
New Member
Does anyone know how to "swap" the text in textbox 1 with
the text in textbox 2 on a form using only one line of
vbscript code?
-
May 18th, 2000, 09:10 PM
#2
Member
It's impossible 
Now why do you want to do it in only 1 line?
K
----------------------------------
VB6 Ent SP4 Win2K Pro Platform SDK
-
May 20th, 2000, 03:16 AM
#3
Fanatic Member
dim txt1, txt2:txt1 = textbox1.text:txt2 = textbox2.text:textbox1.text = txt2:textbox2.text = txt1
(Please note this IS one line of code. Don't know if it'll word wrap or not so I thought I'd tell you that)
kleve: It's not impossible... There's just no point in doing it. however if somebody can give us one, let us know.
-
May 21st, 2000, 02:43 PM
#4
Member
Ok, it's possible to do it in one line of code, by putting ":"'s in. IMHO that's cheating 
What you've really got is 5 separate execution statements. To me a statement is a line of code, but I agree that it can be done in a single line, not a single execution statement.
I'd still like to know why thou
K
----------------------------------
VB6 Ent SP4 Win2K Pro Platform SDK
-
May 22nd, 2000, 07:12 AM
#5
Fanatic Member
He re-posted this in a new thread, and explained that he was looking for this because his professor said it was possible and he wanted to know how.
You can also create your own function.
Function SwitchBox(Text1, Text2)
dim txt1
txt1 = text1.text
text1.text = text2.text
text2.text = txt1
end function
Then call in code.
SwitchBox TextBox1, TextBox2
Of course, I realize this is not really on line of code, but I guess that just depends on how you look at it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|