Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


String and Shell questions


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-18-2007, 04:34 PM
Knows the basics
 
Join Date: Apr 2007
Location: Netherlands
Posts: 86
Default String and Shell questions

Hi,

Quite some time I had no opportunity to program; therefore I have forgotten some simple things. Two questions:

1) How to include quote (") symbols in a string variable?

2) Is Shell variable name a valid statement? Variable should include (" "," ")?

Thanks for some help

Harry
Reply With Quote
  #2 (permalink)  
Old 12-18-2007, 04:54 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by HARRY View Post
1) How to include quote (") symbols in a string variable?
"first bit " & chr(34) & "second bit". It's in Help - Main Help - Keywords - String - Chr

Quote:
Is Shell variable name a valid statement? Variable should include (" "," ")?
Sorry, don't understand!
Reply With Quote
  #3 (permalink)  
Old 12-18-2007, 06:28 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by HARRY View Post
2) Is Shell variable name a valid statement? Variable should include (" "," ")?
Is this what you are asking about?

Code:
  app = "someapp"
  arglist =Chr(34) & "this is arg0" & Chr(34) & " arg1" & " arg2 arg3"
  Shell(app, arglist)
Note that the quoted string is a single argument and that spaces separate the non-quoted arguments otherwise they appear as one argument
Reply With Quote
  #4 (permalink)  
Old 12-18-2007, 06:49 PM
Knows the basics
 
Join Date: Apr 2007
Location: Netherlands
Posts: 86
Default

Hello Agraham,

Thanks for your prompt reply. The second question in fact was whether the parameter following the Shell statement can be a variable or must be a string itself. I think that a variable is allowed.

Testing some more I got the following problem:

Two lines of coding:
DelStr="(" & Chr(34) & "C:\Program Files\MortScript\MortScript.exe" & Chr(34) & "," & Chr(34) & "C:\Program Files\MortScript\Delete.mscr, DelName=" & DestPath & "Data.zip" & Chr(34) & ")"

Shell Delstr

The contents of DelStr now is :

("C:\Program Files\MortScript\MortScript.exe","C:\Program Files\MortScript\Delete.mscr, DelName=C:\MIOMAP\UI_S\Data.zip")
This results into the message: Invalid characters in path.

Is this caused by the space between Program and Files and how to solve this ?

Harry
Reply With Quote
  #5 (permalink)  
Old 12-18-2007, 06:56 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You will need to use two variables. One for the first argument and one for the second:
Code:
V1 = Chr(34) & "C:\Program Files\MortScript\MortScript.exe" & Chr(34)
V2 = Chr(34) &  "C:\Program Files\MortScript\Delete.mscr, DelName=" &   DestPath &  "Data.zip" &  Chr(34)
Shell(V1,V2)
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions on shell command, and user event, and the 6.30 dan kabestan Questions & Help Needed 2 05-15-2008 07:45 PM
Shell and wait Erel Code Samples & Tips 0 03-26-2008 04:14 PM
using shell() Put Claude Questions & Help Needed 2 12-26-2007 09:41 AM
Shell Wizarda2z Questions & Help Needed 3 08-05-2007 08:56 AM
Shell tvrman Questions & Help Needed 3 07-30-2007 02:20 PM


All times are GMT. The time now is 06:35 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0