💾 Archived View for mirrors.apple2.org.za › archive › apple.cabi.net › Hypercard › Xcmds › StripHi.X… captured on 2024-12-17 at 14:07:46.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

StripHi: an XFCN for HyperCard IIgs

by David Empson

This XFCN is public domain.  You may distribute it and use the source code as you see fit.


The StripHi XFCN is quite simple: it clears the high bits in the text passed to it and returns the resulting text.

Usage (from HyperTalk):      put StripHi(sourceText) into destText

where sourceText and destText are any appropriate container (or chunk).


The following files are included:

STRIPHI.S                Source code for STRIPHI (Merlin)
DUPHANDLE.S              Used by StripHi to duplicate a handle
STRIPHI.CMD.S            Linker command file to make STRIPHI
XCMDIIGS.MACS.S          Macros to perform HyperCard callbacks
STRIPHI                  The XFCN as an EXE file
STRIPHI.DEMO             A HyperCard stack demonstrating the XFCN

You can use StripHi in your own stacks by copying it from the STRIPHI.DEMO stack, or by using my XCMDMAKER stack to convert the EXE file STRIPHI into an XFCN.

For an example of using STRIPHI to read a text file into a HyperCard field (useful for Merlin source files and Micol Advanced BASIC files), see the STRIPHI.DEMO stack.  There are scripts attached to each button in the stack, and the card's script does the actual file load.

Here is another example:

on mouseUp
  answer file "Select file to load:" of type 4  -- text
  if It is not empty then
    put It into filename
    open file filename
    read from file filename until eof
    put StripHi(It) into card field "Text"
    close file filename
  end if
end mouseUp