Re: RevServer deployment on OSX Server

2011-02-17 Thread paolo mazza
Keith,
thank you very much. This is really helpful.

Still I have some questions about rev server:

Generally speaking, is the rev-server (Pre-release 2) reliable for
professional services ?

The Server Deployment Pack (Pre-release 2)  install the same
rev-server version as the one running in the on-rev.com server?

The runrev site says: Current test version  supports Linux and Mac OS
X Darwin. Text encoding support, image rendering and LiveCode stack
support intended for the first shipping version. However it does not
say when  the final version is supposed to be released. Is there
somewhere a road map about this?

All the best

Paolo Mazza

___
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: formattedHeight and scrollbars

2011-02-17 Thread Claus Dreischer
Hi,

Am 17.02.11 01:02, schrieb dunb...@aol.com:
 A fun revlet.

Indeed!


 The way you made it, it can be seen that a horizontal scrollbar not only 
 takes up its own height, but intrudes that amount into the lower part of the 
 field as well. That is why it takes twice its height from the formattedHeight.

The height of the filed does not change, so either you subtract the
scrollbarwidth from the height of the field, or you add the
scrollbarwidth to the formattedHeight to get the height needed by an
object to display its full contents without scrolling (Dictionary).

I don't think you can do both.
(Well at least if you are no banker or politician or something like hat
:- )

Example:
- Start Bernds Revlet
- set textHeight to 11
- set textSize to 1
- gives you formattedHeight of 70
- The height of the field is 78 (i checked with Bernd)
- The difference of 8 pixel (78-70) is the free space below the text
- Now set the scrollbarWidth to 8
- enable the hScrollbar
- The 8 pixel scrollbar takes the place of that free space
- *BUT* the formattedHeight is now 86,
  which implies that you need additional 8 pixel
  to display its full contents without scrolling (Dictionary).

  This is just not true.

the height needed by an object to display its full contents without
scrolling (Dictionary) is 80, Bernds Revlet demonstrates it clearly.

Or, where in the above did i go wrong?


Regards,
Claus.


[...]

 Hi Claus,
 
 I made a little revlet that shows what impacts the formattedHeight of a
 field:
 
 http://berndniggemann.on-rev.com/marginsrevlet/
 
 among other things the scrollbars and their size furthermor the margins, the
 borderwith the textsize and the textheight. I hope I did not forget
 anything. Before 4.5 on a Mac the focusborder also added to the
 formattedHeight if I remember correctly.
 
 Kind regards
 
 Bernd

___
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: RevServer deployment on OSX Server

2011-02-17 Thread Keith Clarke
Paolo,
Sorry, I can't answer your question as whilst I have revServer installed, it is 
currently unused, as my expectations of it were far greater than a CGI engine. 

I bought the server deployment in the expectation that I could take the same 
set of stacks I would use for a desktop app development and (perhaps with a few 
modifications) simply deploy to revServer to create a web application, with the 
UI elements 'automagically' becoming available to a browser. 

It has all gone very quiet concerning both server deployment and browser - no 
new pre-release versions or revised road-maps. I just hope the mothership is 
planning a big surprise for us all come the big April event.
Best,
Keith.. 

On 17 Feb 2011, at 08:12, paolo mazza wrote:

 Keith,
 thank you very much. This is really helpful.
 
 Still I have some questions about rev server:
 
 Generally speaking, is the rev-server (Pre-release 2) reliable for
 professional services ?
 
 The Server Deployment Pack (Pre-release 2)  install the same
 rev-server version as the one running in the on-rev.com server?
 
 The runrev site says: Current test version  supports Linux and Mac OS
 X Darwin. Text encoding support, image rendering and LiveCode stack
 support intended for the first shipping version. However it does not
 say when  the final version is supposed to be released. Is there
 somewhere a road map about this?
 
 All the best
 
 Paolo Mazza
 
 ___
 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: RevServer deployment on OSX Server

2011-02-17 Thread Andre Garzia
On Thu, Feb 17, 2011 at 7:06 AM, Keith Clarke
keith.cla...@clarkeandclarke.co.uk wrote:
 I bought the server deployment in the expectation that I could take the same 
 set of stacks I would use for a desktop app development and (perhaps with a 
 few modifications) simply deploy to revServer to create a web application, 
 with the UI elements 'automagically' becoming available to a browser.

Keith,

that expectation was a tad unrealistic, it was never that. It was
always a php like engine... From its inception and thru all its
descriptions and sparse documents, it was always said this was going
to be a CGI replacement, a new engine like php to create server side
logic.

Andre


-- 
http://www.andregarzia.com All We Do Is Code.

___
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


Call for Linux crashers

2011-02-17 Thread Richard Gaskin
Last week I discovered a crashing issue with LC on Linux, in which 
setting the width of a field which has both vertical and horizonal 
scrollbars active below 14px would cause LC to die instantly:

http://quality.runrev.com/qacenter/show_bug.cgi?id=9395

Thankfully, Mark Waddingham was able to confirm that quickly, and we can 
hope that'll be addressed in an upcoming build.


Once I found the specific recipe, it wasn't hard to build in a 
workaround to prevent the crash by simply coding so that the field is 
never too narrow.


This got me thinking about the other crashers folks have noted here before.

Unfortunately, the reports at RunRev's RQCC don't include all such 
issues, and there's so much noise in that DB (duplicate reports, 
long-since-resolved issues, simple misunderstandings of feature 
implementation, RTFM) that relying on a search there for Linux doesn't 
give me confidence that I'll find everything that may affect our work on 
that platform.


So I'm posting this as an invitation to those here to deploy to Linux or 
plan to this year:


Let's catalog any and all crashing issues you have with LiveCode on 
Linux, and if they're not in the RQCC I'll submit them, and if they are 
I'll see if we can pin down a recipe and hopefully even a workaround, 
and add those notes to the RQCC entry for it.


If you have other non-crashing issues I suppose we can look at those as 
well, and with any luck we may be able to find workarounds for many of 
them just as I found with the field width issue.


Unless the other members of this list object, I feel this effort is 
on-topic enough to warrant happening here on this list, provided such 
discussion is succinct and to the point.


If the other readers here disagree I suppose we can migrate the 
discussion to the Linux section of the forums, but there are a lot of 
Linux users here who aren't there so I'd prefer to keep it here if 
that's no trouble for those who don't currently deploy to Linux.


Thank in advance for your help on this -

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

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


Re: RevServer deployment on OSX Server

2011-02-17 Thread Keith Clarke
Andre, You're absolutely correct that my expectations were too high. I wasn't 
complaining but just explaining why I wasn't using revServer yet and therefore 
couldn't address Paulo's question. ;-)

The revServer product description in the store 
http://www.runrev.com/products/server-deployment/ reads Pre-release 2. 
Supports Linux and Mac OS X Darwin. Text encoding support, image rendering and 
LiveCode stack support intended for the first shipping version. I look forward 
to it being able to meet these launch-ready capabilities. 

Indeed, I'd welcome any new pre-release dated later than 16 June 2010, so that 
I didn't feel that the revServer pre-release programme wasn't merely a ruse to 
gain investment for iOS development.   
   
On 17 Feb 2011, at 15:04, Andre Garzia wrote:

 On Thu, Feb 17, 2011 at 7:06 AM, Keith Clarke
 keith.cla...@clarkeandclarke.co.uk wrote:
 I bought the server deployment in the expectation that I could take the same 
 set of stacks I would use for a desktop app development and (perhaps with a 
 few modifications) simply deploy to revServer to create a web application, 
 with the UI elements 'automagically' becoming available to a browser.
 
 Keith,
 
 that expectation was a tad unrealistic, it was never that. It was
 always a php like engine... From its inception and thru all its
 descriptions and sparse documents, it was always said this was going
 to be a CGI replacement, a new engine like php to create server side
 logic.
 
 Andre
 
 
 -- 
 http://www.andregarzia.com All We Do Is Code.
 
 ___
 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: Rev player for Windows 7???

2011-02-17 Thread Andrew Kluthe

I use sons of thunder's stack runner for this. It works well for me under
windows 7. :)

http://www.sonsothunder.com/devres/livecode/downloads/StackRunner.htm
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Rev-player-for-Windows-7-tp3311061p3311105.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: [OT] Apple at it again

2011-02-17 Thread Bob Sneidar
Heh heh. The Germans loved him! He took Germany from a faltering bankrupt 
country full of starving people and made them a great nation. It was his 
methods that were questionable. So if methods are the issue, who among us is 
good? 

Sorry I can't help myself. 

Bob


On Feb 16, 2011, at 6:48 PM, Chipp Walters wrote:

 Reread that part. Just for the record, I in now way am comparing Jobs to
 Hitler! Just thought the Godwin's law thing was sorta funny-- on second
 read-- not so much.
 
 On Wed, Feb 16, 2011 at 4:38 PM, Chipp Walters ch...@chipp.com wrote:
 
 Furthermore, I don't need to personally know Hitler to know he was a bad,
 evil man-- and can certainly say so without him here to defend himself.
 That's just silly. (I've just invoked Godwin's law!)
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Using revIgniters Encrypt lib in LiveCode Desktop

2011-02-17 Thread Andrew Kluthe

I solved this problem by copying most of the code from Encrypt.irev and a few
other required functions from Common.irev and now have my data being
encrypted and sent to a revIgniter web service for processing. I love the
versatility of this framework.
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Using-revIgniters-Encrypt-lib-in-LiveCode-Desktop-tp3307322p334.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: [OT] Apple at it again

2011-02-17 Thread Björnke von Gierke
On 17 Feb 2011, at 17:36, Bob Sneidar wrote:

 Heh heh. The Germans loved Hitler! He took Germany from a faltering bankrupt 
 country full of starving people and made them a great nation.

No. He destroyed a recouping economy and restarted the war that was deemed to 
be the last one ever needed. Also, there was no the Germans (and still isn't) 
as implied by you.

___
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: [OT] Apple at it again

2011-02-17 Thread Bob Sneidar
I wonder how the Germans feel about that? ;-) JUST KIDDING!

Bob


On Feb 17, 2011, at 9:23 AM, Björnke von Gierke wrote:

 Also, there was no the Germans (and still isn't) as implied by you.


___
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: [OT] Apple at it again

2011-02-17 Thread Björnke von Gierke
On 17 Feb 2011, at 18:47, Bob Sneidar wrote:

 I wonder how the Germans feel about that? ;-) JUST KIDDING!

There's no Germans, Russians, Italian or one of the other human group labels 
that where invented for nationalistic state-building purposes shortly before 
the great war. Stop implying there are.

Also, you really don't know when to stop replying (hint: about 10 replies ago). 
Second hint: I have a German passport.

-- 

official ChatRev page:
http://bjoernke.com?target=chatrev


Chat with other RunRev developers:
go stack URL http://bjoernke.com/chatrev/chatrev1.3b3.rev;


___
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: [OT] Apple at it again

2011-02-17 Thread Bob Sneidar
I wonder if you think that your terse replies to me obligate me to stop 
replying? The best way to get me to stop replying is to stop yourself. Okay? I 
have heard about enough from you. I think I will just create a rule to drop 
everything you post into my trash where it belongs. 

Bob


On Feb 17, 2011, at 9:54 AM, Björnke von Gierke wrote:

 On 17 Feb 2011, at 18:47, Bob Sneidar wrote:
 
 I wonder how the Germans feel about that? ;-) JUST KIDDING!
 
 There's no Germans, Russians, Italian or one of the other human group labels 
 that where invented for nationalistic state-building purposes shortly before 
 the great war. Stop implying there are.
 
 Also, you really don't know when to stop replying (hint: about 10 replies 
 ago). Second hint: I have a German passport.
 
 -- 
 
 official ChatRev page:
 http://bjoernke.com?target=chatrev
 
 
 Chat with other RunRev developers:
 go stack URL http://bjoernke.com/chatrev/chatrev1.3b3.rev;
 
 
 ___
 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: RevServer deployment on OSX Server

2011-02-17 Thread Keith Clarke
Jaque, 
Thanks for the explanation and the links (bookmarked for further study). 

However, isn't this 'thick client' web application architecture, (with the 
proprietary revlet download and requisite local machine/browser support by a 
rev plug-in) only one revServer scenario? 

According to the RunRev product page, it is still being positioned as an 
enabler of HTML+CSS+irev capabilities within a standard browser to create, 
platform-independent cloud-based applications. 

Or am I missing the point completely?

On 17 Feb 2011, at 16:17, J. Landman Gay wrote:

 On 2/17/11 3:06 AM, Keith Clarke wrote:
 
 I bought the server deployment in the expectation that I could take
 the same set of stacks I would use for a desktop app development and
 (perhaps with a few modifications) simply deploy to revServer to
 create a web application, with the UI elements 'automagically'
 becoming available to a browser.
 
 As Andre mentioned, it was never meant for that. It's strictly a server-side 
 language, but it works very well for its intended use. My personal site is 
 built completely with it: http://jacque.on-rev.com/
 
 The automatic embedding of stacks into a web page is what revlets are for. So 
 there are two parts to the LiveCode web experience -- the server language 
 (on-rev, irev) and the client plugin (revlets.)
 
 The nice part is that you can combine the two on the same web page. That's 
 what I've done here: http://jacque.on-rev.com/codebits/dualrevlets.irev On 
 that page, all the page layout is managed by includes in my irev scripts, 
 and some things are dynamically calculated by the irev scripts when the page 
 loads (the copyright notice, for example, updates the year automatically.) 
 But the two revlets on the page are run by the client-side plugin. You get 
 the best of both worlds this way.
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.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: [OT] Apple at it again

2011-02-17 Thread Andre Garzia
2011/2/17 Björnke von Gierke b...@mac.com:
 On 17 Feb 2011, at 18:47, Bob Sneidar wrote:

 I wonder how the Germans feel about that? ;-) JUST KIDDING!

 There's no Germans, Russians, Italian or one of the other human group labels 
 that where invented for nationalistic state-building purposes shortly before 
 the great war. Stop implying there are.

 Also, you really don't know when to stop replying (hint: about 10 replies 
 ago). Second hint: I have a German passport.

I have a brazilian and a portuguese passport, are we playing trumphs? :-D



 --

 official ChatRev page:
 http://bjoernke.com?target=chatrev


 Chat with other RunRev developers:
 go stack URL http://bjoernke.com/chatrev/chatrev1.3b3.rev;


 ___
 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




-- 
http://www.andregarzia.com All We Do Is Code.

___
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: [OT] Apple at it again

2011-02-17 Thread Richmond

On 02/17/2011 07:23 PM, Björnke von Gierke wrote:

On 17 Feb 2011, at 17:36, Bob Sneidar wrote:


Heh heh. The Germans loved Hitler! He took Germany from a faltering bankrupt 
country full of starving people and made them a great nation.

No. He destroyed a recouping economy and restarted the war that was deemed to be the last 
one ever needed. Also, there was no the Germans (and still isn't) as implied 
by you.

___
A certain percentage of the Germans voted for Hitler because the country 
was in a bad state and, at

that point, he seemed to offer a way out. Of those who voted:

1. A large proportion had no idea of what he would subsequently do.

2. A lot more were hypnotised by the razzmatazz, the sexy uniforms and 
the organisation.


I don't think any Germans loved Hitler; what I do think is that a huge 
number of Germans

were BRAINWASHED by Hitler.

Now, if we examine the Stanley Milgram experiments (whic has already 
been done on the Use-List)
we can see that Americans are just as susceptible to brainwashing and 
peer pressure as the
Germans. I suspect that any set of human beings in the right place at 
the right time could

go the same way.

So; while blaming the Germans for what Hitler did is all jolly 
fashionable and so on, it is a load
of old tosh insofar as the vast majority of the German nation (and an 
awful lot of other people
as well) were suffering from a sort of collective madness for about 7-8 
years; the consequences
of which were just as devastating for them as for most of the other 
people involved in the World War.


And Bob's Heh, heh only serves to let us know that his The Germans 
loved Hitler is on the level
and as well thought out as the sort of stupid pronouncements I used to 
come out with when I was 7

years old.
___
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: [OT] Apple at it again

2011-02-17 Thread Björnke von Gierke
Ah but you love to argue so much! If you'd trash every opposing voice, who 
would you then argue with?

Still, probably the wrong place for that. Of course I am not (able of) stopping 
you, only lambast you at every opportunity.

On 17 Feb 2011, at 19:03, Bob Sneidar wrote:

 I wonder if you think that your terse replies to me obligate me to stop 
 replying? The best way to get me to stop replying is to stop yourself. Okay? 
 I have heard about enough from you. I think I will just create a rule to drop 
 everything you post into my trash where it belongs. 
 
 Bob
 
 
 On Feb 17, 2011, at 9:54 AM, Björnke von Gierke wrote:
 
 On 17 Feb 2011, at 18:47, Bob Sneidar wrote:
 
 I wonder how the Germans feel about that? ;-) JUST KIDDING!
 
 There's no Germans, Russians, Italian or one of the other human group labels 
 that where invented for nationalistic state-building purposes shortly before 
 the great war. Stop implying there are.
 
 Also, you really don't know when to stop replying (hint: about 10 replies 
 ago). Second hint: I have a German passport.



-- 

official ChatRev page:
http://bjoernke.com?target=chatrev


Chat with other RunRev developers:
go stack URL http://bjoernke.com/chatrev/chatrev1.3b3.rev;


___
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: [OT] Apple at it again

2011-02-17 Thread Richmond

On 02/17/2011 07:47 PM, Bob Sneidar wrote:

I wonder how the Germans feel about that? ;-) JUST KIDDING!



STOP kidding now!


Bob


On Feb 17, 2011, at 9:23 AM, Björnke von Gierke wrote:


Also, there was no the Germans (and still isn't) as implied by you.


___
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: [OT] Apple at it again

2011-02-17 Thread Richmond

Dear Heather Nagey,

  Please put a cap on this one.

Love, Richmond.
___
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: [OT] Apple at it again

2011-02-17 Thread Björnke von Gierke

On 17 Feb 2011, at 19:12, Andre Garzia wrote:

 2011/2/17 Björnke von Gierke b...@mac.com:
 Also, you really don't know when to stop replying (hint: about 10 replies 
 ago). Second hint: I have a German passport.
 
 I have a brazilian and a portuguese passport, are we playing trumphs? :-D

I equal your Portuguese with a Swiss one: Split pot! 

xD

-- 

official ChatRev page:
http://bjoernke.com?target=chatrev


Chat with other RunRev developers:
go stack URL http://bjoernke.com/chatrev/chatrev1.3b3.rev;


___
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


Sample code for reading a CSV file

2011-02-17 Thread Paul Dupuis

So I am tired of reinventing the proverbial wheel over and over again.

I have a new project that I want to read a CSV file for. Obviously 
reading the file is easy. And is it was tab separated instead of comma, 
parsing out the rows and columns is easy as well. However, with comma 
seperated data where some columns contain string with commas in then 
that are encapsulated in quotes, just plowing through the itemDelimiter 
and lineDelimter doesn't work.


So before I bother to write code to handle encapsulated CSV data, I 
thought I'd ask if anyone on the use-list has existing code to handle 
CSV's that they'd be willing to share.


--
Paul Dupuis
Cofounder
Researchware, Inc.
http://www.researchware.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: [OT] Apple at it again

2011-02-17 Thread Heather Nagey

Dear List Folks,

I concur.

This thread is dead, please do not reply to any further posts on this  
topic.


Regards,

Heather

On 17 Feb 2011, at 18:14, Richmond wrote:


Dear Heather Nagey,

 Please put a cap on this one.

Love, Richmond.
___
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

Email has been scanned for viruses by Altman Technologies' email  
management service - www.altman.co.uk/emailsystems


Heather Nagey
Customer Services Manager
http://www.runrev.com/
LiveCode – Realize fast, compile-free coding


___
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: Call for Linux crashers

2011-02-17 Thread David C.
Hello Richard,
I pretty much test everything I do on the Linux platform and haven't
run into any troubles other than the very severe performance issue we
discussed a bit last week... will keep you posted should that change.

Best regards,
David C.

___
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: Call for Linux crashers

2011-02-17 Thread Richard Gaskin

David C. wrote:

I pretty much test everything I do on the Linux platform and haven't
run into any troubles other than the very severe performance issue we
discussed a bit last week... will keep you posted should that change.


That's actually very encouraging - thanks for that.

I recall the thread, but can't turn it up -- what was the thread title?
And were the slowdowns limited to the script editor, or all text 
operations, or things other than text operations?


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

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


Re: Sample code for reading a CSV file

2011-02-17 Thread Bob Sneidar
seems in that case you would have to check the text between every odd and even 
quote first and convert any cr's in between to another character before your 
line loop. It's not even that simple, because numbers and date values are not 
typically quoted are they? 

I'm beginning to see why some don't like csv files! 

Bob


On Feb 17, 2011, at 10:45 AM, Nonsanity wrote:

 I threw a quick one together, because little problems like this always
 intrigue me. :)
 
 New stack, made two fields and a button, and put the source CSV list in the
 first. Button script as:
 
 on mouseUp
   put  into o
   put fld 1 into x
   repeat with a = 1 to the number of lines in x
  put line a of x into xx
  set itemdel to quote
  repeat with b = 1 to the number of items in xx
 if trunc(b/2) = (b/2) then replace comma with numtochar(2) in item
 b of xx
  end repeat
  set itemdel to comma
  repeat with b = 1 to the number of items in xx
 get item b of xx
 replace numtochar(2) with comma in it
 put it  return after o
  end repeat
  put   return after o
   end repeat
   put o into fld 2
 end mouseUp
 
 As long as quoted items don't have return charters in them, this should
 work. If that IS a possibility, it would get a tad more complicated.
 
 ~ Chris Innanen
 ~ Nonsanity
 
 
 On Thu, Feb 17, 2011 at 1:16 PM, Paul Dupuis p...@researchware.com wrote:
 
 So I am tired of reinventing the proverbial wheel over and over again.
 
 I have a new project that I want to read a CSV file for. Obviously reading
 the file is easy. And is it was tab separated instead of comma, parsing out
 the rows and columns is easy as well. However, with comma seperated data
 where some columns contain string with commas in then that are encapsulated
 in quotes, just plowing through the itemDelimiter and lineDelimter doesn't
 work.
 
 So before I bother to write code to handle encapsulated CSV data, I thought
 I'd ask if anyone on the use-list has existing code to handle CSV's that
 they'd be willing to share.
 
 --
 Paul Dupuis
 Cofounder
 Researchware, Inc.
 http://www.researchware.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: Sample code for reading a CSV file

2011-02-17 Thread Nonsanity
Here's a generalized case that returns an array, with or without the quotes,
and that allows for commas and returns inside the quotes to remain part of
that element. It also preserves backslash-escaped quotes in any element,
quoted or not.


function CSVtoArray csv, removeQuotes, preserveEscapedQuotes
   if preserveEscapedQuotes is empty then put true into
preserveEscapedQuotes

   set itemdel to quote
   if preserveEscapedQuotes then replace (\quote) with numtochar(3) in
csv
   repeat with b = 1 to the number of items in csv
  if trunc(b/2) = (b/2) then
 replace return with numtochar(1) in item b of csv
 replace comma with numtochar(2) in item b of csv
  end if
   end repeat

   set itemdel to comma
   repeat with a = 1 to the number of lines in csv
  put line a of csv into theline
  repeat with b = 1 to the number of items in theline
 get item b of theline
 replace numtochar(1) with return in it
 replace numtochar(2) with comma in it
 if removeQuotes then replace quote with  in it
 if preserveEscapedQuotes then replace numtochar(3) with quote in it
 put it into o[a][b]
  end repeat
   end repeat
   return o
end CSVtoArray


The 2nd and 3rd parameters are optional, with expected settings as default.
(Leave quotes on the strings, and DO preserve escaped quotes.) It doesn't
allow StartOfHeading, StartOfText, or EndOfText characters to be in the
source (ASCII 1, 2, and 3 respectively) but then those are non-printable
characters and not likely to be there to begin with. It should be fairly
speedy, though I haven't tested it with a huge input.

 ~ Chris Innanen
 ~ Nonsanity



On Thu, Feb 17, 2011 at 1:16 PM, Paul Dupuis p...@researchware.com wrote:

 So I am tired of reinventing the proverbial wheel over and over again.

 I have a new project that I want to read a CSV file for. Obviously reading
 the file is easy. And is it was tab separated instead of comma, parsing out
 the rows and columns is easy as well. However, with comma seperated data
 where some columns contain string with commas in then that are encapsulated
 in quotes, just plowing through the itemDelimiter and lineDelimter doesn't
 work.

 So before I bother to write code to handle encapsulated CSV data, I thought
 I'd ask if anyone on the use-list has existing code to handle CSV's that
 they'd be willing to share.

 --
 Paul Dupuis
 Cofounder
 Researchware, Inc.
 http://www.researchware.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: RevServer deployment on OSX Server

2011-02-17 Thread Björnke von Gierke
Note that there's also need for having the stacks cards and most importantly 
graphics and images being accessible. because that's an easy and proven way to 
create images for the web via the export and import commands. 


On 17 Feb 2011, at 20:38, J. Landman Gay wrote:

 There have been requests that irev should use stacks as code libraries, just 
 as we can on the desktop with start using stack x or library stack x. The 
 intention is to add that ability so that you can drop a library stack onto 
 the server, start using it, and it's stack script will be available to irev 
 handlers. Currently we need to write LiveCode scripts as text files and use 
 includes for that. So that's what they mean by LiveCode stack support 
 intended for the first shipping version.

-- 

official ChatRev page:
http://bjoernke.com?target=chatrev


Chat with other RunRev developers:
go stack URL http://bjoernke.com/chatrev/chatrev1.3b3.rev;


___
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: Sample code for reading a CSV file

2011-02-17 Thread Paul Dupuis
First, thanks to everyone who replied, but especially to Nosanity. Your 
code reminded me that you can effectively tell when you are inside an 
encapsulated bit of data by an odd/even count of the encapsulation 
character. So, for anyone who wants it, here is a generalized function 
that I just wrote to parse a CSV file, regardless of the field or record 
delimiters (commas, tabs or whatever) and to deal with encapsulation 
appropriately.


This assumes you read the entire CSV file into a variable you pass into 
pData, so a call would look like:


put csvToArray(myEntireCSVData,return,comma,quote) into myDataAsArray

I have tested it a bit in the last 30 minutes and it working in the 
cases I tried, but did not test exhaustively and have not checked 
performance on large datasets. If any one uses this and run into an 
issue, please let me know.


function csvToArray pData, pRecordDelimiter, pFieldDelimiter, 
pEncapsulationDelimiter

  local tReservedRecordDelimiter, tReservedFieldDelimiter, tArray

  # Initialize the temporary record and field delimiters. Change these 
if your CSV file may contain them.
  put charToNum(1) into tReservedRecordDelimiter; put charToNum(2) into 
tReservedFieldDelimiter;


  # Step 1: Replace any Record or Field delimiters that are 
encapsulated with temporary characters

  set itemdel to pEncapsulationDelimiter
  repeat with i = 1 to the number of items in pData
if trunc(i/2) = (i/2) then
  replace pFieldDelimiter with tReservedFieldDelimiter in item i of 
pData
  replace pRecordDelimiter with tReservedRecordDelimiter in item i 
of pData

end if
  end repeat

  # Step 2: Replace all occurances of the encapsulation delimiter
  replace pEncapsulationDelimiter with empty in pData

  # Step 3: Parse records and fields into the array, replace any 
occurances of the reserved record and field delimiters for each element

  set itemdel to pFieldDelimiter
  set lineDel to pRecordDelimiter
  repeat with i = 1 to the number of lines in pData
  repeat with j = 1 to the number of items in line i of pData
 get item j of line i of pData
 replace tReservedRecordDelimiter with pRecordDelimiter in it
 replace tReservedFieldDelimiter with pFieldDelimiter in it
 put it into tArray[i][j]
  end repeat
   end repeat

   # Step 4: return the array
   return tArray
end csvToArray


--
Paul Dupuis
Cofounder
Researchware, Inc.
http://www.researchware.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: Sample code for reading a CSV file

2011-02-17 Thread Mark Schonewille
Paul,

A lot of code has been posted already, which might make mine superfluous, but 
if you want something simple you might have a look here http://qery.us/o3 . 
This script doesn't work if the items in your CSV file contain linefeeds or 
returns (but could easily be modified).

--
Best regards,

Mark Schonewille

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

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 17 feb 2011, at 19:16, Paul Dupuis wrote:

 So I am tired of reinventing the proverbial wheel over and over again.
 
 I have a new project that I want to read a CSV file for. Obviously reading 
 the file is easy. And is it was tab separated instead of comma, parsing out 
 the rows and columns is easy as well. However, with comma seperated data 
 where some columns contain string with commas in then that are encapsulated 
 in quotes, just plowing through the itemDelimiter and lineDelimter doesn't 
 work.
 
 So before I bother to write code to handle encapsulated CSV data, I thought 
 I'd ask if anyone on the use-list has existing code to handle CSV's that 
 they'd be willing to share.
 
 -- 
 Paul Dupuis
 Cofounder
 Researchware, Inc.
 http://www.researchware.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: Sample code for reading a CSV file

2011-02-17 Thread Bob Sneidar
Nicely done! I know good software that cannot do this efficiently. 

Bob


On Feb 17, 2011, at 11:48 AM, Nonsanity wrote:

 Here's a generalized case that returns an array, with or without the quotes,
 and that allows for commas and returns inside the quotes to remain part of
 that element. It also preserves backslash-escaped quotes in any element,
 quoted or not.
 
 
 function CSVtoArray csv, removeQuotes, preserveEscapedQuotes
   if preserveEscapedQuotes is empty then put true into
 preserveEscapedQuotes
 
   set itemdel to quote
   if preserveEscapedQuotes then replace (\quote) with numtochar(3) in
 csv
   repeat with b = 1 to the number of items in csv
  if trunc(b/2) = (b/2) then
 replace return with numtochar(1) in item b of csv
 replace comma with numtochar(2) in item b of csv
  end if
   end repeat
 
   set itemdel to comma
   repeat with a = 1 to the number of lines in csv
  put line a of csv into theline
  repeat with b = 1 to the number of items in theline
 get item b of theline
 replace numtochar(1) with return in it
 replace numtochar(2) with comma in it
 if removeQuotes then replace quote with  in it
 if preserveEscapedQuotes then replace numtochar(3) with quote in it
 put it into o[a][b]
  end repeat
   end repeat
   return o
 end CSVtoArray
 
 
 The 2nd and 3rd parameters are optional, with expected settings as default.
 (Leave quotes on the strings, and DO preserve escaped quotes.) It doesn't
 allow StartOfHeading, StartOfText, or EndOfText characters to be in the
 source (ASCII 1, 2, and 3 respectively) but then those are non-printable
 characters and not likely to be there to begin with. It should be fairly
 speedy, though I haven't tested it with a huge input.
 
 ~ Chris Innanen
 ~ Nonsanity
 
 
 
 On Thu, Feb 17, 2011 at 1:16 PM, Paul Dupuis p...@researchware.com wrote:
 
 So I am tired of reinventing the proverbial wheel over and over again.
 
 I have a new project that I want to read a CSV file for. Obviously reading
 the file is easy. And is it was tab separated instead of comma, parsing out
 the rows and columns is easy as well. However, with comma seperated data
 where some columns contain string with commas in then that are encapsulated
 in quotes, just plowing through the itemDelimiter and lineDelimter doesn't
 work.
 
 So before I bother to write code to handle encapsulated CSV data, I thought
 I'd ask if anyone on the use-list has existing code to handle CSV's that
 they'd be willing to share.
 
 --
 Paul Dupuis
 Cofounder
 Researchware, Inc.
 http://www.researchware.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: [OT] Apple at it again

2011-02-17 Thread Dave Cragg

On 17 Feb 2011, at 18:19, Bob Sneidar wrote:

 I just know how a country of good people can be deceived

This making the original poster's point. :-) And he from Texas, of all places.

Sorry Heather. I know you closed it.

Cheers
Dave
___
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: [OT] Apple at it again

2011-02-17 Thread Chipp Walters
Ouch, Dave! I resemble that remark! (though I don't feel deceived by Steve
Jobs, just misled ;-)

On Thu, Feb 17, 2011 at 3:18 PM, Dave Cragg dave.cr...@lacscentre.co.ukwrote:


 On 17 Feb 2011, at 18:19, Bob Sneidar wrote:

  I just know how a country of good people can be deceived

 This making the original poster's point. :-) And he from Texas, of all
 places.



___
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


Finding the index of something in the datagrid

2011-02-17 Thread Bob Sneidar
I can roll my own if necessary, but  I was wondering if there were a built in 
find function in a Datagrid which allowed me to get the column and row index of 
something I was searching for. 

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


Re: Finding the index of something in the datagrid

2011-02-17 Thread zryip theSlug
On Fri, Feb 18, 2011 at 12:16 AM, Bob Sneidar b...@twft.com wrote:
 I can roll my own if necessary, but  I was wondering if there were a built in 
 find function in a Datagrid which allowed me to get the column and row index 
 of something I was searching for.

Hi Bob,

Have a look to the commands FindIndex and FindLine in the API.

By looping on the name of the columns, you should be able to get what you want.


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: Sample code for reading a CSV file

2011-02-17 Thread Alex Tweedly


Many years ago (2004 ?) I posted code to do something like his using 
split/combine to differentiate between 'inside' and 'outside' field 
delimiters. It was very fast - but pretty hard to follow, and I don't 
remember now which obscure cases it handled (we haven't even mentioned 
doubled characters and backslash escaped field delimiters yet :-)


The code Paul posted is very clear and easy to follow - but it will 
suffer pretty severe performance issues on large data sets. If you need 
to worry about that, you could get pretty good speed up just by 
replacing the repeat with ... by repeat for each ... - see below.  
The time to run this will grow (approx) linearly with the number of 
lines in the input data, whereas the previous version was a bit worse 
than N-squared growth 


function csvToArray pData, pRecordDelimiter, pFieldDelimiter, 
pEncapsulationDelimiter

   local tReservedRecordDelimiter, tReservedFieldDelimiter, tArray

   # Initialize the temporary record and field delimiters. Change 
these if your CSV file may contain them.
   put charToNum(1) into tReservedRecordDelimiter; put charToNum(2) 
into tReservedFieldDelimiter;


   # Step 1: Replace any Record or Field delimiters that are 
encapsulated with temporary characters

   set itemdel to pEncapsulationDelimiter
   put false into tIsEven
   repeat for each item itm in pData
  if tIsEven then
 replace pFieldDelimiter with tReservedFieldDelimiter in itm
 replace pRecordDelimiter with tReservedRecordDelimiter in itm
  end if
  put itm  itemDelimiter after tData
  put not tIsEven into tIsEven
   end repeat
   delete the last char of tData
   put tData into pData
   # Step 2: Replace all occurances of the encapsulation delimiter
   replace pEncapsulationDelimiter with empty in pData
   -- put pData into field F

   # Step 3: Parse records and fields into the array, replace any 
occurances of the reserved record and field delimiters for each element

   set itemdel to pFieldDelimiter
   set lineDel to pRecordDelimiter
   put 0 into i
   repeat for each line L in pData
  add 1 to i
  put 0 into j
  repeat for each item itm in L
 add 1 to j
 replace tReservedRecordDelimiter with pRecordDelimiter in itm
 replace tReservedFieldDelimiter with pFieldDelimiter in itm
 put itm into tArray[i][j]
  end repeat
   end repeat

   # Step 4: return the array
   return tArray
end csvToArray




On 17/02/2011 20:01, Paul Dupuis wrote:
First, thanks to everyone who replied, but especially to Nosanity. 
Your code reminded me that you can effectively tell when you are 
inside an encapsulated bit of data by an odd/even count of the 
encapsulation character. So, for anyone who wants it, here is a 
generalized function that I just wrote to parse a CSV file, regardless 
of the field or record delimiters (commas, tabs or whatever) and to 
deal with encapsulation appropriately.


This assumes you read the entire CSV file into a variable you pass 
into pData, so a call would look like:


put csvToArray(myEntireCSVData,return,comma,quote) into myDataAsArray

I have tested it a bit in the last 30 minutes and it working in the 
cases I tried, but did not test exhaustively and have not checked 
performance on large datasets. If any one uses this and run into an 
issue, please let me know.


function csvToArray pData, pRecordDelimiter, pFieldDelimiter, 
pEncapsulationDelimiter

  local tReservedRecordDelimiter, tReservedFieldDelimiter, tArray

  # Initialize the temporary record and field delimiters. Change these 
if your CSV file may contain them.
  put charToNum(1) into tReservedRecordDelimiter; put charToNum(2) 
into tReservedFieldDelimiter;


  # Step 1: Replace any Record or Field delimiters that are 
encapsulated with temporary characters

  set itemdel to pEncapsulationDelimiter
  repeat with i = 1 to the number of items in pData
if trunc(i/2) = (i/2) then
  replace pFieldDelimiter with tReservedFieldDelimiter in item i 
of pData
  replace pRecordDelimiter with tReservedRecordDelimiter in item i 
of pData

end if
  end repeat

  # Step 2: Replace all occurances of the encapsulation delimiter
  replace pEncapsulationDelimiter with empty in pData

  # Step 3: Parse records and fields into the array, replace any 
occurances of the reserved record and field delimiters for each element

  set itemdel to pFieldDelimiter
  set lineDel to pRecordDelimiter
  repeat with i = 1 to the number of lines in pData
  repeat with j = 1 to the number of items in line i of pData
 get item j of line i of pData
 replace tReservedRecordDelimiter with pRecordDelimiter in it
 replace tReservedFieldDelimiter with pFieldDelimiter in it
 put it into tArray[i][j]
  end repeat
   end repeat

   # Step 4: return the array
   return tArray
end csvToArray





___
use-livecode mailing list
use-livecode@lists.runrev.com

Re: Finding the index of something in the datagrid

2011-02-17 Thread Bob Sneidar
Thanks I found it by looking at the parent script. For some reason the API I am 
reading does not have it. The URL is 
http://revolution.screenstepslive.com/spaces/revolution_tools/manuals/datagrid/lessons/3461-Data-Grid-API

Do I have this wrong? I only see 3 functions in the API: ColumnControlOfIndex, 
GetDataOfIndex, and GetDataOfLine. This might explain why I am having a hard 
time with DG's (not to mention the fact that my prior DG was messed up 
somehow). 

Bob


On Feb 17, 2011, at 3:25 PM, zryip theSlug wrote:

 On Fri, Feb 18, 2011 at 12:16 AM, Bob Sneidar b...@twft.com wrote:
 I can roll my own if necessary, but  I was wondering if there were a built 
 in find function in a Datagrid which allowed me to get the column and row 
 index of something I was searching for.
 
 Hi Bob,
 
 Have a look to the commands FindIndex and FindLine in the API.
 
 By looping on the name of the columns, you should be able to get what you 
 want.
 
 
 Best regards,
 -- 
 -Zryip TheSlug- wish you the best! 8)
 http://www.aslugontheroad.co.cc
 
 ___
 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


Performance issue with groups

2011-02-17 Thread JosepM

Hi,

I experimented a slow (very) slow performance when I grouped the fields of
one card into 4 groups showing one of each as required. But the problem
seems that isn't show and hide the groups, the problem is located when click
the datagrid and then the fields of the visible group are showed. if I
ungroup the 4 groups and show all the fields at same time the performance is
the normal.

Any idea why?


Salut,
Josep
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Performance-issue-with-groups-tp3311867p3311867.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Sample code for reading a CSV file

2011-02-17 Thread Peter Brigham MD

On Feb 17, 2011, at 3:01 PM, Paul Dupuis wrote:

First, thanks to everyone who replied, but especially to Nosanity.  
Your code reminded me that you can effectively tell when you are  
inside an encapsulated bit of data by an odd/even count of the  
encapsulation character. So, for anyone who wants it, here is a  
generalized function that I just wrote to parse a CSV file,  
regardless of the field or record delimiters (commas, tabs or  
whatever) and to deal with encapsulation appropriately.


This assumes you read the entire CSV file into a variable you pass  
into pData, so a call would look like:


put csvToArray(myEntireCSVData,return,comma,quote) into myDataAsArray

I have tested it a bit in the last 30 minutes and it working in the  
cases I tried, but did not test exhaustively and have not checked  
performance on large datasets. If any one uses this and run into an  
issue, please let me know.


function csvToArray pData, pRecordDelimiter, pFieldDelimiter,  
pEncapsulationDelimiter

 local tReservedRecordDelimiter, tReservedFieldDelimiter, tArray

 # Initialize the temporary record and field delimiters. Change  
these if your CSV file may contain them.
 put charToNum(1) into tReservedRecordDelimiter; put charToNum(2)  
into tReservedFieldDelimiter;


 # Step 1: Replace any Record or Field delimiters that are  
encapsulated with temporary characters

 set itemdel to pEncapsulationDelimiter
 repeat with i = 1 to the number of items in pData
   if trunc(i/2) = (i/2) then
 replace pFieldDelimiter with tReservedFieldDelimiter in item i  
of pData
 replace pRecordDelimiter with tReservedRecordDelimiter in item  
i of pData

   end if
 end repeat

 # Step 2: Replace all occurances of the encapsulation delimiter
 replace pEncapsulationDelimiter with empty in pData

 # Step 3: Parse records and fields into the array, replace any  
occurances of the reserved record and field delimiters for each  
element

 set itemdel to pFieldDelimiter
 set lineDel to pRecordDelimiter
 repeat with i = 1 to the number of lines in pData
 repeat with j = 1 to the number of items in line i of pData
get item j of line i of pData
replace tReservedRecordDelimiter with pRecordDelimiter in it
replace tReservedFieldDelimiter with pFieldDelimiter in it
put it into tArray[i][j]
 end repeat
  end repeat

  # Step 4: return the array
  return tArray
end csvToArray


Here's an extension of your handler that will find appropriate  
reservedDelimiters that do not appear in the csv text, so you don't  
have to hope that numtochar(1) and numtochar(2) are not in the data:


function csvToArray pData, pRecordDelimiter, pFieldDelimiter,  
pEncapsulationDelimiter

   local tReservedRecordDelimiter, tReservedFieldDelimiter, tArray
   # Initialize the temporary record and field delimiters. Change  
these if your CSV file may contain them.


   put getDelimiters(pData) into tDelim -- ## see below
   put numtochar(line 1 of tDelim) into tReservedRecordDelimiter
   put numtochar(line 2 of tDelim) into tReservedFieldDelimiter

# Step 1: Replace any Record or Field delimiters that are  
encapsulated with temporary characters

set itemdel to pEncapsulationDelimiter
repeat with i = 1 to the number of items in pData
 if trunc(i/2) = (i/2) then
  replace pFieldDelimiter with tReservedFieldDelimiter in  
item i of pData
  replace pRecordDelimiter with tReservedRecordDelimiter  
in item i of pData

 end if
end repeat

# Step 2: Replace all occurances of the encapsulation delimiter
replace pEncapsulationDelimiter with empty in pData

# Step 3: Parse records and fields into the array, replace any  
occurances of the reserved record and field delimiters for each element

set itemdel to pFieldDelimiter
set lineDel to pRecordDelimiter
repeat with i = 1 to the number of lines in pData
   repeat with j = 1 to the number of items in line i of pData
 get item j of line i of pData
 replace tReservedRecordDelimiter with  
pRecordDelimiter in it
 replace tReservedFieldDelimiter with pFieldDelimiter  
in it

 put it into tArray[i][j]
   end repeat
 end repeat

 # Step 4: return the array
 return tArray
end csvToArray

function getDelimiters tCSV
   -- return 2 non-printing ASCII characters not found in the  
variable tCSV

   put 1,2,3,4,5,6,7,8 into dList
   -- could use other non-printing ASCII values
   put false into foundOne
   repeat with i = 1 to the number of items of dList
  put item i of dList into testNbr
  if numtochar(testNbr) is not in tCSV then
 put true into foundOne
 put testNbr into delimOne
 exit repeat
  end if
   end repeat
   if not foundOne then
  doAlert
  exit to top
   end if
   delete item i of dList
   put false into foundOne
   repeat with i = 1 to the number of items of dList
 

Re: Performance issue with groups

2011-02-17 Thread Geoff Canyon Rev
My guess would be screen updates -- lock screen before you show/hide and see
if the delay goes away.

On Thu, Feb 17, 2011 at 5:50 PM, JosepM jmye...@mac.com wrote:


 Hi,

 I experimented a slow (very) slow performance when I grouped the fields of
 one card into 4 groups showing one of each as required. But the problem
 seems that isn't show and hide the groups, the problem is located when
 click
 the datagrid and then the fields of the visible group are showed. if I
 ungroup the 4 groups and show all the fields at same time the performance
 is
 the normal.

 Any idea why?


 Salut,
 Josep
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/Performance-issue-with-groups-tp3311867p3311867.html
 Sent from the Revolution - User mailing list archive at Nabble.com.

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

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


Re: Finding the index of something in the datagrid

2011-02-17 Thread zryip theSlug
On Fri, Feb 18, 2011 at 12:38 AM, Bob Sneidar b...@twft.com wrote:
 Thanks I found it by looking at the parent script. For some reason the API I 
 am reading does not have it. The URL is 
 http://revolution.screenstepslive.com/spaces/revolution_tools/manuals/datagrid/lessons/3461-Data-Grid-API

I have this by reading the API of this link:

snip

FindIndex / FindLine
- FindIndex pKey, pSearchString
- Search for data in pKey that matches pSearchString. pKey is one of
the custom defined keys you defined for your data. pSearchingString is
the value to look for in that key. You can pass multiple
pKey=pSearchString combinations to match multiple criteria.

-- Find the index where message is hi
dispatch FindIndex to group DataGrid with message, hi
put the result into theIndex

snip

 Do I have this wrong? I only see 3 functions in the API: 
 ColumnControlOfIndex, GetDataOfIndex, and GetDataOfLine. This might explain 
 why I am having a hard time with DG's (not to mention the fact that my prior 
 DG was messed up somehow).

Anyway, there is only a few function in the datagrid API.

You have also:
- ColumnControlOfLine a recent function added with the datagrid
library version 1.0.2 build 6
- GetKeyValuesOfIndexes used by the dgKeyValuesOfHilitedIndexes
property. I think it is recent and I have not explored it yet.

Some properties, functions or commands are indeed not documented in the API.


In my experience, be extremly carefull before to conclude your
datagrid is broken. It could depend how you explored the parent
script. If you opened the library script by using such command as go
to stack revdatagridlibrary and then editing the datagrid button, the
library could stop working properly resulting of odds effects in your
opened datagrids. In this case, close your copy of LC and reopen it.
Then, test your work again.

For a safe parent script exploration, prefer to edit the parent script using:
edit script of btn data grid of stack revdatagridlibrary


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: Group/Ungroup by script

2011-02-17 Thread Joe Lewis Wilkins
Hi Peter,

Looks like you're doing this from the message box? How come you're not just 
doing it manually, since you're only doing it one time?

Joe Lewis Wilkins
Architect  Director of Product Development for GSI
www.glsysinc.com



On Feb 17, 2011, at 5:59 PM, Peter Haworth wrote:

 I have a need to add a specific control to an existing group.  The following 
 works but I'm curious if there's a better/easier way?
 
 select group Test
 put group  into mycommand
 repeat for each line myId in the selectedObjects
put myID  AND  after mycommand
 end repeat 
 put the long ID of button Button after myCommand
 do myCommand
 
 
 Pete Haworth
 
 
 
 
 
 
 
 ___
 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: Group/Ungroup by script

2011-02-17 Thread Joe Lewis Wilkins
Sorry, Peter, I didn't see the repeat in your code.

Joe Lewis Wilkins
Architect  Director of Product Development for GSI
www.glsysinc.com
760-738-1721








On Feb 17, 2011, at 5:59 PM, Peter Haworth wrote:

 I have a need to add a specific control to an existing group.  The following 
 works but I'm curious if there's a better/easier way?
 
 select group Test
 put group  into mycommand
 repeat for each line myId in the selectedObjects
put myID  AND  after mycommand
 end repeat 
 put the long ID of button Button after myCommand
 do myCommand
 
 
 Pete Haworth
 
 
 
 
 
 
 
 ___
 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: Group/Ungroup by script

2011-02-17 Thread Peter Haworth
I'm not doing it just once, sorry if it came across that way.  I need to do it 
as part of a special tools palette I'm working on.

Pete Haworth







http://www.mollysrevenge.com
http://www.sonicbids.com/MollysRevenge
http://www.myspace.com/mollysrevengeband








On Feb 17, 2011, at 6:39 PM, Joe Lewis Wilkins wrote:

 Hi Peter,
 
 Looks like you're doing this from the message box? How come you're not just 
 doing it manually, since you're only doing it one time?
 
 Joe Lewis Wilkins
 Architect  Director of Product Development for GSI
 www.glsysinc.com
 
 
 
 On Feb 17, 2011, at 5:59 PM, Peter Haworth wrote:
 
 I have a need to add a specific control to an existing group.  The following 
 works but I'm curious if there's a better/easier way?
 
 select group Test
 put group  into mycommand
 repeat for each line myId in the selectedObjects
   put myID  AND  after mycommand
 end repeat 
 put the long ID of button Button after myCommand
 do myCommand
 
 
 Pete Haworth
 
 
 
 
 
 
 
 ___
 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: Group/Ungroup by script

2011-02-17 Thread J. Landman Gay

On 2/17/11 7:59 PM, Peter Haworth wrote:

I have a need to add a specific control to an existing group.  The following 
works but I'm curious if there's a better/easier way?

select group Test
put group  into mycommand
repeat for each line myId in the selectedObjects
 put myID  AND  after mycommand
end repeat
put the long ID of button Button after myCommand
do myCommand


Try:
  copy control 1 to grp x

Substitute a control reference for control 1.

If you don't need the original control after it's been copied to the 
group, delete it.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: Group/Ungroup by script

2011-02-17 Thread Monte Goulding

On 18/02/2011, at 2:10 PM, J. Landman Gay wrote:

 On 2/17/11 7:59 PM, Peter Haworth wrote:
 I have a need to add a specific control to an existing group.  The following 
 works but I'm curious if there's a better/easier way?
 
 select group Test
 put group  into mycommand
 repeat for each line myId in the selectedObjects
   put myID  AND  after mycommand
 end repeat
 put the long ID of button Button after myCommand
 do myCommand
 
 Try:
  copy control 1 to grp x
 
 Substitute a control reference for control 1.
 
 If you don't need the original control after it's been copied to the group, 
 delete it.

Other options are using relayerGroupedControls to move a control into a group 
or if this is a control that you are creating then you can create a control in 
a group.

Cheers

Monte
___
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: Group/Ungroup by script

2011-02-17 Thread Peter Haworth
Thanks Jacqueline, I knew there would be an easier way!  Does that work if the 
group doesn't yet exist?  I know that wasn't in my original post but it is 
something I  need to account for.

Pete Haworth

On Feb 17, 2011, at 7:10 PM, J. Landman Gay wrote:

 On 2/17/11 7:59 PM, Peter Haworth wrote:
 I have a need to add a specific control to an existing group.  The following 
 works but I'm curious if there's a better/easier way?
 
 select group Test
 put group  into mycommand
 repeat for each line myId in the selectedObjects
   put myID  AND  after mycommand
 end repeat
 put the long ID of button Button after myCommand
 do myCommand
 
 Try:
  copy control 1 to grp x
 
 Substitute a control reference for control 1.
 
 If you don't need the original control after it's been copied to the group, 
 delete it.
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.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: Group/Ungroup by script

2011-02-17 Thread J. Landman Gay

On 2/17/11 10:16 PM, Peter Haworth wrote:

Thanks Jacqueline, I knew there would be an easier way!  Does that
work if the group doesn't yet exist?  I know that wasn't in my
original post but it is something I  need to account for.


I just knew there'd be a catch. :) You need an existing group to copy an 
object into. If you want to make a new group then you have to do what 
you did -- loop through the objects, adding them to the selection, and 
then group them.


select control 1 and control 2 and control 3
group

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: Group/Ungroup by script

2011-02-17 Thread Peter Haworth
Got it, thanks.  Interestingly, the group command seems to allow you to create 
a group with only 1 control in it, whereas the IDE doesn't.

Pete Haworth







http://www.mollysrevenge.com
http://www.sonicbids.com/MollysRevenge
http://www.myspace.com/mollysrevengeband








On Feb 17, 2011, at 8:28 PM, J. Landman Gay wrote:

 On 2/17/11 10:16 PM, Peter Haworth wrote:
 Thanks Jacqueline, I knew there would be an easier way!  Does that
 work if the group doesn't yet exist?  I know that wasn't in my
 original post but it is something I  need to account for.
 
 I just knew there'd be a catch. :) You need an existing group to copy an 
 object into. If you want to make a new group then you have to do what you did 
 -- loop through the objects, adding them to the selection, and then group 
 them.
 
 select control 1 and control 2 and control 3
 group
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.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: Group/Ungroup by script

2011-02-17 Thread Terry Judd
Works both ways for me.

Terry...


On 18/02/11 5:14 PM, Peter Haworth p...@mollysrevenge.com wrote:

 Got it, thanks.  Interestingly, the group command seems to allow you to create
 a group with only 1 control in it, whereas the IDE doesn't.
 
 Pete Haworth



___
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