Thanks phil

2001-08-19 Thread debdoot das

Thanks Phil for the help.

Debdoot

Phil Davis wrote:

> One way:
>
> get fld "tenDigitNumber"
> if (it is a number) and (length(it) = 10) then
>   --do stuff
> end if


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Determining Midnite in Seconds

2001-08-19 Thread Sivakatirswami

Time mystery: What was last midnight in seconds?

on mouseup
  -- This script tests getting the seconds at midnite
  -- last night using three methods

  -- First is based on the assumption seconds function
  -- began at midnite in the past, probably wrong assumptin
  -- since docs say "arbitrary seconds in the past"

  put the seconds into tNow
  put tNow- (tNow mod  86400) into tLastMidNiteA

-- the second method assumes that "convert" returns
-- midnite of the beginning of the current day.


  put the short date into tLastMidNiteB
  convert tLastMidNiteB to seconds

  -- Third method uses the current time as a portion of 24 hours
  -- passed since midnite and then subtracts that from now, in seconds
  
  put the time into tNow
  set the itemdelimiter to ":"
  if word 2 of item 2 of tNow = "PM" then put (12+ item 1 of tNow) into item
1 of tNow
  put ((item 1 of tNow*60*60) + (word 1 of item 2 of tNow*60)) into
tSinceMidnite
  put the seconds-tSinceMidnite into tLastMidniteC
  
  
  -- but, we get three different times:
  put tLastMidNiteA & cr& tLastMidNiteB & cr & tLastMidniteC after fld
"returned_data"

end mouseUp

We get three different times for midnite and the difference is not trivial

998265600
998222400
998215200

So, when was last midnight, in seconds? Now, what IS interesting is that
method 2 and 3 are exactly two hours apart and Hawaii is two hours off the
international dateline: i.e. zone two on the international time system by
longitude.

Can we have some clues?

TIA

Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED] 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




how to define helper applications for browser Mac/PC

2001-08-19 Thread Rodney Tamblyn
Title: how to define helper applications for browser
Mac/PC


Hi Richard,

It's possible to script the Apple side of things by using
ICScripter (application or OSAX)

Here's the script I use to make my EMView application a Helper
app for EMV urls:

set temp
to {fileCreator:"MSTD", fileName:"EMView"}
tell application "ICScriptor"
    SetICHelper
"emv" to temp
   quit
end tell
display dialog "Your web browser has been configured to use
EMView as a helper application when required." buttons
{"OK"} with icon 1

The installer for EMView runs this script (compiled as a script
application, no startup dialog) after EMView is installed.  I
install ICScriptor at the same time, therefore no OSAX has to be
present.  I have also noticed (perhaps this is true of all
OSAX?) that after installing an OSAX you often need to restart before
it becomes active. 

Not however that Netscape Navigator on the Mac does not support
defining custom helper applications for protocols in this way, it
will only let you modify the settings for certain standard protocols,
eg ftp, mailto etc

On the Windows side I simply make some Registry edits from
within the installer (you could just as easily do this in Metacard,
but I preferred to have the uninstall side of things handled
transparently).  I then implemented a DDE server in EMView to
handle the events. If people are interested in how to go about doing
this I can document it and post an example.  On windows both
Netscape and IE handle custom handlers, although Netscape 6 removes
DDE support - since few people use it here I am not too concerned
about that.

Rodney.

How can I have MC automate whatever's
necessary to add it as a Helper app
for both Mac and Win?

The Mac Internet Control Panel is not AppleScriptable, and the Win
Internet
Properties Control Panel only has a very few Helper apps listed, so
I'm
assuming anything else needs to be done with a registry setting --
which
one?

Thanks in advance -

-- 
--
Rodney Tamblyn
Educational Media group
Higher Education Development Centre, 75 Union Place
University of Otago, PO Box 56, Dunedin, New Zealand
ph +64 3 479 7580 Fax +64 3 479 8362
http://hedc.otago.ac.nz ~ http://rodney.weblogs.com



Extra Blank Sheet

2001-08-19 Thread Nelson Zink

When printing out a card from script I get an addition blank sheet. If I
print from menu this doesn't happen. What setting(s) might be involved and
need set?

Nelson Zink


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




FTP in 2.4/Permissoins

2001-08-19 Thread Sivakatirswami

on 8/18/01 6:32 PM, [EMAIL PROTECTED] at
[EMAIL PROTECTED] wrote:

>> 
>> Anyone know how to use LibURL to ftp? Any help text on this?
> 
> put url "ftp://ftp.metacard.com/"; with "/", returns the directory
> put url "user:password@ftp://ftp.metacard.com/"; with authentication
> put url "ftp://ftp.metacard.com/MetaCard/linux.tgz"; returns file
> put  into url Y uploads files
> set ftpActive() for active (as opposed to passive) transfers
> 
> ..and make sure you report any bugs.

Outstanding, great work Andu! ... I am using FTP from MC every day now
(2.3.2) and will upgrade  to 2.4 soon.

Meanwhile I figured out the permissions thing by using a monitor log to see
that an FTP client simply writes to the socket:

SITE CHMOD 755 /public_html/cgi-bin/build_lessons.mt

(in this case, specifically to make cgi's executable with rwx r-x r-x)

So, in Andu's MC FTP script, after the sendData handler is done,
 it seemed obvious to add this:

  write "SITE CHMOD 755 " &  iPath & crlf to socket Q
read from socket Q for 1 line #for confirmation
put  cr & it before fld "log"

just before writing QUIT to the socket... Bingo, it worked like charm.

Now, of course this means I have to manually change the script for any
different kinds of permissions (don't know any others are needed for .mt
scripts...) So, if you were able to incorporate permissions into the new 2.4
routines that would be great (or maybe you have already) This is allows one
to use an MC interface to manage .mt scripts (and bourne shell scripts
also), upload, set permissions, trigger with "get" and put the results into
a field... all with just the click of a button. saying good bye to FTP
clients and browsers for the cgi  development process and it is saving a LOT
of time.  

Of course, one can modify the LibURL oneself too, but then, that would
globally set permissions for all FTP uploads... so, ideally it would be a
separate handler all together, that you would call after you completed the
upload, something like:

> put  into url Y uploads files
set permissions url Y to "755"

where the 

set permissions url Y

part was handled by the LibURL "engine"

One option at least...

Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED] 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: MacTech Programmer's Challenge

2001-08-19 Thread Scott Raney

On Sat, 18 Aug 2001 Geoff Canyon <[EMAIL PROTECTED]> wrote:

> >From the web page at: 
>  "The basic requirement is that you open a text file containing
> valid C/C++ source code and generate a Nassi-Schneiderman diagram
> for each routine included in that file."
> It's frustrating that they aren't offering sample files. One thing
> that will definitely be needed is regex patterns to recognize C and
> C++ source code. I'm looking online for this right now, but haven't
> found anything yet. If anyone knows where such a beast exists, or
> better yet has already done C/C++ pattern matching in MC/Rev, that
> would help.

I think you probably don't want to use regex for this.  It isn't
necessary and will probably just make parsing the file harder and
slower.  Instead, keep in mind that spaces and returns aren't
significant in C and that the primary delimiter is the semicolon (in
fact, you might want to just convert all the returns to spaces as the
very first step to make building the labels easier because you don't
have to worry about handling statements that break over multiple
lines, or multiple statements on a single line, though the problem
description isn't specific about whether this sort of reformatting is
allowed or required).  This means the main loop should probably be
something like:
set the itemDelimiter to ";"
repeat for each item i in yourcontainer

Then, switch of word 1 of i to see if it's one of the language
keywords.  Dealing with "for" is a little tricky because you'll have
to set a flag to collect two more items into a container and then do
some hand-coded parsing of the last one (the stuff before the closing
")" goes with the "for" and the stuff after goes with the next
statement.  If you really want to get fancy (probably not necessary
for this Challenge), use "repeat for each token" to separate out each
operator, MetaTalk being similar enough to C that that will do most of
the work for you.  This would be a lot more work, though, because
you'll have to build something that has a lot better understanding of
the C language than if you just use the semicolon as a delimiter.

> Also, I think this description is vague:
>  "You must provide a means for the user to select a section of the
> diagram, or click on a section of interest, and zoom in on that
> section. The zoomed-in display should increase the level of detail
> displayed, until no further increase in detail is possible."
>  Does that mean that higher levels of the diagram go away, or is it
> more like the zoom feature on the dock in OS X, where everything is
> visible all the time, but whatever has the focus is expanded to the
> detriment of others?

Seems to me it could go either way.  But if zoom excludes other stuff,
you're going to have to add some sort of "unzoom" feature that brings
it back.  It might be sufficient to just show a single line in each of
the code blocks and have "zoom" just mean to expand a block so that
you can see all of the text in it (kind of like a progressive
disclosure/tree view, except that you raise the expanded object *on
top* of the other objects rather than pushing them all down, which
would be nice but would also be a nightmare to lay out with a deeply
nested diagram).  Clicking on the object again would unzoom it back to
it's previous size.

I also don't think much of their idea of squashing the diagram down to
fit in whatever the window size is.  Seem to me you'll just end up
with a solid black figure in the degenerate case.  Better would be to
put a lower limit on the size and then add scrollbars if it won't fit
in the window.

If nothing else, we can all get one take-home message here: trying to
set requirement specs in the absence of a working prototype (the
hallmark of design with traditional CASE (Computer Aided Software
Engineering) methodologies) is a recipe for disaster, which of course
is the reason CASE became a dirty word among software developers and
why high-level tools are becoming so popular.
  Regards,
Scott

> regards,
> 
> Geoff


Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




MC 2.4 for OS X

2001-08-19 Thread Richard MacLemale

OK, 
I've been tied up for the past two months with OS X Server 10, NetInfo, and
setting up a 400 workstation totally cross platform network, so although
I've been lurking I haven't posted in a while... So forgive me if this has
been addressed... It may have already been discussed...

I know that in the most recent beta (4) that UNIX API's are still not
available, so you can't use MC 2.4 yet as a front end for CLI stuff.  There
are, very shortly, going to be millions of Mac users looking at moving into
OS X and they are not going to want to learn CLI to do stuff like turn on OS
X's built-in firewall.  And so there will be a ton of shareware authors
cranking out pretty front ends for doing things like proxy, firewall, ftp,
and tons of other things.

MetaCard authors could cash in on this with access to OS X's UNIX
underworld.  Not only that, but as a network administrator, I'd like to be
able to build my own front end tools so that I don't have to go into
apache's three hundred million line long text file any time I want to do
something with it. 

I'm in the process of learning UNIX now, and even after I learn how to do
everything I want, I'm STILL going to want to use MetaCard as a front end.

So I guess what I'm saying is this... What are the plans for accessing the
UNIX core of OS X via MetaCard?  If it's going to be included within the
next 4-6 months, I'll be upgrading to 2.4 tomorrow.

-- 
Richard MacLemale
Macintosh Manager Guy
J.W. Mitchell High School
http://mitchellonline.pasco.k12.fl.us/training/mm2_setup.htm


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




re:put image 1....

2001-08-19 Thread diskot123

>When you treat images as containers, what format is the data actually
in. If
>the original image brought into Metacard was a GIF/JPEG - do they *stay*
in
>that format, or are they converted to a standard internal
representation?
They stay in the orginal image format if you use 'put image 1 into url
someurl. You may also be able to use the new export command if you need
to convert the image while exporting for example 

export image 1 to url someurl as jpeg

Tuviah

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: URGENT SCRIPTING NEEDED --

2001-08-19 Thread Sjoerd Op 't Land
Title: Re: URGENT SCRIPTING NEEDED --



I don't know if I understand your question, but I'll give it a try:

Case:
Your want to open "stack1.mc","stack2.mc","stack3.mc" (are in the same directory) when the stack opens.

Solution:
If you want to do it from a standalone it's easy:
  the directory will contain the current working directory (like "C:/programming/test" or "D:/govatwork")
  Also, when you just don't give a absolute path (C:/.../stack1.mc) but a relative one ("stack1.mc") it will use
  the current working directory as start. So you can just:
    go "stack1.mc"
  When the stack is in the same directory as the standalone, of course.

If want to do this from within a stack, thing get a little different, but still, not that difficult:
  the fileName will contain an absolute path to this stack like
    c:/programming/govatwork/main.mc
  As the directory contains the path to the current engine, like
    c:/program files/mc/
  We have to use the fileName, and just split the filename from the path:
  
  on openStack
    global stackDir -- here the path is gonna be stored
    set the itemDelimiter to "/"
    put item 1 to -2 of the fileName of this stack into stackDir
    -- stackDir now contains something like "C:/programming/govatwork" or "D:/govatwork"
  end openStack
  -- now you can use the stackDir from everywhere in you app e.g.

  on mouseUp
    global stackDir
    go stackDir & "/stack1.mc"
  end mouseUp

Hope this helps,
Sjoerd

BTW We all sometimes have a time problem when programming a project, but when you have a urgent question again (I assume of course that you tried everything to avoid this situation), please use a little more polite tone, because there is nothing wrong with being polite. You can, of course, set the priority of the mail to "High".
  

A Oliver wrote/ schreef:

PLEASE REPLY SEPERATLY TO [EMAIL PROTECTED] DON'T REPLY ONTO THE METACARD EMAIL LIST AS I DON'T HAVE ALOT OF TIME TO SEARCH DOWN EVERY EMAIL. 

PROBLEM DETAILS: 
I have a project that I need to go onto a cd-rom as a part of a government project @ work.What I need is a script to run only once when the stack opens. Reason being is that I can't put all the stack locations into scripts.. for example: c:\project\mainstack.mc because then this forces them to copy to their harddrive. It is going to be 700MB, what happens if they don't have that much space? -well they can';t use it. 

outline: what I need.. 

On OpenStack 
{set a global field in the stack to the location of where this file is opened} - so for example it will set a global field called "location" to x:\[folder]\ (where x is the drive letter of where it is opening from. 
If this can be achieved then how do i recall it 

for example: (I want to open a file in the same folder called "credits.mc") 

A Button called Credits has to do: 

open "{location} (as defined before as the location) \credits.mc" therefore printing below: 

open "e:\project\credits.mc" -- where e: is the drive and project is the name of the folder 
 

If you can send script or something to help me with this it is greatly appreciated.