i have the executable files, now how to create the GUI

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Thu Mar 19, 2009 2:52 am

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

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Thu Mar 19, 2009 3:15 am

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 :shock:

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Thu Mar 19, 2009 3:41 am

why not try to get some rest first? maybe somebody'll be able to answer it tomorrow? Image
Parañaque, Philippines
Image
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Thu Mar 19, 2009 5:11 am

If you bring up the messagebox and type

Code: Select all

put the constantnames
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.

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Thu Mar 19, 2009 5:17 am

Code: Select all

constant dot="."

Image
Parañaque, Philippines
Image
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Thu Mar 19, 2009 5:22 am

Well, yes, you can always define your own constants. Good one.

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Thu Mar 19, 2009 6:27 am

Hey i got a question, i'll post it in a new thread as it doesn't pertain to this topic... Image
Parañaque, Philippines
Image
Image

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Thu Mar 19, 2009 8:52 am

***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. :D
It,s amazing what a few hours sleep can do.

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Thu Mar 19, 2009 12:31 pm

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.

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Thu Mar 19, 2009 12:45 pm

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.
Last edited by SparkOut on Thu Mar 19, 2009 12:49 pm, edited 1 time in total.

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Thu Mar 19, 2009 12:49 pm

so rev will just automatically skip the field if there is nothing in it, leaving no gap?

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Thu Mar 19, 2009 12:57 pm

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.

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Thu Mar 19, 2009 1:00 pm

:D

lovely, i'm starting to understand much better now, thanks

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Thu Mar 19, 2009 1:50 pm

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
Image

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Thu Mar 19, 2009 2:55 pm

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.

Post Reply