Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Removing arguments


Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2002, 05:26 PM
I_R_Lee
Guest
 
Posts: n/a
Question Removing arguments


I am currenly making a launcher for Operation Flashpoint and I need to know how to remove up to 5 different arguments from a text box.

Thanks in advance
Reply With Quote
  #2  
Old 07-18-2002, 05:29 PM
saryon's Avatar
saryon saryon is offline
Junior Contributor
 
Join Date: Jan 2002
Location: Alaska
Posts: 299
Default

well, two ways to go...
make 5 different textboxes (easiest)
or use some sort of delimeter, have them put a | between each argument and then parse the string by the |
__________________
A+ Certified
CCNA
http://fpow.netchaos.cc
FPOW!
Reply With Quote
  #3  
Old 07-18-2002, 05:35 PM
I_R_Lee
Guest
 
Posts: n/a
Default

What do you mean by this
Quote:
| between each argument and then parse the string by the |
?
Reply With Quote
  #4  
Old 07-18-2002, 05:38 PM
saryon's Avatar
saryon saryon is offline
Junior Contributor
 
Join Date: Jan 2002
Location: Alaska
Posts: 299
Default

if you want them to input all 5 arguments into one textbox, have them input it like this

text1.text=argument1 | argument2 | ...| argument5

then, store to your array or whatever you use

loc=instr(1,text1.text,"|")
arg(0)=left(text1.text,loc-2)
loc=instr(loc,text1.text,"|")
arg(1)=left(text1.text,loc-2)
__________________
A+ Certified
CCNA
http://fpow.netchaos.cc
FPOW!
Reply With Quote
  #5  
Old 07-18-2002, 05:42 PM
BillSoo's Avatar
BillSoo BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default

....or just use the SPLIT function....
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #6  
Old 07-18-2002, 05:43 PM
I_R_Lee
Guest
 
Posts: n/a
Default

It says the '|' character is not valid. I'm using VB .NET by the way.
Reply With Quote
  #7  
Old 07-18-2002, 05:45 PM
saryon's Avatar
saryon saryon is offline
Junior Contributor
 
Join Date: Jan 2002
Location: Alaska
Posts: 299
Default

well, I dont know what affect that has, I've never used vb.net so...yah...lol, use something else then, like the @ symbol..unless you're expecting them to use that...the '|' wasn't the significant character, so long as you use something that wont be used elsewher in the box (i.E. done use A to seperate arguments hehe)
__________________
A+ Certified
CCNA
http://fpow.netchaos.cc
FPOW!
Reply With Quote
  #8  
Old 07-18-2002, 05:47 PM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

Did you use the pipe | in double quotes? Like "|"
__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
  #9  
Old 07-18-2002, 05:57 PM
I_R_Lee
Guest
 
Posts: n/a
Default

I'm new to programming and I don't understand this . I have 5 check boxes. I want them to pass a variable to a text box when checked and remove it if you uncheck it.
Reply With Quote
  #10  
Old 07-18-2002, 05:59 PM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

A textbox on your own form, or another application?
__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
  #11  
Old 07-18-2002, 06:05 PM
I_R_Lee
Guest
 
Posts: n/a
Default

My own form
Reply With Quote
  #12  
Old 07-18-2002, 06:12 PM
saryon's Avatar
saryon saryon is offline
Junior Contributor
 
Join Date: Jan 2002
Location: Alaska
Posts: 299
Default

if your 5 checkboxes and 5 textboxes are in an array (easiest way to do it) throw this code in there

Code:
Private Sub Check1_Click(Index As Integer)
    If Check1(Index).Value = 1 Then
        text1(Index).Text = "Checkbox " & Index & " is clicked!"
    Else
        text1(Index).Text = "Checkbox " & Index & " isn't clicked!"
    End If
End Sub
P.S.
this means that the 5 textboxes correspond specifically with a checkbox...so if you need all 5 arguments, just put them all together

Code:
dim fulltext as string
fulltext=""
for x = 1 to 5
fulltext=fulltext & text1(x)
next
__________________
A+ Certified
CCNA
http://fpow.netchaos.cc
FPOW!
Reply With Quote
  #13  
Old 07-18-2002, 06:12 PM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

Okay, I think I understand. You're building a commandline for the application. Do the variables in the textbox have to be in a specific order when they are inserted?

They can be removed with the Replace$() function.
__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
  #14  
Old 07-18-2002, 06:32 PM
I_R_Lee
Guest
 
Posts: n/a
Default

How do I use the Replace$() function?
Reply With Quote
  #15  
Old 07-18-2002, 06:54 PM
I_R_Lee
Guest
 
Posts: n/a
Talking

Thanks alot!!!!!!!!!!!!!!!!!!!!!!
The replace function works!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->