[Rev] Problem with seemingly simple code

Ken Ray kray at sonsothunder.com
Sat Mar 23 21:52:01 EST 2002


Welcome, Dave!

Your code looks OK, although I'd parenthesize for clarity:

if (field "in_field" = "") and (the number of lines of field "waiting_reqs"
> 0) then
    put line 1 of field "waiting_reqs" into field "in_field"
    delete line 1 of field "waiting_reqs"
    send mouseUp to button "sendReq"
end if

You might also want to use:

   the text of field "in_field"

instead of just:

   field "in_field"

Both should be the same, but you never know. Also, can you put in an
"answer" command and after the "if" statement to check the contents of the
fields? As in:

answer "Field 'in_field' contains: " & (field "in_field") & cr & \
   "field 'waiting_reqs' contains: " & (the number of lines of field
"waiting reqs")
if (field "in_field" = "") and (the number of lines of field "waiting_reqs"
> 0) then
    put line 1 of field "waiting_reqs" into field "in_field"
    delete line 1 of field "waiting_reqs"
    send mouseUp to button "sendReq"
end if

Just a few thoughts...

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web site: http://www.sonsothunder.com/

----- Original Message -----
From: "David Kwinter" <dk42 at mac.com>
To: <use-revolution at lists.runrev.com>
Sent: Saturday, March 23, 2002 8:22 PM
Subject: [Rev] Problem with seemingly simple code


> This chunk of script lives in an idle handler and works fine on OSX, but
> when I open a compiled Windows version, I get nothing. Any thoughts?
> Should I have said 'empty' instead of "" in line 1?
>
> if field "in_field"="" and the number of lines in field "waiting_reqs">0
> then
>      put line 1 of field "waiting_reqs" into field "in_field"
>      delete line 1 of field "waiting_reqs"
>      send mouseup to button "sendReq"
>    end if
>
> Btw, nice to meet everyone! My name's Dave, I'm 19, in university
> (UofT), and have worked with Hypercard, SC, MC, now Rev. since
> elementary school. I'm presently working on two client/server projects.
> One of which needs to be able to parse headers out of .DWG files, if
> anyone knows where I could find any sort of DWG xcmd, please let me
> know. (http://www.OpenDWG.com)
>
> Thanks for any help.
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list