Re: scaleFactor strangeness

2015-10-15 Thread Monte Goulding
Hmm... Even with the view object you would have an issue there. Inside the view 
they would be relative to the topleft of the view and in the coordinate system 
of the stack. If the message is passed it then becomes arguable whether the 
message hierarchy includes the stack the view is in and whether the parameters 
are altered to match the parent window (or maybe even parent view) coordinate 
system.

Can of worms...

Sent from my iPhone

> On 15 Oct 2015, at 7:38 pm, Mark Waddingham  wrote:
> 
> This is all well and good - however the part you haven't addressed is what 
> about co-ordinates that 'come into' the engine.
> e.g. mouseMove has pX, pY as parameters - what co-ordinate system are they in?

___
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: From any button script, how can I reset the scrollbar of a field to the "top" ?

2015-10-15 Thread Francis Nugent Dixon
Hi from Beautiful Brittany,

> The scrolled amount of a field is defined by the vscroll (vertical) and  
> hscroll (horizontal) properties, so to set the scrollbar back to the top,  
> do this:
> 
> set the vscroll of field "myField" to 0


Thanks David !

I tried everything I knew, but have never used scrolling commands before,
and I obviously didn't know vScroll and hScroll existed.

-Francis

"Nothing should ever be done for the first time !"

___
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: scaleFactor strangeness

2015-10-15 Thread Richard Gaskin

Dr. Hawkins wrote:
> As far as retrofitting to the older language, as someone (Richard?)
> mentioned, it could be done by
>
>   set the groupTop of field myField to 100
>
> and so forth.

I don't think that one's mine, but similar ideas have been floating 
around for a while for making positioning within groups simpler.


I like the xOrigin and yOrigin in HTML's Canvas, and maybe something 
even simpler for LC groups might be a local property in the script along 
the lines of "the useGroupCoordinates" (maybe abbreviated 
"useGrpCoords"), e.g."


  set the useGrpCoords to the long id of grp "SomeParentGroup"
  set the rect of btn "ChildBtn" to 10,10,110,30

The result there would set the rect of the button "ChildBtn" relative to 
both the rect and scroll of the specified group.


Not married to the suggested token, but something like it might be a 
useful way of simplifying positioning within groups.


If scaling within groups were available, all scaling would be 
independent of our scripting.  That is, the script above would render 
appropriately whether the scale is 1, 0.5, or 2, so scripting works in 
factor 1 sizes while rendering accounts for the scale.


If we need to know the actual rects of objects within scaled groups, 
"the effective rect" would give us that info.


Scripts stay simple to write, coordinates obtainable either translated 
for scale or not with minimal effort.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: scaleFactor strangeness

2015-10-15 Thread Mark Waddingham

On 2015-10-15 09:18, Richard Gaskin wrote:

Scripts stay simple to write, coordinates obtainable either translated
for scale or not with minimal effort.


This is all well and good - however the part you haven't addressed is 
what about co-ordinates that 'come into' the engine.
e.g. mouseMove has pX, pY as parameters - what co-ordinate system are 
they in?


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: scaleFactor strangeness

2015-10-15 Thread Mark Waddingham

On 2015-10-15 16:45, hh wrote:
The scalefactor SF of a button in a (non-background-) group on a card 
is then


SF(stack) * SF(card) * SF(group) * SF(button).


The problem I am concerned about is actually the differing co-ordinate 
systems at each level here and how that affects script - this proposal 
is identical to anything which offers the ability to set a transform on 
any object and so still suffers from it.



It's really simple, isn't it? And it works ...


Of course, posed as you have, it has made me realize that there is a 
potentially feasible option right now.


We already have the 'fullScreenMode' property - which controls the 
transform from 'card-space' to 'window-space'. This acts on the entire 
content of the card and thus doesn't have a problem with any translation 
of co-ordinate systems (as they don't change within the card).


What we didn't do was add the option of controlling this mapping 
directly and have the result displayed in a window. This could be done 
by adding a property which specifies the region of the card rect you 
want stretched to fill the window.


So if your stack is 400x400 and you want to display the middle portion 
(100,100,300,300); then you'd set something like:


set the visibleRect of stack ... to "100,100,300,300"

This would scale and translate the 200x200 middle rectangle to fill the 
entire window.


The reason this is unaffected by my concerns about the action of script 
in such an environment is that script actions are contained entirely 
within the stack and objects within it. The co-ordinate transform 
boundary happens between the OS and the window essentially - which is at 
the globalLoc / localLoc level - the thing that changes is the mapping 
between what script considers to be 'card-relative' (local) and 
'screen-relative' (global). Script already has to take this into 
account, as does the engine (which it does, otherwise fullScreenMode 
wouldn't work).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Export snapshot and native controls

2015-10-15 Thread Earthednet-wp
Ludevic,

I found that it's better to put the area you want to take a snapshot of, in a 
group and take the snapshot of the group. Leave out any rect. This way LC 
doesn't use the screen buffer to get the image data, which avoids some problems 
on some pc's. 

I'm not at my office, but can supply example code f you need it.
Bill

William Prothero
http://es.earthednet.org

> On Oct 14, 2015, at 10:27 PM, Ludovic THEBAULT  
> wrote:
> 
> Hello,
> 
> Livecode 6.77
> 
> When i create a snapshot with this script :
> 
> export snapshot from rectangle theRect of this cd to file…
> 
> I’ve the correct snapshot but all natives controls are gone !
> 
> And if i use this script :
> 
> export snapshot from rectangle theRect to file…
> 
> I’ve only the natives controls on a black background…
> 
> Any ideas ?
> 
> Thanks
> 
> 
> 
> ___
> 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: Export snapshot and native controls

2015-10-15 Thread Paul Hibbert
Bill is spot on, try…

export snapshot from this cd to file tFile as JPEG

Paul

> On 15 Oct 2015, at 08:50, Earthednet-wp  wrote:
> 
> Ludevic,
> 
> I found that it's better to put the area you want to take a snapshot of, in a 
> group and take the snapshot of the group. Leave out any rect. This way LC 
> doesn't use the screen buffer to get the image data, which avoids some 
> problems on some pc's. 
> 
> I'm not at my office, but can supply example code f you need it.
> Bill
> 
> William Prothero
> http://es.earthednet.org
> 
>> On Oct 14, 2015, at 10:27 PM, Ludovic THEBAULT 
>>  wrote:
>> 
>> Hello,
>> 
>> Livecode 6.77
>> 
>> When i create a snapshot with this script :
>> 
>> export snapshot from rectangle theRect of this cd to file…
>> 
>> I’ve the correct snapshot but all natives controls are gone !
>> 
>> And if i use this script :
>> 
>> export snapshot from rectangle theRect to file…
>> 
>> I’ve only the natives controls on a black background…
>> 
>> Any ideas ?
>> 
>> Thanks
>> 
>> 
>> 
>> ___
>> 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: scaleFactor strangeness

2015-10-15 Thread hh
> The scalefactor SF of a button in a (non-background-) group on a card is then
> SF(stack) * SF(card) * SF(group) * SF(button).

Should read:

The 'total' scalefactor TSF of a button in a (non-background-) group on a card 
is then

TSF = SF(stack) * SF(card) * SF(group) * SF(button).



___
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: scaleFactor strangeness

2015-10-15 Thread hh
The scalefactor problem -- I reported this already months ago, in vain.

Currently LC uses the scalefactor as if the physical device has changed 
accordingly.
It scales(nearly) everything, and especially global coordinates.
That's why windows walk out to offscreen if you use a scalefactor > 1 and are 
still
staring at the same monitor.

Nothing bad about that, because

> "Use the scaleFactor property when developing to scale down stacks that 
> are larger than the available screen space."


What some of us wish is to use the scalefactor also for rendering (like PDF 
etc.).

For this a second kind of scalefactor is necessary. No way out of this.

** My proposal is to set a new property for all objects: the scalefactor **

The scalefactor of the stack remains the old one and may or may not used by its 
objects:
This scalefactor will be inherited (what obviously solves the group-problem).

The scalefactor of a button is then the product of the scalefactors of all the 
owners
along the owner path. That is, for example;

The scalefactor SF of a button in a (non-background-) group on a card is then

SF(stack) * SF(card) * SF(group) * SF(button).

Of course, the scalefactor of an object has the default value one.
The scalefactor of a stack is the only one that changes global coords. All 
others have
only impact on local coords.

For some few objects on a special stack I used this already by custom 
properties (that
is the math for all coords is to be computed, without difficulties, but its not 
native).

It's really simple, isn't it? And it works ...
___
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


Release: 6.7.8 RC 1 / 7.1.1 RC 1

2015-10-15 Thread Sebastien Nouat

Dear List Members,

We are pleased to announce the release of LiveCode 6.7.8 RC 1 and 7.1.1 
RC 1.


*Release Contents
*
This release has been delayed due to issues with iOS 9.0 and Xcode 7.0, 
but on the other side, we can announce that:

  - 51 bugs are fixed in LiveCode 6.7.8 RC 1
  - 24 bugs are fixed in LiveCode 7.1.1 RC 1 (in addition to the 51 
bugs fixed in 6.7.8 RC 1, which are also fixed in 7.1.1 RC 1).


7.1.1 RC 1 includes string and single-byte operation improvement (the 
same as the one that have been introduced in LiveCode 8.0.0 DP 7).


This release also allows you to select Xcode 7.0 in the Preferences > 
Mobile Support pane, and thus allowing users to deploy on iOS 9.0 simulator.


*Known Issues with Xcode 7.0 and iOS ***9.0 *simulator

** The first time an iOS application is saved as a standalone with 
LiveCode 6.7.8 RC 1, and error might occur at the linking step. This 
only occurs once, and does not replicate at a second saving.


* When deploying on iOS simulator 9.0, if the dialog 'The simulator 
seems to take a long time to launch the application. Do you wish to 
continue trying?' appears, and 'No' is clicked, then LiveCode crashes 
(or hangs). This is due to a bug in Xcode 7.0, and we are currently 
working on finding a workaround.


Getting the Release
To get the release please download the installer directly at: 
http://downloads.livecode.com



*6.7.8 RC 2 / 7.1.0 RC 2*
The next RC build is planned to be released next week.

If you reported a bug in BugZilla, you can check whether it will be 
fixed by having a look at its status.
Bugs reported against LiveCode 6.7 or LiveCode 7.x will be fixed in the 
next release, if the status is AWAITING_BUILD.


You can also follow our release schedule, and bug fixing patches, on our 
GitHub repository .



Warm regards,

The LiveCode Team
___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Mark Waddingham
I think that is a combination of precedence ('is really a' binds more tightly 
than '+') and the bug Paul noticed with regards 'constants' which are currently 
represented as strings internally except in specific cases due to a rather 
subtle issue with representations of numbers as strings.

Sent from my iPhone

> On 15 Oct 2015, at 23:47, Peter W A Wood  wrote:
> 
> Mark 
> 
>> On 16 Oct 2015, at 01:07, Mark Waddingham  wrote:
>> 
>> put "0" + 0 into tVar1 -- tVar is really a number
>>   put "0" & 0 into tVar2 -- tVar is really a string
>>   put tVar1 is really tVar2 -- false
> 
> The current implementation appears to differ a little from the above. You 
> need to specify integer or real as number is not currently supported.
> 
> When I try “0” + 0 in the message box only “is really a string” returns true, 
> “is really an integer” returns false.
> 
> Warm regards
> 
> Peter
> 
> ___
> 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: CSV again.

2015-10-15 Thread Alex Tweedly
H ... my quick test of what was csv4Tab, but is now called csvToTab1 
- see below - gives me
(showing results with a colon  ':' for the cell delimiter, i.e. 
replacing numtochar(29) from the code in the previous use-list code


a,b,c   ---> a:b:c
"a","","c" ---> a::c

Now to me, that's what it should give - so I think it gets it right :-)

Question is
a. do you get the same result ?
if not, what do you get ?  OR can you try with the code below
if you do, but disagree that this is right, what do you think it 
should give ?


-- Alex

function CSVToTab1 pData,pcoldelim
   local tNuData -- contains tabbed copy of data
   local tReturnPlaceholder -- replaces cr in field data to avoid line
   --   breaks which would be misread as records;
   local tNuDelim  -- new character to replace the delimiter
   local tStatus, theInsideStringSoFar
   --
   put numtochar(11) into tReturnPlaceholder -- vertical tab as placeholder
   put numtochar(29) into tNuDelim
   --
   if pcoldelim is empty then put comma into pcoldelim
   -- Normalize line endings:
   replace crlf with cr in pData  -- Win to UNIX
   replace numtochar(13) with cr in pData -- Mac to UNIX

   put "outside" into tStatus
   set the itemdel to quote
   repeat for each item k in pData
  -- put tStatus && k & CR after msg
  switch tStatus

 case "inside"
put k after theInsideStringSoFar
put "passedquote" into tStatus
next repeat

 case "passedquote"
-- decide if it was a duplicated escapedQuote or a closing 
quote

if k is empty then   -- it's a duplicated quote
   put quote after theInsideStringSoFar
   put "inside" into tStatus
   next repeat
end if
-- not empty - so we remain inside the cell, though we have 
left the quoted section
-- NB this allows for quoted sub-strings within the cell 
content !!

replace cr with tReturnPlaceholder in theInsideStringSoFar
put theInsideStringSoFar after tNuData

 case "outside"
replace pcoldelim with tNuDelim in k
-- and deal with the "empty trailing item" issue in Livecode
replace (tNuDelim & CR) with tNuDelim & tNuDelim & CR in k
put k after tNuData
put "inside" into tStatus
put empty into theInsideStringSoFar
next repeat
 default
put "defaulted"
break
  end switch
   end repeat
   return tNuData
end CSVToTab1

On 16/10/2015 01:34, Mike Kerner wrote:

csv4 does not handle it, and it comes up with a different result from csv2
(which is also wrong).  I sent Richard proposed changes to csv2 which
addresses that issue, but I'll wait while we collectively try to remember
what the latest and greatest csv parser algorithm is before I try to come
up with more ways to break or fix it.

On Thu, Oct 15, 2015 at 8:24 PM, Alex Tweedly  wrote:


Richard et al.,

sometime after that article, there was a further thread on the use-list.
Pete Haworth found a case not properly covered by the version on the
article, and I came up with a revised version (cutely called csv4Tab !! -
csv3Tab was an interim, deeply buggy attempt)

(It's in
http://lists.runrev.com/pipermail/use-livecode/2012-May/172275.html )

It *looks* from that thread (
http://lists.runrev.com/pipermail/use-livecode/2012-May/172191.html ) as
though this case had been discussed, and the re-write should properly
handle it - but I haven't yet had time to try it. My laptop has been
replaced in the meantime, and I can't find my test stack, and recreating it
and finding the test data is a bit too much for after 1am:-)

So I'll try it tomorrow; hopefully csv4Tab() will already work for this
case. If it doesn't, we can try again :-)

-- Alex.


On 16/10/2015 00:34, Richard Gaskin wrote:


Mike Kerner wrote:

Alex, Richard, etc.

What do we consider the latest version of the csv parser?  I think I
found a bug in Richard's CSV2Text code, and proposed changes, but he
wanted the discussion to go down over here, first.  Then I noticed
that csv4Text is out over here, which makes 2, I guess, a bit long in
the tooth.

The version referred to here as "Richard's" is the famous Tweedly algo,
in the middle of this page:


Alex came up with that after a a bunch of us here had a long discussion
about the many variants of CSV running around, and how stupidly complex
they are to parse (see the details in that article).

Mike wrote me this afternoon letting me know that there's yet another
exception that doesn't seem to be accounted for there:

"value","","value"

I had thought we'd covered that in the earlier discussion, but perhaps
not.

So this seems like a good time to once again bring together the best
minds in our community (are you listening Alex Tweedly, Geoff 

Re: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Mark Waddingham
I pondered 'is exactly' for the 'is really' semantics previously proposed which 
are the same as yours :)

However I do think that it is slightly misleading - when it comes to numbers 
(due to the inexact representation used) you can end up with two numeric tokens 
which are slightly different but compare with 'is exactly' true.

I'm wondering whether 'is strictly' is perhaps most appropriate as it suggests 
the two sides are equal under strict rules (type and value are the same) 
compared to loose rules (try number comparison first, then string).

Mark.

Sent from my iPhone

> On 15 Oct 2015, at 19:47, Geoff Canyon  wrote:
> 
>> On 2015-10-14 22:19, Devin Asay wrote:
>> 
>> Shouldn’t there be a way to force a string comparison? I know LC tries
>> to be all helpful about casting numerals as numbers, but what if I
>> want to know if it’s the exact string?
> 
> I think you have come up with the best syntax right there.
> 
> put 3 is "3" -- true
> put 3 is "3.0" -- true
> put 3 is 2.999 -- true
> 
> put 3 is exactly "3" -- false
> put 3 is exactly "3.0" -- false
> put "3" is exactly "3" -- true
> put 3 is exactly 3 -- true
> put 3 is exactly 3.0 -- true
> put 3 is exactly 2.999 -- false
> ___
> 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: CSV again.

2015-10-15 Thread Richard Gaskin

Mike Kerner wrote:


csv4 does not handle it, and it comes up with a different result from csv2
(which is also wrong).  I sent Richard proposed changes to csv2 which
addresses that issue, but I'll wait while we collectively try to remember
what the latest and greatest csv parser algorithm is before I try to come
up with more ways to break or fix it.


If the fix you provided addresses the issues you found it would be 
helpful to post it here so others can test it.


There was a naming issue in previous versions I'd like to address here:

The function named "CSV2Tab" uses a naming convention popular among some 
Pascal programmers back in the day (but apparently less common today), 
in which conversion functions use a numeral "2" instead of "to" to more 
readily distinguish the text on either side.


Along the way it seems some believed it was a version number embedded in 
the middle of the function name, and during our discussion we started 
seeing things like "CSV3Tab", "CSV4Tab", etc.


The version at my page may well be what was originally named "CSV4Tab", 
but renamed once it became the final version when I posted it to my 
site.  To the best of my knowledge the version posted on my page was the 
most robust available at the time I posted it.


Making things even more confusing, I believe there were at least two 
versions named "CSV4Tab", so I believe it may take some digging to find 
the latest and greatest.  And keep in mind that given the many weird 
things about the many very different implementations of CSV, the latest 
may not be the greatest.


A few years ago I stopped using the older "2" convention for converters, 
so no hand-slapping needed; already did it myself.  And I've never 
embedded a version number in a handler name except during testing, so if 
you ever see code from me that has a numeral in it rest assured it's not 
a version number; if it's meaning is unclear feel free to ask.



So all that said, two notes going forward:

1. When we get a good CSV algo here, the version I post at my page will 
be named "CSVToTab" to avoid such misunderstandings in the future.


2. While we're experimenting here perhaps we could add a version number 
at the end of the function name if it needs to be distinguished for 
comparison purposes (e.g., "CSVtoTab5").


I'll wait to update the page until we have a good one, and when I'll 
also provide a link back to the source post for reference.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: CSV again.

2015-10-15 Thread Tim Selander


So, tell us what you really think about .CSV, Richard!  :-)

Tim Selander
Tokyo, Japan

On 15/10/16 8:34, Richard Gaskin wrote:

 stupidly complex
really stupid 
stupid format 
really dumb idea



___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Peter W A Wood
Mark 

> On 16 Oct 2015, at 07:26, Mark Waddingham  wrote:
> 
> I think that is a combination of precedence ('is really a' binds more tightly 
> than '+') and the bug Paul noticed with regards 'constants' which are 
> currently represented as strings internally except in specific cases due to a 
> rather subtle issue with representations of numbers as strings.

I should have shown the code that I ran in the message box (multiline):

put "0" + 0 into tVar1
put tVar1 is really an integer

It returned false.

I added a test to my LiveCode tests. It also fails:

MT.startTest "Is Really 1"
put "0" + 0 into tTemp
MT.assert tTemp is really an integer
 MT.endTest

Should I open a bug report?

Warm regards

Peter
___
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: CSV again.

2015-10-15 Thread Mike Kerner
csv4 does not handle it, and it comes up with a different result from csv2
(which is also wrong).  I sent Richard proposed changes to csv2 which
addresses that issue, but I'll wait while we collectively try to remember
what the latest and greatest csv parser algorithm is before I try to come
up with more ways to break or fix it.

On Thu, Oct 15, 2015 at 8:24 PM, Alex Tweedly  wrote:

> Richard et al.,
>
> sometime after that article, there was a further thread on the use-list.
> Pete Haworth found a case not properly covered by the version on the
> article, and I came up with a revised version (cutely called csv4Tab !! -
> csv3Tab was an interim, deeply buggy attempt)
>
> (It's in
> http://lists.runrev.com/pipermail/use-livecode/2012-May/172275.html )
>
> It *looks* from that thread (
> http://lists.runrev.com/pipermail/use-livecode/2012-May/172191.html ) as
> though this case had been discussed, and the re-write should properly
> handle it - but I haven't yet had time to try it. My laptop has been
> replaced in the meantime, and I can't find my test stack, and recreating it
> and finding the test data is a bit too much for after 1am:-)
>
> So I'll try it tomorrow; hopefully csv4Tab() will already work for this
> case. If it doesn't, we can try again :-)
>
> -- Alex.
>
>
> On 16/10/2015 00:34, Richard Gaskin wrote:
>
>> Mike Kerner wrote:
>> > Alex, Richard, etc.
>> >
>> > What do we consider the latest version of the csv parser?  I think I
>> > found a bug in Richard's CSV2Text code, and proposed changes, but he
>> > wanted the discussion to go down over here, first.  Then I noticed
>> > that csv4Text is out over here, which makes 2, I guess, a bit long in
>> > the tooth.
>>
>> The version referred to here as "Richard's" is the famous Tweedly algo,
>> in the middle of this page:
>> 
>>
>> Alex came up with that after a a bunch of us here had a long discussion
>> about the many variants of CSV running around, and how stupidly complex
>> they are to parse (see the details in that article).
>>
>> Mike wrote me this afternoon letting me know that there's yet another
>> exception that doesn't seem to be accounted for there:
>>
>>"value","","value"
>>
>> I had thought we'd covered that in the earlier discussion, but perhaps
>> not.
>>
>> So this seems like a good time to once again bring together the best
>> minds in our community (are you listening Alex Tweedly, Geoff Canyon, Mark
>> Weider, Dick Kreisel, and others?) to see if we can revisit CSV parsing and
>> come up with a function that can parse it into tabs efficiently, while
>> taking into account all of the really stupid exceptions that have crept
>> into the world since that really stupid format was first popularized.
>>
>> When we're done I'll update the article, and add even more sarcastic
>> comments about what a really dumb idea it was to have encouraged people to
>> delimit text with a character so frequently appearing in text.
>>
>> --
>>  Richard Gaskin
>>  Fourth World Systems
>>  Software Design and Development for the Desktop, Mobile, and the Web
>>  
>>  ambassa...@fourthworld.com http://www.FourthWorld.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
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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: CSV again.

2015-10-15 Thread Peter Haworth
Right I remember that although not what the exact problem was.  In any
case, csv4Tab has been working fine in my SQLiteAdmin program for at least
a couple of years now, but I have no idea what flavor of csv files have
been imported.

Pete
lcSQL Software 
Home of lcStackBrowser  and
SQLiteAdmin 

On Thu, Oct 15, 2015 at 5:24 PM, Alex Tweedly  wrote:

> Richard et al.,
>
> sometime after that article, there was a further thread on the use-list.
> Pete Haworth found a case not properly covered by the version on the
> article, and I came up with a revised version (cutely called csv4Tab !! -
> csv3Tab was an interim, deeply buggy attempt)
>
> (It's in
> http://lists.runrev.com/pipermail/use-livecode/2012-May/172275.html )
>
> It *looks* from that thread (
> http://lists.runrev.com/pipermail/use-livecode/2012-May/172191.html ) as
> though this case had been discussed, and the re-write should properly
> handle it - but I haven't yet had time to try it. My laptop has been
> replaced in the meantime, and I can't find my test stack, and recreating it
> and finding the test data is a bit too much for after 1am:-)
>
> So I'll try it tomorrow; hopefully csv4Tab() will already work for this
> case. If it doesn't, we can try again :-)
>
> -- Alex.
>
> On 16/10/2015 00:34, Richard Gaskin wrote:
>
>> Mike Kerner wrote:
>> > Alex, Richard, etc.
>> >
>> > What do we consider the latest version of the csv parser?  I think I
>> > found a bug in Richard's CSV2Text code, and proposed changes, but he
>> > wanted the discussion to go down over here, first.  Then I noticed
>> > that csv4Text is out over here, which makes 2, I guess, a bit long in
>> > the tooth.
>>
>> The version referred to here as "Richard's" is the famous Tweedly algo,
>> in the middle of this page:
>> 
>>
>> Alex came up with that after a a bunch of us here had a long discussion
>> about the many variants of CSV running around, and how stupidly complex
>> they are to parse (see the details in that article).
>>
>> Mike wrote me this afternoon letting me know that there's yet another
>> exception that doesn't seem to be accounted for there:
>>
>>"value","","value"
>>
>> I had thought we'd covered that in the earlier discussion, but perhaps
>> not.
>>
>> So this seems like a good time to once again bring together the best
>> minds in our community (are you listening Alex Tweedly, Geoff Canyon, Mark
>> Weider, Dick Kreisel, and others?) to see if we can revisit CSV parsing and
>> come up with a function that can parse it into tabs efficiently, while
>> taking into account all of the really stupid exceptions that have crept
>> into the world since that really stupid format was first popularized.
>>
>> When we're done I'll update the article, and add even more sarcastic
>> comments about what a really dumb idea it was to have encouraged people to
>> delimit text with a character so frequently appearing in text.
>>
>> --
>>  Richard Gaskin
>>  Fourth World Systems
>>  Software Design and Development for the Desktop, Mobile, and the Web
>>  
>>  ambassa...@fourthworld.com http://www.FourthWorld.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
>
___
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: CSV again.

2015-10-15 Thread Richard Gaskin

Mike Kerner wrote:
> Alex, Richard, etc.
>
> What do we consider the latest version of the csv parser?  I think I
> found a bug in Richard's CSV2Text code, and proposed changes, but he
> wanted the discussion to go down over here, first.  Then I noticed
> that csv4Text is out over here, which makes 2, I guess, a bit long in
> the tooth.

The version referred to here as "Richard's" is the famous Tweedly algo, 
in the middle of this page:



Alex came up with that after a a bunch of us here had a long discussion 
about the many variants of CSV running around, and how stupidly complex 
they are to parse (see the details in that article).


Mike wrote me this afternoon letting me know that there's yet another 
exception that doesn't seem to be accounted for there:


   "value","","value"

I had thought we'd covered that in the earlier discussion, but perhaps not.

So this seems like a good time to once again bring together the best 
minds in our community (are you listening Alex Tweedly, Geoff Canyon, 
Mark Weider, Dick Kreisel, and others?) to see if we can revisit CSV 
parsing and come up with a function that can parse it into tabs 
efficiently, while taking into account all of the really stupid 
exceptions that have crept into the world since that really stupid 
format was first popularized.


When we're done I'll update the article, and add even more sarcastic 
comments about what a really dumb idea it was to have encouraged people 
to delimit text with a character so frequently appearing in text.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: CSV again.

2015-10-15 Thread Alex Tweedly

Richard et al.,

sometime after that article, there was a further thread on the use-list. 
Pete Haworth found a case not properly covered by the version on the 
article, and I came up with a revised version (cutely called csv4Tab !! 
- csv3Tab was an interim, deeply buggy attempt)


(It's in 
http://lists.runrev.com/pipermail/use-livecode/2012-May/172275.html )


It *looks* from that thread ( 
http://lists.runrev.com/pipermail/use-livecode/2012-May/172191.html ) as 
though this case had been discussed, and the re-write should properly 
handle it - but I haven't yet had time to try it. My laptop has been 
replaced in the meantime, and I can't find my test stack, and recreating 
it and finding the test data is a bit too much for after 1am:-)


So I'll try it tomorrow; hopefully csv4Tab() will already work for this 
case. If it doesn't, we can try again :-)


-- Alex.

On 16/10/2015 00:34, Richard Gaskin wrote:

Mike Kerner wrote:
> Alex, Richard, etc.
>
> What do we consider the latest version of the csv parser?  I think I
> found a bug in Richard's CSV2Text code, and proposed changes, but he
> wanted the discussion to go down over here, first.  Then I noticed
> that csv4Text is out over here, which makes 2, I guess, a bit long in
> the tooth.

The version referred to here as "Richard's" is the famous Tweedly 
algo, in the middle of this page:



Alex came up with that after a a bunch of us here had a long 
discussion about the many variants of CSV running around, and how 
stupidly complex they are to parse (see the details in that article).


Mike wrote me this afternoon letting me know that there's yet another 
exception that doesn't seem to be accounted for there:


   "value","","value"

I had thought we'd covered that in the earlier discussion, but perhaps 
not.


So this seems like a good time to once again bring together the best 
minds in our community (are you listening Alex Tweedly, Geoff Canyon, 
Mark Weider, Dick Kreisel, and others?) to see if we can revisit CSV 
parsing and come up with a function that can parse it into tabs 
efficiently, while taking into account all of the really stupid 
exceptions that have crept into the world since that really stupid 
format was first popularized.


When we're done I'll update the article, and add even more sarcastic 
comments about what a really dumb idea it was to have encouraged 
people to delimit text with a character so frequently appearing in text.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.com http://www.FourthWorld.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: CSV again.

2015-10-15 Thread Mike Kerner
For everyone trying to get back up to speed on CSV, here's the closest
thing to a "Standard", RFC 4180:
https://tools.ietf.org/html/rfc4180

On Thu, Oct 15, 2015 at 8:34 PM, Peter Haworth  wrote:

> Right I remember that although not what the exact problem was.  In any
> case, csv4Tab has been working fine in my SQLiteAdmin program for at least
> a couple of years now, but I have no idea what flavor of csv files have
> been imported.
>
> Pete
> lcSQL Software 
> Home of lcStackBrowser  and
> SQLiteAdmin 
>
> On Thu, Oct 15, 2015 at 5:24 PM, Alex Tweedly  wrote:
>
> > Richard et al.,
> >
> > sometime after that article, there was a further thread on the use-list.
> > Pete Haworth found a case not properly covered by the version on the
> > article, and I came up with a revised version (cutely called csv4Tab !! -
> > csv3Tab was an interim, deeply buggy attempt)
> >
> > (It's in
> > http://lists.runrev.com/pipermail/use-livecode/2012-May/172275.html )
> >
> > It *looks* from that thread (
> > http://lists.runrev.com/pipermail/use-livecode/2012-May/172191.html ) as
> > though this case had been discussed, and the re-write should properly
> > handle it - but I haven't yet had time to try it. My laptop has been
> > replaced in the meantime, and I can't find my test stack, and recreating
> it
> > and finding the test data is a bit too much for after 1am:-)
> >
> > So I'll try it tomorrow; hopefully csv4Tab() will already work for this
> > case. If it doesn't, we can try again :-)
> >
> > -- Alex.
> >
> > On 16/10/2015 00:34, Richard Gaskin wrote:
> >
> >> Mike Kerner wrote:
> >> > Alex, Richard, etc.
> >> >
> >> > What do we consider the latest version of the csv parser?  I think I
> >> > found a bug in Richard's CSV2Text code, and proposed changes, but he
> >> > wanted the discussion to go down over here, first.  Then I noticed
> >> > that csv4Text is out over here, which makes 2, I guess, a bit long in
> >> > the tooth.
> >>
> >> The version referred to here as "Richard's" is the famous Tweedly algo,
> >> in the middle of this page:
> >> 
> >>
> >> Alex came up with that after a a bunch of us here had a long discussion
> >> about the many variants of CSV running around, and how stupidly complex
> >> they are to parse (see the details in that article).
> >>
> >> Mike wrote me this afternoon letting me know that there's yet another
> >> exception that doesn't seem to be accounted for there:
> >>
> >>"value","","value"
> >>
> >> I had thought we'd covered that in the earlier discussion, but perhaps
> >> not.
> >>
> >> So this seems like a good time to once again bring together the best
> >> minds in our community (are you listening Alex Tweedly, Geoff Canyon,
> Mark
> >> Weider, Dick Kreisel, and others?) to see if we can revisit CSV parsing
> and
> >> come up with a function that can parse it into tabs efficiently, while
> >> taking into account all of the really stupid exceptions that have crept
> >> into the world since that really stupid format was first popularized.
> >>
> >> When we're done I'll update the article, and add even more sarcastic
> >> comments about what a really dumb idea it was to have encouraged people
> to
> >> delimit text with a character so frequently appearing in text.
> >>
> >> --
> >>  Richard Gaskin
> >>  Fourth World Systems
> >>  Software Design and Development for the Desktop, Mobile, and the Web
> >>  
> >>  ambassa...@fourthworld.com http://www.FourthWorld.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
> >
> ___
> 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
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:

Re: CSV again.

2015-10-15 Thread Richard Gaskin

Mike Kerner wrote:

For everyone trying to get back up to speed on CSV, here's the closest
thing to a "Standard", RFC 4180:
https://tools.ietf.org/html/rfc4180


Unfortunately the "format" was around for so long before that RFC, and 
so many big companies have ignored the RFC since, that it doesn't 
reflect the staggeringly rich variety of escapes and quoting conventions 
found in real-world data.


Doesn't hurt to make sure whatever we come up with handles the spec, but 
the spec doesn't handle a lot of what the world calls "CSV".


(And don't even get me started about files delimited by things other 
than commas that identify themselves by the acronym for "Comma-Separated 
Values").


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: How to go to a stack without a flash

2015-10-15 Thread Marty Knapp

Hey Bill,
When you go to the app stack you can use the form "go stack stTarget in 
window (the short name of this stack)" If the size of the stacks are the 
same it looks pretty seamless.


Marty

Folks:
I haver a splash stack and I’m trying to open the app stack in the same rect, 
without a flash. This should be easy, but I can’t get it to work with what is 
obvious to me. Here’s my script.

on mouseUp
put the name of this stack into splashStackName
put the filename of this stack into fName
set the itemdelimiter to "/"
delete the last item of fName
put fName&"/Earth Explorer.livecode" into stTarget
set the destroyStack of splashStackName to TRUE
set the lockscreen to true
go invisible cd 1 of stack stTarget
set the rect of stack"Earth Explorer" to the rect of stack splashStackName
wait for 0 seconds with messages
set the visible of stack stTarget to TRUE
close stack splashStackName
send "initCard" to cd "Opening" of stack "Earth Explorer"
set the lockscreen to false
  end mouseUp

What am i doing wrong?
Bill



William A. Prothero
http://es.earthednet.org/




___
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 go to a stack without a flash

2015-10-15 Thread Roger Eller
Have you used any Quicktime transitions that have been left by mistake?


On Thu, Oct 15, 2015 at 3:45 PM, William Prothero 
wrote:

> Folks:
> I haver a splash stack and I’m trying to open the app stack in the same
> rect, without a flash. This should be easy, but I can’t get it to work with
> what is obvious to me. Here’s my script.
>
> on mouseUp
>put the name of this stack into splashStackName
>put the filename of this stack into fName
>set the itemdelimiter to "/"
>delete the last item of fName
>put fName&"/Earth Explorer.livecode" into stTarget
>set the destroyStack of splashStackName to TRUE
>set the lockscreen to true
>go invisible cd 1 of stack stTarget
>set the rect of stack"Earth Explorer" to the rect of stack
> splashStackName
>wait for 0 seconds with messages
>set the visible of stack stTarget to TRUE
>close stack splashStackName
>send "initCard" to cd "Opening" of stack "Earth Explorer"
>set the lockscreen to false
>  end mouseUp
>
> What am i doing wrong?
> Bill
>
>
>
> William A. Prothero
> http://es.earthednet.org/
>
> ___
> 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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Paul Dupuis
On 10/15/2015 3:36 PM, Peter Haworth wrote:
> There is a new operator in LC8, "is really" which may help the
> string/number comparison issue. See the LC8 dictionary for details.
The is really operator is only for types:

/value/ is really [ nothing | a boolean | an integer | a real | a string
| a binary string | an array ]

and as of LC8dp7 it is not working to well:
"0" is a string -> true
0 is a string -> true
0 is an integer -> false
0. is a string -> true
0. is a real -> false
"0." is a string -> true

The proposed "is exactly" syntax is comparing two variables (or values)
for equivalence by type and contents.

Whoever came up with the "is exactly" syntax should submit it as an
enhancement to http://quality.runrev.com/
It would be a great addition to the language.

___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Peter W A Wood
Mark 

> On 16 Oct 2015, at 01:07, Mark Waddingham  wrote:
> 
>  put "0" + 0 into tVar1 -- tVar is really a number
>put "0" & 0 into tVar2 -- tVar is really a string
>put tVar1 is really tVar2 -- false

The current implementation appears to differ a little from the above. You need 
to specify integer or real as number is not currently supported.

When I try “0” + 0 in the message box only “is really a string” returns true, 
“is really an integer” returns false.

Warm regards

Peter

___
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 go to a stack without a flash

2015-10-15 Thread Scott Rossi
Without knowing what's going on in your stacks, it's tough to know for
sure, but it's unlikely you're doing anything "wrong".  In addition to
what Marty suggested, another option is to set the blendLevel of a stack
to 100 before making it visible, and the setting (or ramping) the stack's
blendLevel to 0. Sometimes it also helps to open at stack at a negative
location (off screen) before displaying it, but setting the blendLevel
should eliminate any flashing.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 10/15/15, 12:58 PM, "use-livecode on behalf of Marty Knapp"
 wrote:

>Hey Bill,
>When you go to the app stack you can use the form "go stack stTarget in
>window (the short name of this stack)" If the size of the stacks are the
>same it looks pretty seamless.
>
>Marty
>> Folks:
>> I haver a splash stack and I¹m trying to open the app stack in the same
>>rect, without a flash. This should be easy, but I can¹t get it to work
>>with what is obvious to me. Here¹s my script.
>>
>> on mouseUp
>> put the name of this stack into splashStackName
>> put the filename of this stack into fName
>> set the itemdelimiter to "/"
>> delete the last item of fName
>> put fName&"/Earth Explorer.livecode" into stTarget
>> set the destroyStack of splashStackName to TRUE
>> set the lockscreen to true
>> go invisible cd 1 of stack stTarget
>> set the rect of stack"Earth Explorer" to the rect of stack
>>splashStackName
>> wait for 0 seconds with messages
>> set the visible of stack stTarget to TRUE
>> close stack splashStackName
>> send "initCard" to cd "Opening" of stack "Earth Explorer"
>> set the lockscreen to false
>>   end mouseUp
>>
>> What am i doing wrong?
>> Bill
>>
>>
>>
>> William A. Prothero
>> http://es.earthednet.org/
>>
>
>
>___
>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: CSV again.

2015-10-15 Thread Mike Kerner
Alex, Richard, etc.

What do we consider the latest version of the csv parser?  I think I found
a bug in Richard's CSV2Text code, and proposed changes, but he wanted the
discussion to go down over here, first.  Then I noticed that csv4Text is
out over here, which makes 2, I guess, a bit long in the tooth.
___
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


Clipboard problem with Word and LC

2015-10-15 Thread Charles Szasz
I have been struggling with a font/clipboard problem for four days.  The 
following script works great on the Mac (Yosemite) and LC 5.5.5 placing text 
from a field “preview” onto to a clipboard and then pasted into a word 
processing document. The type of font and font size is set from the font menu 
in an option button.

But on Windows XP and Windows 8 the Windows app continues to give a Tahoma font 
and 9 point size font for all of the fonts when pasted into the Windows version 
of Open Office.  

I check the clipBoardData with the following command in the message box on both 
Mac and Windows versions of LC 5.5.5:

put keys(the clipBoardData)

which yielded:
styles
rtf
unicode
text

So there is styled text on the clipboard.

Here is the button script for adding the contents of field “preview” to the 
clipboard. Please note I tried both RTF and htmlText code but neither worked in 
Windows

on mouseUp
   if field "preview" <> ""
   then
 set the clipboardData to empty
  
 set the clipboardData["RTF"] to the RTFText of field "preview" 

  --set the clipboardData["html"] to the htmlText of field “preview” This 
gives the same results as RTF
  
   else
  answer information "You have no completed form to add to the clipboard."
   end if
end mouseUp

I also an option font menu for field “preview” with the following script:

on menuPick pItemName
   switch pItemName
  case "Select Font and Font Size for MSE in Document"
 set the textFont of field "preview" to "Arial"
 set the textSize of field "preview" to "12"
 break
  case "Arial - 10 point"
 set the textFont of field "preview" to "Arial"
 set the textSize of field "preview" to "10"
 break
  case "Arial - 11 point"
 set the textFont of field "preview" to "Arial"
 set the textSize of field "preview" to "11"
 break
  case "Arial - 12 point"
 set the textFont of field "preview" to "Arial"
 set the textSize of field "preview" to "12"
 break
  case "Georgia - 10 point"
 set the textFont of field "preview" to "Georgia"
 set the textSize of field "preview" to "10"
 break
  case "Georgia - 11 point"
 set the textFont of field "preview" to "Georgia"
 set the textSize of field "preview" to "11"
 break
  case "Georgia - 12 point"
 set the textFont of field "preview" to "Georgia"
 set the textSize of field "preview" to "12"
 break
  case "Palatino - 10 point - Mac only"
 set the textFont of field "preview" to "Palatino"
 set the textSize of field "preview" to "10"
 break
  case "Palatino - 11 point - Mac only"
 set the textFont of field "preview" to "Palatino"
 set the textSize of field "preview" to "11"
 break
  case "Palatino - 12 point - Mac only"
 set the textFont of field "preview" to "Palatino"
 set the textSize of field "preview" to "12"
 break
  case "Tahoma - 10 point"
 set the textFont of field "preview" to "Tahoma"
 set the textSize of field "preview" to "10"
 break
  case "Tahoma - 11 point"
 set the textFont of field "preview" to "Tahoma"
 set the textSize of field "preview" to "11"
 break
  case "Tahoma - 12 point"
 set the textFont of field "preview" to "Tahoma"
 set the textSize of field "preview" to "12"
 break
  case "Times New Roman - 10 point"
 set the textFont of field "preview" to "Times New Roman"
 set the textSize of field "preview" to "10"
 break
  case "Times New Roman - 11 point"
 set the textFont of field "preview" to "Times New Roman"
 set the textSize of field "preview" to "11"
 break
  case "Times New Roman - 12 point"
 set the textFont of field "preview" to "Times New Roman"
 set the textSize of field "preview" to "12"
 break
  case "Verdana - 10 point"
 set the textFont of field "preview" to "Verdana"
 set the textSize of field "preview" to "10"
 break
  case "Verdana - 11 point"
 set the textFont of field "preview" to "Verdana"
 set the textSize of field "preview" to "11"
 break
  case "Verdana - 12 point"
 set the textFont of field "preview" to "Verdana"
 set the textSize of field "preview" to "12"
 break
   end switch
end menuPick

I also viewed LC business academy short lesson on clipboard but it does not 
provide any clues on how to solve this problem.  In fact, it actually takes 
text from a Word (Mac) document and then pastes it into a LC field, which is 
not the same thing here. 

I would appreciate any help to solve this problem.  

Sent from my iPad

Re: Re: Export snapshot and native controls

2015-10-15 Thread Ludovic THEBAULT

> Le 15 oct. 2015 à 17:55, Paul Hibbert  a écrit :
> 
> Bill is spot on, try…
> 
> export snapshot from this cd to file tFile as JPEG
> 
> Paul


Export snapshot from  group … give me a screenshot without native controls
just as your solution.

It seem i need to fill a bug !


___
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: scaleFactor strangeness

2015-10-15 Thread Mark Waddingham

On 2015-10-15 11:08, Monte Goulding wrote:

Hmm... Even with the view object you would have an issue there. Inside
the view they would be relative to the topleft of the view and in the
coordinate system of the stack. If the message is passed it then
becomes arguable whether the message hierarchy includes the stack the
view is in and whether the parameters are altered to match the parent
window (or maybe even parent view) coordinate system.


Well the solution there is that the hosted stack's message path is *not* 
integrated into that of the host stack - the problem then goes away :)


Instead, think of a stackview control as creating a transformed space 
within a stack which is filled by another stack. It is a purely visual 
thing rather than structural.


Stacks can still communicate in all sorts of ways - for example, you 
could have substacks embedded in the mainstack so the messages flow in 
the current way you'd expect; or you could use a library which enables 
communication.


Also, there's also the option to add syntax allow a stack to send 
messages to its 'host' - whatever that might be. (This idea of 'host' 
isn't unique to the idea of stackview - exactly the same idea is present 
when you think about embedding a stack in a web-page in the HTML5 
engine).



Can of worms...


Only if you choose a worm-filled can ;)

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: I don't get Quicktime to run under LC 6.7.6

2015-10-15 Thread panagiotis merakos
Hi Tiemo,

What happens if you do:

on preopenstack

put the filename of player "myPlayer" into tOldFilename
set the filename of player "myPlayer" to empty
set the dontuseQT to false
set the filename of player "myPlayer" to tOldFilename
[...]
end preopenstack

Best regards,
Panos
--


On Thu, Oct 15, 2015 at 7:35 PM, Tiemo Hollmann TB 
wrote:

> Hello,
>
> OSX 10.9.5. Because of video file compatibility I still want to use QT in
> 6.7.6. In preopenstack I set:
>
> set the dontuseQT to false
>
> put the qtVersion into tTest
>
> In IDE:  start player "myplayer" -- nothing happens. The player runs (I get
> the playStopped status after the video is finished), but doesn't shows any
> video. Doing "set the dontuseQT to false" multiple times again, changes
> nothing.
>
> When closing the stack, removing from memory and reloading the same stack a
> second time, everything works fine like before in LC 6.5.2, the videos are
> played fine. So it seems, it has something to do with loading and providing
> QT. The first opening of my stack seems to load QT, but doesn't provides it
> to my stack. When opening the stack a second time, it now catches the
> properly loaded QT.
>
> In a standalone the videos are not played anymore at all.
>
> Does anybody got QT to run under 6.7.6? Any ideas, what else I could do?
>
> Thanks for any hints
>
> Tiemo
>
>
>
>
>
> ___
> 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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Mike Kerner
We have to be able to do better than "is really a".  If anything, "could be
a" and "is a" would be more helpful, where "is a" tells us what is going on
under the hood and "could be a" lets us know what we can do with the
container.

On Thu, Oct 15, 2015 at 1:11 PM, Dr. Hawkins  wrote:

> On Thu, Oct 15, 2015 at 10:07 AM, Mark Waddingham 
> wrote:
>
> > We added 'is really a' operators in LC8 to help with writing code which
> > needs to preserve values exactly (the main use-case is lcVCS) - so we
> have
> > been considering an 'is really' operator.
> >
>
> Soon to be accompanied by the 'damnit, I mean it!' command . . .
>
> :)
>
>
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> ___
> 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
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Mark Waddingham
Definitely not before we add ain't...

If x ain't y then darnit

;)

Sent from my iPhone

> On 15 Oct 2015, at 18:11, Dr. Hawkins  wrote:
> 
>> On Thu, Oct 15, 2015 at 10:07 AM, Mark Waddingham  wrote:
>> 
>> We added 'is really a' operators in LC8 to help with writing code which
>> needs to preserve values exactly (the main use-case is lcVCS) - so we have
>> been considering an 'is really' operator.
> 
> Soon to be accompanied by the 'damnit, I mean it!' command . . .
> 
> :)
> 
> 
> -- 
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> ___
> 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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread dunbarx
See a feature request I made in the forums. Whichever is the best/easiest/most 
robust  is up for grabs.


Craig Newman



-Original Message-
From: Mark Waddingham 
To: How to use LiveCode 
Sent: Thu, Oct 15, 2015 1:08 pm
Subject: Re: Forcing string comparisons, or When is "0" not 0?


On 2015-10-14 22:19, Devin Asay wrote:
> Shouldn’t there be a way to force a
string comparison? I know LC tries
> to be all helpful about casting numerals as
numbers, but what if I
> want to know if it’s the exact string?

I think this is
one of those things which has come up periodically over 
the years...

We added
'is really a' operators in LC8 to help with writing code which 
needs to
preserve values exactly (the main use-case is lcVCS) - so we 
have been
considering an 'is really' operator.

(It occurs to me this morning that perhaps
these should be 'x really is 
a string', or 'x really is y' as opposed to 'x is
really a string', or 
'x is really y' - I'm not sure which is 'more correct' in
English)

The 'is really a' operators check the internal (dynamic type) of the

value, by-passing any type-coercion:
   'x is really a string' -> returns true
if the current value of x is 
(internally) a string
   'x is a string' ->
returns true if x can be converted to a string

So, the 'is really' operator
would do much the same thing:
   'x is really y' -> returns true if the internal
types of x and y are 
the same, and they are the same value
   'x is y' -> if x
and y can be converted to numbers then compare as 
numbers else compare as
strings

The problem with 'is really' is that to truly understand what it is

doing, you have to explain about whilst LiveCode is a 'typeless' 
language
(assuming you ignore the existence of arrays ;)), the engine 
still has a notion
of distinct types internally (it needs to store the 
values in memory in some
chosen representation after all) and the 
internal type of a value depends on
how the value was last produced:
 put "0" + 0 into tVar1 -- tVar is really a
number
 put "0" & 0 into tVar2 -- tVar is really a string
 put tVar1 is
really tVar2 -- false

The other option (which has the potential advantage of
not exposing the 
7.0+ under-the-hood dynamically typed nature) is to have an
explicit 
'compare as string' operator (for purposes of exposition let's call it

is_string) for now. The action of such an operator would be to convert 
both
sides to strings (if possible) and then compare:
 put "0" is_string "0." --
false
 put 0+0 is_string char 1 of "0." -- true

This is subtly different
from is really:
 put 0 + 1 is really "1" -- false
 put 0 + 1 is_string
"1" -- true

Indeed, if we imagined that we had 'as ' operators then:

x is_string y <=> (x as string) is really (y as string)

So, anyway, a couple of
potential solutions (I think 'is really' is a 
useful compliment to the 'is
really a' operators, the question is 
whether there is a nice syntax for
is_string and whether it is a useful 
thing to have).

Warmest
Regards,

Mark.

> I guess I could do this dance:
> 
>   if char 1 of fld
“display” is “0” and char 2 of fld “display” is NOT 
> “0” then…
> 
> It’s seems
to complicated for such a simple thing, especially for
> explaining to novice
programmers. Maybe I’m missing something obvious.
> 
> Devin
> 
> 
> Devin
Asay
> Office of Digital Humanities
> Brigham Young University
> 
>
___
> 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

-- 
Mark Waddingham ~
m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create
apps

___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Scott Rossi
I'm not following all the nuances of this, but it seems you have laid the 
groundwork for a new operator: is useful

if theVar is useful then...

Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design

> On Oct 15, 2015, at 10:07 AM, Mark Waddingham  wrote:
> 
> So, anyway, a couple of potential solutions (I think 'is really' is a useful 
> compliment to the 'is really a' operators, the question is whether there is a 
> nice syntax for is_string and whether it is a useful thing to have).

___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Mark Waddingham
Unfortunately we already had 'is a' :(

Sent from my iPhone

> On 15 Oct 2015, at 18:16, Mike Kerner  wrote:
> 
> We have to be able to do better than "is really a".  If anything, "could be
> a" and "is a" would be more helpful, where "is a" tells us what is going on
> under the hood and "could be a" lets us know what we can do with the
> container.
> 
>> On Thu, Oct 15, 2015 at 1:11 PM, Dr. Hawkins  wrote:
>> 
>> On Thu, Oct 15, 2015 at 10:07 AM, Mark Waddingham 
>> wrote:
>> 
>>> We added 'is really a' operators in LC8 to help with writing code which
>>> needs to preserve values exactly (the main use-case is lcVCS) - so we
>> have
>>> been considering an 'is really' operator.
>> 
>> Soon to be accompanied by the 'damnit, I mean it!' command . . .
>> 
>> :)
>> 
>> 
>> --
>> Dr. Richard E. Hawkins, Esq.
>> (702) 508-8462
>> ___
>> 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
> 
> 
> 
> -- 
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>   and did a little diving.
> And God said, "This is good."
> ___
> 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: iPad File structure question

2015-10-15 Thread Ralph DiMola
Mobile app's files specified in the "copy files" pane of the standalone
settings are accessed via "the engine folder" path. You can't open SQLite
DBs in "the engine folder" because "the engine folder" is read-only. There
is no facility to open a SQLite db read-only. Option 1:Copy the db from "the
engine folder" to "the documents folder" and open it there. On iOS make sure
you mark any large files in the documents folder as "no backup" to make it
through the review process. Option 2: Copy the db from "the engine folder"
to "specialFolderPath("cache")" and open it there. The user can clear the
cache so check at each startup to make sure the db is still in the
"specialFolderPath("cache")" folder. There is no size limitation(within
reason) for the cache on iOS as it is not backed up to the cloud.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Glen Bojsza
Sent: Thursday, October 15, 2015 10:31 AM
To: How to use LiveCode
Subject: iPad File structure question

Hello,

I am working on an iPad app and have two SQLite databases that I want to be
stored in the contents of the app itself and not placed in the documents
folder.

I am using LC 8.

Q. Under Standalone Application Settings all options are "grayed" out so I
can't select Script Libraries for database and Database Support for SQLite?
Is this not currently supported in LC 8 DP4?

Q: how do you access the SQLite database when it is stored in the contents
of the application? Is there a special path?

I show the package contents of the iPad application and see the Folder Quiz
which contains the SQLite db.

thanks,

Glen
___
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


I don't get Quicktime to run under LC 6.7.6

2015-10-15 Thread Tiemo Hollmann TB
Hello,

OSX 10.9.5. Because of video file compatibility I still want to use QT in
6.7.6. In preopenstack I set:

set the dontuseQT to false

put the qtVersion into tTest

In IDE:  start player "myplayer" -- nothing happens. The player runs (I get
the playStopped status after the video is finished), but doesn't shows any
video. Doing "set the dontuseQT to false" multiple times again, changes
nothing.

When closing the stack, removing from memory and reloading the same stack a
second time, everything works fine like before in LC 6.5.2, the videos are
played fine. So it seems, it has something to do with loading and providing
QT. The first opening of my stack seems to load QT, but doesn't provides it
to my stack. When opening the stack a second time, it now catches the
properly loaded QT.

In a standalone the videos are not played anymore at all.

Does anybody got QT to run under 6.7.6? Any ideas, what else I could do?

Thanks for any hints

Tiemo

 

 

___
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: iPad File structure question

2015-10-15 Thread Glen Bojsza
This must be how a lot of the other apps are doing it since I have seen
their SQLite files in their app contents.

I am only doing read only and was hoping that this be fine but your
suggestions are well taken.

What is the syntax for copying the file from the engine's folder?

Also any idea why I can't select Script Libraries for database and Database
Support for SQLite?


Glen


On Thu, Oct 15, 2015 at 12:31 PM, Ralph DiMola 
wrote:

> Mobile app's files specified in the "copy files" pane of the standalone
> settings are accessed via "the engine folder" path. You can't open SQLite
> DBs in "the engine folder" because "the engine folder" is read-only. There
> is no facility to open a SQLite db read-only. Option 1:Copy the db from
> "the
> engine folder" to "the documents folder" and open it there. On iOS make
> sure
> you mark any large files in the documents folder as "no backup" to make it
> through the review process. Option 2: Copy the db from "the engine folder"
> to "specialFolderPath("cache")" and open it there. The user can clear the
> cache so check at each startup to make sure the db is still in the
> "specialFolderPath("cache")" folder. There is no size limitation(within
> reason) for the cache on iOS as it is not backed up to the cloud.
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Mark Waddingham

On 2015-10-14 22:19, Devin Asay wrote:

Shouldn’t there be a way to force a string comparison? I know LC tries
to be all helpful about casting numerals as numbers, but what if I
want to know if it’s the exact string?


I think this is one of those things which has come up periodically over 
the years...


We added 'is really a' operators in LC8 to help with writing code which 
needs to preserve values exactly (the main use-case is lcVCS) - so we 
have been considering an 'is really' operator.


(It occurs to me this morning that perhaps these should be 'x really is 
a string', or 'x really is y' as opposed to 'x is really a string', or 
'x is really y' - I'm not sure which is 'more correct' in English)


The 'is really a' operators check the internal (dynamic type) of the 
value, by-passing any type-coercion:
  'x is really a string' -> returns true if the current value of x is 
(internally) a string

  'x is a string' -> returns true if x can be converted to a string

So, the 'is really' operator would do much the same thing:
  'x is really y' -> returns true if the internal types of x and y are 
the same, and they are the same value
  'x is y' -> if x and y can be converted to numbers then compare as 
numbers else compare as strings


The problem with 'is really' is that to truly understand what it is 
doing, you have to explain about whilst LiveCode is a 'typeless' 
language (assuming you ignore the existence of arrays ;)), the engine 
still has a notion of distinct types internally (it needs to store the 
values in memory in some chosen representation after all) and the 
internal type of a value depends on how the value was last produced:

put "0" + 0 into tVar1 -- tVar is really a number
put "0" & 0 into tVar2 -- tVar is really a string
put tVar1 is really tVar2 -- false

The other option (which has the potential advantage of not exposing the 
7.0+ under-the-hood dynamically typed nature) is to have an explicit 
'compare as string' operator (for purposes of exposition let's call it 
is_string) for now. The action of such an operator would be to convert 
both sides to strings (if possible) and then compare:

put "0" is_string "0." -- false
put 0+0 is_string char 1 of "0." -- true

This is subtly different from is really:
put 0 + 1 is really "1" -- false
put 0 + 1 is_string "1" -- true

Indeed, if we imagined that we had 'as ' operators then:
x is_string y <=> (x as string) is really (y as string)

So, anyway, a couple of potential solutions (I think 'is really' is a 
useful compliment to the 'is really a' operators, the question is 
whether there is a nice syntax for is_string and whether it is a useful 
thing to have).


Warmest Regards,

Mark.


I guess I could do this dance:

  if char 1 of fld “display” is “0” and char 2 of fld “display” is NOT 
“0” then…


It’s seems to complicated for such a simple thing, especially for
explaining to novice programmers. Maybe I’m missing something obvious.

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University

___
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


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Dr. Hawkins
On Thu, Oct 15, 2015 at 10:07 AM, Mark Waddingham  wrote:

> We added 'is really a' operators in LC8 to help with writing code which
> needs to preserve values exactly (the main use-case is lcVCS) - so we have
> been considering an 'is really' operator.
>

Soon to be accompanied by the 'damnit, I mean it!' command . . .

:)


-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Ralph DiMola
I had a thread a month or 2 ago (Compare numeric strings with leading zeros). I 
needed to make sure that 0123 <> 123 for password validation. There were many 
good suggestions but I finally wound up with:

function stringsAreEqual pString1, pString2
 set the caseSensitive to true
 if (len(pString1) = len(pString2)) and (pString1 = pString2) then
  return true
 end if
 return false
end stringsAreEqual

Something built in would be better. If "0123" is exactly "123" then... would 
work for me

Now, should "is exactly" respect the caseSensitive property? If not then 
"exactly" would mean just what is says "EXACTLY". But respecting the 
caseSensitive property would be more flexible.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net
Phone: 518-636-3998 Ex:11
Cell: 518-796-9332


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Geoff Canyon
Sent: Thursday, October 15, 2015 2:48 PM
To: How to use LiveCode
Subject: Re: Forcing string comparisons, or When is "0" not 0?

On 2015-10-14 22:19, Devin Asay wrote:

> Shouldn’t there be a way to force a string comparison? I know LC tries 
> to be all helpful about casting numerals as numbers, but what if I 
> want to know if it’s the exact string?
>

I think you have come up with the best syntax right there.

put 3 is "3" -- true
put 3 is "3.0" -- true
put 3 is 2.999 -- true

put 3 is exactly "3" -- false
put 3 is exactly "3.0" -- false
put "3" is exactly "3" -- true
put 3 is exactly 3 -- true
put 3 is exactly 3.0 -- true
put 3 is exactly 2.999 -- false 
___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Peter Haworth
There is a new operator in LC8, "is really" which may help the
string/number comparison issue. See the LC8 dictionary for details.

Pete
lcSQL Software 
Home of lcStackBrowser  and
SQLiteAdmin 

On Thu, Oct 15, 2015 at 12:35 PM, Ralph DiMola 
wrote:

> I had a thread a month or 2 ago (Compare numeric strings with leading
> zeros). I needed to make sure that 0123 <> 123 for password validation.
> There were many good suggestions but I finally wound up with:
>
> function stringsAreEqual pString1, pString2
>  set the caseSensitive to true
>  if (len(pString1) = len(pString2)) and (pString1 = pString2) then
>   return true
>  end if
>  return false
> end stringsAreEqual
>
> Something built in would be better. If "0123" is exactly "123" then...
> would work for me
>
> Now, should "is exactly" respect the caseSensitive property? If not then
> "exactly" would mean just what is says "EXACTLY". But respecting the
> caseSensitive property would be more flexible.
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> Phone: 518-636-3998 Ex:11
> Cell: 518-796-9332
>
>
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On
> Behalf Of Geoff Canyon
> Sent: Thursday, October 15, 2015 2:48 PM
> To: How to use LiveCode
> Subject: Re: Forcing string comparisons, or When is "0" not 0?
>
> On 2015-10-14 22:19, Devin Asay wrote:
>
> > Shouldn’t there be a way to force a string comparison? I know LC tries
> > to be all helpful about casting numerals as numbers, but what if I
> > want to know if it’s the exact string?
> >
>
> I think you have come up with the best syntax right there.
>
> put 3 is "3" -- true
> put 3 is "3.0" -- true
> put 3 is 2.999 -- true
>
> put 3 is exactly "3" -- false
> put 3 is exactly "3.0" -- false
> put "3" is exactly "3" -- true
> put 3 is exactly 3 -- true
> put 3 is exactly 3.0 -- true
> put 3 is exactly 2.999 -- false
> ___
> 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

How to go to a stack without a flash

2015-10-15 Thread William Prothero
Folks:
I haver a splash stack and I’m trying to open the app stack in the same rect, 
without a flash. This should be easy, but I can’t get it to work with what is 
obvious to me. Here’s my script.

on mouseUp
   put the name of this stack into splashStackName
   put the filename of this stack into fName
   set the itemdelimiter to "/"
   delete the last item of fName
   put fName&"/Earth Explorer.livecode" into stTarget
   set the destroyStack of splashStackName to TRUE
   set the lockscreen to true
   go invisible cd 1 of stack stTarget
   set the rect of stack"Earth Explorer" to the rect of stack splashStackName
   wait for 0 seconds with messages
   set the visible of stack stTarget to TRUE
   close stack splashStackName
   send "initCard" to cd "Opening" of stack "Earth Explorer"
   set the lockscreen to false
 end mouseUp

What am i doing wrong?
Bill



William A. Prothero
http://es.earthednet.org/

___
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: LC8 lineOffset

2015-10-15 Thread Mark Talluto

> On Oct 14, 2015, at 5:58 PM, Peter Haworth  wrote:
> 
> Thanks Mark, I think it's the same bug, except on OSX.  I'm using the
> linestoskip parameter of lineOffset as you were.  I'm using lineOffset in a
> loop to return lines between a start and end line number.  I've worked
> around the problem by deleting the lines after I've finished using them, so
> the start line number is always 1.  For some reason it manages to get the
> correct offset for the end line number that way.

Hey Pete,

That is the problem right there. I was able to recreate our issue on a Mac as 
well. Hans works on a Windows system right now and reported the issue there.

Best regards,

Mark Talluto
canelasoftware.com 
CassiaDB: The rapid development, free local storage database, made for LiveCode 
developers: livecloud.io 





___
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: iPad File structure question

2015-10-15 Thread Glen Bojsza
Well I am behind when learning to make an iPad app... the SQLite is also a
checkbox in iOS Standalone settings (I see nothing about database libraries
so I assume LC 8 handles this in the background)

Also, the "engine's folder" may work since I would load the database in
memory while the app is running alternatively I can put them in the cache
or Documents folder as suggested.

Glen

On Thu, Oct 15, 2015 at 12:57 PM, Glen Bojsza  wrote:

> This must be how a lot of the other apps are doing it since I have seen
> their SQLite files in their app contents.
>
> I am only doing read only and was hoping that this be fine but your
> suggestions are well taken.
>
> What is the syntax for copying the file from the engine's folder?
>
> Also any idea why I can't select Script Libraries for database and
> Database Support for SQLite?
>
>
> Glen
>
>
> On Thu, Oct 15, 2015 at 12:31 PM, Ralph DiMola 
> wrote:
>
>> Mobile app's files specified in the "copy files" pane of the standalone
>> settings are accessed via "the engine folder" path. You can't open SQLite
>> DBs in "the engine folder" because "the engine folder" is read-only. There
>> is no facility to open a SQLite db read-only. Option 1:Copy the db from
>> "the
>> engine folder" to "the documents folder" and open it there. On iOS make
>> sure
>> you mark any large files in the documents folder as "no backup" to make it
>> through the review process. Option 2: Copy the db from "the engine folder"
>> to "specialFolderPath("cache")" and open it there. The user can clear the
>> cache so check at each startup to make sure the db is still in the
>> "specialFolderPath("cache")" folder. There is no size limitation(within
>> reason) for the cache on iOS as it is not backed up to the cloud.
>>
>> Ralph DiMola
>> IT Director
>> Evergreen Information Services
>> rdim...@evergreeninfo.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: scaleFactor strangeness

2015-10-15 Thread hh
@Mark

> this proposal is identical to anything which offers the ability to set
> a transform on any object and so still suffers from it.

Not really, if you mean affine transform. Translation destroys the wonderful
commutativity you have with my proposal: If you interchange objects in the
owner path/message path before a target then this has no effect on the total
scalefactor of this target. And you know the "inverse" operation as a function!
Beside the usual rounding effects I can see no problem with that at the moment.

But I see your (good) arguments related to stack's scalefactor.
Mine are to see it hierarchically in the top level:

The stack (and it's view) is the global object and handles with the OS and
the hardware (you have a lot of pretty things already realized for us).
Everything in the stack is in local coords.

The mouseLoc etc. is scaled by TSF(mouse) = SF(stack)*SF(card)*SF(mouse).
We don't have to care about such things, you do in the engine.
And it is scripter's problem to ask for the total scalefactor ('TSF') of 
objects.

For example one may set SF(mouse)=1/SF(stack)/SF(card) to have TSF(mouse)=1, the
usual unscaled local coords (which are then correct physical coords, relative to
physical coords of the topleft of the window).

> We already have the 'fullScreenMode' property - which controls the 
> transform from 'card-space' to 'window-space'.

This is for me still the card space, everything on the card has its old 
coordinates
now multiplied by a different SF(stack) and is clipped to the screenrect.

> So if your stack is 400x400 and you want to display the middle portion 
> (100,100,300,300); then you'd set something like:
> set the visibleRect of stack ... to "100,100,300,300"
> This would scale and translate the 200x200 middle rectangle to fill the 
> entire window.

This is for me a change of the card's scalefactor with an unchanged stack's
scalefactor: For each and every object
 TSF(object) = SF(stack)*SF(card)*SF(object)
has changed its second factor.
This means, in that situation of a window that clips the stack, you could once
again zoom in/out by simply changing the card's scalefactor (and clipping) and
leaving the topleft of the clipping window pinned to screen.
No need to change global coords.

This example could be essentially a starting point for the discussion. One stays
on the same hardware, leaves SF(stack) unchanged. Then changing SF(card) would
leave the topleft of stack's window unchanged and scale everything on the card
(incl. mouseLoc).
[Additionally changing the width and height of stack's view or clipping to
another/the old size could be an option.]

If I'm right, has every object beside (sub-)stacks currently the owner "card",
so that the owner paths of a mainstack seem to lead uniquely to:
 TSF(stack) = SF(stack)
  TSF(card) = SF(stack)*SF(card)
TSF(object) = SF(stack)*SF(card)*SF(object)

TMHO, this is isn't more complicated and burden with problems than the handling
of a property like "colour".
Anyway, thanks and praise to the whole team for some really great (even though 
partly unfinished) improvements of LC.


___
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: iPad File structure question

2015-10-15 Thread Ralph DiMola
First of all I created a function theEngine. This will allow testing in the
IDE.

function TheEngine
   local tStackPath
switch 
 case the environment = "Mobile"
 return the engine folder
 break
default
  put the long name of this stack into tStackPath
   replace ("stack ") with empty in tStackPath
   put char 1 to -2 in tStackPath into tStackPath
   set the itemdelimiter to slash
   put item 1 to -2 of tStackPath into tStackPath 
 return tStackPath
end switch
   
end TheEngine

Then a function to get destination document paths

Function TheDocuments
local tStackPath
switch 
 case the environment = "Mobile"
 return the documents folder
 break
default
put the long name of this stack into tStackPath
   replace ("stack ") with empty in tStackPath
   put char 1 to -2 in tStackPath into tStackPath
   set the itemdelimiter to slash
   put item 1 to -2 of tStackPath into tStackPath 
 return tStackPath & slash & "MyTestFolder"
end switch
End TheDocuments

MyTestFolder is a folder in the stack folder that will mirror what will be
in the documents folder on mobile.

Then copy the file...

put url ("binfile:"()slash&"Mydb.db") into url
("binfile:"())

set the no-backup for iOS
if the platform = "iphone" then
iphoneSetDoNotBackupFile TheDocuments()slash&"Mydb.db" , true
end if

When opening the DB use this as the filename parameter==>
TheDocuments()slash&"Mydb.db"
This will work in the IDE or Mobile.

Disclaimer. I excised this code and there could be a typo But this should
get you going.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Glen Bojsza
Sent: Thursday, October 15, 2015 12:58 PM
To: How to use LiveCode
Subject: Re: iPad File structure question

This must be how a lot of the other apps are doing it since I have seen
their SQLite files in their app contents.

I am only doing read only and was hoping that this be fine but your
suggestions are well taken.

What is the syntax for copying the file from the engine's folder?

Also any idea why I can't select Script Libraries for database and Database
Support for SQLite?


Glen


On Thu, Oct 15, 2015 at 12:31 PM, Ralph DiMola 
wrote:

> Mobile app's files specified in the "copy files" pane of the 
> standalone settings are accessed via "the engine folder" path. You 
> can't open SQLite DBs in "the engine folder" because "the engine 
> folder" is read-only. There is no facility to open a SQLite db 
> read-only. Option 1:Copy the db from "the engine folder" to "the 
> documents folder" and open it there. On iOS make sure you mark any 
> large files in the documents folder as "no backup" to make it through 
> the review process. Option 2: Copy the db from "the engine folder"
> to "specialFolderPath("cache")" and open it there. The user can clear 
> the cache so check at each startup to make sure the db is still in the 
> "specialFolderPath("cache")" folder. There is no size 
> limitation(within
> reason) for the cache on iOS as it is not backed up to the cloud.
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Geoff Canyon
On 2015-10-14 22:19, Devin Asay wrote:

> Shouldn’t there be a way to force a string comparison? I know LC tries
> to be all helpful about casting numerals as numbers, but what if I
> want to know if it’s the exact string?
>

I think you have come up with the best syntax right there.

put 3 is "3" -- true
put 3 is "3.0" -- true
put 3 is 2.999 -- true

put 3 is exactly "3" -- false
put 3 is exactly "3.0" -- false
put "3" is exactly "3" -- true
put 3 is exactly 3 -- true
put 3 is exactly 3.0 -- true
put 3 is exactly 2.999 -- false
___
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: Forcing string comparisons, or When is "0" not 0?

2015-10-15 Thread Mike Kerner
yes, I know and it's great, like, what is the other one?  "is me"?

If we're going to leave "is a" as is, then let's come up with something
better than "is really a"

On Thu, Oct 15, 2015 at 1:24 PM, Scott Rossi  wrote:

> I'm not following all the nuances of this, but it seems you have laid the
> groundwork for a new operator: is useful
>
> if theVar is useful then...
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, UX/UI Design
>
> > On Oct 15, 2015, at 10:07 AM, Mark Waddingham  wrote:
> >
> > So, anyway, a couple of potential solutions (I think 'is really' is a
> useful compliment to the 'is really a' operators, the question is whether
> there is a nice syntax for is_string and whether it is a useful thing to
> have).
>
> ___
> 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
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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