Navigation: ABC Library Reference > ASCIIViewerClass > AsciiViewerClass Methods >====== SetTranslator (set run-time translator:ASCIIViewerClass) ====== | |
SetTranslator( translator )
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