Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 07, 2019 1:50 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: shell.execute not working like cmdline control
PostPosted: Sun Feb 26, 2012 4:15 pm 
Offline

Joined: Fri Jan 08, 2010 9:59 am
Posts: 315
Hi there...(sorry I reposted it because i mistakenly posted this in the mac forum - sorry for the spam)

I've gotten some exciting breakthroughs in my search to convert ABC music into SVG AND THEN USE BATIK TO CONVERT INTO A PNG.
IT WORKS BEAUTIFULLY - IN THE CMD WINDOW.
for example.
I navigate my way to the directory where the app is using "cd"
I get there and run a command
apcm2ps -v -s 1.5 music.abc

and it wonderfully converts into an SVG file called out001.svg,
Then I use another library in the same file and do
jave -jar batik-rasterizer.jar -out001.svg
and it converts into a PNG of beuatifully rendered music that can load into my app to display.

I thought - well that should be easy enough.
Well that I started 4 hours ago and still no luck.
I;ve tried every combination I can think of...
here's my code

dim a,FItem as string
dim stream as TextOutputStream
dim f,f1,f2 as FolderItem
Dim s As Shell
s=New Shell
f= specialfolder.applicationdata.child("Guitar SightReader Toolbox").child("ABC").child("convert")
f1=specialfolder.applicationdata.child("Guitar SightReader Toolbox").child("ABC").child("convert").child("music.abc")
FItem=f.AbsolutePath
if f1.Exists then msgbox "it's here"
if f1.Exists then f1.Delete

(I think put the code in to write the textfile for music.abc (which coverts awesomly when I run it in the cmd line terminal))

then I tried

dim cmd as String

cmd = "open "+f.ShellPath
s.Execute "abcm2ps -v -l -s 1.5 music.abc"
's.Execute FItem+"abcm2ps -v -l -s 1.5 music.abc"
's.Execute (f2.AbsolutePath +" -v -l -s 1.5 music.abc")
'msgbox FItem+"abcm2ps -v -l -s 1.5 music.abc"
If s.errorCode = 0 then
else
MsgBox "Error code: " + Str(s.errorCode)
end if

all resulting in error 1
What am I doing wrong?


Top
 Profile  
Reply with quote  
 Post subject: Re: shell.execute not working like cmdline control
PostPosted: Sun Feb 26, 2012 5:24 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Set up the environment and use absolute paths.


Top
 Profile  
Reply with quote  
 Post subject: Re: shell.execute not working like cmdline control
PostPosted: Sun Feb 26, 2012 6:32 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
The shell is NOT a command line terminal
It does not have the same environment nor the same set up
So paths to applications need to be fully specified
OR you need to set up the same environment variables by running the persons shell start up command

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group