Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!amdahl!nsc!voder!apple!dan From: dan@Apple.COM (Dan Allen) Newsgroups: comp.sys.mac.hypercard Subject: Re: Writing cards to a text file Message-ID: <11920@apple.Apple.COM> Date: 10 Jun 88 00:34:03 GMT References: <13394@shemp.CS.UCLA.EDU> Reply-To: dan@apple.apple.com.UUCP (Dan Allen) Organization: Apple Computer Inc, Cupertino, CA Lines: 43 In article <13394@shemp.CS.UCLA.EDU> ryan@CS.UCLA.EDU (Ryan R. Ramsey) writes: >I just completed a database that contains over 500 records and need a better >alternative to a subroutine. What I want to do is write all the information >I have on all of my cards to a file using the open file and write commands. >The problem is that in order to write the next I actually have to be >on that physical card. As you can imagine, trying to write 500+ cards takes >a long time... Is there any way to do this other than the way I do it? Well, I don't really know how you are doing it, but here is a generic script that I use to export text from all BACKGROUND fields. It creates an ASCII file in the TAB TAB TAB CR type of format. It also strips all carriage returns found in fields, leaving CR to be unique as a record separator. (Tab is the field separator). on mouseUp put the short name of this stack & ".tx" into defaultName ask "Export text to what file?" with defaultName if it is empty then exit mouseUp put it into fileName open file fileName go to first card repeat for the number of cards repeat with i = 1 to the number of fields put field i into temp repeat if return is not in temp then exit repeat put space into char offset(return,temp) of temp end repeat write temp to file fileName if i<> the number of fields then write tab to file fileName else write return to file fileName end if end repeat go to next card end repeat close file fileName end mouseUp Hope this helps. Dan Allen Apple Computer