Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 19th, 2004, 03:32 PM
Tantalus Tantalus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 185 Tantalus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 35 sec
Reputation Power: 8
Send a message via ICQ to Tantalus Send a message via AIM to Tantalus
Sub Main() With Parameters.

Hello, I have recently run into this problem: I created a vb application with Sub Main() as the startup object and it worked fine, but when I tried to add parameters to Sub Main() it did not work at all. ex: Sub Main( param1, param2, param3, ... ). Is there like an ArgC[] and ArgV[] for a VB application to get input when it is starting up?
__________________
--Tantapants

Reply With Quote
  #2  
Old January 19th, 2004, 03:44 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,191 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 15 m 7 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
You have to use command line arguments. You cannot add parameters to sub Main as it is automatically stubbed in by the compiler. I believe in the build properties (by going to the project properties) you can specify command line arguments. Also, you can specify them in any command line runtime, such as a .bat.

Reply With Quote
  #3  
Old January 19th, 2004, 03:51 PM
Tantalus Tantalus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 185 Tantalus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 35 sec
Reputation Power: 8
Send a message via ICQ to Tantalus Send a message via AIM to Tantalus
And how do you access the command line arguments from inside the VB program? Are they passed in as an array or what?

Last edited by Tantalus : January 19th, 2004 at 04:19 PM.

Reply With Quote
  #4  
Old January 19th, 2004, 10:26 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 13th Plane (11000 - 11499 posts)
 
Join Date: Jun 2003
Posts: 11,110 Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 11 h 41 m
Reputation Power: 830
You get a string of all the command line parameters with

mystring = Command()

Reply With Quote
  #5  
Old January 19th, 2004, 10:36 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,191 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 15 m 7 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
sorry, yeah - I've been out of it for a while. What Doug said. He stole my answer.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Sub Main() With Parameters.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT