|
-
Mar 18th, 2004, 08:50 PM
#1
Thread Starter
Member
string variables
Hey, i was wondering, is there a way i could store a variable in mid-string?
like rather then saying
VB Code:
Dim strName As string
strName = txtinput.text
have it do something like
VB Code:
If txtinput.text = "my name is <Variable>"(then have it store whatever you put in that slot as strName) then
messagebox.show: "you said your name was " & strName
End If
if you understand this question and have a solution, would appricate it
thanks
--Flac
Everything great once started with the words "That will never catch on, you shouldnt even bother" be great, go against the crowed, do something stupid, you might become famous.
-
Mar 18th, 2004, 09:15 PM
#2
I wonder how many charact
Re: string variables
Originally posted by Flac
if you understand this question and have a solution, would appricate it
thanks
--Flac
Messagebox.Show ("you said your name was " & txtboxinput.text)
-
Mar 18th, 2004, 09:19 PM
#3
Addicted Member
No, that'll give you a message box that says
"you said your name was my name is Tim"
I think what he wants is a messagebox that says
"you said your name was Tim"
I think this code will give you that:
Code:
strName = txtInput.Text
Dim lastspace As Integer = strName.LastIndexOf(" ")
Dim name As String = strName.Substring(lastspace)
MsgBox("you said your name was " & name)
-
Mar 18th, 2004, 09:21 PM
#4
I wonder how many charact
what if they type "since you asked, frank is my name."
-
Mar 18th, 2004, 09:23 PM
#5
Addicted Member
No kidding! How do you control what they enter in the box?
-
Mar 18th, 2004, 09:28 PM
#6
I wonder how many charact
I think he's probably best of inheriting from System.Net.AI.SuperArtificalIntelligence.Genius class...
Then using the Genius.FigureOutMyName method.
-
Mar 18th, 2004, 09:29 PM
#7
-
Mar 18th, 2004, 09:32 PM
#8
I wonder how many charact
Oh yea Whidby rocks....
There's also the System.Security.SuperUltraSecure.Impenetrable class....
My personal favorite though is System.Life.LiveForever class, which has the public method MakeImmortal. I'm gonna LOVE that one!
-
Mar 18th, 2004, 11:05 PM
#9
Thread Starter
Member
Heh, yes your right "how do i control what they type"
But see the example i gave isnt what im applying it to, the actaul program im putting it in has little room for anything but what the command would be.
its just that the actaul program is more complex then the bit of code i need, so i figured to get the code it would be easier to just give a name finder as an example 
as for the next version of VS, sounds good count me in 
maybe it will come with a
system.WriteMyCodeForMe.MakeItWork.RightFreakennow
method...that would be grand...
but ya, thanks for the assist, i will try to earlier mentioned code and see if i can piece it together
---Flac
Everything great once started with the words "That will never catch on, you shouldnt even bother" be great, go against the crowed, do something stupid, you might become famous.
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
|