exporting data from fields in supercard

Working on making the switch to SuperCard? Many here have done it... ask your questions here.

exporting data from fields in supercard

Postby gavmap » Thu Apr 16, 2009 9:52 am

When my Mac was upgraded to OS 10.4.11, I found I can no longer edit scripts in my hypercard stacks. I want to rescue the information in them.
I downloaded the supercard trial demo and successfully converted my hypercard stacks, but I can't figure out how to view the field information
in the new stack nor how to export the data into a new database such as filemaker.
Posts: 1
Joined: Thu Apr 16, 2009 8:25 am

Re: exporting data from fields in supercard

Postby JoeKoomen2011 » Thu Apr 16, 2009 10:35 am

This script should work id placed in a button. It separates records with non-printing, non-typeable characters so that returns, tabs or commas in your fields don't mess with the data and make it easy to parse the data back later.

Code: Select all
on mouseUp
  global gFS, gGS, gRS, gUS, gList
  put numToChar(28) into gFS
  put numToChar(29) into gGS
  put numToChar(30) into gRS
  put numToChar(31) into gUS
  lock screen
  put "" into tData
  repeat for the number of cards of this window -- put the name of this window after tData
    repeat with x = 1 to the number of bg flds of this card
      put bg fld x after tData
      put gRS after tData
    end repeat
    put gFS after tData
    go next
  end repeat
  put gUS after tData
  put gFS after tData
  set the fileType to "R*chtext" -- file type for BBEdit files
  ask file "Select location to create records:" with (the short name of this window) & ".txt"
  if it is empty then exit mouseUp
  put it into tProjectLoc
  open file tProjectLoc
  write tData to file tProjectLoc
  close file tProjectLoc
end mouseUp
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
Posts: 469
Joined: Thu Mar 12, 2009 1:38 pm

Return to Upgrading From HyperCard

Who is online

Users browsing this forum: No registered users and 1 guest