Moving Resources (LibURL)

John Kiltinen kiltinen at nmu.edu
Sun Dec 22 21:59:01 EST 2002


My question has to do with using Resource Mover to delete resources and
then using it to add them back to a stack.  This is happening in the
context of migrating to a newer version of MetaCard and converting from Mac
classic to OS X.  In particular, my question relates to bringing in LibURL.

Here are the specifics.  My Permutation Puzzles Package was developed under
MetaCard 2.3.2 for the Macintosh classic and Windows platforms.  The
publication of this package has been delayed long enough, so that I decided
I needed to have a Mac OS X version as well.  This OS X version is being
developed in MetaCard 2.4.3.

I have gotten everything to work under OS X and MetaCard 2.4.3 except for
my system for online registration of the package.  The system makes use of
the MetaCard "post" command.  Everything works fine under MetaCard 2.3.2 in
Mac classic and Windows environments, and also under MetaCard 2.4.3 when
the development environment is running and my program is still a stack.
However once I build a standalone under MetaCard 2.4.3, the post command no
longer makes contact with the server.

The problem is that in the conversion to the new version of MetaCard, as I
understand it, is that the handling of Internet functionality has been
taken over by the libURL system.  In order to incorporate this funcionality
into my program, I think that I should delete resources from my stack with
Resource Mover, and then add them back again. However when I do this, many
other details in the package break down.

I have noted this problem in the past.  When I have to delete resources
with Resource Mover and then add them back, things get broken that were
previously working just fine.

Is there a solution to this problem?  Have I given enough information to
make it clear?  In case not, here is the script for my registration routine
that uses the "post" command, taken from a button that the user presses
after filling in a form:

global gPostInfo
on mouseUp
  if the platform is "MacOS" then
    put MacToISO(gPostInfo) into postThisNow
  else
    put gPostInfo into postThisNow
  end if
  try
    post postThisNow to url "http://math.nmu.edu/~registrar/post.cgi"
  catch errornum
    answer "Error number" && errornum && "in attempt to send your data."
    exit mouseUp
  finally
    put it into CheckWhatHappened
    if matchText(CheckWhatHappened,  "SUCCESS") then
      put "You are now registered.  Thank you." & return & \
          "Wait just a moment while I record the " & \
          "fact that you have registered" & return & \
          "so that I do not have to remind you about this any more." \
          into field "Result" \
          of card 3 of stack "Registration Form"
      show field "Result" of card 3 of stack "Registration Form"

      ##Steps for recording locally that registration was successful deleted.

    else
      put "The registration did not go through.  Here are some " & \
      "things that you can try." & return & return & \
          "1.  Check to make sure that you are connected to the Internet." \
           & return & return & \
          "2.  Maybe the computer that receives these messages is " & \
           "temporarily down.  Try the online registration later."  & \
          return & return & \
          "3.  If the online procedure has failed on several attempts, " & \
          "use one of the other options." \
          into field "Result" of card 3 of stack "Registration Form"
      show field "Result" of card 3 of stack "Registration Form"
      show button "Close Result" of card 3 of stack "Registration Form"
      exit mouseUp
    end if
  end try
end mouseUp

John Kiltinen


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 John Kiltinen (kiltinen at nmu.edu)        Home              Office
 Professor, Dept. of Math. & CS   Tel.(906) 228-8035 or (906) 227-1600
 Northern Michigan University     Fax (906) 228-4667 or (906) 2272010
 Marquette, MI 49855 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





More information about the metacard mailing list