Page 4 of 6
Posted: Thu Mar 19, 2009 2:52 am
by maverickalex
Ok i have run into a problem that i didnt expect.
I have done two of the tools now and both work.
However they will only work when getting the data from one folder.
What i mean by that is, lets say for example.
The n10w070.hgt.zip file is in e:\Terragear\Tools
i can select it, put the output path in and extract the contents of it perfectly.
both tools work fine like that.
If i happened to move n10w070.hgt.zip to c:\Terragear\work and try the same process, the tool doesnt work.
I put the file back into E:\Terragear\Tools and it works again.
I used the standalone features to create the standalone application.
But i'm a bit baffled by this..
Alex
Posted: Thu Mar 19, 2009 3:15 am
by maverickalex
Ok in reply to my own question, i'm wondering if this has anything to do with absolute paths and relative paths?
If anyone has the answer, i can goto bed

Posted: Thu Mar 19, 2009 3:41 am
by shadowslash
why not try to get some rest first? maybe somebody'll be able to answer it tomorrow?

Posted: Thu Mar 19, 2009 5:11 am
by mwieder
If you bring up the messagebox and type
you'll see several lines of useful things, but a period isn't one of them. Seems like it should be, but you'll have to use "." (a dot surrounded by quotes) instead.
Posted: Thu Mar 19, 2009 5:17 am
by shadowslash
Posted: Thu Mar 19, 2009 5:22 am
by mwieder
Well, yes, you can always define your own constants. Good one.
Posted: Thu Mar 19, 2009 6:27 am
by shadowslash
Hey i got a question, i'll post it in a new thread as it doesn't pertain to this topic...

Posted: Thu Mar 19, 2009 8:52 am
by maverickalex
***solved****
It had nothing to do with paths etc.
basically there is an unzippping facility within the folder that the tools are kept. If you dont unzip the file before using the tools, then they need to be in the same folder as the tool, so that the tool can unzip them first.
If you pre-unzip them they can be anywhere.
It,s amazing what a few hours sleep can do.
Posted: Thu Mar 19, 2009 12:31 pm
by maverickalex
If i have a text field that i want to include if there is something in it or if it is empty to skip it.
can i use something like.
Code: Select all
if tfield is not empty then
put it in "foo"
else
i know else and if are involved!
basically the next tool has a lot of options, i want it to check the field if it has any text to include it in the final options, if not to skip but not leave a blank space.
Posted: Thu Mar 19, 2009 12:45 pm
by SparkOut
something like, certainly:
Code: Select all
if tField is not empty then
put tField into <foo>
--<foo> is whatever container, rather than a quoted literal, btw
end if
An "end if" is always required, "else" is only required if there is an alternative action to be taken. "end if" on its own implies "else do nothing"
On the other hand, if tField is actually empty, then putting it into "foo" will result in "foo" being empty too, so it wouldn't have caused a space to be generated.
Posted: Thu Mar 19, 2009 12:49 pm
by maverickalex
so rev will just automatically skip the field if there is nothing in it, leaving no gap?
Posted: Thu Mar 19, 2009 12:57 pm
by SparkOut
No, it won't automatically skip the field, but the result should be the same.
If tFfoo is a variable, then until I put something into it it is empty.
So if I
Code: Select all
answer "This line" & tFoo & "has no gap"
The answer dialog displays "This linehas no gap" because tFoo's contents are empty.
If I have a field "fldFoo" that is empty, then if I
Code: Select all
put field "fldFoo" into tFoo
answer "This line" & tFoo & "still has no gap"
then because field "fldFoo" was
empty then tFoo is still empty (or is now empty, even if it had some data in it before). Rev still went through the motions of putting the field contents into the variable, it just happens that there was nothing in the source, so there's still nothing in the destination. So the answer dialog will be "This linestill has no gap".
If field "fldFoo" happens to have a space in it, then
it is not empty - it contains data - just something that is not typically a visible item when displayed in a field on screen.
Posted: Thu Mar 19, 2009 1:00 pm
by maverickalex
lovely, i'm starting to understand much better now, thanks
Posted: Thu Mar 19, 2009 1:50 pm
by maverickalex
does this look about right?
I'm somewhere close i think. the tools not running, the command box comes up and makes the suggested usage (gives the order that the options are put in)
(quoted from the commandline)
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\alex>e:\terragear\genapts.exe
Usage e:\terragear\genapts.exe --input=<apt_file> --work=<work_dir> [ --start-id
=abcd ] [ --nudge=n ] [--min-lon=<deg>] [--max-lon=<deg>] [--min-lat=<deg>] [--m
ax-lat=<deg>] [ --airport=abcd ] [--tile=<tile>] [--chunk=<chunk>]
they look like they are being selected in the right order in the script.
Code: Select all
on mouseUp
local tShellCommand
put field "aptdatfld" into taptdatfld
put field "workdirfld" into tworkdirfld
if field "startidfld" is not empty then
put "startidfld" into tstartidfld
end if
if field "nudgefld" is not empty then
put "nudgefld" into tnudgefld
end if
if field "minlonfld" is not empty then
put "minlonfld" into tminlonfld
end if
if field "maxlonfld" is not empty then
put "maxlonfld" into tmaxlonfld
end if
if field "minlatfld" is not empty then
put field "minlatfld" into tminlatfld
end if
if field "maxlatfld" is not empty then
put field "maxlatfld" into tmaxlatfld
end if
if field "icaofld" is not empty then
put "icaofld" into ticaofld
end if
if field "chunkfld" is not empty then
put "chunkfld" into tchunkfld
end if
--put space & quote & quote into tShellCommand
--the above line puts an empty pair of quotes to be the
--first parameter passed to the shell command which is
--necessary to act as the dummy console window "title"
--if setHideConsoleWindows is true
--so you will need to uncomment the line when you do that.
put space & "genapts" & space after tShellCommand
put space & taptdatfld & space after tShellCommand
put space & tworkdirfld after tShellCommand
put space & tstartidfld after tshellcommand
put space & tnudgefld after tshellcommand
put space & tminlonfld after tshellcommand
put space & tmaxlonfld after tshellcommand
put space & tminlatfld after tshellcommand
put space & tmaxlatfld after tshellcommand
put space & ticaofld after tshellcommand
put space & tchunkfld after tshellcommand
answer "About to:" && quote & "start" & tShellCommand & quote
get shell ("start" & tShellCommand)
end mouseUp
GUI looks like this

Posted: Thu Mar 19, 2009 2:55 pm
by SparkOut
Looks like you have to specify the switches longhand for this app.
It's expecting the "--input=" to be included along with the parameter itself.
Try
Code: Select all
put "--input=" & field "aptdatfld" into taptdatfld
put "--work=" & field "field "workdirfld" into tworkdirfld
etc. etc.