User Tools

Site Tools


settranslator_set_run_time_translator_asciiviewerclass_.htm
Navigation:  ABC Library Reference > ASCIIViewerClass > AsciiViewerClass Methods >====== SetTranslator (set run-time translator:ASCIIViewerClass) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

SetTranslator( translator )

blk2blue.jpg

SetTranslator Sets the TranslatorClass object for the AsciiViewerClass object.
Translator The label of the TranslatorClass object for this AsciiViewerClass object.

The SetTranslator method sets the TranslatorClass object for the AsciiViewerClass object. By specifying a TranslatorClass object for the AsciiViewerClass object, you automatically translate any window or popup menu text displayed by the viewer.

Implementation:

The SetTranslator method sets the TranslatorClass object for the PopupClass, AsciiPrintClass, and AsciiSearchClass objects.

Example:

Viewer    AsciiViewerClass             !declare Viewer object

Translator  TranslatorClass            !declare Translator object

CODE

 Translator.Init                    !initialize Translator object

ViewerActive=Viewer.Init( AsciiFile,|     ! file label,

             A1:line,               |     ! file field to display

             Filename,              |     ! variable file NAME attribute

             ?AsciiBox,             |     ! LIST control number

             GlobalErrors,          |     ! ErrorClass object

             EnableSearch+EnablePrint)    ! features to implement flag

IF ~ViewerActive THEN RETURN.             !if init unsuccessful, don't

! call other Viewer methods

Viewer.SetTranslator(Translator)           !enable text translation

!program code

settranslator_set_run_time_translator_asciiviewerclass_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)