filepaths and seeing clearly
rev at armbase.com
rev at armbase.com
Tue Jul 5 05:45:17 EDT 2005
Hi All
I have to share this wee story about how I have been battering my head on the
wall due to filepaths. I hope it can be of use to some.
Here goes......
I have an app which has a components folder with externals in it.
I can use absolute paths....
on mouseUp
set the hideConsoleWindows to true
put "c:\Armbase\Components\PDATconv.exe /I" && quote &
"c:\Armbase\Components\Armbase.xdf" & quote into mycommandline
get shell(mycommandline)
put url("file:c:\Armbase\Components\Armbase.txt") into tFile
repeat for each line tLine in tFile
put item 1 of tLine into fld "field1"
put item 2 of tLine into fld "field2"
put item 3 of tLine into fld "field3"
put item 4 of tLine into fld "field4"
put item 5 of tLine into fld "field5"
put item 6 of tLine into fld "field6"
create card -- for next line of values
end repeat
delete last card -- last card was never loaded with values
-- now each line is displayed on a separate card
end mouseUp
But I cannot get relative paths working using various scripts that I have
canibalised and recreated in many guises. I was at my wits end over this one.
Even considering posting about paying someone to do it for me even though the
app is free.
However, I sat back today and thought. Hold on!!!!!!! All I want is the user to
be able to put the .exe anywhere. And here is the "really silly bit" where I
shouted at myself :-) BOB!!!!! THE COMPONENTS FOLDER DOES NOT HAVE TO FOILLOW
THE .EXE. :-)
And so it was a eureka moment. I was trying to be too neat and have the folder
all self-contained. Why? I simply have to use Installgadget to put the
components folder in the same place and then the user can put the .exe where
they like. So blooming easy.
So the moral of the story is.... Sometimes it is easier to work with the problem
as it is.. rather than try too hard to be elegant.
Hope this is of use to some.
Regards
Bob; Sunny Scotland (honest it really is)
More information about the use-livecode
mailing list