Re: Sounds in iOS

2012-02-21 Thread Graham Samuel
Ken I AM using your code, and very grateful I am for it; but that doesn't stop 
me being worried by RunRev apparently altering the engine to be slightly less 
cross-platform than one might hope, and then not being very clear about it. 
IMHO this is bad news for old dogs like me, and worse for people trying to 
learn LC for the first time.

Graham

Sent from my iPad

On Tue Feb 2012 20:05:52 +, Ken Corey  wrote:

> On 21/02/2012 19:57, Graham Samuel wrote:
>> If you can point me at an explicit statement about this in the LC 
>> documentation, I'd be grateful.
> 
> Well, you could argue the point about the documentation, or you could 
> look at the code that I put on my web server.  And the relevant code is 
> just a few lines.
> 
> It works on the desktop, simulator and iOS device.
> 
> -Ken


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: RFC: Silly little Animate function...

2012-02-21 Thread Malte Brill
CALL THE SPANISH INQUISITION! HE USED REGEX GET THE COMPFY CHAIR.

Jokes aside... Well done!

Cheers,

Malte

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: RFC: Silly little Animate function...

2012-02-21 Thread Ken Corey

On 22/02/2012 02:59, kdjanz wrote:

Any chance that you could post a demo stack of this little item in action?


Hi Kelly,

How silly of me, I should have done that already.

http://its.ec/static/animate.livecode.zip   (2.5Kb file)

-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
Hi Mark,
I think this may not be difficult.  Turns out you can use an array with
numbered keys instead of a list of variables with revExecuteSQL, so here's
some code ( completely untested)

put 1 into x
put "UPDATE test SET " into mySQL
repeat for each item myField in "One,Two,Three"
   if field myField is not empty then
  put myField & "=:" & x & comma after mySQL
  put field myField into myArray[x]
  add 1 to x
   end if
end repeat
put space into char -1 of mySQL
put "where ID=" & tID after mySQL
revExecuteSQL gConnectID, mySQL, myArray

Shouldn't be too hard to generalise it as a command/function if necessary.

But then the easiest thing might be to just use text instead.

I plan to enter this as bug tomorrow, as well as the incorrect handling of
the NULL keyword.

Pete

On Tue, Feb 21, 2012 at 7:19 PM, Mark Smith wrote:

>
> Peter Haworth-2 wrote
> >
> > Yes, it causes a headache, you're right.  You would have to  build the
> > UPDATE command in a variable by examining each field for empty and adding
> > it to the variable list if not empty.  Don't have time to give some
> > example
> > code right now, but will try to do something tomorrow.
> > Pete
> >
>
> Thats ok, thats enough of a hint... I can work something up from there. If
> fld"one" is not empty then
>put "some string" after "the string I'm trying to build"
> should do it.
>
> Thanks
>
> -- M
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409145.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>


-- 
Pete
Molly's Revenge 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Standalone blocked by "software restriction policy"

2012-02-21 Thread Mark Powell
> Thanks for the quick, if somewhat discouraging, response!Can anyone
> (perhaps Mr. Powell) tell me what code-signing is?

Mark W. explained it much better that I could. 

Good luck and don't be discouraged.  Anxiety is the dizziness of freedom...it 
is just that some times are dizzier than others is all.

Mark



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith

Peter Haworth-2 wrote
> 
> The only way round this that I've found as in my earlier email is to not
> include the integer column in any INSERT or UPDATE statements if you want
> it to come back as empty instead of zero.
> 

Which sort of works, until you consider the case of wanting to back out a
value (revert from some value to NULL). At present, I think I'll just stick
with using text fields, but we should definitely report this to RR. If the
user wants to put an undefined value into an integer field (because the
value is in fact UNDEFINED... that does happen in the real world) then the
user should be able to use empty or NULL to signal that (I have no
preference... to my failing eyesight they both look equally missing to me :)

-- Mark


--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409186.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Standalone blocked by "software restriction policy"

2012-02-21 Thread Mark Wieder
AcidJazz-

Tuesday, February 21, 2012, 6:01:26 PM, you wrote:

> To All Marks (and others)

> Thanks for the quick, if somewhat discouraging, response!Can anyone
> (perhaps Mr. Powell) tell me what code-signing is?

I'll take a stab at this, although you probably want to wait for Mark
Powell to chime in here.

Due to the fact that there are so many bug^H^H^Haspects of Microsoft's
code that people can exploit^H^H^Hutilize, Microsoft created a way to
digitally sign your application when you release it. The code is
directly traceable back to you and verified by the installation code.
That way if somebody or some program messes with your application and
modifies it in any way the verification will fail and the user will be
presented with a warning message before installation proceeds. It's a
way of ensuring that the application is intact from the time it leaves
your hands to the time the end-user installs it. If you don't sign
your application then the user will be get a message to that effect
and "do they want to continue?". IT departments hate that and would
probably be more likely to let signed apps be installed. YMMV.

-- 
-Mark Wieder
 mwie...@ahsoftware.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith

slylabs13 wrote
> 
> Is it important to discern between null and a value? If so, uncheck the
> not null in the table definition and don't include the column in
> inserts/updates
> 

Awkward but yes, that seems to be the solution. 

-- mark

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409162.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
Ah ic. I think that in a situation where you are passing an empty string to a 
numerical field with no default, either SQL must throw an error, or else insert 
what amounts to nothing in a numeric column. 

I think the nature of sqLite is that Instead of tossing an error it puts 0 in 
the column. You are right that not including columns you do not intend to 
update is the way to go. What I do is I have a function called buildRecord 
which gets the defaults of the table and populates an array accordingly. I then 
get user input passing that thru validation functions before inserts/updates. 
Then i update all columns in the table. By this method I avoid any unexpected 
results/errors in my SQL queries. I suppose that checking for null  in values 
can be used as a method of detecting an uninitialized value, but there are 
other ways to go about that IMHO.  

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On Feb 21, 2012, at 19:05, Pete  wrote:

> Bob,
> The field type is integer as Mark said.  Since he doesn't have a default
> specified, the default value is NULL and that should not come back as zero
> and doesn't in any tool except LC - tried it with sqlite3 and the Firefox
> plugin.  Nor should an empty value he's supplying (which is entirely
> different than NULL to SQL) come back as zero and, once again, it doesn't
> in any tool except LC.
> 
> The only way round this that I've found as in my earlier email is to not
> include the integer column in any INSERT or UPDATE statements if you want
> it to come back as empty instead of zero.
> 
> On Tue, Feb 21, 2012 at 6:42 PM, Mark Smith 
> wrote:
> 
>> 
>> slylabs13 wrote
>>> 
>>> What is the field type? What is the default? If numeric and not null then
>>> it may be that the value defaults to 0
>>> 
>> 
>> Thanks Bob, field type is integer, no default is defined. Firefox plugin
>> has
>> a zero in the Not Null column,(which means?) and a zero in the Primary Key
>> column (which I presume means the field is not a primary key).
>> 
>> Just to add to my previous comments, I thought I would check to see if it
>> had anything to do with the substitution form of revExecuteSQL. It did not.
>> Switching back to
>> 
>> 
>> put "UPDATE test SET " & \
>>merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
>>" WHERE id = " & tID into tCmd  -- old format
>> 
>> had the same result. One advantage though was that if I put a "Put tCmd" to
>> throw the statement to the msg box I could actually see what the values
>> were. For the first save of the empty fields (UPDATE statement above) it
>> looks like this:
>> 
>> UPDATE test SET one='', two='', three='' WHERE id = 10
>> 
>> field types are integer, integer and text respectively
>> 
>> After reading it back in, it displays 0's in the int fields. If I then try
>> saving it again (running the same code as above) I get this:
>> 
>> UPDATE test SET one='0', two='0', three='' WHERE id = 10
>> 
>> and as you can see the int fields now contain 0's while the text field does
>> not. No data entry has occurred on my part, I am just executing a repeated
>> read and write on the same record using the same code. Bob may be on to
>> something though maybe I have to define a default... but what should
>> that be (I want undefined to remain undefined)?
>> 
>> -- Mark
>> 
>> 
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
> 
> 
> -- 
> Pete
> Molly's Revenge 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith

Peter Haworth-2 wrote
> 
> Yes, it causes a headache, you're right.  You would have to  build the
> UPDATE command in a variable by examining each field for empty and adding
> it to the variable list if not empty.  Don't have time to give some
> example
> code right now, but will try to do something tomorrow.
> Pete
> 

Thats ok, thats enough of a hint... I can work something up from there. If
fld"one" is not empty then
put "some string" after "the string I'm trying to build"
should do it.

Thanks

-- M

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409145.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
I absolutely agree that default values should be defined in the database
but it wouldn't help in this case since he wants the default to be either
NULL or empty and LC has taken it upon itself to decide it knows better
than the database and interpret that as zero.
Pete

On Tue, Feb 21, 2012 at 7:01 PM, Bob Sneidar  wrote:

> Right. So in a column defined as integer not null, there must then be a
> default value when you pass empty otherwise there would be an
> inconsistency. What I do ( and how I do it is too much to go into on an
> iPhone) is I preload all the values I intend to insert/update with default
> values, then get input from the user. If the user does not alter the
> defaults, then the SQL table gets the ones I defined. The best way however
> is to define your table columns with some default. I have learned to do
> this at pains to The contrary.
>
> Bob Sneidar
> IT Manager
> Calvary Chapel CM
> Sent from iPhone
>
> On Feb 21, 2012, at 18:42, Mark Smith  wrote:
>
> >
> > slylabs13 wrote
> >>
> >> What is the field type? What is the default? If numeric and not null
> then
> >> it may be that the value defaults to 0
> >>
> >
> > Thanks Bob, field type is integer, no default is defined. Firefox plugin
> has
> > a zero in the Not Null column,(which means?) and a zero in the Primary
> Key
> > column (which I presume means the field is not a primary key).
> >
> > Just to add to my previous comments, I thought I would check to see if it
> > had anything to do with the substitution form of revExecuteSQL. It did
> not.
> > Switching back to
> >
> >
> >  put "UPDATE test SET " & \
> > merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
> > " WHERE id = " & tID into tCmd  -- old format
> >
> > had the same result. One advantage though was that if I put a "Put tCmd"
> to
> > throw the statement to the msg box I could actually see what the values
> > were. For the first save of the empty fields (UPDATE statement above) it
> > looks like this:
> >
> > UPDATE test SET one='', two='', three='' WHERE id = 10
> >
> > field types are integer, integer and text respectively
> >
> > After reading it back in, it displays 0's in the int fields. If I then
> try
> > saving it again (running the same code as above) I get this:
> >
> > UPDATE test SET one='0', two='0', three='' WHERE id = 10
> >
> > and as you can see the int fields now contain 0's while the text field
> does
> > not. No data entry has occurred on my part, I am just executing a
> repeated
> > read and write on the same record using the same code. Bob may be on to
> > something though maybe I have to define a default... but what should
> > that be (I want undefined to remain undefined)?
> >
> > -- Mark
> >
> >
> > --
> > View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html
> > Sent from the Revolution - User mailing list archive at Nabble.com.
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>


-- 
Pete
Molly's Revenge 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
Yes, it causes a headache, you're right.  You would have to  build the
UPDATE command in a variable by examining each field for empty and adding
it to the variable list if not empty.  Don't have time to give some example
code right now, but will try to do something tomorrow.
Pete




On Tue, Feb 21, 2012 at 6:58 PM, Mark Smith wrote:

>
> Peter Haworth-2 wrote
> >
> > Long story short, the only way I could find to make this work correctly
> is
> > to not include the integer column in the UPDATE statement.  Not sure if
> > your update was just a test with that one column or if there;d normally
> be
> > more columns to update, but you'd have to test your integer fields for
> > empty and leave them off the UPDATE statement if they are.
> > --
> > Pete
> > Molly's Revenge ;
> >
>
> Thanks Pete, nice to have confirmation, although its not so much fun to
> contemplate the alternatives :)
>
> I guess there are 2 really: in the first case, since I am only going to be
> using this app with SQLite and SQLite has pretty relaxed type affinity I
> could store everything in text fields. LC seems to be leaving those alone
> when they are undefined. However, thats not a good solution if you are
> writing an app that needs to work with other SQL databases. In that case
> your suggestion of including or excluding the columns based on whether they
> are defined or not defined seems the better solution. However, my own LC
> skills are not at the level where I would know how to make that work
> (although I am sure it can be done).
>
> For example, if one were to use the substitution form of revExecuteSQL how
> would you write it so that if one of the fields was undefined it would
> disappear from the statements:
>
>
>   put "UPDATE test SET one=:1, two=:2, three=:3 where ID=" & tID into tCmd
>   revExecuteSQL gConnectID, tCmd, "tOne", "tTwo", "tThree"
>
> I guess this might be easier to do in the merge() form ??? (since you are
> only dealing with 1 string):
>
>   put "UPDATE test SET " & \
> merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
> " WHERE id = " & tID into tCmd  -- old format
>
> But then you have to worry about escaping characters in text fields... etc
>
> -- Mark
>
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409110.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>


-- 
Pete
Molly's Revenge 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
 Is it important to discern between null and a value? If so, uncheck the not 
null in the table definition and don't include the column in inserts/updates

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On Feb 21, 2012, at 18:58, Mark Smith  wrote:

> 
> Peter Haworth-2 wrote
>> 
>> Long story short, the only way I could find to make this work correctly is
>> to not include the integer column in the UPDATE statement.  Not sure if
>> your update was just a test with that one column or if there;d normally be
>> more columns to update, but you'd have to test your integer fields for
>> empty and leave them off the UPDATE statement if they are.
>> -- 
>> Pete
>> Molly's Revenge ;
>> 
> 
> Thanks Pete, nice to have confirmation, although its not so much fun to
> contemplate the alternatives :)
> 
> I guess there are 2 really: in the first case, since I am only going to be
> using this app with SQLite and SQLite has pretty relaxed type affinity I
> could store everything in text fields. LC seems to be leaving those alone
> when they are undefined. However, thats not a good solution if you are
> writing an app that needs to work with other SQL databases. In that case
> your suggestion of including or excluding the columns based on whether they
> are defined or not defined seems the better solution. However, my own LC
> skills are not at the level where I would know how to make that work
> (although I am sure it can be done). 
> 
> For example, if one were to use the substitution form of revExecuteSQL how
> would you write it so that if one of the fields was undefined it would
> disappear from the statements:
> 
> 
>   put "UPDATE test SET one=:1, two=:2, three=:3 where ID=" & tID into tCmd
>   revExecuteSQL gConnectID, tCmd, "tOne", "tTwo", "tThree"
> 
> I guess this might be easier to do in the merge() form ??? (since you are
> only dealing with 1 string):
> 
>   put "UPDATE test SET " & \
> merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
> " WHERE id = " & tID into tCmd  -- old format
> 
> But then you have to worry about escaping characters in text fields... etc
> 
> -- Mark
> 
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409110.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
Bob,
The field type is integer as Mark said.  Since he doesn't have a default
specified, the default value is NULL and that should not come back as zero
and doesn't in any tool except LC - tried it with sqlite3 and the Firefox
plugin.  Nor should an empty value he's supplying (which is entirely
different than NULL to SQL) come back as zero and, once again, it doesn't
in any tool except LC.

The only way round this that I've found as in my earlier email is to not
include the integer column in any INSERT or UPDATE statements if you want
it to come back as empty instead of zero.

On Tue, Feb 21, 2012 at 6:42 PM, Mark Smith wrote:

>
> slylabs13 wrote
> >
> > What is the field type? What is the default? If numeric and not null then
> > it may be that the value defaults to 0
> >
>
> Thanks Bob, field type is integer, no default is defined. Firefox plugin
> has
> a zero in the Not Null column,(which means?) and a zero in the Primary Key
> column (which I presume means the field is not a primary key).
>
> Just to add to my previous comments, I thought I would check to see if it
> had anything to do with the substitution form of revExecuteSQL. It did not.
> Switching back to
>
>
>  put "UPDATE test SET " & \
> merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
> " WHERE id = " & tID into tCmd  -- old format
>
> had the same result. One advantage though was that if I put a "Put tCmd" to
> throw the statement to the msg box I could actually see what the values
> were. For the first save of the empty fields (UPDATE statement above) it
> looks like this:
>
> UPDATE test SET one='', two='', three='' WHERE id = 10
>
> field types are integer, integer and text respectively
>
> After reading it back in, it displays 0's in the int fields. If I then try
> saving it again (running the same code as above) I get this:
>
> UPDATE test SET one='0', two='0', three='' WHERE id = 10
>
> and as you can see the int fields now contain 0's while the text field does
> not. No data entry has occurred on my part, I am just executing a repeated
> read and write on the same record using the same code. Bob may be on to
> something though maybe I have to define a default... but what should
> that be (I want undefined to remain undefined)?
>
> -- Mark
>
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>


-- 
Pete
Molly's Revenge 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
Right. So in a column defined as integer not null, there must then be a default 
value when you pass empty otherwise there would be an inconsistency. What I do 
( and how I do it is too much to go into on an iPhone) is I preload all the 
values I intend to insert/update with default values, then get input from the 
user. If the user does not alter the defaults, then the SQL table gets the ones 
I defined. The best way however is to define your table columns with some 
default. I have learned to do this at pains to The contrary. 

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On Feb 21, 2012, at 18:42, Mark Smith  wrote:

> 
> slylabs13 wrote
>> 
>> What is the field type? What is the default? If numeric and not null then
>> it may be that the value defaults to 0
>> 
> 
> Thanks Bob, field type is integer, no default is defined. Firefox plugin has
> a zero in the Not Null column,(which means?) and a zero in the Primary Key
> column (which I presume means the field is not a primary key). 
> 
> Just to add to my previous comments, I thought I would check to see if it
> had anything to do with the substitution form of revExecuteSQL. It did not.
> Switching back to
> 
> 
>  put "UPDATE test SET " & \
> merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
> " WHERE id = " & tID into tCmd  -- old format
> 
> had the same result. One advantage though was that if I put a "Put tCmd" to
> throw the statement to the msg box I could actually see what the values
> were. For the first save of the empty fields (UPDATE statement above) it
> looks like this:
> 
> UPDATE test SET one='', two='', three='' WHERE id = 10
> 
> field types are integer, integer and text respectively
> 
> After reading it back in, it displays 0's in the int fields. If I then try
> saving it again (running the same code as above) I get this:
> 
> UPDATE test SET one='0', two='0', three='' WHERE id = 10
> 
> and as you can see the int fields now contain 0's while the text field does
> not. No data entry has occurred on my part, I am just executing a repeated
> read and write on the same record using the same code. Bob may be on to
> something though maybe I have to define a default... but what should
> that be (I want undefined to remain undefined)?
> 
> -- Mark
> 
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: RFC: Silly little Animate function...

2012-02-21 Thread kdjanz
Ken

Any chance that you could post a demo stack of this little item in action?

Thanks

Kelly

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RFC-Silly-little-Animate-function-tp4408356p4409112.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith

Peter Haworth-2 wrote
> 
> Long story short, the only way I could find to make this work correctly is
> to not include the integer column in the UPDATE statement.  Not sure if
> your update was just a test with that one column or if there;d normally be
> more columns to update, but you'd have to test your integer fields for
> empty and leave them off the UPDATE statement if they are.
> -- 
> Pete
> Molly's Revenge ;
> 

Thanks Pete, nice to have confirmation, although its not so much fun to
contemplate the alternatives :)

I guess there are 2 really: in the first case, since I am only going to be
using this app with SQLite and SQLite has pretty relaxed type affinity I
could store everything in text fields. LC seems to be leaving those alone
when they are undefined. However, thats not a good solution if you are
writing an app that needs to work with other SQL databases. In that case
your suggestion of including or excluding the columns based on whether they
are defined or not defined seems the better solution. However, my own LC
skills are not at the level where I would know how to make that work
(although I am sure it can be done). 

For example, if one were to use the substitution form of revExecuteSQL how
would you write it so that if one of the fields was undefined it would
disappear from the statements:


   put "UPDATE test SET one=:1, two=:2, three=:3 where ID=" & tID into tCmd
   revExecuteSQL gConnectID, tCmd, "tOne", "tTwo", "tThree"

I guess this might be easier to do in the merge() form ??? (since you are
only dealing with 1 string):

   put "UPDATE test SET " & \
 merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
 " WHERE id = " & tID into tCmd  -- old format

But then you have to worry about escaping characters in text fields... etc

-- Mark


--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409110.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith

slylabs13 wrote
> 
> What is the field type? What is the default? If numeric and not null then
> it may be that the value defaults to 0
> 

Thanks Bob, field type is integer, no default is defined. Firefox plugin has
a zero in the Not Null column,(which means?) and a zero in the Primary Key
column (which I presume means the field is not a primary key). 

Just to add to my previous comments, I thought I would check to see if it
had anything to do with the substitution form of revExecuteSQL. It did not.
Switching back to


  put "UPDATE test SET " & \
 merge("one='[[tOne]]', two='[[tTwo]]', three='[[tThree]]'") & \
 " WHERE id = " & tID into tCmd  -- old format

had the same result. One advantage though was that if I put a "Put tCmd" to
throw the statement to the msg box I could actually see what the values
were. For the first save of the empty fields (UPDATE statement above) it
looks like this:

UPDATE test SET one='', two='', three='' WHERE id = 10

field types are integer, integer and text respectively

After reading it back in, it displays 0's in the int fields. If I then try
saving it again (running the same code as above) I get this:

UPDATE test SET one='0', two='0', three='' WHERE id = 10

and as you can see the int fields now contain 0's while the text field does
not. No data entry has occurred on my part, I am just executing a repeated
read and write on the same record using the same code. Bob may be on to
something though maybe I have to define a default... but what should
that be (I want undefined to remain undefined)?

-- Mark


--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
Hi Mark,
I tested this out after emailing you earlier today.  It's definitely
Livecode that is doing this and it's a serious problem for more reasons
than you've found.

Long story short, the only way I could find to make this work correctly is
to not include the integer column in the UPDATE statement.  Not sure if
your update was just a test with that one column or if there;d normally be
more columns to update, but you'd have to test your integer fields for
empty and leave them off the UPDATE statement if they are.

For anyone interested, here's what I tried.

Using LC, I Inserted a record into a table with empty in an integer field.
 I used sqlite3 (SQLite's command line db admin tool) to select and read it
back and it showed no value in the integer field.  I then displayed the
entry using LC and it showed zero in the integer field, so something
somewhere in LC is converting empty to zero for integer columns.  That is
not good.

I also tried supplying a value of NULL for the integer field.  When I did
this in slqite3, then read the record back, it showed empty in both sqlite3
and Livecode so I thought I had found a way round it.  But then I added a
record using LC and specifying NULL as the value for the integer field.
 When I displayed that record in sqlite3, it showed up with a literal value
of  "NULL", not empty and it still showed up as zero in LC.  So LC is
treating NULL as a literal value insetad of a keyword on the way in to the
database, but converting that literal NULL value to zero on the way back
out.  That is also not good

I think this is a bug.  There's no way LC should do any data
transformations from how it is stored in a database, and it should
recognise all SQL keywords including NULL.

Pete


On Tue, Feb 21, 2012 at 5:35 PM, Mark Smith wrote:

> Hi, I've encountered a bit of an anomaly when storing empty values into
> integer fields in SQLite, and wonder if others have observed the same
> behavior. If I store an empty value from a LC field into an integer field
> in
> a database, and then subsequently read it back LC displays it as a 0. Where
> this translation occurs is not 100% clear to me, but it certainly is not
> desirable (0 and undefined are not the same thing). Has anyone else
> encountered this?
>
> Here's an example:
>
> put fld "One" into tOne -- One is an empty field, so tOne is empty too
> put "UPDATE test SET one=:1 where ID=" & tID into tCmd
> revExecuteSQL gConnectID, tCmd, "tOne"
>
> If the field called one in the database is defined as type int and fld
> "one"
> on the form is empty then when I execute this:
>
>   put "Select * FROM test where ID = " & tID into tQuery
>   put revDataFromQuery(,,gConnectID,tQuery) into tRecord
>   -- display the record
>   put item 1 of tRecord into fld"ID"
>   put item 2 of tRecord into fld"one"
>
> I get a 0 (zero) for the value in fld "one".
>
> The only way I can see to get around this is to store all numeric values in
> text fields because when an "empty" text field is read back its value
> remains the same (ie it remains empty). I think LC is doing the translation
> on integer type fields but….. I'm not 100% sure of that.
>
> Your thoughts? (I'm using 5.0.2 for these tests)
>
> -- Mark
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4408942.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
Pete
Molly's Revenge 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
What is the field type? What is the default? If numeric and not null then it 
may be that the value defaults to 0

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On Feb 21, 2012, at 17:35, Mark Smith  wrote:

> Hi, I've encountered a bit of an anomaly when storing empty values into
> integer fields in SQLite, and wonder if others have observed the same
> behavior. If I store an empty value from a LC field into an integer field in
> a database, and then subsequently read it back LC displays it as a 0. Where
> this translation occurs is not 100% clear to me, but it certainly is not
> desirable (0 and undefined are not the same thing). Has anyone else
> encountered this?
> 
> Here's an example:
> 
> put fld "One" into tOne -- One is an empty field, so tOne is empty too
> put "UPDATE test SET one=:1 where ID=" & tID into tCmd
> revExecuteSQL gConnectID, tCmd, "tOne"
> 
> If the field called one in the database is defined as type int and fld "one"
> on the form is empty then when I execute this:
> 
>   put "Select * FROM test where ID = " & tID into tQuery
>   put revDataFromQuery(,,gConnectID,tQuery) into tRecord
>   -- display the record
>   put item 1 of tRecord into fld"ID"
>   put item 2 of tRecord into fld"one"
> 
> I get a 0 (zero) for the value in fld "one". 
> 
> The only way I can see to get around this is to store all numeric values in
> text fields because when an "empty" text field is read back its value
> remains the same (ie it remains empty). I think LC is doing the translation
> on integer type fields but….. I'm not 100% sure of that. 
> 
> Your thoughts? (I'm using 5.0.2 for these tests)
> 
> -- Mark
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4408942.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

RE: Standalone blocked by "software restriction policy"

2012-02-21 Thread AcidJazz
To All Marks (and others)

Thanks for the quick, if somewhat discouraging, response!Can anyone
(perhaps Mr. Powell) tell me what code-signing is?

Mark (#1, in this case)

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Standalone-blocked-by-software-restriction-policy-tp4408799p4409005.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Standalone blocked by "software restriction policy"

2012-02-21 Thread Mark Powell
Quadruply incestuous yikes...this post seems to attract the Marks all right.

In addition to what the other Marks have said, I have recently encountered 
similar blocking here.  However, it was not a Windows-triggered problem, but 
rather a quarantine that Symantec Endpoint Protection and Norton products 
asserted.  I have solved the problem within the company through corporate 
white-listing, but for usage outside of the company I believe that code-signing 
is the only reliable solution.  I am leaving the company for a new position, 
but that is the advisory I am leaving behind.

Mind you, this may not be at all what is stymying use by your customers, but it 
is what hit us here.

Mark


-Original Message-
From: use-livecode-boun...@lists.runrev.com 
[mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Mark Wieder
Sent: Tuesday, February 21, 2012 4:38 PM
Subject: Re: Standalone blocked by "software restriction policy"

Mark (yikes - this is getting a bit incestuous)-



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith
Hi, I've encountered a bit of an anomaly when storing empty values into
integer fields in SQLite, and wonder if others have observed the same
behavior. If I store an empty value from a LC field into an integer field in
a database, and then subsequently read it back LC displays it as a 0. Where
this translation occurs is not 100% clear to me, but it certainly is not
desirable (0 and undefined are not the same thing). Has anyone else
encountered this?

Here's an example:

put fld "One" into tOne -- One is an empty field, so tOne is empty too
put "UPDATE test SET one=:1 where ID=" & tID into tCmd
revExecuteSQL gConnectID, tCmd, "tOne"

If the field called one in the database is defined as type int and fld "one"
on the form is empty then when I execute this:

   put "Select * FROM test where ID = " & tID into tQuery
   put revDataFromQuery(,,gConnectID,tQuery) into tRecord
   -- display the record
   put item 1 of tRecord into fld"ID"
   put item 2 of tRecord into fld"one"

I get a 0 (zero) for the value in fld "one". 

The only way I can see to get around this is to store all numeric values in
text fields because when an "empty" text field is read back its value
remains the same (ie it remains empty). I think LC is doing the translation
on integer type fields but….. I'm not 100% sure of that. 

Your thoughts? (I'm using 5.0.2 for these tests)

-- Mark

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4408942.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Standalone blocked by "software restriction policy"

2012-02-21 Thread Bob Sneidar
She needs to contact the IT department of her company and have it "unblocked". 
This is actually quite common in places where confidentiality is required. A 
rogue app can be installed by a user that compromises the security of the 
system. IT administrators will very often block unknown apps, or use software 
to do so. There is no way to get around this (or else the hackers would do it). 

Bob


On Feb 21, 2012, at 4:07 PM, AcidJazz wrote:

> We're running a large study with Canadian physicians.  They must download a
> standalone file to their computer.   The other day one of the lab assistants
> was checking the program and got the following message on her windows
> machine:
> 
> "Windows cannot open this program because it has been prevented by a
> software restriction policy contact your administrator"
> 
> 
> I've been using mostly macs these days, and can't tell you anything more
> about the circumstances surrounding this particular block, but can someone
> familiar with Windows tell me how *common* I should expect this problem to
> be?   A quick google search suggests that this error message has been around
> since Windows XP.   Assuming most people using Windows 7 these days, how
> worried should I be about our standalone getting blocked?   There's no way
> in hell that physicians are going to take the time to change their settings. 
> Heck, most aren't going to take the time to download the standalone in the
> first place.
> 
> Nuts, now I'm getting depressed.
> 
> Mark
> 
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/Standalone-blocked-by-software-restriction-policy-tp4408799p4408799.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Standalone blocked by "software restriction policy"

2012-02-21 Thread Mark Wieder
Mark (yikes - this is getting a bit incestuous)-

Tuesday, February 21, 2012, 4:07:36 PM, you wrote:

> "Windows cannot open this program because it has been prevented by a
> software restriction policy contact your administrator"

As Mark pointed out, this is a typical IT reaction to users installing
software on their own. There's nothing you can modify in your
application to change this. And probably nothing the users can do on
their own to change the local policies.

Trust Micro$oft to take the personal out of computing.

-- 
-Mark Wieder
 mwie...@ahsoftware.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Standalone blocked by "software restriction policy"

2012-02-21 Thread Terry Judd
Mark S is right - we run into this stuff all the time in our libraries and 
clinical schools/hospitals. Ask the physicians to ask their local IT support 
guys/gals to install/allow the app. If the IT types have any concerns then ask 
them to contact you directly - hopefully you'll be able to placate them.

Terry...

On 22/02/2012, at 11:15 AM, Mark Schonewille wrote:

Hi Mark,

This happens all the time, particularly in large companies, research institutes 
and schools. As the message says: you should contact an administrator and have 
the app installed by him or her.

Frankly, I think this isn't your problem. If the lab assistant wants to use 
your app, then the lab should order the admins to sort it out.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker Plugin 1.7 for LiveCode here http://qery.us/za

On 22 feb 2012, at 01:07, AcidJazz wrote:

We're running a large study with Canadian physicians.  They must download a
standalone file to their computer.   The other day one of the lab assistants
was checking the program and got the following message on her windows
machine:

"Windows cannot open this program because it has been prevented by a
software restriction policy contact your administrator"


I've been using mostly macs these days, and can't tell you anything more
about the circumstances surrounding this particular block, but can someone
familiar with Windows tell me how *common* I should expect this problem to
be?   A quick google search suggests that this error message has been around
since Windows XP.   Assuming most people using Windows 7 these days, how
worried should I be about our standalone getting blocked?   There's no way
in hell that physicians are going to take the time to change their settings.
Heck, most aren't going to take the time to download the standalone in the
first place.

Nuts, now I'm getting depressed.

Mark


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Standalone blocked by "software restriction policy"

2012-02-21 Thread Mark Schonewille
Hi Mark,

This happens all the time, particularly in large companies, research institutes 
and schools. As the message says: you should contact an administrator and have 
the app installed by him or her.

Frankly, I think this isn't your problem. If the lab assistant wants to use 
your app, then the lab should order the admins to sort it out.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker Plugin 1.7 for LiveCode here http://qery.us/za

On 22 feb 2012, at 01:07, AcidJazz wrote:

> We're running a large study with Canadian physicians.  They must download a
> standalone file to their computer.   The other day one of the lab assistants
> was checking the program and got the following message on her windows
> machine:
> 
> "Windows cannot open this program because it has been prevented by a
> software restriction policy contact your administrator"
> 
> 
> I've been using mostly macs these days, and can't tell you anything more
> about the circumstances surrounding this particular block, but can someone
> familiar with Windows tell me how *common* I should expect this problem to
> be?   A quick google search suggests that this error message has been around
> since Windows XP.   Assuming most people using Windows 7 these days, how
> worried should I be about our standalone getting blocked?   There's no way
> in hell that physicians are going to take the time to change their settings. 
> Heck, most aren't going to take the time to download the standalone in the
> first place.
> 
> Nuts, now I'm getting depressed.
> 
> Mark


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Standalone blocked by "software restriction policy"

2012-02-21 Thread AcidJazz
We're running a large study with Canadian physicians.  They must download a
standalone file to their computer.   The other day one of the lab assistants
was checking the program and got the following message on her windows
machine:

"Windows cannot open this program because it has been prevented by a
software restriction policy contact your administrator"


I've been using mostly macs these days, and can't tell you anything more
about the circumstances surrounding this particular block, but can someone
familiar with Windows tell me how *common* I should expect this problem to
be?   A quick google search suggests that this error message has been around
since Windows XP.   Assuming most people using Windows 7 these days, how
worried should I be about our standalone getting blocked?   There's no way
in hell that physicians are going to take the time to change their settings. 
Heck, most aren't going to take the time to download the standalone in the
first place.

Nuts, now I'm getting depressed.

Mark


--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Standalone-blocked-by-software-restriction-policy-tp4408799p4408799.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Visual effect problems in iOS

2012-02-21 Thread Pete
Interesting.  There's an example in the dictionary that specifically uses
"slowly" but sounds like you can't use that any longer.

At the risk of giving Ken apoplexy, you could argue that "slow" is being
used as an adjective to describe the speed property of the visual effect
command, not as an adverb to the effect.  I'm not saying I am arguing that,
just that a person could

Pete

On Tue, Feb 21, 2012 at 9:58 AM, Peter M. Brigham, MD wrote:

> Ah, another grammarhead! I love it! I've always found it interesting that
> the obsessive focus on syntax and grammar needed by programmers/coders to
> use the coding language well is rarely associated with equal attention to
> grammatical English.
>
> -- Peter
>
> Peter M. Brigham
> pmb...@gmail.com
> http://home.comcast.net/~pmbrig
>
> On Feb 21, 2012, at 12:12 PM, Ken Ray wrote:
>
> >
> > On Feb 20, 2012, at 2:26 PM, Graham Samuel wrote:
> >
> >> Having finally reviewed that page (12) I notice that the description
> doesn't apply to my case. I have not locked the screen, and am just doing a
> card-to-card transition. As I said, my very simple example works (set up a
> "flip left" visual effect, then go to a different card), but it doesn't
> work in my app. I am quite prepared to believe it's my fault but I really
> can't see what I'm doing wrong. Incidentally, locking and unlocking the
> screen as described in the document doesn't help.
> >
> > Is it possible you're using an unsupported adjective? I discovered that
> if I used "slowly" instead of "slow", the visual effect wouldn't work. The
> only supported adjectives are "very slow", "slow", "normal", "fast", and
> "very fast".
> >
> > OT: Grammar(you can stop reading here if you don't care about this)
> >
> > 
> > As someone who's kind of picky about the use of language, the fact that
> the descriptor is described in the iOS Development Release Notes as an
> *adjective* and not an *adverb* drives me crazy… you see visual effects
> originated in HyperCard, then SuperCard, and then ultimately in
> MetaCard/Revolution/LiveCode. At the beginning, the syntax allowed for both
> proper adverbs (like "slowly") as well as improper ones (like "slow"). But
> at some point along the way, Revolution/LiveCode dropped official support
> (in the documentation, that is) for proper adverbs. So where you used to be
> able to use:
> >
> >unlock screen with visual effect dissolve slowly
> >
> > you are now urged to use:
> >
> >unlock screen with visual effect dissolve slow
> >
> > The current desktop versions of LC still support proper adverbs, but the
> mobile versions don't. Personally I see that as a bad direction. Use of
> "slowly" is  the correct form, since "dissolve", "flip", etc. are all
> *verbs*, thus requiring an *adverb* to modify them. Adjectives are meant to
> modify *nouns*, which in this case is the "visual effect". So if the speeds
> were adjectives, or if for some reason the noun being modified is "visual
> effect dissolve" and not "visual effect", the syntax would end up being:
> >
> >unlock screen with slow visual effect dissolve
> >
> > However since the current syntax is to apply the modifier *after* the
> description of the effect, it means that "dissolve" is a verb, and as such
> should use an adverb. And while most of the rest of the world seems OK with
> saying things like:
> >
> >"The car moves fast"  (instead of "The car moves quickly")
> >"Your clock is running slow"  (instead of "Your clock is running
> slowly")
> >"Eat a healthy breakfast" (instead of "Eat a healthful breakfast")
> >
> > I feel that LiveCode should at least continue to support adverbs with
> visual effects on *all* platforms.
> >
> > Thank you for listening to this rant…
> >
> > :D
> > 
> >
> > Ken Ray
> > Sons of Thunder Software, Inc.
> > Email: k...@sonsothunder.com
> > Web Site: http://www.sonsothunder.com/
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>


-- 
Pete
Molly's Revenge 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Recreating a binary stack from xml text

2012-02-21 Thread Mark Wieder
Geoff Canyon Rev  writes:

> I'm looking at the docs for Eclipse and I see "safe rename." Is that what
> you're talking about? Out of curiosity does it mean that when you rename
> something, it goes through all your source files looking for references to
> that thing, and changes them?

Yes on both counts. And there's a preview mode so you can do a dry run to see
what's going to be changed.

https://www.ibm.com/developerworks/library/os-ecref/

-- 
 Mark Wieder





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Recreating a binary stack from xml text

2012-02-21 Thread Geoff Canyon Rev
Yeah, I'm not by any means saying FileMaker is perfect. It has limitations
I can't stand as well. Every environment I know does. I wish LC also had
J's unlimited ability to handle arrays, and reversible functions, and
several other features.

I also wish -- desperately -- that LC had LISP's macros. It would be so
awesome to be able to define new syntax. First class functions are a good
idea as well.

On Tue, Feb 21, 2012 at 11:48 AM, Bob Sneidar  wrote:

> One of the things that frustrated me with Filemaker is that references to
> tables were constants. You could not by script save the name of a table in
> a variable, and then reference the table by name. At the time it was
> essential to me to be able to do that, so I could set some environment
> variables at the outset depending on the company being edited, and have my
> code access the set of tables via their variable names.
>
> Also, while a graphical "code" editor may seem like a good idea at first,
> in practice it turns out to be quite a slow way of doing things.
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Geoff Canyon Rev
As Richard said, the engine is smart enough to avoid this pitfall. So no,
it's perfectly fine to say

repeat for each line x in the keys of array y

even if the list of keys is large.

On Tue, Feb 21, 2012 at 12:03 PM, Bob Sneidar  wrote:

> Repeat for each line x in the keys of array y would seem at a glance to
> have to reevaluate the keys of  each time through the loop, wouldn't
> it? You must mean you get the keys first in a variable and then use that.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Bob Sneidar
You are probably right, I imagined in my mind that when the engine parses the 
chunk, it had to already be in memory, as in a variable or array. Since the 
thing being parsed was a statement that evaluated to something, it seemed that 
the engine would have nothing in existence to parse to begin with, and would 
have to create it. I suppose then that upon evaluating the repeat for each 
statement the first time, it would create a temporary place in memory 
inaccessible to the code, which would cease to exist once the repeat loop was 
done. 

I can see other functions and commands would have to do something similar, 
evaluating a statement, as in put line (the number of lines of myvar) of myVar 
, but the value of the number of lines of myVar must cease to exist once the 
statement was evaluated. In the repeat for each loop, the value would have to 
be retained while the repeat loop ran, and then purged when it was done. It's 
odd to think like that, but the repeat for each command *might* be written this 
way. I suppose it would have to be. 

Bob
 

On Feb 21, 2012, at 12:34 PM, Richard Gaskin wrote:

> Bob Sneidar wrote:
> 
> > Repeat for each line x in the keys of array y would seem at a glance
> > to have to reevaluate the keys of  each time through the loop,
> > wouldn't it? You must mean you get the keys first in a variable and
> > then use that.
> 
> If I understand how the engine treats that, it seems that it gets the keys 
> only once up front, since anything used with "repeat for each" is considered 
> unchangeable during the repeat.
> 
> --
> Richard Gaskin
> Fourth World
> LiveCode training and consulting: http://www.fourthworld.com
> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
> LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RFC: Silly little Animate function...

2012-02-21 Thread Ken Corey

Hi All,

I now have that silly little animate function I was threatening earlier. 
I post it here for comments.  Is this done in a Livecode-style?  Are 
there CPU hogs I'm hiding in here? Can anyone spot any errors? Any 
improvements/speed-ups you can suggest?


I noticed that the regular expressions are long, and are going to wrap, 
which means they'll likely break in many email clients.  Just tape 'em 
back together.


The syntax came out pretty much as I'd hoped:

animate "long name of obj", \
  "property newvalue;[property newvalue[;...]]", \
  howLong

"property" is the name of the property of the object.

"newvalue" is the new value of the property.  It can be
an integer, a float, a percentage of current (50%), or
a color triplet (255,0,0)

"howLong" is the time to attempt to take, in milliseconds to
perform the animation.

Caveats:
1) No error/bounds/property checking happens. If you tell it to, it will 
try to set the "vanilla" property of something whether it exists or not.
2) The color changing "works" for some value of "works".  It's slowish 
because it uses regular expressions.

3) The frames per second is hard coded into animate.  Change as you like.
4) There's no hand-shaking with the world outside this function.  You 
would *not* want to try to make a game with this function.
5) It relies on the 'send' command for each frame of each animated 
object, which means it's much less efficient than it could be.


8<-
-- pAtts and pTime is only passed the first time.
-- subsequent calls only pObj is populated, all working
-- variables are stored as custom properties in pObj.
on animate pObj,pAtts,pTime
   lock screen
   local nf
   local sFramesPerSecond
   put 30 into sFramesPerSecond

   put the animating of pObj into bAnimating
   if bAnimating is empty or not bAnimating then
  -- set up animating
  -- make sure we always get at least 1 frame
  put max(trunc((sFramesPerSecond*pTime/1000)+.5),1) into nf

  set the pAtts of pObj to empty

  split pAtts by ";" and space
  set the pAtts of pObj to pAtts
  repeat for each line aKey in the keys of pAtts
 put the aKey of pObj into tVar

 put aKey&"_delta" into tKey
 if char -1 of pAtts[aKey] = "%" then
-- we were passed a percentage
put (char 1 to -2 of pAtts[aKey])/100 into tValue
set the tKey of pObj to (tValue * (the aKey of pObj) - the 
aKey of pObj)/nf

 else if aKey = "foregroundColor" or aKey = "backgroundColor" then
put 
matchText(pAtts[aKey],"([0-9\.\-]+),([0-9\.\-]+),([0-9\.\-]+)",tNRed,tNGreen,tNBlue) 
into tJunk

put the aKey of pObj into tColor
if tColor is empty then
   put 0,0,0 into tColor
end if
put 
matchText(tColor,"([0-9\.\-]+),([0-9\.\-]+),([0-9\.\-]+)",tORed,tOGreen,tOBlue) 
into tJunk

put (tNRed - tORed)/nf into tDRed
put (tNGreen - tOGreen)/nf into tDGreen
put (tNBlue - tOBlue)/nf into tDBlue
-- set the color change here...note that each channel can 
be fractional.

set the tKey of pObj to tDRed&comma&tDGreen&comma&tDBlue
 else
set the tKey of pObj to (pAtts[aKey] - the aKey of pObj)/nf
 end if

 -- Drat! floats get trunced, so we must carry them through, 
but start

 -- with the original number.
 put aKey&"_float" into tKeyFloat
 set the tKeyFloat of pObj to the aKey of pObj

 set the timeslice of pObj to pTime/nf
 set the numberOfFrames of pObj to nf
 set the curFrame of pObj to 1
  end repeat
  set the animating of pObj to true
  send "animate "&pObj to me in 1/nf milliseconds
   else
  -- we're animating, so the delta's should exist
  if the curFrame of pObj <= the numberOfFrames of pObj then
 set the curFrame of pObj to (the curFrame of pObj + 1)
 put the pAtts of pObj into pAtts
 repeat for each line aKey in the keys of pAtts
put aKey&"_delta" into tKey
put aKey&"_float" into tKeyFloat

if aKey = "foregroundColor" or aKey = "backgroundColor" then
   put the tKeyFloat of pObj into tColor
   put 
matchText(tColor,"([0-9\.\-]+),([0-9\.\-]+),([0-9\.\-]+)",tORed,tOGreen,tOBlue) 
into tJunk

   put the tKey of pObj into tColor
   put 
matchText(tColor,"([0-9\.\-]+),([0-9\.\-]+),([0-9\.\-]+)",tNRed,tNGreen,tNBlue) 
into tJunk

   put tNRed + tORed into tDRed
   put tNGreen + tOGreen into tDGreen
   put tNBlue + tOBlue into tDBlue
   set the aKey of pObj to 
trunc(tDRed)&comma&trunc(tDGreen)&comma&trunc(tDBlue)
   set the tKeyFloat of pObj to 
tDRed&comma&tDGreen&comma&tDBlue

else
   -- Drat! floats get trunced, so we must carry them throug

Re: How to use an array to solve the following...

2012-02-21 Thread Richard Gaskin

Bob Sneidar wrote:

> Repeat for each line x in the keys of array y would seem at a glance
> to have to reevaluate the keys of  each time through the loop,
> wouldn't it? You must mean you get the keys first in a variable and
> then use that.

If I understand how the engine treats that, it seems that it gets the 
keys only once up front, since anything used with "repeat for each" is 
considered unchangeable during the repeat.


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sounds in iOS

2012-02-21 Thread Ken Corey

On 21/02/2012 19:57, Graham Samuel wrote:

If you can point me at an explicit statement about this in the LC 
documentation, I'd be grateful.


Well, you could argue the point about the documentation, or you could 
look at the code that I put on my web server.  And the relevant code is 
just a few lines.


It works on the desktop, simulator and iOS device.

-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sounds in iOS

2012-02-21 Thread Graham Samuel
Hi Mark

Sorry, it wasn't clear to me that embedded sounds are outlawed, only that if 
one chooses to use an external sound file, one has to be more careful than in 
playing sounds on other platforms. The documentation is not very clear on this 
IMHO. For example, the LC Dictionary's section on "play" includes iOS as one of 
the possible platforms, whereas according to you it's only "play file" that 
will work. On Page 33 of the latest iOS notes (revision 69) "play" is discussed 
with an example which uses the term "soundFile" as a parameter, but it doesn't 
mention a ban on embedded sounds. In the section on "what doesn't work" (p16) 
there is one sentence:

• audioclips/videoclips/player functionality (use the 'play' and 'play 
video' syntax described later)

which seems to suggest that "play" will be OK. The User Guide doesn't mention 
the issue at all (see section 13). Where else am I supposed to look? I think if 
RunRev has really pulled this functionality with no intention of restoring it 
in a later release then they should be clearer about it.

If you can point me at an explicit statement about this in the LC 
documentation, I'd be grateful.

Cheers

Graham


On Tue, 21 Feb 2012 18:30:39 +0100, Mark Schonewille 
 wrote:

> Graham,
> 
> I think that's what both Ken and I tried to make clear to you. A _path_ 
> means: a path to an external file. That is the _only_ way to make it work. 
> Also, this external file _must_ be a sound file and not a stack with an 
> embedded sound. Embedded sounds don't work in iOS. This is explicitly stated 
> in the documentation.
> 
> --
> Best regards,
> 
> Mark Schonewille

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Recreating a binary stack from xml text

2012-02-21 Thread Pete
Hi Bob,
As mentioned in my original email, I don't consider detecting changes in
data part of this project.  It would be kinda like asking the tool to check
the contents of two snapshots of an SQL database that is somehow linked to
a stack.  That's not to say it's not important, just beyond the scope of
what I have in mind (if I ever do anything!).

There's definitely more issues that would have to be resolved, one of them
being what you mentioned - dynamically created/deleted objects.  Off the
top of my head, I'd say that the versioning would have to look at the base
version of such a stack (with no dynamic objects) and rely on changes in
the scripts that create/delete objects dynamically to detect changes in how
and when that is done.

Plus there's a bunch of other custom objects out there that would have to
be dealt with.  As an example, I'm just checking out the Data Tree product
which probably has its own set of issues to consider in terms of versioning.

Pete

On Tue, Feb 21, 2012 at 9:40 AM, Bob Sneidar  wrote:

> The temporary objects in a datagrid change dynamically IF data is
> reloaded. What if the developer is using a datagrid as a static list and
> needs to restore the contents? I think the solution is to bypass the
> temporary objects of a datagrid, instead saving the datagrid data in some
> fashion (see my functions for converting an array to text and back again)
> as a special case. The first time a stack is "versioned" it could present
> the dev with a list of datagrid objects and allow the dev to choose between
> versioning the contents or the structure + data.
>
> Where things are going to get really dicey is stacks that are constantly
> creating and deleting objects and groups. I am not a big fan of using
> Livecode this way, but people do, so there you are.
>



-- 
Pete
Molly's Revenge 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Omegabundle for LiveCode 2012 Released: Get the TopDeveloperAdd-ons for LiveCode

2012-02-21 Thread Lynn Fredricks
> Also, it'd be *real* handy to know what platforms those items 
> (or their
> outputs) run on.  Franklin is for Windows/Mac only, how about 
> Valentina? 
>   The ChartMaker would be useful on an iOS app I'm building, 
> as would the TM Tools, if they work there.

For Valentina ADK+, you get Linux, Mac OS X and Windows.

Franklin 3D is a port of the Irrlicht engine
(http://irrlicht.sourceforge.net/features/) to work with LiveCode, and at
the time it was ported over, the Linux implementation wasn't quite ripe. The
upside though is that you can use all of the Irrlicht compatible set up
tools available for scene creation (.irr scene files), and commands work
just like their C++ equivalents. The base examples from Irrlicht have been
ported over to LiveCode stacks.

Franklin/Irrlicht has some curious features, including accelerated 2D and
also a built in windowing system. The built in windowing doesn't really look
native but it can be useful if you are going for a full screen project.

Best regards,

Lynn Fredricks
President
Paradigma Software
http://www.paradigmasoft.com

Valentina SQL Server: The Ultra-fast, Royalty Free Database Server 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: dereference a string as a custom property...

2012-02-21 Thread Ken Corey

On 21/02/2012 18:10, Ken Corey wrote:

How do I pass the name of a custom property, and then use it in a
statement?


*sigh* open mouth, switch feet

put "testing" into tP
new grc
set the tP of it to "blue cheese"
answer "the testing of it is "&the testing of it

Note to self: at least try things a bit before posting.  Ugh.

-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Omegabundle for LiveCode 2012 Released: Get the TopDeveloperAdd-ons for LiveCode

2012-02-21 Thread Lynn Fredricks
> Seriously though, there's a *lot* of stuff here. What're the 
> licensing terms?  Is it a per-year fee, or is it a 
> buy-it-once kind of affair?

Everything is under its own license. Valentina products + Franklin 3D all
come with 12 months of updates. I can't speak for the other vendors but this
is a pretty generous crowd.

Best regards,

Lynn Fredricks
President
Paradigma Software
http://www.paradigmasoft.com

Valentina SQL Server: The Ultra-fast, Royalty Free Database Server 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Omegabundle for LiveCode 2012 Released: Get the TopDeveloperAdd-ons for LiveCode

2012-02-21 Thread Lynn Fredricks
> does this mean you need to have a beard to get your  products 
> included in the Omega bundle? Or are developers w/o beards 
> also welcome?  ;)

Non-beards on a probationary basis, though Gandalf-class eyebrows or
moustaches will cut weeks off of probation :-)>

Best regards,

Lynn Fredricks
President
Paradigma Software
http://www.paradigmasoft.com

Valentina SQL Server: The Ultra-fast, Royalty Free Database Server 



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Bob Sneidar
Take for example retrieving a large data set from an SQL db. You can retrieve 
it as a cursor, and array or a string. Cursors are read only and I don't see 
the advantage of working with them. That leaves only arrays and strings. So if 
you *can* get the data as an array, and sorting is not an issue, I'd say use an 
array. If the data you are working with can only be gotten as a string, such as 
a web query, then you gain nothing parsing it into an array first. 

Bob


On Feb 21, 2012, at 8:48 AM, Richard Gaskin wrote:

> Pete wrote:
>> Interesting, and it kinda makes sense.  For elements, there's no
>> positioning required like with lines/words/item, just a case of cycling
>> through the keys - which is what "repeat for each line  in the keys of
>>  does I suppose.
> 
> As with most things in computing, the truly optimal solution comes with a lot 
> of "depends"; total date size, size of elements, distance from the start of a 
> chunk to the value being obtained in it, how deeply nested are the array keys 
> - all those and more play a role in total performance, which can sometimes 
> yield unexpected results.
> 
> One challenge with arrays is their use in CGIs, where total throughput 
> performance is unusually critical since the app is born, lives, and dies all 
> in the space of satisfying a single request from the user.
> 
> The problem with arrays in that context is that they don't exist with the 
> routine begins, since the engine itself needs to be loaded.
> 
> Arrays offer blinding speed for random access, but they're able to do this 
> because they rely on memory-specific structures, leaving us with the 
> question:  how do we load the array from a cold start?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


dereference a string as a custom property...

2012-02-21 Thread Ken Corey

Hi All,

I'm making a silly little animate function for my app.

Let's say I have a grc "new".  I'd like to be able to animate it like this:

animate (the long name of grc "new", "loc 100,50;width 40%;height 
50%;foregroundColor 255,0,0",200)


How do I pass the name of a custom property, and then use it in a statement?

So, the intent of the function should be pretty clear:
Assuming n frames per second, we have nf = n*200/1000 frames to play with.
Each attribute should change 1/nf between the start value and the end value.

I'm making this up as I go, but something like the code below. Can 
anyone point out how to dereference the name of a custom property just 
after the asterisks?


-- pAtts and pTime is only passed the first time
on animate pObj,pAtts,pTime
  if the animating of pObj is false then
-- set up animating
-- make sure we always get at least 1 frame
put max(n*pTime/1000,1) into nf

split pAtts by ";" and space
set the pAtts of pObj to pAtts
repeat for each line aKey in the keys of pAtts
  -- this next line is where I'm stuck...how do I use
  -- the value of 'aKey' as the name of the custom prop
  -- instead of setting the custom prop name to be "aKey_delta"
  -- below? ***
  set the aKey&"_delta" of pObj to (-)/nf
  set the timeslice of pObj to 1/nf
  set the numberOfFrames of pObj to nf
  set the curFrame of pObj to 1
end repeat
set the animating of pObj to true
send "animate "&pObj to me in 1/nf milliseconds
  else
-- we're animating, so the delta's should exist
if the curFrame of pObj < the numberOfFrames of pObj then
  set the curFrame of pObj to (the curFrame of pObj + 1)
  put the pAtts of pObj into pAtts
  repeat for each line of the keys of pAtts
-- do the math to modify the attributes by deltas
  end repeat
  send "animate "&pObj to me in 1/nf milliseconds
end if
  end if
end animate

Thanks!

-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Bob Sneidar
Even with repeat for each line, the chunk has to be parsed in memory for 
returns before proceeding. An array is by nature already parsed. As has been 
discussed before, the repeat for each command is so fast because it parses the 
memory used by the chunk, creating a list of pointers (forgive me if that is 
the wrong word) to the delimiters. It only has to do this once, as opposed to 
each time through the loop which is what makes it so fast. An array is already 
parsed, although the engine may reparse it for the purposes of the command, I 
do not know. 

Repeat for each line x in the keys of array y would seem at a glance to have to 
reevaluate the keys of  each time through the loop, wouldn't it? You 
must mean you get the keys first in a variable and then use that. 

Bob


On Feb 20, 2012, at 6:54 PM, Pete wrote:

> Interesting, and it kinda makes sense.  For elements, there's no
> positioning required like with lines/words/item, just a case of cycling
> through the keys - which is what "repeat for each line  in the keys of
>  does I suppose.
> Pete
> 
> On Mon, Feb 20, 2012 at 6:20 PM, Geoff Canyon Rev 
> wrote:
> 
>> Certainly correct, but there is not the tremendous performance advantage to
>> using "for each element in..." For items, lines, and words, using
>> "item/line/word of myContainer" gets worse the larger the container is. For
>> character and with arrays, it doesn't. In my quick testing here, there's
>> just about no performance advantage to doing repeat for each element.
>> There's about a 4x benefit for using "repeat for each char" over "repeat
>> with i = 1 to length(myString)" But note that it seems to be 4x regardless
>> of the string length. That isn't the case with items, lines, and words --
>> there, the longer your container, the more you'll suffer.
>> 
>> 
>> On Mon, Feb 20, 2012 at 3:02 PM, Bob Sneidar  wrote:
>> 
>>> Also each element in 
>>> 
>>> Bob
>>> 
>>> 
>>> On Feb 20, 2012, at 10:34 AM, gcanyon+rev wrote:
>>> 
 any time you find yourself writing:
 
 repeat with i = 1 to the number of lines|words|items of someContainer
 
 stop. Rewrite it as:
 
 repeat for each line|word|item in someContainer
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
> 
> 
> -- 
> Pete
> Molly's Revenge 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Visual effect problems in iOS

2012-02-21 Thread Peter M. Brigham, MD
Ah, another grammarhead! I love it! I've always found it interesting that the 
obsessive focus on syntax and grammar needed by programmers/coders to use the 
coding language well is rarely associated with equal attention to grammatical 
English.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Feb 21, 2012, at 12:12 PM, Ken Ray wrote:

> 
> On Feb 20, 2012, at 2:26 PM, Graham Samuel wrote:
> 
>> Having finally reviewed that page (12) I notice that the description doesn't 
>> apply to my case. I have not locked the screen, and am just doing a 
>> card-to-card transition. As I said, my very simple example works (set up a 
>> "flip left" visual effect, then go to a different card), but it doesn't work 
>> in my app. I am quite prepared to believe it's my fault but I really can't 
>> see what I'm doing wrong. Incidentally, locking and unlocking the screen as 
>> described in the document doesn't help.
> 
> Is it possible you're using an unsupported adjective? I discovered that if I 
> used "slowly" instead of "slow", the visual effect wouldn't work. The only 
> supported adjectives are "very slow", "slow", "normal", "fast", and "very 
> fast". 
> 
> OT: Grammar(you can stop reading here if you don't care about this)
> 
> 
> As someone who's kind of picky about the use of language, the fact that the 
> descriptor is described in the iOS Development Release Notes as an 
> *adjective* and not an *adverb* drives me crazy… you see visual effects 
> originated in HyperCard, then SuperCard, and then ultimately in 
> MetaCard/Revolution/LiveCode. At the beginning, the syntax allowed for both 
> proper adverbs (like "slowly") as well as improper ones (like "slow"). But at 
> some point along the way, Revolution/LiveCode dropped official support (in 
> the documentation, that is) for proper adverbs. So where you used to be able 
> to use:
> 
>unlock screen with visual effect dissolve slowly
> 
> you are now urged to use:
> 
>unlock screen with visual effect dissolve slow
> 
> The current desktop versions of LC still support proper adverbs, but the 
> mobile versions don't. Personally I see that as a bad direction. Use of 
> "slowly" is  the correct form, since "dissolve", "flip", etc. are all 
> *verbs*, thus requiring an *adverb* to modify them. Adjectives are meant to 
> modify *nouns*, which in this case is the "visual effect". So if the speeds 
> were adjectives, or if for some reason the noun being modified is "visual 
> effect dissolve" and not "visual effect", the syntax would end up being:
> 
>unlock screen with slow visual effect dissolve
> 
> However since the current syntax is to apply the modifier *after* the 
> description of the effect, it means that "dissolve" is a verb, and as such 
> should use an adverb. And while most of the rest of the world seems OK with 
> saying things like:
> 
>"The car moves fast"  (instead of "The car moves quickly")
>"Your clock is running slow"  (instead of "Your clock is running slowly")
>"Eat a healthy breakfast" (instead of "Eat a healthful breakfast")
> 
> I feel that LiveCode should at least continue to support adverbs with visual 
> effects on *all* platforms.
> 
> Thank you for listening to this rant…
> 
> :D
> 
> 
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: k...@sonsothunder.com
> Web Site: http://www.sonsothunder.com/
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using DropBox for Faster Mobile Development

2012-02-21 Thread Bob Sneidar
I see it differently. The same command with essentially the same data (except 
for the one trailing cr) returns different results. The FILTER command works 
with lines. It doesn't know from squat whether or not the developer meant to 
"terminate" or "delimit" and simply forgot to "terminate" the last line. In 
fact I am not even sure I understand the distinction. In this context 
"terminate" and "delimit" mean the same thing. There is no termination in LC 
that I know of. 

Bob


On Feb 21, 2012, at 7:14 AM, Ben Rubinstein wrote:

> On 21/02/2012 00:11, Bob Sneidar wrote:
>> That is possible. The craziness is that the trailing cr affects the result 
>> even if the filtered text does not include the last line of the list. If 
>> there is a trailing cr, then the result will end with a cr no matter WHICH 
>> lines end up in the filtered text. If there isn't, then the result will NOT 
>> contain the trailing cr. That cannot be the desired behavior. Anyway, I have 
>> submitted a QCC on it, but it's too low a level for anyone to worry about I 
>> suspect.
> 
> That doesn't seem unreasonable to me.
> 
> If you have a list in which the format is that every line including the last 
> has a terminating return, then filter honours that format in the list it 
> returns, regardless of which lines were in- or excluded.  If you have a list 
> in which the format is returns delimiting between lines, rather than 
> terminating each line, then filter honours that.
> 
> I'd read it as a feature.
> 
> Ben
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: iPhone audio calls

2012-02-21 Thread Bob Sneidar
Yes create a command that does the same thing. have it check the environment 
first. Now you have a one liner you can call in your code. The principle 
applies to ALL programming: If you use a bit of code repeatedly, create a 
command or function for it. 

Bob


On Feb 21, 2012, at 3:49 AM, Richard MacLemale wrote:

> In our latest app (which is for iOS) we use a lot of iphone audio calls to 
> set volume channels and play sounds, like:
> 
> iPhoneSetSoundChannelVolume "Ch_1","80"
> 
> and so on.  The annoying thing is that since the Mac doesn't understand those 
> commands, you get nonstop errors in the development environment unless you do 
> something like:
> 
> if the environment is "mobile" then
>   iPhoneSetSoundChannelVolume "Ch_1","80"
> end if
> 
> This gets tedious when you have dozens of audio calls throughout an app.  
> Does anyone have a more clever way to do this?  Now that our latest app is 
> practically done, I don't feel like rewriting all of those calls, but next 
> time I'm thinking maybe I write a handler for it like:
> 
> on callAudio daSound daChannel
>   if the environment is "mobile" then
>  iPhonePlaySoundOnChannel daSound, daChannel, "now"
>   else
>  -- do nothing
>   end if
> end callAudio
> 
> Is that the best method, or would there be a better way?  It's a small thing 
> but it would be nice if LiveCode just ignored these calls or something...
> 
> ---
> Richard MacLemale
> Music = http://www.richardmac.com
> Programming = http://www.macandchee.se
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Recreating a binary stack from xml text

2012-02-21 Thread Bob Sneidar
One of the things that frustrated me with Filemaker is that references to 
tables were constants. You could not by script save the name of a table in a 
variable, and then reference the table by name. At the time it was essential to 
me to be able to do that, so I could set some environment variables at the 
outset depending on the company being edited, and have my code access the set 
of tables via their variable names. 

Also, while a graphical "code" editor may seem like a good idea at first, in 
practice it turns out to be quite a slow way of doing things.  

Bob

On Feb 20, 2012, at 10:54 PM, Geoff Canyon Rev wrote:

> I'm looking at the docs for Eclipse and I see "safe rename." Is that what
> you're talking about? Out of curiosity does it mean that when you rename
> something, it goes through all your source files looking for references to
> that thing, and changes them?
> 
> I understand that this is nitpicking, but I think FileMaker does something
> more robust. At least I think it does, I could be wrong. When FileMaker
> stores your script, it stores within it any references to tables, columns,
> scripts, etc., by some underlying id, not by name. Then, when it is time to
> display the script to you in the editor, it re-constitutes the names at
> that point. In any case, there is only the one tool for renaming things,
> and it always does the right thing.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Recreating a binary stack from xml text

2012-02-21 Thread Bob Sneidar
As I have said before, they are the blocks in the "constructor set" or "prefab 
building kit" if you will. They are a part of the IDE, and I think LC was 
written in Objective C (If I am not totally mistaken). 

Bob


On Feb 20, 2012, at 9:30 PM, Michael Chean wrote:

> Thanks this conversation has been very interesting, though a lot of it is
> above my head.  I didn't realize that
> there were scripts and objects.  I just assumed that the objects were
> canned scripted objects, with only
> the various properties exposed.   What are they written in then?
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Visual effect problems in iOS

2012-02-21 Thread Graham Samuel
Thanks Chris

I am embarrassed to say that my card-to-card effects are now working! I had a 
completely repeatable recipe to show they won't working yesterday, but a 
restart of my machine and a test immediately afterwards (both on the simulator 
and the iPad itself) showed the effects working fine. Since I hadn't changed 
the code of my app between the two tests, I can only think that I somehow 
messed up the IDE with other stuff I did in the previous sessions. If I find 
out exactly how to cause the problem, I will report it. Meanwhile thanks for 
the advice. 

Right now I no longer want to do stack-to-stack transitions, but your advice on 
this will be stored away in the scrapbook for later use.

Graham
Back to the next problem - embedded sounds.

On Tue, 21 Feb 2012 08:37:14 -0700, Chris Sheffield wrote:

> Graham,
> 
> Not sure if you've ever found a solution for this problem, but I've got a 
> couple other suggestions that may help.
> 
> First, if you're simply issuing a command like:
> 
>   visual effect "whatever"
>   go cd "someCard"
> 
> then this should work just fine. I've found that if something like this is 
> not working, it's usually because I have some kind of error that's occurring 
> in the script (usually preOpenCard) of the card I'm trying to go to. Nothing 
> to do in this case but debug and try to figure out what's going on. With that 
> said, I have actually found, and I believe others have as well, that you get 
> a very slight performance boost if you use the "lock screen for visual 
> effect" command instead of the above method. So something like:
> 
>   lock screen for visual effect
>   go cd "someCard"
>   unlock screen with visual effect "whatever"
> 
> So you might give that a try and see what happens. As I said, it's not 
> necessary to do it this way, and the first method should work just fine.
> 
> If I remember correctly, your original post also mentioned using a visual 
> effect when moving to different stacks. If not, disregard the following. I've 
> found a way that works well for me. There are probably others. I was also 
> having issues with this at one point, and I found this worked just fine. 
> Something like:
> 
>   visual effect "whatever"
>   go cd "someCard" of stack "theToStack"
>   close stack "theFromStack"
> 
> It seems to be necessary to specify a card, even if there's only one, when 
> using the go command, otherwise the visual effect doesn't happen. And the 
> same goes for the close stack command. It's supposedly not necessary to do 
> that, as in iOS only one stack is open at a time, but, once again, I found 
> that the effect did not work correctly if I didn't issue that command.
> 
> Hope some of this helps. Once again, if you find that visual effects are not 
> happening like they should, but the code is correct and you *are* moving to 
> the desired card, most likely it's a script error somewhere.
> 
> Chris
> 
> 
> --
> Chris Sheffield
> Read Naturally, Inc.
> www.readnaturally.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Recreating a binary stack from xml text

2012-02-21 Thread Bob Sneidar

On Feb 20, 2012, at 8:45 PM, Pete wrote:

> As for datagrids, the controls that are permanent fixtures of a datagrid
> are easily identifiable, the rest should not be considered in this scheme
> since they change dynamically every time data is loaded into a datagrid,
> not when the datagird structure changes.  The job of a version comparison
> tool is to detect permanent structural changes, not temporal or data
> storage changes.  The properties of the datagrid itself and the properties
> of the controls in it's template are all that matters since the latter form
> the basis for any temporary controls that are created in the datagrid.

The temporary objects in a datagrid change dynamically IF data is reloaded. 
What if the developer is using a datagrid as a static list and needs to restore 
the contents? I think the solution is to bypass the temporary objects of a 
datagrid, instead saving the datagrid data in some fashion (see my functions 
for converting an array to text and back again) as a special case. The first 
time a stack is "versioned" it could present the dev with a list of datagrid 
objects and allow the dev to choose between versioning the contents or the 
structure + data. 

Where things are going to get really dicey is stacks that are constantly 
creating and deleting objects and groups. I am not a big fan of using Livecode 
this way, but people do, so there you are. 

Bob
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sounds in iOS

2012-02-21 Thread Mark Schonewille
Graham,

I think that's what both Ken and I tried to make clear to you. A _path_ means: 
a path to an external file. That is the _only_ way to make it work. Also, this 
external file _must_ be a sound file and not a stack with an embedded sound. 
Embedded sounds don't work in iOS. This is explicitly stated in the 
documentation.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker Plugin 1.7 for LiveCode here http://qery.us/za

On 21 feb 2012, at 18:25, Graham Samuel wrote:

> Thanks to Mark and Ken for interesting insights. I am beginning to think that 
> embedded sounds within stacks don't work in iOS, even if one does respect 
> case sensitivity. I am going to do some more tests, but basically I found 
> that Ken's method (using an external file) works for me, but despite being 
> very careful about case sensitivity, I can't get the embedded sounds to work. 
> This is a bummer, because in my experience, the first time you play a sound 
> from a file you get a delay, and all my sounds are supposed to coincide with 
> short events that the user sees on the screen (think some kind of crash). I 
> suppose there may be a method of pre-loading sounds - I may have to search 
> for one.
> 
> Has anyone got embedded sounds (the audioclips attached to stacks, that have 
> always worked in the desktop versions of LC) to work on iOS?
> 
> TIA
> 
> Graham


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sounds in iOS

2012-02-21 Thread Graham Samuel
Thanks to Mark and Ken for interesting insights. I am beginning to think that 
embedded sounds within stacks don't work in iOS, even if one does respect case 
sensitivity. I am going to do some more tests, but basically I found that Ken's 
method (using an external file) works for me, but despite being very careful 
about case sensitivity, I can't get the embedded sounds to work. This is a 
bummer, because in my experience, the first time you play a sound from a file 
you get a delay, and all my sounds are supposed to coincide with short events 
that the user sees on the screen (think some kind of crash). I suppose there 
may be a method of pre-loading sounds - I may have to search for one.

Has anyone got embedded sounds (the audioclips attached to stacks, that have 
always worked in the desktop versions of LC) to work on iOS?

TIA

Graham

On Mon, 20 Feb 2012 23:12:51 +0100, Mark Schonewille 
 wrote:

> Graham,
> 
> The full path is not the full path to some sound object in a stack but the 
> full path to the file on disk. For example specialfolderpath("engine") & 
> slash & "sounds" & slash & "Xylo.aif"
> 
> I think that file paths on the iPhone are case sensitive. I'm not entirely 
> sure whether this also applies to LiveCode scripts but I always take case 
> sensitivity into account.
> 
> --
> Best regards,
> 
> Mark Schonewille

On Tue, 21 Feb 2012 08:08:33 +,  Ken Corey  wrote:

> Hi Graham,
> 
> I found it a bit difficult as well.  Keep in mind I've only just started 
> with LiveCode, so there's bound to be some wrong information here.
> 
> Take a look at this stack:
> http://its.ec/static/iossounddemo.zip (158k)
> 
> The keys that I needed were:
> 1) Put sounds into a sub folder of my project
> 2) Ensure that in the Copy Files tab, the subdirectory is included.
> 3) Make the files .caf files (make .aiff files, and rename them to .caf)
> 4) Use the rootPath function given so the files work in both the IDE and 
> iOS device.
> 
> Hope this helps.
> 
> -Ken
> 
Previously, I wrote:

>> I haven't had much luck on my iOS iPad app with waiting until a sound is 
>> done (RR have just said I found a bug), but ignoring this issue I can't get 
>> a really simple 'play' statement to work. I have a button
>> 
>> play "Xylo.AIF"
> 
and 
> 
>> I haven't had much luck on my iOS iPad app with waiting until a sound is 
>> done (RR have just said I found a bug), but ignoring this issue I can't get 
>> a really simple 'play' statement to work. I have a button
>> 
>> play "Xylo.AIF"
>> 
>> which works in the IDE but not in the simulator. In case it was a path 
>> problem, I added a line that sets the defaultStack to the stack where the 
>> sounds are stored (this is not the stack where the button is); this makes no 
>> difference in the IDE but it still doesn't work in the simulator. I then 
>> used the full name of the file which is actually
>> 
>> audioclip "Xylo.AIF"
>> 
>> with the same result. Changing the playLoudness didn't do anything either.
>> 
>> I read somewhere (but can't find it) that for iOS one needs a full path to 
>> the sound, but I don't know what the full path of an embedded sound would 
>> look like.
>> 
>> Has anyone got iOS sounds to work in 5.0.2?
>> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Visual effect problems in iOS

2012-02-21 Thread Michael Doub
Let me join you on the soapbox.   I agree with you that support for all 
platforms should be the same.   I am less of an language purest, but I am happy 
to support you.

-= Mike


On 02/21/2012, at 12:12 PM, Ken Ray wrote:

> 
> On Feb 20, 2012, at 2:26 PM, Graham Samuel wrote:
> 
>> Having finally reviewed that page (12) I notice that the description doesn't 
>> apply to my case. I have not locked the screen, and am just doing a 
>> card-to-card transition. As I said, my very simple example works (set up a 
>> "flip left" visual effect, then go to a different card), but it doesn't work 
>> in my app. I am quite prepared to believe it's my fault but I really can't 
>> see what I'm doing wrong. Incidentally, locking and unlocking the screen as 
>> described in the document doesn't help.
> 
> Is it possible you're using an unsupported adjective? I discovered that if I 
> used "slowly" instead of "slow", the visual effect wouldn't work. The only 
> supported adjectives are "very slow", "slow", "normal", "fast", and "very 
> fast". 
> 
> OT: Grammar(you can stop reading here if you don't care about this)
> 
> 
> As someone who's kind of picky about the use of language, the fact that the 
> descriptor is described in the iOS Development Release Notes as an 
> *adjective* and not an *adverb* drives me crazy… you see visual effects 
> originated in HyperCard, then SuperCard, and then ultimately in 
> MetaCard/Revolution/LiveCode. At the beginning, the syntax allowed for both 
> proper adverbs (like "slowly") as well as improper ones (like "slow"). But at 
> some point along the way, Revolution/LiveCode dropped official support (in 
> the documentation, that is) for proper adverbs. So where you used to be able 
> to use:
> 
>unlock screen with visual effect dissolve slowly
> 
> you are now urged to use:
> 
>unlock screen with visual effect dissolve slow
> 
> The current desktop versions of LC still support proper adverbs, but the 
> mobile versions don't. Personally I see that as a bad direction. Use of 
> "slowly" is  the correct form, since "dissolve", "flip", etc. are all 
> *verbs*, thus requiring an *adverb* to modify them. Adjectives are meant to 
> modify *nouns*, which in this case is the "visual effect". So if the speeds 
> were adjectives, or if for some reason the noun being modified is "visual 
> effect dissolve" and not "visual effect", the syntax would end up being:
> 
>unlock screen with slow visual effect dissolve
> 
> However since the current syntax is to apply the modifier *after* the 
> description of the effect, it means that "dissolve" is a verb, and as such 
> should use an adverb. And while most of the rest of the world seems OK with 
> saying things like:
> 
>"The car moves fast"  (instead of "The car moves quickly")
>"Your clock is running slow"  (instead of "Your clock is running slowly")
>"Eat a healthy breakfast" (instead of "Eat a healthful breakfast")
> 
> I feel that LiveCode should at least continue to support adverbs with visual 
> effects on *all* platforms.
> 
> Thank you for listening to this rant…
> 
> :D
> 
> 
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: k...@sonsothunder.com
> Web Site: http://www.sonsothunder.com/
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Omegabundle for LiveCode 2012 Released: Get the Top DeveloperAdd-ons for LiveCode

2012-02-21 Thread Ken Corey

On 21/02/2012 17:09, Ken Corey wrote:

Seriously though, there's a *lot* of stuff here. What're the licensing
terms? Is it a per-year fee, or is it a buy-it-once kind of affair?


Also, it'd be *real* handy to know what platforms those items (or their 
outputs) run on.  Franklin is for Windows/Mac only, how about Valentina? 
 The ChartMaker would be useful on an iOS app I'm building, as would 
the TM Tools, if they work there.


-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Visual effect problems in iOS

2012-02-21 Thread Ken Ray

On Feb 20, 2012, at 2:26 PM, Graham Samuel wrote:

> Having finally reviewed that page (12) I notice that the description doesn't 
> apply to my case. I have not locked the screen, and am just doing a 
> card-to-card transition. As I said, my very simple example works (set up a 
> "flip left" visual effect, then go to a different card), but it doesn't work 
> in my app. I am quite prepared to believe it's my fault but I really can't 
> see what I'm doing wrong. Incidentally, locking and unlocking the screen as 
> described in the document doesn't help.

Is it possible you're using an unsupported adjective? I discovered that if I 
used "slowly" instead of "slow", the visual effect wouldn't work. The only 
supported adjectives are "very slow", "slow", "normal", "fast", and "very 
fast". 

OT: Grammar(you can stop reading here if you don't care about this)


As someone who's kind of picky about the use of language, the fact that the 
descriptor is described in the iOS Development Release Notes as an *adjective* 
and not an *adverb* drives me crazy… you see visual effects originated in 
HyperCard, then SuperCard, and then ultimately in MetaCard/Revolution/LiveCode. 
At the beginning, the syntax allowed for both proper adverbs (like "slowly") as 
well as improper ones (like "slow"). But at some point along the way, 
Revolution/LiveCode dropped official support (in the documentation, that is) 
for proper adverbs. So where you used to be able to use:

unlock screen with visual effect dissolve slowly

you are now urged to use:

unlock screen with visual effect dissolve slow

The current desktop versions of LC still support proper adverbs, but the mobile 
versions don't. Personally I see that as a bad direction. Use of "slowly" is  
the correct form, since "dissolve", "flip", etc. are all *verbs*, thus 
requiring an *adverb* to modify them. Adjectives are meant to modify *nouns*, 
which in this case is the "visual effect". So if the speeds were adjectives, or 
if for some reason the noun being modified is "visual effect dissolve" and not 
"visual effect", the syntax would end up being:

unlock screen with slow visual effect dissolve

However since the current syntax is to apply the modifier *after* the 
description of the effect, it means that "dissolve" is a verb, and as such 
should use an adverb. And while most of the rest of the world seems OK with 
saying things like:

"The car moves fast"  (instead of "The car moves quickly")
"Your clock is running slow"  (instead of "Your clock is running slowly")
"Eat a healthy breakfast" (instead of "Eat a healthful breakfast")

I feel that LiveCode should at least continue to support adverbs with visual 
effects on *all* platforms.

Thank you for listening to this rant…

:D


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/  

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Omegabundle for LiveCode 2012 Released: Get the Top DeveloperAdd-ons for LiveCode

2012-02-21 Thread Ken Corey

On 21/02/2012 16:52, Matthias Rebbe wrote:

does this mean you need to have a beard to get your  products
included in the Omega bundle? Or are developers w/o beards also welcome?  ;)


Sure, you're welcome, but apparently you must leave your spell checker 
at home: "tmGuage"


*cheeky grin*

Seriously though, there's a *lot* of stuff here. What're the licensing 
terms?  Is it a per-year fee, or is it a buy-it-once kind of affair?


-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Recreating a binary stack from xml text

2012-02-21 Thread Bob Sneidar
Well I have made good use of the find dialog. I tried to do a search using all 
other to find something in a property (not sure if that would do it) and LC 
locked up most of the way through the search. I waited a minute or two and it 
didn't move so I was forced to force quit. A search specifically for properties 
and/or their contents would be nice. (Except that you can put a STACK in a 
property and how would you search that??)

Bob


On Feb 20, 2012, at 6:38 PM, Mark Wieder wrote:

> Geoff-
> 
> Monday, February 20, 2012, 6:03:20 PM, you wrote:
> 
>> For FileMaker, it's the easy database, but equally important, it's the fact
>> that all items -- scripts, layouts, columns, tables, etc. -- are abstracted
>> from their names. In FileMaker, if you change the name of a table, then
>> everywhere in any script that refers to that table, the script changes
>> automatically to match. Change a layout name, same thing. That's something
>> I wish every environment I use could have. Given that FileMaker has had
>> this since at least 1994 or so, it's frustrating that no one else has
>> picked it up. It's one of those things that seems obvious once you've
>> experienced it 
> 
> Both Visual Studio and Eclipse support that for refactoring. And yes,
> I miss it here.
> 
> -- 
> -Mark Wieder
> mwie...@ahsoftware.net
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Omegabundle for LiveCode 2012 Released: Get the Top DeveloperAdd-ons for LiveCode

2012-02-21 Thread Klaus on-rev
Hi Matthias,

Am 21.02.2012 um 17:52 schrieb Matthias Rebbe:

> Hm,
> 
> does this mean you need to have a beard to get your  products 
> included in the Omega bundle? Or are developers w/o beards also welcome?  ;)

I think it is completely sufficient if you just don't shave for at least a day 
to get the bundle :-D

> Matthias

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Omegabundle for LiveCode 2012 Released: Get the Top DeveloperAdd-ons for LiveCode

2012-02-21 Thread Matthias Rebbe
Hm,

does this mean you need to have a beard to get your  products 
included in the Omega bundle? Or are developers w/o beards also welcome?  ;)

Matthias

Am 21.02.2012 um 15:54 schrieb Lynn Fredricks:

>> Does tm tools get mentioned twice because it's twice as good 
>> as the rest?
> 
> Scott's beard makes its own demands, separate from Scott.
> 
> tm|tools gets an addition this year, too - tm|control basic. It's a worthy
> new addition. This is also the first year for Ah Software among us, and
> Mark's very fine PowerDebug. 
> 
> Though significantly larger, Mark's beard did not have any additional
> requirements ;-)
> 
> Best regards,
> 
> Lynn Fredricks
> President
> Paradigma Software
> http://www.paradigmasoft.com
> 
> Valentina SQL Server: The Ultra-fast, Royalty Free Database Server 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Richard Gaskin

Pete wrote:

Interesting, and it kinda makes sense.  For elements, there's no
positioning required like with lines/words/item, just a case of cycling
through the keys - which is what "repeat for each line  in the keys of
 does I suppose.


As with most things in computing, the truly optimal solution comes with 
a lot of "depends"; total date size, size of elements, distance from the 
start of a chunk to the value being obtained in it, how deeply nested 
are the array keys - all those and more play a role in total 
performance, which can sometimes yield unexpected results.


One challenge with arrays is their use in CGIs, where total throughput 
performance is unusually critical since the app is born, lives, and dies 
all in the space of satisfying a single request from the user.


The problem with arrays in that context is that they don't exist with 
the routine begins, since the engine itself needs to be loaded.


Arrays offer blinding speed for random access, but they're able to do 
this because they rely on memory-specific structures, leaving us with 
the question:  how do we load the array from a cold start?


One can use custom properties, or arrayEncode/arrayDecode, or 
split/combine, but all of them are only slightly optimized versions of 
what you'd need to do if you had to script it yourself using "repeat for 
each line..." and stuffing the array elements sequentially.


So oddly enough, if the context of use requires that you take into 
account the loading of the array, total throughput will often be 
substantially slower than scooping up a delimited file and using chunk 
expressions on it.


Even outside of a total-throughput context, I've seen other cases where 
arrays can be slower than "repeat for each", such as deeply-nested 
arrays (say, four levels deep).  In such cases, while each traversal of 
the hash used to identify the location of the element value is pretty 
darn fast, you'll have to do four traversals of each hash to get at each 
element, and that can add up.


Moreover, arrays can impact memory in ways that chunks don't, because in 
a world where we don't yet have structs (see 
), element labels are 
replicated for every key.  With a tab-delimited list the non-data 
overhead is one char per field, but with arrays it's the length of the 
key for every field, which can double the size of the data in memory if 
the keys are as long as the data.


So alas, as you folks have done here, many times the only way to know 
for sure what an optimal solution will be is to test it.


If you find yourself doing this sort of thing often, I've put together a 
few tips on benchmarking performance in this LiveCode Journal article:




--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Visual effect problems in iOS

2012-02-21 Thread Chris Sheffield
Graham,

Not sure if you've ever found a solution for this problem, but I've got a 
couple other suggestions that may help.

First, if you're simply issuing a command like:

visual effect "whatever"
go cd "someCard"

then this should work just fine. I've found that if something like this is not 
working, it's usually because I have some kind of error that's occurring in the 
script (usually preOpenCard) of the card I'm trying to go to. Nothing to do in 
this case but debug and try to figure out what's going on. With that said, I 
have actually found, and I believe others have as well, that you get a very 
slight performance boost if you use the "lock screen for visual effect" command 
instead of the above method. So something like:

lock screen for visual effect
go cd "someCard"
unlock screen with visual effect "whatever"

So you might give that a try and see what happens. As I said, it's not 
necessary to do it this way, and the first method should work just fine.

If I remember correctly, your original post also mentioned using a visual 
effect when moving to different stacks. If not, disregard the following. I've 
found a way that works well for me. There are probably others. I was also 
having issues with this at one point, and I found this worked just fine. 
Something like:

visual effect "whatever"
go cd "someCard" of stack "theToStack"
close stack "theFromStack"

It seems to be necessary to specify a card, even if there's only one, when 
using the go command, otherwise the visual effect doesn't happen. And the same 
goes for the close stack command. It's supposedly not necessary to do that, as 
in iOS only one stack is open at a time, but, once again, I found that the 
effect did not work correctly if I didn't issue that command.

Hope some of this helps. Once again, if you find that visual effects are not 
happening like they should, but the code is correct and you *are* moving to the 
desired card, most likely it's a script error somewhere.

Chris


--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.com

On Feb 20, 2012, at 1:26 PM, Graham Samuel wrote:

> Thanks Paul, stupid of me. I seem always to be looking in the wrong place for 
> information.
> 
> Having finally reviewed that page (12) I notice that the description doesn't 
> apply to my case. I have not locked the screen, and am just doing a 
> card-to-card transition. As I said, my very simple example works (set up a 
> "flip left" visual effect, then go to a different card), but it doesn't work 
> in my app. I am quite prepared to believe it's my fault but I really can't 
> see what I'm doing wrong. Incidentally, locking and unlocking the screen as 
> described in the document doesn't help.
> 
> Thanks for the info, though.
> 
> Graham
> 
> OnMon, 20 Feb 2012 11:21:36 +, Paul Hibbert  wrote:
> 
>> Hi Graham,
>> 
>>> Thanks - I had not read these notes in detail and indeed it took some time 
>>> to find anything like them on the RunRev web site - they don't seem to have 
>>> stuck around on my Mac after installation. The only notes I could find are 
>>> called "LiveCodeNotes-5_0_0.pdf, revision 7", and there's nothing on Page 
>>> 12, so I still seem to have missed it - maybe you could tell me what it 
>>> says?
>> 
>> The notes John Dixon referred to should be under the Help menu in the 
>> LiveCode application, they are right below the 'User Guide' link.
>> 
>> If you want to access them through the finder, ctrl-click (right click) on 
>> the LiveCode application icon, choose 'Show Package Contents', then navigate 
>> to 'Contents > Tools', the release notes for LiveCode, iOS & Android are all 
>> in that folder.
>> 
>> HTH
>> 
>> Paul
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using DropBox for Faster Mobile Development

2012-02-21 Thread Ben Rubinstein

On 21/02/2012 00:11, Bob Sneidar wrote:

That is possible. The craziness is that the trailing cr affects the result even 
if the filtered text does not include the last line of the list. If there is a 
trailing cr, then the result will end with a cr no matter WHICH lines end up in 
the filtered text. If there isn't, then the result will NOT contain the 
trailing cr. That cannot be the desired behavior. Anyway, I have submitted a 
QCC on it, but it's too low a level for anyone to worry about I suspect.


That doesn't seem unreasonable to me.

If you have a list in which the format is that every line including the last 
has a terminating return, then filter honours that format in the list it 
returns, regardless of which lines were in- or excluded.  If you have a list 
in which the format is returns delimiting between lines, rather than 
terminating each line, then filter honours that.


I'd read it as a feature.

Ben



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Geoff Canyon Rev
On Tue, Feb 21, 2012 at 8:36 AM, Glen Bojsza  wrote:

> The good news is that the lists may grow as high as 1,000,000 lines and are
> as little as 30,000.
>

1,000,000 lines is pretty big. If you're guaranteed to be working on a
recent machine, then perhaps it would be okay. But that's certainly pushing
the limits of what makes sense in a repeat for each.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Geoff Canyon Rev
On Tue, Feb 21, 2012 at 3:52 AM, Kay C Lan  wrote:

>  repeat for each line L in the keys of yourArray
>   if L > 20 then
>  put L & cr after R
>  if L > 60 then
>exit repeat
> end if
>  end if
>  end repeat
>
> Don't waste cyling through lines you don't have to.
>

Agreed, if the keys are sorted. I was assuming that they were coming
straight from the keys of the array (as shown in my example) so you'd have
to test the whole thing. I'd be curious which is faster:

get the keys
sort the keys
do your script

or

get the keys
do my script

My first instinct is to say your solution, for the obvious reasons, but
I've been fooled by the near-infinite speed of repeat for each too many
times to count.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Omegabundle for LiveCode 2012 Released: Get the Top DeveloperAdd-ons for LiveCode

2012-02-21 Thread Lynn Fredricks
> Does tm tools get mentioned twice because it's twice as good 
> as the rest?

Scott's beard makes its own demands, separate from Scott.

tm|tools gets an addition this year, too - tm|control basic. It's a worthy
new addition. This is also the first year for Ah Software among us, and
Mark's very fine PowerDebug. 

Though significantly larger, Mark's beard did not have any additional
requirements ;-)

Best regards,

Lynn Fredricks
President
Paradigma Software
http://www.paradigmasoft.com

Valentina SQL Server: The Ultra-fast, Royalty Free Database Server 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Glen Bojsza
Once the final list has been made it could have up to 10 ?t columns but the
query is only for the lines identified as start and end based on the first
column which is xs.

There would be no other queries involving the data in the ?t columns the
whole line that meets the xs query is moved to a new list.

YES xs column will ALWAYS be sequential.

The good news is that the lists may grow as high as 1,000,000 lines and are
as little as 30,000.

The methods you have described are fast enough not to justify going to
sqlite (which in itself has a learning curve and adds to the stack
overhead).

thanks again.

On Tue, Feb 21, 2012 at 7:06 AM, Kay C Lan  wrote:

> On Tue, Feb 21, 2012 at 4:29 PM, Glen Bojsza  wrote:
>
> >
> > For example a user wants an starting xs value of 10 and an ending xs
> value
> > of 40 I think that if the keys are sequential (the keys being the first
> > column - xs) then it would be a fast solution using arrays since you
> should
> > be able to determine the starting line and ending line of the array
> without
> > needing to cycle through every line and then just produce a new array /
> > list. Again, is this a good use for an array?
> >
>
> Looking at your example more closely it could be possible to achieve some
> extremely fast results with arrays. But as always, if speed is really
> important to you you'd need to do some comparitive tests. As I think I've
> demonstrated it's not too hard to whip up a couple of test script to time
> solutions.
>
> Some determining factors.
>
> In a previous post you indicated that there would be 10 ?t columns. When
> you are doing your search are you after all data from every column? Then
> setting up flat data and doing repeat for each line will probably be the
> fastest. Alternatively you could create an array with the xs as the key and
> the entire line as the data.
>
> You indicate that your searches would be of sequential lines. If that is
> ALWAYS true, then repeat for each line will be very fast, if there is any
> possibility that the searches will not be of sequential lines, then some
> overhead will be introduced. Even so repeat for each line will still be
> fast. Conversely, it would be quite easy to create a list of every xs
> values from, in your example 10 to 40 and do a repeat for each to extract
> the data from an array. If there was a possibility that you didn't require
> the whole line of data, but just an ht or gt value, then this would not
> carry any overhead with an array search.
>
> On average you could get quicker results with an array but they are only
> small differences, and if your queries are less than 10s of thousands, then
> the amounts are so small they are probably unnoticeable.
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: iPhone audio calls

2012-02-21 Thread Paul Hibbert
As with most things in LiveCode there are many ways to tackle most problems, I 
haven't done any mobile development yet, but I assume the custom properties 
work the same, if so a quick fix for this could be to use a custom property 
that is set to true on preOpenStack and then check that custom property at each 
command, something like...

--Stack Script
on preOpenStack
if the environment is "mobile" then set the cMobile of this stack to "true"
end preOpenStack

on closeStack
set the cMobile of this stack to empty // avoids the stack being saved with 
the custom property set to true
end closeStack
--

then your command could be…

--Control script
if the cMobile of this stack then iPhoneSetSoundChannelVolume "Ch_1","80"
--

You could fix most of this with a find & replace for the whole stack by finding 
"iPhoneSetSoundChannelVolume" and replacing with "if the cMobile of this stack 
then iPhoneSetSoundChannelVolume"

I'm not saying this is the best approach, but it should work and is very quick 
and easy to implement or remove.

Paul


On 21 Feb 2012, at 11:49, Richard MacLemale wrote:

> In our latest app (which is for iOS) we use a lot of iphone audio calls to 
> set volume channels and play sounds, like:
> 
> iPhoneSetSoundChannelVolume "Ch_1","80"
> 
> and so on.  The annoying thing is that since the Mac doesn't understand those 
> commands, you get nonstop errors in the development environment unless you do 
> something like:
> 
> if the environment is "mobile" then
>   iPhoneSetSoundChannelVolume "Ch_1","80"
> end if
> 
> This gets tedious when you have dozens of audio calls throughout an app.  
> Does anyone have a more clever way to do this?  Now that our latest app is 
> practically done, I don't feel like rewriting all of those calls, but next 
> time I'm thinking maybe I write a handler for it like:
> 
> on callAudio daSound daChannel
>   if the environment is "mobile" then
>  iPhonePlaySoundOnChannel daSound, daChannel, "now"
>   else
>  -- do nothing
>   end if
> end callAudio
> 
> Is that the best method, or would there be a better way?  It's a small thing 
> but it would be nice if LiveCode just ignored these calls or something...
> 
> ---
> Richard MacLemale
> Music = http://www.richardmac.com
> Programming = http://www.macandchee.se
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Kay C Lan
On Tue, Feb 21, 2012 at 4:29 PM, Glen Bojsza  wrote:

>
> For example a user wants an starting xs value of 10 and an ending xs value
> of 40 I think that if the keys are sequential (the keys being the first
> column - xs) then it would be a fast solution using arrays since you should
> be able to determine the starting line and ending line of the array without
> needing to cycle through every line and then just produce a new array /
> list. Again, is this a good use for an array?
>

Looking at your example more closely it could be possible to achieve some
extremely fast results with arrays. But as always, if speed is really
important to you you'd need to do some comparitive tests. As I think I've
demonstrated it's not too hard to whip up a couple of test script to time
solutions.

Some determining factors.

In a previous post you indicated that there would be 10 ?t columns. When
you are doing your search are you after all data from every column? Then
setting up flat data and doing repeat for each line will probably be the
fastest. Alternatively you could create an array with the xs as the key and
the entire line as the data.

You indicate that your searches would be of sequential lines. If that is
ALWAYS true, then repeat for each line will be very fast, if there is any
possibility that the searches will not be of sequential lines, then some
overhead will be introduced. Even so repeat for each line will still be
fast. Conversely, it would be quite easy to create a list of every xs
values from, in your example 10 to 40 and do a repeat for each to extract
the data from an array. If there was a possibility that you didn't require
the whole line of data, but just an ht or gt value, then this would not
carry any overhead with an array search.

On average you could get quicker results with an array but they are only
small differences, and if your queries are less than 10s of thousands, then
the amounts are so small they are probably unnoticeable.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: iOS And XML Image Results Download in the Background?

2012-02-21 Thread Ken Corey
Sure, why not?  Let's assume that this is all kicked off from a button 
press:


-- I assume you have your URLs in a list

on mouseUp
  -- send in 0 milliseconds means call downloadImage as soon
  --   as this handler is done
  -- I'd create placeholder graphics where the images might
  --   go once downloaded, and then you can put them into a list
  send "downloadImage 1" to me in 0 milliseconds
end openCard

on downloadImage idx
  -- check to see if we've fallen off the end of the list.
  if idx <= the number of lines of listOfURLs then
get URL "http://blah.com/image.gif";
-- do something terribly clever to display them to the user.
-- e.g. replace the placeholder images above for item idx
--
-- queue up the next image for download
send "downloadImage "&(idx+1) to me in 0 milliseconds
  end if
end downloadImage

So, your app interface should be happily trundling along responding to 
user input, while the images are being downloaded.  Increase the '0 
milliseconds' for more responsiveness.


This assumes you want the images to come down one at a time.  You 
/could/ queue up more than one at a time by sending 'downloadImage' to 
yourself multiple times, but then you'd have to get fancier managing the 
index.


You probably don't want to issue all the sends at the same time, because 
unless you have a monster fat pipe none of them will come down at any 
rational rate of speed.


You might also want to think about caching the image somehow.  Check for 
its existance before the get, and avoid hitting the net at all. (Of 
course, that means you have to let the user clear the cache, limit the 
size to which it grows, etc.)


-Ken



On 19/02/2012 05:40, johnpat...@me.com wrote:

I'm looking to use the Flickr API search routine to return the latest
images for a specific tag. I will probably limit it to the 10 or 20 most
recent images. I can create the resulting URL to the images from the
resulting XML, and set the file name of an image to that URL, looping
through the list of images, but I'm curious as to what would be best
practice would be to download these images in the background? Ideally I
would like the user to be able to use the simulated swipe routines
between the images.

The only thing I can think of is downloading the images in the
background as soon as the iOS app is launched. Could a script like this
be launched at openStack and run in the background?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: iPhone audio calls

2012-02-21 Thread Gerry Orkin
I can't think of a better method...

g


On 21/02/2012, at 10:49 PM, Richard MacLemale wrote:

> Is that the best method, or would there be a better way?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


iPhone audio calls

2012-02-21 Thread Richard MacLemale
In our latest app (which is for iOS) we use a lot of iphone audio calls to set 
volume channels and play sounds, like:

iPhoneSetSoundChannelVolume "Ch_1","80"

and so on.  The annoying thing is that since the Mac doesn't understand those 
commands, you get nonstop errors in the development environment unless you do 
something like:

if the environment is "mobile" then
   iPhoneSetSoundChannelVolume "Ch_1","80"
end if

This gets tedious when you have dozens of audio calls throughout an app.  Does 
anyone have a more clever way to do this?  Now that our latest app is 
practically done, I don't feel like rewriting all of those calls, but next time 
I'm thinking maybe I write a handler for it like:

on callAudio daSound daChannel
   if the environment is "mobile" then
  iPhonePlaySoundOnChannel daSound, daChannel, "now"
   else
  -- do nothing
   end if
end callAudio

Is that the best method, or would there be a better way?  It's a small thing 
but it would be nice if LiveCode just ignored these calls or something...

---
Richard MacLemale
Music = http://www.richardmac.com
Programming = http://www.macandchee.se

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: iOS And XML Image Results Download in the Background?

2012-02-21 Thread Gerry Orkin
Yep, this is do-able. Have a look at this post on the forums: 
http://forums.runrev.com/viewtopic.php?f=49&t=8934&start=15#p43063 .

That's an example of an iOS app that downloads another stack from the internet 
and then goes to that stack. You have a different use case but the method of 
downloading files I use can be adapted to your purpose.

Gerry



On 19/02/2012, at 4:40 PM, johnpat...@me.com wrote:

> Hi All...
> 
> I'm looking to use the Flickr API search routine to return the latest images 
> for a specific tag. I will probably limit it to the 10 or 20 most recent 
> images. I can create the resulting URL to the images from the resulting XML, 
> and set the file name of an image to that URL, looping through the list of 
> images, but I'm curious as to what would be best practice would be to 
> download these images in the background? Ideally I would like the user to be 
> able to use the simulated swipe routines between the images.
> 
> The only thing I can think of is downloading the images in the background as 
> soon as the iOS app is launched. Could a script like this be launched at 
> openStack and run in the background?
> 
> Thank you!
> 
> John Patten
> SUSD
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: How to use an array to solve the following...

2012-02-21 Thread Glen Bojsza
Then repeat for is King in Livecode!

thanks for everyone's feedback .

On Tue, Feb 21, 2012 at 2:52 AM, Kay C Lan  wrote:

> Glen,
>
> Look at my test results more closely:
>
> Finding the 1st item of the 1st line using direct reference = 3ms
> Finding the last item of the last line using direct reference = 440294ms
> Finding the -1 item of the 1st line using direct reference = 5ms
> Finding the -1 item of the -1 line using direct reference = 733095ms
> Finding the first child of the first key = 3ms
> Finding the last child of the last key = 3ms
> Finding 1st item of 1st line using repeat for each line = 0ms
> Finding last item of last line using repeat for each line = 454ms
>
> Using direct reference is always slower than repeat for each, ESPECIALLY if
> the data is toward the end.
>
> I would amend Geoff's script to this:
>
>  repeat for each line L in the keys of yourArray
>   if L > 20 then
>  put L & cr after R
>  if L > 60 then
>exit repeat
> end if
>  end if
>  end repeat
>
> Don't waste cyling through lines you don't have to.
>
> HTH
>
> On Tue, Feb 21, 2012 at 5:37 PM, Glen Bojsza  wrote:
>
> > I was thinking more along the lines (no pun intended) of
> >
> > - find line number of starting value (for example line 578 )
> >
> > - find line line number of ending value (for example 12125)
> >
> > put lines 578 to 12125 into results
> >
> > Can this be done verses looping through each line since we know the xs
> > column is sequentially in order?
> >
> >
> >
> > On Tue, Feb 21, 2012 at 1:54 AM, Geoff Canyon Rev  > >wrote:
> >
> > > Depends on how big the list is. Unless there's a faster method than the
> > one
> > > I used (or you're using slower hardware than I am), you should be okay
> up
> > > to about 100,000 rows using something lik
> > >   repeat for each line L in the keys of yourArray
> > >  if L > 20 and L < 60 then put L & cr after R
> > >   end repeat
> > > -- 20 and 60 are your filter values,
> > > -- R is your result set
> > >
> > >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Kay C Lan
Glen,

Look at my test results more closely:

Finding the 1st item of the 1st line using direct reference = 3ms
Finding the last item of the last line using direct reference = 440294ms
Finding the -1 item of the 1st line using direct reference = 5ms
Finding the -1 item of the -1 line using direct reference = 733095ms
Finding the first child of the first key = 3ms
Finding the last child of the last key = 3ms
Finding 1st item of 1st line using repeat for each line = 0ms
Finding last item of last line using repeat for each line = 454ms

Using direct reference is always slower than repeat for each, ESPECIALLY if
the data is toward the end.

I would amend Geoff's script to this:

  repeat for each line L in the keys of yourArray
  if L > 20 then
 put L & cr after R
 if L > 60 then
exit repeat
 end if
  end if
  end repeat

Don't waste cyling through lines you don't have to.

HTH

On Tue, Feb 21, 2012 at 5:37 PM, Glen Bojsza  wrote:

> I was thinking more along the lines (no pun intended) of
>
> - find line number of starting value (for example line 578 )
>
> - find line line number of ending value (for example 12125)
>
> put lines 578 to 12125 into results
>
> Can this be done verses looping through each line since we know the xs
> column is sequentially in order?
>
>
>
> On Tue, Feb 21, 2012 at 1:54 AM, Geoff Canyon Rev  >wrote:
>
> > Depends on how big the list is. Unless there's a faster method than the
> one
> > I used (or you're using slower hardware than I am), you should be okay up
> > to about 100,000 rows using something lik
> >   repeat for each line L in the keys of yourArray
> >  if L > 20 and L < 60 then put L & cr after R
> >   end repeat
> > -- 20 and 60 are your filter values,
> > -- R is your result set
> >
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Glen Bojsza
I was thinking more along the lines (no pun intended) of

- find line number of starting value (for example line 578 )

- find line line number of ending value (for example 12125)

put lines 578 to 12125 into results

Can this be done verses looping through each line since we know the xs
column is sequentially in order?



On Tue, Feb 21, 2012 at 1:54 AM, Geoff Canyon Rev wrote:

> Depends on how big the list is. Unless there's a faster method than the one
> I used (or you're using slower hardware than I am), you should be okay up
> to about 100,000 rows using something like:
>
>   repeat for each line L in the keys of yourArray
>  if L > 20 and L < 60 then put L & cr after R
>   end repeat
> -- 20 and 60 are your filter values,
> -- R is your result set
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Kay C Lan
On Tue, Feb 21, 2012 at 4:29 PM, Glen Bojsza  wrote:

> Or will Kay prove it to be faster
> with just lists :-)
>
>
Already proven. I agree with Geoff. For the data example you have provided
and the queries you are suggesting, LC can easily handle it using repeat
for each line and an if statement as shown by Geoff.

My own tests seem to indicate that as your individual data is so small,
even with a 100 lines it's possible to do 1 searches in under 0.5
sec!
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Kay C Lan
On Tue, Feb 21, 2012 at 2:09 PM, Dick Kriesel  wrote:

> On Feb 20, 2012, at 9:37 PM, Kay C Lan wrote:
>
> > Anyone want to test the speed of finding data in a 100 line variable
> > using char -1 of word -1 of item -1 of line -1?
>
> Hi, Kay.  Sure.  How do I get the script?
>
> I'd guess that almost all the time goes into the line -1, and within that
> line there are so few items and words and chars that the engine will eat
> them in an instant, at least relatively speaking.
>
> The suggestion was more tongue-in-cheek. And yes you are correct for as
Geoff clearly stated, it all comes down to size.

If you want to poke the rattlesnake though, here is a script to test the
difference between forward referencing and backward (-1) referencing.

For safety reasons it's currently set to only '10', that's 10 lines, of 10
items of 10 words of 10 char.

If you'd like to change that to 1000, be my guest, but I don't think you
are going to prove anything we don't already know; backwards referencing is
slower than forward referencing:

tStore is 10 lines of 10 items of 10 words of 10 chars created in 2ms
Searching tStore 1 times
Finding using forward direct reference = 141ms
Finding using -1 direct reference = 234ms

Oh, and if you are foolish enough to change that 10 to a 1000, by my
calculations we'll not hear from you for 200 DAYS! 100 should take about 30
min. And you volunteered for a million!

on mouseUp
   put 10 into tRepeats
   put the millisec into tStartTime
   repeat  tRepeats times --lines
  repeat tRepeats times --items
 repeat tRepeats times --words
put " " after tStore
repeat tRepeats times --chars
   put "a" after tStore
end repeat
 end repeat
 put "," after tStore
  end repeat
  put cr into char -1 of tStore
   end repeat
   put the millisec into tEndTime
   put "tStore is " & tRepeats & " lines of " & \
 tRepeats & " items of " & tRepeats & \
 " words of " & tRepeats  & " chars created in " & (tEndTime -
tStartTime) & "ms" & cr into msg

   put 1 into tCycles
   put "Searching tStore " & tCycles & " times" & cr after msg
   put the millisec into tStartTime
   repeat tCycles times
  put char tRepeats of word tRepeats of item tRepeats of line tRepeats
of tStore into tStore2
   end repeat
   put the millisec into tEndTime
   put "Finding using forward direct reference = " \
 & (tEndTime - tStartTime) & "ms" & cr after msg


   put the millisec into tStartTime
   repeat tCycles times
  put char -1 of word -1 of item -1 of line -1 of tStore into tStore2
   end repeat
   put the millisec into tEndTime
   put "Finding using -1 direct reference = " \
 & (tEndTime - tStartTime) & "ms" & cr after msg
end mouseUp
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Geoff Canyon Rev
Depends on how big the list is. Unless there's a faster method than the one
I used (or you're using slower hardware than I am), you should be okay up
to about 100,000 rows using something like:

   repeat for each line L in the keys of yourArray
  if L > 20 and L < 60 then put L & cr after R
   end repeat
-- 20 and 60 are your filter values,
-- R is your result set

On Tue, Feb 21, 2012 at 2:29 AM, Glen Bojsza  wrote:

> If the final list is kept in sequential order based on the xs column I
> thought that either an sqlite database or arrays could be used for a basic
> query. I prefer arrays since it is probably easier to use for the desired
> result.
>
> The query would be based on the user selecting a starting xs value and and
> ending xs value with the resulting rows between (and including the starting
> and ending value rows).
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to use an array to solve the following...

2012-02-21 Thread Glen Bojsza
Sorry got caught up on an issue...

So far things look very fast and seem to give the results I need (will
confirm as I use larger data sets that have a known answer).

But this does bring up a question and doing more than planned with the
final lists...

If the final list is kept in sequential order based on the xs column I
thought that either an sqlite database or arrays could be used for a basic
query. I prefer arrays since it is probably easier to use for the desired
result.

The query would be based on the user selecting a starting xs value and and
ending xs value with the resulting rows between (and including the starting
and ending value rows).

Everything would be based on this query of the final list.

For example a user wants an starting xs value of 10 and an ending xs value
of 40 I think that if the keys are sequential (the keys being the first
column - xs) then it would be a fast solution using arrays since you should
be able to determine the starting line and ending line of the array without
needing to cycle through every line and then just produce a new array /
list. Again, is this a good use for an array? A database would work and be
more flexible if the query was going to have multiple requirements but for
my case it would be over kill...true? Or will Kay prove it to be faster
with just lists :-)

xs wtgt
10  632 <--starting value
20  0  0
30  0  0
40  0 67 <--ending value
50  0  0
70  0  0
80  7  0
90  0  0
1200  0
1302355

produces a new list / array

xs wtgt
10  632
20  0  0
30  0  0
40  0 67




On Mon, Feb 20, 2012 at 10:37 PM, Kay C Lan wrote:

> On Tue, Feb 21, 2012 at 10:20 AM, Geoff Canyon Rev  >wrote:
>
> > For items, lines, and words, using
> > "item/line/word of myContainer" gets worse the larger the container is.
> For
> > character and with arrays, it doesn't.
> >
>
> Excellent rules of thumb, though there is a caveat to all this.
>
> Unfortunately I haven't seen a further response from Glen, as I was going
> to wait to ask one more question, before offering further suggestions; but
> I'll now offer it anyway.
>
> Glen doesn't mention what the final use/access of the data will be. If you
> are only every going to deal with the data as a whole, then repeat for each
> line will generally be the fastest. On the other hand, if after preparing
> all your lists and merging them, the final purpose is to pick small bits
> and pieces out of it from here, there and anywhere, arrays (or a db) might
> be better.
>
> So the caveat is, always test and compare. It might be faster to create and
> merge the data using repeat for each, but slower to access it that way. It
> might be slower to merge the data using arrays, but faster to access it
> final format.
>
> Here are some comparisons I carried out.
>
> I created a variable of 100 lines containing 11 items similar to Glen's
> data.
> I created an array of the same data. It took less time to create the array.
>
> I then accessed the data 1 times in the following ways.
>
> put item 2 of line 1 into tStore2
> --because item 1 is an id not data
> put item 11 of line 100 into tStore2
> put item -1 of line 1 into tStore2
> put item -1 of line -1 into tStore2
> put aStore[1][1] into tStore2
> put aStore[100][10] tStore2
>
> For the final 2 repeat for each cases I had to add the overhead of an if
> statement to test that I was at the right line, and simply put the 1st or
> last item into tStore2. In both cases I immediately exit repeat so that it
> did not waste cycles processing lines it didn't have too.
>
> Here are the results:
>
> Created tStore in 4962ms
> Created aStore[][] in 30463ms
> For 1 cycles.
> Finding the 1st item of the 1st line using direct reference = 3ms
> Finding the last item of the last line using direct reference = 440294ms
> Finding the -1 item of the 1st line using direct reference = 5ms
> Finding the -1 item of the -1 line using direct reference = 733095ms
> Finding the first child of the first key = 3ms
> Finding the last child of the last key = 3ms
> Finding 1st item of 1st line using repeat for each line = 0ms
> Finding last item of last line using repeat for each line = 454ms
>
> The results speak for themselves. Repeat for each can be blindingly fast,
> but naturally, as Geoff pointed out, slows the further into the data you
> need to go, and will therefore give an inconsistent feel to a user. Arrays
> on the other hand might not be the fastest, but they not slow, and will
> always respond the same way no matter where in the data you look.
>
> What ever you do, avoid using item -1 of line -1 
>
> One last thing. Normally when I do these speed test I don't 'do' anything
> else on my computer, although other apps might be loaded in the background.
> In this case, because it was taking so long I did read some emails, which
> is probably real life conditions, I mean would

Re: Sounds in iOS

2012-02-21 Thread Ken Corey

On 20/02/2012 21:28, Graham Samuel wrote:

I haven't had much luck on my iOS iPad app with waiting until a sound is done 
(RR have just said I found a bug), but ignoring this issue I can't get a really 
simple 'play' statement to work. I have a button

play "Xylo.AIF"


Hi Graham,

I found it a bit difficult as well.  Keep in mind I've only just started 
with LiveCode, so there's bound to be some wrong information here.


Take a look at this stack:
http://its.ec/static/iossounddemo.zip (158k)

The keys that I needed were:
1) Put sounds into a sub folder of my project
2) Ensure that in the Copy Files tab, the subdirectory is included.
3) Make the files .caf files (make .aiff files, and rename them to .caf)
4) Use the rootPath function given so the files work in both the IDE and 
iOS device.


Hope this helps.

-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode