Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

String and Shell questions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-18-2007, 03:34 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Netherlands
Posts: 222
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, 03:54 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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, 05:28 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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, 05:49 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Netherlands
Posts: 222
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, 05:56 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,731
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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 Off
Pingbacks are Off
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 (Windows Mobile) 2 05-15-2008 06:45 PM
Shell and wait Erel Code Samples & Tips 0 03-26-2008 03:14 PM
using shell() Put Claude Questions (Windows Mobile) 2 12-26-2007 08:41 AM
Shell Wizarda2z Questions (Windows Mobile) 3 08-05-2007 07:56 AM
Shell tvrman Questions (Windows Mobile) 3 07-30-2007 01:20 PM


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


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0