Agil Abdullah

Contributed samples by Agil Abdullah

BosTaurus Show – Digital Artist

Multiple Grid

Project Free HRD & Payroll Application (Manpower)

Read Text Files & Codes

Advertisements

__TextSave()

Template

Procedure

Name

__TextSave()

Category

API

Subcategory

Internal

Oneliner

Redirect console output to printer or file and save old settings

Syntax

      __TextSave( <cFile> )

Arguments

<cFile> is either “PRINTER” (note the uppercase) in which console output is SET to PRINTER, or a name of a text file with a default “.txt” extension, that is used to redirect console output.

Description

__TextSave() is used in the preprocessing of the TEXT TO command to redirect the console output while saving old settings that can be restored later by __TextRestore().

Compliance

C52U

Platforms

All

Files

Library is core

Seealso

Set(), SET ALTERNATE, SET PRINTER, TEXT, __TextRestore()

__TextRestore()

Template

Procedure

Name

__TextRestore()

Category

API

Subcategory

Internal

Oneliner

Restore console output settings as saved by __TextSave()

Syntax

      __TextRestore()

Arguments

none.

Description

__TextRestore() is used in the preprocessing of the TEXT TO command to restore console output settings that were previously saved by __TextSave().

Compliance

C52U

Platforms

All

Files

Library is core

Seealso

Set(), SET ALTERNATE, SET PRINTER, TEXT, __TextSave()

SP_STRPULL

STRPULL()

  Short:
  ------
  STRPULL() Extract text between 2 characters in a string

  Returns:
  --------
  <cExtract> => text extracted

  Syntax:
  -------
  STRPULL(cSource,cDelim1,cDelim2)

  Description:
  ------------
  Extracts text from <cSource> between characters
  <cDelim1> and <cDelim2>.

  If <cDelim1> is empty, uses beginning of <cSource>.

  If <cDelim2> is empty, uses end of <cSource>.

  Examples:
  ---------
   cString := "SUPERFUNCTION"

   cString := STRPULL(cString,'E','C')

   // (returns "RFUN")

  Source:
  -------
  S_STRPUL.PRG

 

SP_ARRANGE

ARRANGE()

  Short:
  ------
  ARRANGE() Rearranges text in a string

  Returns:
  --------
  <cNewString> => String rearranged

  Syntax:
  -------
  ARRANGE(cInString,nStart,nLength,nNewPosit)

  Description:
  ------------
  Extracts text from <cInString> starting at <nStart>
  for a length of <nLength> and moves it to position
  <nNewPosition>.

  Examples:
  ---------
   cString := "SUPERFUNCTION"
   cString := ARRANGE(cString,6,8,1)
    // =>  "FUNCTIONSUPER"

  Notes:
  ------
  New position is position AFTER text is cut from
  original position

  Source:
  -------
  S_ARRANG.PRG

 

FT_PCHR

FT_PCHR()
 Convert printer control codes

 Syntax

       FT_PCHR( <cString> )  ->  <cPrinterFormat>

 Arguments

       <cString> is the representation of the printer control codes in
       text, numeric, hexadecimal, Epson command format, or any combination
       separated by commas.

 Returns

       A character string of printer control codes.

 Description

       This function is useful for allowing the user to enter printer
       control codes in text (enclosed in double quotes), numeric,
       hexadecimal, or Epson commands preceded by a slash and returns
       the printer control code equivalent.

       NOTES"

         - Combinations of text, numbers, hex, and commands must be
            separated by commas ("A",27,&1B,/RESET).
         - Text must be enclosed in double quotes ("x").
         - Hexadecimal must be preceded by an ampersand (&1B).
         - Epson commands, listed below, must be preceded by a forward
            slash (/RESET).

         Epson commands: (slash commands are specific to the Epson)

           Job Control:

           /RESET or /INIT   Reset or initialize the printer
           /BELL  or /BEEP   Cause the printer's speaker to beep (not HS)
           /CAN              Clear print buffers (not MX)
           /SLOW             Set low speed mode (not CR, HS, MX)
           /FAST             Cancel low speed mode (not CR, HS, MX)
           /ONE              Select Unidirectional mode
           /TWO              Select Directional mode
           /ON               Activate printer
           /OFF              Turn off printer

           /FF or /EJECT     Form Feed

           Page Control:

           /1/6              Set 6 lines per inch
           /1/8              Set 8 lines per inch
           /SKIP             Set Skip perforation ON
           /SKIPOFF          Set Skip perforation OFF

           Font Selection and Manipulation:

           /ITALIC           Select italic char. set  (only FX86, EX, LX,
                                                           no LQ-1500, SX)
           /GRAPHIC          Select graphic char. set (only FX86, EX, LX,
                                                           no LQ-1500, SX)
           /ROMAN            Choose Roman font
           /SANS             Choose Sans Serif font
           /DRAFT            Choose draft
           /NLQ              Choose near letter quality
           /PICA             Choose 10 chars per inch
           /ELITE            Choose 12 chars per inch
           /COND or /SI      Choose 15 chars per inch
           /EMPH             Turn emphasize on
           /EMPHOFF          Turn emphasize off
           /SPANISH          Select spanish international char set
           /USA              Select USA international char set

 Examples

       cSetUp := '27,116,1'
       Set Print ON
       ? FT_PCHR( cSetUp )      ->  (CHR(27)+CHR(116)+CHR(1))
                                            <select Epson char. graphics>

       ? FT_PCHR( '27,"x",0' )  ->  (CHR(27)+CHR(120)+CHR(0))
                                         <Epson draft mode>

       ? FT_PCHR( '&1B,"E"'  )  ->  (CHR(27)+CHR(69))   <HP reset>

       ? FT_PCHR( '/ELITE,/NLQ' ) ->(CHR(27)+CHR(77)+CHR(27)+CHR(120)+CHR(1))
                                <Epson elite & near letter quality>

 Source: PCHR.PRG

 Author: Jim Gale

 

C5 UI – Advanced

C5 UI – Advanced

ACHOICE() :

Execute a pop-up menu

ACHOICE(<nTop>, <nLeft>, <nBottom>, <nRight>,
    <acMenuItems>,
    [<alSelectableItems> | <lSelectableItems>],
    [<cUserFunction>],
    [<nInitialItem>],
    [<nWindowRow>]) --> nPosition

BROWSE()* :

Browse records within a window

BROWSE([<nTop>], [<nLeft>],
    [<nBottom>], [<nRight>]) --> lSuccess

DBEDIT() :

Browse records in a table format

DBEDIT( [<nTop>], [<nLeft>],
    [<nBottom>], <nRight>],
    [<acColumns>],
    [<cUserFunction>],
    [<acColumnSayPictures> | <cColumnSayPicture>],
    [<acColumnHeaders> | <cColumnHeader>],
    [<acHeadingSeparators> | <cHeadingSeparator>],
    [<acColumnSeparators> | <cColumnSeparator>],
    [<acFootingSeparators> | <cFootingSeparator>],
    [<acColumnFootings> | <cColumnFooting>]) --> NIL

DISPLAY :

Display records to the console

DISPLAY <exp list>
    [TO PRINTER] [TO FILE <xcFile>]
    [<scope>] [WHILE <lCondition>]
    [FOR <lCondition>] [OFF]

LIST :

List records to the console

LIST <exp list>
    [TO PRINTER] [TO FILE <xcFile>]
    [<scope>] [WHILE <lCondition>]
    [FOR <lCondition>] [OFF]

LABEL FORM :

Display labels to the console

LABEL FORM <xcLabel>
    [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
    [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
    [SAMPLE]

REPORT FORM :

Display a report to the console

REPORT FORM <xcReport>
    [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
    [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
    [PLAIN | HEADING <cHeading>] [NOEJECT] [SUMMARY]

TEXT :

Display a literal block of text

TEXT [TO PRINTER] [TO FILE <xcFile>]
    <text>...
ENDTEXT