Re: Wrapper code

2002-05-16 Thread Shao Sean

i think he meant being able to call his already typed and compiled C code without 
having to re-type it.. 

take a look at the "externals" tutorial
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Karl Petersen

At 4:54 PM +0100 5/16/02, Ben Rubinstein wrote:
>Or potentially (but less neatly) an app running in the background, which
>could be invisibly instructed to save the image, would do the job.  I'll try
>to dig up Hack TV and see if it can fill this role.

If you can't find a Rev-only solution, one app to consider is BTV 
Pro, a shareware product available for both Mac OS 9 and Mac OS X.

BTV Pro has lots of capture options, including live video via 
FireWire. You can capture continuously or at specific intervals, for 
the duration you want. You can even capture using motion sensitivity 
-- catch a bird splashing in a birdbath. Lots of options.

Best of all, BTV Pro is all AppleScriptable, so anything BTV Pro can 
do you can do with Revolution.

There's a demo available. Note that BTV Pro is required for FireWire; 
the other version doesn't support it.

http://www.bensoftware.com/index.html

Karl
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Dar Scott


On Thursday, May 16, 2002, at 09:54 AM, Ben Rubinstein wrote:

>  The situation is that I'll have a source of
> video (actually a live camera);
...
> Or potentially (but less neatly) an app running in the background, 
> which
> could be invisibly instructed to save the image, would do the job.

Is this composite video?  Your capture card might have some example 
apps including command line apps or scriptable apps.  (Or an SDK 
for it.)  You might be able to use one of those, or--should you 
have time and inclination--modify one.

If this is a firewire or USB camera, you still might have some apps 
that apply.

I'm currently using DirectShow with an Osprey 2000 on Windows 
2000.  I found some ways that a recording can be made with 
something like Revolution.  (I had to go with C++ for several 
reasons, though.)  I would expect that on the Mac you would find 
both general and specific apps that can help.

Dar Scott



___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Terry Judd

>I'm writing a proposal for a job which will involve a program capturing an
>image at odd intervals (a long time apart, eg 5-15 minutes).  I've
>established that I can do all the other things necessary in Revolution, so
>it's a candidate; but I've not found a way to do this part of the job.
>
>Given a QuickTime-recognised video source, is there a built-in way in Rev to
>capture a frame and save it out as a file, named under program control?
>
>If not, does anyone know of any plug-ins that give access to the sequence
>grabber?
>
>Or can anyone suggest alternative approaches (AppleScript to some nice
>cooperative app?)?
>
>This has to work in the background, without doing anything on the screen.
>
>By default, this is to work on MacOS - it would be nice to keep options for
>other MacOS X, Windows open, but not critical.
>
>TIA,
>
>   Ben Rubinstein   |  Email: [EMAIL PROTECTED]
>   Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
>   http://www.cogapp.com|  Fax  : +44 (0)1273-728866
>
>

Check out QTgrabber (Mac only XFCN) at...
.
-- 
___
Dr Terry Judd

Lecturer in Instructional Design / Multimedia Developer
Biomedical Multimedia Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne
Email: [EMAIL PROTECTED]
Phone: 03 9344 0187
Fax: 03 9344 4998
___
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: text files with quotes

2002-05-16 Thread David Vaughan

The original problem was to take a record like:
1,"5/14/02, 10:00 AM",Pending,Batch0001,"This is a memo field, gee it's 
cool",45362
and to strip the quotes, while either removing the commas which were 
inside quotes but not the others (so the record can then be parsed by 
item) or alternatively to replace the commas outside quotes with tabs 
and leave those inside quotes alone.

At this stage we have four different but successful scripts (Mark, 
Geoff, Jan, myself) plus a practical suggestion here from Rob  to remove 
the problem at source. So, I ought to stop talking about this but last 
night as I dropped into bed I recognised a fifth solution which was 
still sufficiently elegant in the morning that I am publishing it anyway 
as grist for those who deal with similar problems. It exploits the fact 
that Rev perceives both a quoted string and a comma as single tokens.

   put field "data source" into inList
   repeat for each line inLine in inList
 put empty into outLine
 repeat for each token inTok in inLine
   if inTok is comma then
 put tab after outLine
   else
 put inTok after outLine
   end if
 end repeat
 put outLine & return after outList
   end repeat
   replace quote with empty in outList
   put outList into field "ready to parse"

Alas, runtime is off a little compared with our earlier solutions but at 
over 10k lines/sec it's simple and effective.

regards
David

On Friday, May 17, 2002, at 12:31 , Rob Cozens wrote:

>> This line is comma delimited, but if I try to separate it that way, the
>> interior quoted commas will mess things up,
>
> Hi Mark,
>
> Do you have any control over the format of the source files?
>
> If so, have the file prepared with a different item delimiter that 
> can't possibly appear in your data.
> --
> Rob Cozens
> CCW, Serendipity Software Company
> http://www.oenolog.com/who.htm
>
> "And I, which was two fooles, do so grow three;
> Who are a little wise, the best fooles bee."
>
> from "The Triple Foole" by John Donne (1572-1631)
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Wrapper code

2002-05-16 Thread Rob Cozens

>I have some libraries and source files written in C and I would like 
>to "translate" them into Transcript, to avoid typing again.

Hello Fabio,

Create a simple library stack, translate your C code to Transcript 
handlers, and place them in the stack script of the library stack. 
Now any Rev app or stack can resolve those handlers at runtime with a 
'start using stack "myLibrary"' statement.
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Text manipulation - underlying data structures

2002-05-16 Thread Rob Cozens

>   I was thinking about this in my CS class a couple of weeks ago, 
>and wondered about a data structure that would basically be an array 
>(for fast random access), but every k positions (lines in this case 
>I suppose) would maintain a pointer to that position, making a new 
>pointer-list of length n/k.

Hi Jim,

Karl Petersen wrote a HyperTalk script or external that indexed 
strings in some fashion.  Perhaps he'll respond in more detail.
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Rob Cozens

>Unfortunately, when that script exports the captured frame to a JPEG 
>file, Rev refuses to relinquish the temporary memory it grabs, 
>eventually causing your program to crash. If you can find a 
>workaround for that problem, "import snapshot" should work nicely.

Hi Karl,

Isn't the current workaround to set the system colors to millions or 
256:anything but thousands?
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Text manipulation - underlying data structures

2002-05-16 Thread Jim Witte

>   put tNum into item 1 of line tNum of tVar
>
> forces the engine to go through tVar looking for 4998th carriage 
> return; then when tNum is 5000 the engine has to go through again 
> looking for the

   I was thinking about this in my CS class a couple of weeks ago, and 
wondered about a data structure that would basically be an array (for 
fast random access), but every k positions (lines in this case I 
suppose) would maintain a pointer to that position, making a new 
pointer-list of length n/k.  Then another pointer list would be made off 
of this one, of length n/k^2, and so on forming a pointer tree.  Then an 
access into the original list should be able to be made close to 
logrithmic time (you'd have a small semi-constant to access up the 
pointer tree, and a linear search of O(k) once you got to the correct 
k-section of the original list.  This would probably only be useful for 
large data sets (say n>1000 maybe k=20 would make sense), but would it 
be worthwhile implementing something like this in Rev's text engine?

Jim

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Check and Uncheck a menuItem

2002-05-16 Thread Jeanne A. E. DeVoto

At 3:39 PM -0700 5/15/2002, Bill Vlahos wrote:
>How do I toggle a checked menuItem?

Put "!c" in front of the menu item to add a check; put "!n" in front of it
to remove it. For example:

  on menuPick myItem
if char 1 to 2 of line (the menuHistory of me) of me is "!c"
then delete char 1 to 2 of line (the menuHistory of me) of me
  end menuPick

>How can I check the status of a menuItem (for example is the item
>checked)?

See above - check the first two characters.

>I can't find this anywhere in the docs.

There's some discussion in "About menus and the menu bar" (scroll down to
the section "Special effects in menus"). The upcoming Cookbook (yes! At
last! The script cookbook is coming!) will have several recipes devoted to
manipulating menus, and checking/unchecking will be one of them.

--
Jeanne A. E. DeVoto ~ [EMAIL PROTECTED]
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sound recording MAC and QTPRO

2002-05-16 Thread Kevin Miller

On 16/5/02 12:00 pm, cowhead <[EMAIL PROTECTED]> wrote:

> Can someone explain this to me?  The rev 'record sound file' really
> needs the 'pro' version of QT?

No.

Kevin

Kevin Miller <[EMAIL PROTECTED]> 
Runtime Revolution Limited - The Solution for Software Development
Tel: +44 (0) 870 747 1165.  Fax: +44 (0)1639 830 707.

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread sims

>  I'll try
>to dig up Hack TV and see if it can fill this role.
>

See below.

I wrote the following to Rev a while back...didn't get
much interest back. I'd still like to see it...

sims

>
>Apple Developer provides code and working samples for capturing
>digital video from firewire & other capture cards/means on the
>web pages shown in this email.
>
>Would it be possible for Rev to use this code/samples and build this facility
>into Rev?  I suppose I am making a request more than asking if it 
>can be done...
>
>atb
>
>sims
>
>---
>
>HackTV Carbon - for Mac OS 9 and X
>
>http://developer.apple.com/samplecode/Sample_Code/QuickTime/Capturing 
>/HackTV_Carbon.htm
>
>HackTV Carbon is the carbonized version of the venerable HackTV for 
>Mac OS 9 and X. It shows how to use the sequence grabber to preview 
>and record movies.
>HackTV can use either the software 'vdig' or a hardware 'vdig' that 
>you may already own. HackTV can also be used by 'vdig' makers to 
>test their code.
>Requires: QuickTime 5, Metrowerks CodeWarrior 6 or 7, CarbonLib 1.4
>
>
>HackTV - for Intel Pentium or compatible processor
>
>
>http://developer.apple.com/samplecode/Sample_Code/QuickTime/Capturing 
>/HackTV.htm
>
>This sample code has been updated for QuickTime 5.0
>HackTV illustrates how to use do Video Digitizing under QuickTime.
>Refer to develop Issue 14 for details on this code.
>68k or PowerPC (or newer) machines running System 8.5 or later. PC 
>with Intel Pentium or compatible processor. QuickTime 4.0 or later. 
>CodeWarrior Pro 2 or later or Visual C++ 5.0 or later.
>QuickTime, Video, Digitizing, vDig

___

http://EZPZapps.com [EMAIL PROTECTED]
   Software - Internet Development - Consulting
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Ben Rubinstein

on 16/5/02 1:56 PM, sims at [EMAIL PROTECTED] wrote:

>> This has to work in the background, without doing anything on the screen.
> 
> Do you mean that it has to happen while the movie is running?
> 
> Have you looked at HackTV from the Apple web site?


on 16/5/02 4:33 PM, Karl Petersen at [EMAIL PROTECTED] wrote:

>> Given a QuickTime-recognised video source, is there a built-in way in Rev to
>> capture a frame and save it out as a file, named under program control?
> 
> This will capture any portion of the stack window:
> import snapshot from rect  of window 


Thanks both for your replies.  I think I wasn't as clear in my initial
request as I might have been.  The situation is that I'll have a source of
video (actually a live camera); but I do not wish to display it on screen at
all.  In response to some event that Revolution can trap, I want my Rev app
to invisibly save a file to disk representing a frame grabbed from this
source - meanwhile the screen is displaying something quite different.  At
no point should the live video feed appear on the screen (the image from the
file will be manipulated and a manipulated version will be displayed at some
other point in the process).

In my ideal world there'd be a sequence grabber component in Rev that could
go into an offscreen or hidden control, from which I could extract the image
data.  There is a record sound command - what about a record video command?
Or an external which can just be used to retrieve a frame from the given
source?

Or potentially (but less neatly) an app running in the background, which
could be invisibly instructed to save the image, would do the job.  I'll try
to dig up Hack TV and see if it can fill this role.

(I may have some control over the camera used as the soure - I'm also
currently looking at webcams sold with embedded servers, with the thought
that this could be networked to the computer, and using "get URL" to
retrieve a jpg.  But I'd rather have a higher quality image than I suspect
these are typically configured to deliver.)

Anyone know of an external that can do something like this?

TIA,
 
  Ben Rubinstein   |  Email: [EMAIL PROTECTED]
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com|  Fax  : +44 (0)1273-728866




___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Karl Petersen

At 8:33 AM -0700 5/16/02, Karl Petersen wrote:
>Unfortunately, when that script exports the captured frame to a JPEG 
>file, Rev refuses to relinquish the temporary memory it grabs, 
>eventually causing your program to crash. If you can find a 
>workaround for that problem, "import snapshot" should work nicely. 
>(I've tested the memory problem only in Mac OS 9.1.)

Oops, I forgot to mention a possible solution to the memory problem: 
While exporting JPEGs in a different context, I discovered the memory 
loss occurs only if the monitor is set to Thousands of colors. If you 
see the memory problem too, test it using more/fewer colors.

Karl
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Karl Petersen

At 1:25 PM +0100 5/16/02, Ben Rubinstein wrote:
>Given a QuickTime-recognised video source, is there a built-in way in Rev to
>capture a frame and save it out as a file, named under program control?

This will capture any portion of the stack window:
   import snapshot from rect  of window 


As in this context:
   reset the templateImage
   put the windowID of this stack into winID
   set the name of the templateImage to "frameCapture"
   put the rect of player "your player name" into tFrameRect
   -- Adjust your frame edges here to remove borders, if required
   -- So the new image doesn't jump, force the new image to match the
   -- rect of frame being copied.
   -- Note the templateImage rect must fit within the rect of this card.
   set the rect of the templateImage to tFrameRect
   import snapshot from rect tFrameRect of window winID
   export image "frameCapture" to file "frameSample.JPEG" as JPEG
   -- or use this to export:
   -- export image nameOfSnapImage() to URL ("binfile:" & 
) as JPEG
   delete image "frameCapture"


Unfortunately, when that script exports the captured frame to a JPEG 
file, Rev refuses to relinquish the temporary memory it grabs, 
eventually causing your program to crash. If you can find a 
workaround for that problem, "import snapshot" should work nicely. 
(I've tested the memory problem only in Mac OS 9.1.)

Karl
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Wrapper code

2002-05-16 Thread Fabio Ivasse

Hi,
I have some libraries and source files written in C and I would like to 
"translate" them into Transcript, to avoid typing again.
How can I do this?
Thanks

_
Converse com amigos on-line, conheƧa o MSN Messenger: 
http://messenger.msn.com

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: text files with quotes

2002-05-16 Thread Rob Cozens

>This line is comma delimited, but if I try to separate it that way, the
>interior quoted commas will mess things up,

Hi Mark,

Do you have any control over the format of the source files?

If so, have the file prepared with a different item delimiter that 
can't possibly appear in your data.
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sound recording MAC and QTPRO

2002-05-16 Thread Dave

Requiring QT Pro to record audio in Rev does not make a lot of sense to me.

 QT Pro is an application built to access the QuickTime APIs. The API
architecture and application are two separate entities.  (QuickTime Player 4
still runs with QuickTime 5 installed.)

The ability to record audio through QuickTime comes from the underlying
architecture, not the application.

Rev. is just another application that accesses parts of the QuickTime API
(QuickTime Player in fact doesn't even access the recording APIs).  AFAIK
the API is free and does not require QT Pro.  I've seen the bug in Rev.
where the audio file has been created but when you try to open it, the file
doesn't open. The file size seems about right, so it looks to me like audio
is being recorded.  I've wondered if I haven't stopped recording correctly
or closed the file correctly.  I haven't had the chance to follow the
excellent advice on this list regarding audio recording but hope to do so
soon.

BTW, here's a free recording app (non-Rev) that uses QuickTime to record
audio, it doesn't need QT Pro:
http://dgrwww.epfl.ch/~jenny/

--
Dave

On 5/16/02 5:00 AM, "cowhead" <[EMAIL PROTECTED]> wrote:

> Talking about recording sound on a Mac, presumably using the record
> sound file command in Rev?  Jean-Luc wrote:
> 
>> Hello,
>> You need to have "QuickTime Pro" installed. Do you have it?
>> The player you can dowload free enables you to listen to files, but
> not to
>> record them.
>> Your problem may be due to that. If it is, you can get "QuickTime Pro"
> at
>> "www;quicktime.com" it costs about $20.
> 
> Can someone explain this to me?  The rev 'record sound file' really
> needs the 'pro' version of QT?  Although I don't have this, it seems to
> work OK as long as I use 'with dialog' and under OS9 only (not OSX,
> which has a bug apparently, causing separate channels to record at
> different levels).  I'm trying to decide if I need to invest in QTPRO
> now!
> 
> mark mitchell
> Japan
> 
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Capturing video (or at least one frame) inside Rev

2002-05-16 Thread sims

>I'm writing a proposal for a job which will involve a program capturing an
>image at odd intervals (a long time apart, eg 5-15 minutes).  I've
>established that I can do all the other things necessary in Revolution, so
>it's a candidate; but I've not found a way to do this part of the job.



>
>This has to work in the background, without doing anything on the screen.

Do you mean that it has to happen while the movie is running?

Have you looked at HackTV from the Apple web site?

sims

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Capturing video (or at least one frame) inside Rev

2002-05-16 Thread Ben Rubinstein

I'm writing a proposal for a job which will involve a program capturing an
image at odd intervals (a long time apart, eg 5-15 minutes).  I've
established that I can do all the other things necessary in Revolution, so
it's a candidate; but I've not found a way to do this part of the job.

Given a QuickTime-recognised video source, is there a built-in way in Rev to
capture a frame and save it out as a file, named under program control?

If not, does anyone know of any plug-ins that give access to the sequence
grabber?

Or can anyone suggest alternative approaches (AppleScript to some nice
cooperative app?)?

This has to work in the background, without doing anything on the screen.

By default, this is to work on MacOS - it would be nice to keep options for
other MacOS X, Windows open, but not critical.

TIA,

  Ben Rubinstein   |  Email: [EMAIL PROTECTED]
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com|  Fax  : +44 (0)1273-728866


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: sound recording MAC and QTPRO

2002-05-16 Thread Klaus Major

Hi Mark and all,

> Talking about recording sound on a Mac, presumably using the record
> sound file command in Rev?  Jean-Luc wrote:
>
>> Hello,
>> You need to have "QuickTime Pro" installed. Do you have it?
>> The player you can dowload free enables you to listen to files, but
> not to
>> record them.
>> Your problem may be due to that. If it is, you can get "QuickTime Pro"
> at
>> "www;quicktime.com" it costs about $20.
>
> Can someone explain this to me?  The rev 'record sound file' really
> needs the 'pro' version of QT?  Although I don't have this, it seems to
> work OK as long as I use 'with dialog' and under OS9 only (not OSX,
> which has a bug apparently, causing separate channels to record at
> different levels).  I'm trying to decide if I need to invest in QTPRO
> now!
>
> mark mitchell
> Japan

you are so right.

I thinks this needs some clarification...

What if you deliver a standalone with the record-sound feature ?

Forcing your customers to buy QT Pro would definitively a real 
showstopper ;-)


Regards


Klaus Major
[EMAIL PROTECTED]

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



RE: sound recording MAC and QTPRO

2002-05-16 Thread cowhead
Talking about recording sound on a Mac, presumably using the record
sound file command in Rev?  Jean-Luc wrote:

> Hello,
> You need to have "QuickTime Pro" installed. Do you have it?
> The player you can dowload free enables you to listen to files, but
not to
> record them.
> Your problem may be due to that. If it is, you can get "QuickTime Pro"
at
> "www;quicktime.com" it costs about $20.

Can someone explain this to me?  The rev 'record sound file' really
needs the 'pro' version of QT?  Although I don't have this, it seems to
work OK as long as I use 'with dialog' and under OS9 only (not OSX,
which has a bug apparently, causing separate channels to record at
different levels).  I'm trying to decide if I need to invest in QTPRO
now!

mark mitchell
Japan

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: text files with quotes --- thanks!

2002-05-16 Thread BCE

David, Jan & Geoff,

Thanks so much for the great code ideas --- and yes, I agree that the status
becomes moot when the execution is so fast!

Thanks again!!!

Mark


- Original Message -
From: "David Vaughan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 5:39 AM
Subject: Re: text files with quotes


> Jan, Geoff, Mark
>
> You know, it's an interesting thing,  but Mark's original script
> executes at about the same rate (~50 to 70 milliseconds per thousand on
> my Tibook) as do mine, Geoff's and Jan's, simply by making the same
> three basic changes to Mark's script as we all assumed for our own
> variations -  using variables and not fields for operations, and
> ditching the "repeat with x = 1 to N"  together with the "put 
> into field whatever" (who needs status when execution is so fast?).
>
> Within that, the original and offered solutions provide some variations
> in operation and output that should keep Mark entertained for a while,
> but the three basic lessons are very clear. Practically a mantra.
>
> cheers
> David
>
>
> On Thursday, May 16, 2002, at 07:25 , Jan Decroos wrote:
>
> > Maybe this can help...
> >
> > the parseItems handler will pass an item to DoStuff only when it's
> > completed
> > (i.e. when one of the prev. items was started with a quote, all items
> > are
> > gathered until we find an item ending with a quote, or when there are no
> > quotes).
> > Maybe you should strip the leading and the ending spaces too.
> >
> >
> > -- the button script
> > on mouseUp
> >   parseItems cd fld 1   -- my data was in field 1
> > end mouseUp
> >
> > on parseItems pData
> >   repeat for each line lLine in pData
> > put empty into lRealItem
> > repeat for each item lItem in lLine
> >   if (char 1 of litem = quote) then
> > if (last char of litem = quote) then
> >   DoStuff lItem
> > else
> >   put lItem into lRealItem
> > end if
> >   else
> > if (lRealItem <> empty) then
> >   put comma&lItem after lRealItem
> >   if (last char of litem = quote) then
> > DoStuff lRealItem
> > put "" into lRealItem
> >   end if
> > else
> >   DoStuff lItem
> > end if
> >   end if
> > end repeat
> >   end repeat
> > end parseItems
> >
> > on DoStuff pItem
> >   answer pItem
> > end DoStuff
> >
> >
> > Jan
> >
> >> Anyone have a good method of parsing a text file that is delimmited by
> >> commas, yet has quotes (") surrounding SOME of the records, which in
> >> turn
> >> may have commas inside of them (such as a notes field)?  (!)
> >>
> >> The only routine I made for this was long and ugly, taking a second per
> >> record.  I first replaced commas inside of quotes with a blank space,
> >> then
> >> got rid of the quotes, then parsed by comma.
> >>
> >> Is there a routine I might be missing?  Thanks!
> >>
> >> Mark
> >>
> >
> > ___
> > use-revolution mailing list
> > [EMAIL PROTECTED]
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
>
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: text files with quotes

2002-05-16 Thread David Vaughan

Jan, Geoff, Mark

You know, it's an interesting thing,  but Mark's original script 
executes at about the same rate (~50 to 70 milliseconds per thousand on 
my Tibook) as do mine, Geoff's and Jan's, simply by making the same 
three basic changes to Mark's script as we all assumed for our own 
variations -  using variables and not fields for operations, and 
ditching the "repeat with x = 1 to N"  together with the "put  
into field whatever" (who needs status when execution is so fast?).

Within that, the original and offered solutions provide some variations 
in operation and output that should keep Mark entertained for a while, 
but the three basic lessons are very clear. Practically a mantra.

cheers
David


On Thursday, May 16, 2002, at 07:25 , Jan Decroos wrote:

> Maybe this can help...
>
> the parseItems handler will pass an item to DoStuff only when it's 
> completed
> (i.e. when one of the prev. items was started with a quote, all items 
> are
> gathered until we find an item ending with a quote, or when there are no
> quotes).
> Maybe you should strip the leading and the ending spaces too.
>
>
> -- the button script
> on mouseUp
>   parseItems cd fld 1   -- my data was in field 1
> end mouseUp
>
> on parseItems pData
>   repeat for each line lLine in pData
> put empty into lRealItem
> repeat for each item lItem in lLine
>   if (char 1 of litem = quote) then
> if (last char of litem = quote) then
>   DoStuff lItem
> else
>   put lItem into lRealItem
> end if
>   else
> if (lRealItem <> empty) then
>   put comma&lItem after lRealItem
>   if (last char of litem = quote) then
> DoStuff lRealItem
> put "" into lRealItem
>   end if
> else
>   DoStuff lItem
> end if
>   end if
> end repeat
>   end repeat
> end parseItems
>
> on DoStuff pItem
>   answer pItem
> end DoStuff
>
>
> Jan
>
>> Anyone have a good method of parsing a text file that is delimmited by
>> commas, yet has quotes (") surrounding SOME of the records, which in 
>> turn
>> may have commas inside of them (such as a notes field)?  (!)
>>
>> The only routine I made for this was long and ugly, taking a second per
>> record.  I first replaced commas inside of quotes with a blank space, 
>> then
>> got rid of the quotes, then parsed by comma.
>>
>> Is there a routine I might be missing?  Thanks!
>>
>> Mark
>>
>
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Impatient script

2002-05-16 Thread Terry Vogelaar

In a repeat loop I bring up a dialog (a stack opened as 'modal') to fill in
some additional info when needed. But while the dialog is waiting for user
input, the repeat loop continues! How do I let the script wait until the
user responds to the dialog?

Terry

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



RE: text files with quotes

2002-05-16 Thread Jan Decroos

Maybe this can help...

the parseItems handler will pass an item to DoStuff only when it's completed
(i.e. when one of the prev. items was started with a quote, all items are
gathered until we find an item ending with a quote, or when there are no
quotes).
Maybe you should strip the leading and the ending spaces too.


-- the button script
on mouseUp
  parseItems cd fld 1   -- my data was in field 1
end mouseUp

on parseItems pData
  repeat for each line lLine in pData
put empty into lRealItem
repeat for each item lItem in lLine
  if (char 1 of litem = quote) then
if (last char of litem = quote) then
  DoStuff lItem
else
  put lItem into lRealItem
end if
  else
if (lRealItem <> empty) then
  put comma&lItem after lRealItem
  if (last char of litem = quote) then
DoStuff lRealItem
put "" into lRealItem
  end if
else
  DoStuff lItem
end if
  end if
end repeat
  end repeat
end parseItems

on DoStuff pItem
  answer pItem
end DoStuff


Jan

>Anyone have a good method of parsing a text file that is delimmited by
>commas, yet has quotes (") surrounding SOME of the records, which in turn
>may have commas inside of them (such as a notes field)?  (!)
>
>The only routine I made for this was long and ugly, taking a second per
>record.  I first replaced commas inside of quotes with a blank space, then
>got rid of the quotes, then parsed by comma.
>
>Is there a routine I might be missing?  Thanks!
>
>Mark
>

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: WWDC Summary

2002-05-16 Thread Geoff Canyon

The picture during the presentation is now available for anyone who's curious at:



Note that it's just a picture of me on a stage looking calmly confident ;-)
-- 

regards,

Geoff Canyon
[EMAIL PROTECTED]
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: text files with quotes

2002-05-16 Thread Geoff Canyon

>David,
>
>Thanks for the response  :-)
>
>A sample line in a file I might want to parse:
>1,"5/14/02, 10:00 AM",Pending,Batch0001,"This is a memo field, gee it's
>cool",45362
>

Assuming what you want is:

Remove quotes
Leave commas that are in quotes alone
Replace commas outside of quotes with tab (for instance)

This will do it. Note that this doesn't account for tabs that might exist in the input.

  put field "in" into tInputList
  put empty into tOutputList
  put false into tInQuotes
  set the itemDelimiter to quote
  repeat for each item I in tInputList
if tInQuotes then
  put I after tOutputList
  put false into tInQuotes
else
  replace "," with tab in I
  put I after tOutputList
  put true into tInQuotes
end if
  end repeat
  
  put tOutputList into field "out"

I tested on 16,000 lines like the one you showed above. On a G3 400 it took about .75 
seconds.
-- 

regards,

Geoff Canyon
[EMAIL PROTECTED]
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Checkbox problem

2002-05-16 Thread Klaus Major

Hi Fred,

>  Klaus/ David
>
> Thanks
> I tried both versions which work.
>
> One question Klaus you set the invisible property with hilite property 
> (am I
> using these words correctly?) of the check box. The hilite and invisible
> properties are both true or false states?
>
> "on mouseUp
> set the invisible of field ID "1068" to the hilite of me
> set the invisible of field ID "1069" to the hilite of me
> set the invisible of field ID "1070" to the hilite of me
> end mouseup"
>
> Fred D

yes :-)

"Invisible" and "hilite" (and a lot more props...) are Boolean values.

(Hint: to avoid confusion, try to use "visible" instead ;-)

So they can be "true" of "false".

Regards


Klaus Major
[EMAIL PROTECTED]


P.S. This is a good one ;-)

...
set the hilite of me to (not the hilite of me)
...:-)

This will behave like an on/off-switch, where you do not have to check 
the state.

If it is on, a click will turn it off.
If it is off, a click will turn it on.

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution