XFCNs and XCMDs
External Functions and Commands for HyperCard
Contents

Software

Adminalyser

Reference Maker

Licenses Stack

File Sync

License

USB2Serial Chat

Links

Port Chooser

DIFfersifier 3.0

Zipfer

Salery Web Shop

Quibble Archives Browser

Bugs in the Quibble
Archives Browser


Sample Scripts Stack

Chat Rev 1.2M

CheckPDF 1.0

Create New Stack 1.1

Curvator

Bugs Log 1.0

Country Codes 1.1.1

Noughts and Crosses

XFCNs and XCMDs

More downloads

XFCNs and XCMDs

This page contains a few external functions and commands for HyperCard that I have created.

ShowHideControlstrip

The ShowHideControlstrip XCMD shows and hides the Control Strip.Download it here.


StackToFilename XFCN

StackToFilename XFCN returns the path to the parent folder of your HyperCard stack together with a filename which has to be supplied as a parameter. It allows you to dynamically determine the filepath to a file relative to the filepath of your stack. Download


CharToHex XFCN

This XFCN returns the hexadecimal value of a character. For example, the ASCII value of [˘ ] is 255, but it is the 256th ASCII character, since the NULL character has value 0. The hex value of [˘ ] is FF (=16*16). This can be very useful when converting text to hex values. Download


HexToChar XFCN

This XFCN returns the character equivalent of hexadecimal value. For example, the equivalent of AF is [Ø] and the equivalent of BB is [ª]. This XFCN converts all HEX codes between 00 and FF. Download


ErrorMsg XCMD

My scripts are full of lines checking for errors. Since I am using AddColor all the time --except in my external release stacks-- my scripts look like this:

on openStack
  start using stack "Color Tools"
  addColor "install",8
  put the result into rslt
  if rslt is not empty then
   beep
   answer rslt
  end if
  -- rest of script
end openStack

The big problem here is that the result is emptied directly after the next command. When I just started using AddColor this caused bad headaches because I couldn't find the source of my errors. Now, the only problem is that I want HyperCard to beep if an error occurs, thereby clearing the result.

The solution is this ErrorMsg XCMD. This XCMD does nothing but to beep and put an answer dialog on screen. The only difference with the above script is that the result contains the message shown in the answer dialog, afterwards. So, if you make an syntax error in an AddColor command, you can use one line of code to show the error message without changing the result.

The openStack script can now be rewritten as follows:

on openStack
  start using stack "Color Tools"
  addColor "install",8
  if the result is not empty then errorMsg (the result)
  -- rest of script
end openStack

Download the ErrorMsg XCMD here


SetDepth XCMD

The SetDepth XCMD sets the colour depth of your monitor. It only works with 256, thousands and millions of colours. The idea behind this XCMD is that some games need a screen depth of 256 colours while most people have their screen set to thousands or millions of colours. If you develop a stack that needs the colour depth of the monitor to be set to 256, use this XCMD to do so and to restore the depth afterwards.

It might be useful to use the SetDepth XCMD in combination with the Picture XCMD or the Color Tools. You can save memory by using a lower colour depth when calling AddColor and in some instances you might avoid colour distortion by changing the screen depth accordingly.

The syntax for this XCMD is:

SetDepth <integer>

where:
integer is either 8, 16, or 32. Any different value will return an error. Error messages are returned as the result. If the result is empty, no error has occurred.

You can download the SetDepth XCMD here.


GetFontList XCMD

Use this XCMD to retrieve a list of fonts currently available. This is particularly useful of the Font menu is not available.

Download here


Last update: 02-06-2005