Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingVisual 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 ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old October 1st, 2004, 06:18 AM
goels goels is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 goels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Expandable Variables in VBA

Hi All,

I was trying to pass parameters to this script file (i.e testappend3.scr) in VBA code:

Shell "\\lvamfs01\advent\Axys\Axys32.Exe script testappend3.scr batchpassvalue -exit"

where the batchpassvalue variable has the value "mts" stored in it but what happens is that when the code is executed instead of the value stored in batchpassvalue getting passed , it itself gets passed as the value. Now i have tried combinations with batchpassvalue like

%batchpassvalue%
&batchpassvalue&

but the whole thing gets passed as the value itself.

Is there a way through which we can pass the value stored in batchpassvalue or any other variable, instead of it itself getting passed ?

Chow
Goels

Reply With Quote
  #2  
Old October 1st, 2004, 07:36 AM
Mythomep Mythomep is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Zaandam, The Netherlands
Posts: 70 Mythomep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 37 sec
Reputation Power: 4
Send a message via MSN to Mythomep
Cool

Hi,

If you want to "include" variable values in any string, you need to use the & symbols to concatenate the value of the variable to the string. In other words:

Code:
  Shell "\\lvamfs01\advent\Axys\Axys32.Exe script testappend3.scr " & batchpassvalue & " -exit"


That should do the trick.

Grtz.©

M.

Last edited by Mythomep : October 1st, 2004 at 07:38 AM. Reason: Code was mangled to a link, restored it.

Reply With Quote
  #3  
Old October 1st, 2004, 02:40 PM
goels goels is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 goels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Reply:Expandable Variables

Dear All,

I found out the way in which one can acheive the desired functionality. Posting the answer here as it might be of some help to any viewer:

Shell ("\\lvamfs01\advent\Axys\Axys32.Exe script testappend3.scr " & batchpassvalue & " -exit")

It was just a matter of getting the right syntax in place; which believe me as one new to programming i am finding notoriously difficult.

Cheers
Goels


Quote:
Originally Posted by goels
Hi All,

I was trying to pass parameters to this script file (i.e testappend3.scr) in VBA code:

Shell "\\lvamfs01\advent\Axys\Axys32.Exe script testappend3.scr batchpassvalue -exit"

where the batchpassvalue variable has the value "mts" stored in it but what happens is that when the code is executed instead of the value stored in batchpassvalue getting passed , it itself gets passed as the value. Now i have tried combinations with batchpassvalue like

%batchpassvalue%
&batchpassvalue&

but the whole thing gets passed as the value itself.

Is there a way through which we can pass the value stored in batchpassvalue or any other variable, instead of it itself getting passed ?

Chow
Goels

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Expandable Variables in VBA


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 | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway