home *** CD-ROM | disk | FTP | other *** search
- /*
- @BFraction @P@Iby Robin Evans, July, 1992
- Converts a block of text into a superscript/subscript fraction.
- */
-
- if word(ppm_GetState(), 1) ~= 3 then
- exit_msg("You must be in edit mode to use this GEnie")
-
-
- text = ppm_GetBlockText(0)
- if text = '' then exit_msg("No block selected")
-
- parse var text Dividend '/' Divisor
- if ~datatype(Dividend, 'N') | ~datatype(Divisor, 'N') then
- exit_msg("Highlight a numerical fraction.")
-
- call ppm_cut()
-
- FontSize = ppm_GetSize()
- BaseLine = ppm_GetBaseLine()
- Tracking = ppm_GetTracking()
-
- NewSize = .75 * fontsize
- Divisor = substr(Divisor, 1,1) || '\t<'Tracking'>' || substr(Divisor, 2)
-
- /* The next 4 lines can be entered on one line.
- the characters ' ||,' indicate a continuation of the line */
- NewText = '\fs<'NewSize'>\ls<'BaseLine + .25 * FontSize'>'Dividend'\fs<' ||,
- FontSize'>\ls<'BaseLine - .12 * FontSize'>\t<'Tracking - .75 * FontSize ||,
- '>/\fs<'NewSize'>\ls<'BaseLine - .25 * FontSize'>'Divisor ||,
- '\fs<'FontSize'>\ls<'BaseLine'>'
-
- call ppm_InsertText(NewText)
-
- exit
-
- exit_msg:
- do
- parse arg message
-
- if message ~= '' then call ppm_ShowStatus(message)
- exit
- end
-