<> <> <> <> <> DIRECTORY <> CHNameP2V0 USING [Name, maxObjectLength, maxDomainLength, maxOrganizationLength], <> NSExec USING [Error, ExecProc, GetTTY, Handle, OutputHandle, ServerName], NSString USING [AppendDecimal, AppendLongDecimal, FreeString, nullString, MakeString, String], PaperHandling USING [BannerMode, D1Registration, D1RegLong, D1RegShort, Fax495BannerMode, FX3500Registration, FX3500RegLong, FX3500RegShort, PaperFeed, PaperStacking, PrintOrder, RavenRegistration, RavenRegLong, RavenRegShort, TwoPaperSizes], PaperTypes USING [PaperSize], PSCommand USING [Error, GetPrinterDisplay, GetPrintServiceStatus, PutPrinterDisplay, SetBanner, SetMultipleCopies, SetPaperFeed, SetPaperSupply, SetRegistration, SetPaperStacking, SetPrintOrder, SetTargetPrintService, SetTrace, TraceParameters, SetTransmissionRetries], PSExecInternal USING [ChoiceList, ExpandKeyAndPrint, GetList, KeyList, KeyListRep, printServiceName], PSExecMessages USING [Key], PSKMessages USING [GetHandle], PSState USING [StateHandle, TraceLevel], TextInput USING [ChoiceIndex, GetChoice, GetDecimal, GetLongDecimal, GetText], TTY USING [Handle], XFormat USING [Blanks, Handle, NSLine, NSString], XMessage USING [Get, Handle, Compose, StringArray], XNS USING [Address, unknownAddress]; PSExecCImpl: CEDAR PROGRAM IMPORTS NSExec, NSString, PSCommand, PSExecInternal, PSKMessages, TextInput, XFormat, XMessage EXPORTS PSExecInternal SHARES NSString = BEGIN OPEN CHName: CHNameP2V0; nsNil: NSString.String = NIL; tab0: CARDINAL = 2; tab1: CARDINAL = 4; tab2: CARDINAL = 8; <> execMsgs: XMessage.Handle _ PSKMessages.GetHandle[exec]; <<*******************************>> <> <<*******************************>> SetParameters: PUBLIC NSExec.ExecProc = TRUSTED BEGIN ENABLE NSExec.Error => IF type = invalidExec THEN GOTO Exit; tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; nsPrompt: NSString.String _ nsNil; nsPrompt2: NSString.String _ M[mSelect]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; WITH s: state SELECT FROM bansheeDl => --Banshee has only one operation parameter <> BansheeBannerMode[exec, s.banner]; d1 => BEGIN d1Choices: CARDINAL = 4; d1MsgKeys: PSExecInternal.KeyList _ NEW[PSExecInternal.KeyListRep[d1Choices]]; d1ChoiceStrings: PSExecInternal.ChoiceList _ NEW[XMessage.StringArray[d1Choices]]; PSExecInternal.GetList[d1Choices, d1MsgKeys, d1ChoiceStrings]; DO -- until EXIT SELECT TextInput.GetChoice[tty: tty, prompt: nsPrompt, choices: d1ChoiceStrings, default: 0] FROM 0 => EXIT; <<1 => D1BannerMode[exec, s.banner];>> 2 => PrintOrderMode[exec, s.printOrder]; <<3 => D1RegistrationMode[exec, s.registration];>> ENDCASE => outputHandle.NSLine[M[mInvalidChoice]]; nsPrompt _ nsPrompt2; ENDLOOP; END; fax495 => BEGIN <> <> <> <> <> <> <> <<0 => EXIT;>> <<1 => FX3500PaperFeedMode[exec: exec, current: s.paperFeed,>> <> <<2 => FX3500BannerMode[exec, s.banner];>> <<3 => PrintOrderMode[exec, s.printOrder];>> <<4 => FX3500RegistrationMode[exec, s.registration];>> < outputHandle.NSLine[M[mInvalidChoice]];>> <> <> END; raven => BEGIN IF s.engineBuild < b2 THEN BEGIN --Can't set stacking on a b0 and b1 ravens. b1Choices: CARDINAL = 5; b1MsgKeys: PSExecInternal.KeyList _ NEW[PSExecInternal.KeyListRep[b1Choices]]; b1ChoiceStrings: PSExecInternal.ChoiceList _ NEW[XMessage.StringArray[b1Choices]]; PSExecInternal.GetList[b1Choices, b1MsgKeys, b1ChoiceStrings]; DO -- until EXIT SELECT TextInput.GetChoice[tty: tty, prompt: nsPrompt, choices: b1ChoiceStrings, default: 0] FROM 0 => EXIT; 1 => RavenPaperSupplyMode[exec, s.paperSupply]; 2 => RavenPaperFeedMode[exec: exec, current: s.paperFeed, sameSizeBothTrays: s.paperSupply.size1 = s.paperSupply.size2]; 3 => RavenBannerMode[exec, s.banner]; 4 => RavenRegistrationMode[exec, s.registration]; ENDCASE => outputHandle.NSLine[M[mInvalidChoice]]; nsPrompt _ nsPrompt2; ENDLOOP; END ELSE BEGIN --b2 and later engines may set stacking. b2Choices: CARDINAL = 6; b2MsgKeys: PSExecInternal.KeyList _ NEW[PSExecInternal.KeyListRep[b2Choices]]; b2ChoiceStrings: PSExecInternal.ChoiceList _ NEW[XMessage.StringArray[b2Choices]]; PSExecInternal.GetList[b2Choices, b2MsgKeys, b2ChoiceStrings]; DO -- until EXIT SELECT TextInput.GetChoice[tty: tty, prompt: nsPrompt, choices: b2ChoiceStrings, default: 0] FROM 0 => EXIT; 1 => RavenPaperSupplyMode[exec, s.paperSupply]; 2 => RavenPaperFeedMode[exec: exec, current: s.paperFeed, sameSizeBothTrays: s.paperSupply.size1 = s.paperSupply.size2]; 3 => RavenBannerMode[exec, s.banner]; 4 => RavenStackingMode[exec, s.paperStacking]; 5 => RavenRegistrationMode[exec, s.registration]; ENDCASE => outputHandle.NSLine[M[mInvalidChoice]]; nsPrompt _ nsPrompt2; ENDLOOP; END; END; ENDCASE; EXITS Exit => NULL; END; --SetParameters PutPrinterDisplay: PUBLIC NSExec.ExecProc = BEGIN --Display chars input at TTY on printer console. ENABLE NSExec.Error => IF type = invalidExec THEN GOTO Exit; tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; charString: NSString.String _ NSString.MakeString[2]; leftChar, rightChar: CHARACTER; BEGIN ENABLE UNWIND => NSString.FreeString[charString]; charString _ TextInput.GetText[tty: tty, prompt: M[mDisplayChars], text: charString, minLength: 2, maxLength: 2]; leftChar _ LOOPHOLE[charString[0]]; rightChar _ LOOPHOLE[charString[1]]; PSCommand.PutPrinterDisplay[leftChar, rightChar]; NSString.FreeString[charString]; END; --Enable clause and code EXITS Exit => NULL; END; --PutPrinterDisplay GetPrinterDisplay: PUBLIC NSExec.ExecProc = BEGIN ENABLE NSExec.Error => IF type = invalidExec THEN GOTO Exit; tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; leftChar, rightChar: CHARACTER; stringArray: REF XMessage.StringArray _ NEW [XMessage.StringArray[2]]; TRUSTED BEGIN ENABLE UNWIND => NULL; stringArray[0] _ NSString.MakeString[2]; [leftChar, rightChar] _ PSCommand.GetPrinterDisplay[]; <> stringArray.data[0][0] _ LOOPHOLE[leftChar]; <> stringArray.data[0][1] _ LOOPHOLE[rightChar]; <> stringArray.data[0].length _ 2; PSExecInternal.ExpandKeyAndPrint[exec, mPrinterDisplay, stringArray]; NSString.FreeString[stringArray[0]]; END; --Enable clause and code EXITS Exit => NULL; END; --GetPrinterDisplay SetTargetPrintService: PUBLIC NSExec.ExecProc = TRUSTED BEGIN ENABLE NSExec.Error => IF type = invalidExec THEN GOTO Exit; tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; <> maxTargetStringSize: CARDINAL = CHName.maxObjectLength + CHName.maxDomainLength + CHName.maxOrganizationLength + 5; <> target: NSString.String _ NSString.MakeString[bytes: maxTargetStringSize]; address: XNS.Address _ XNS.unknownAddress; name: NSString.String _ NSString.nullString; oldTargetName: CHName.Name _ [NIL, NIL, NIL]; defaultDomainOrg: CHName.Name _ IF PSExecInternal.printServiceName = [NIL, NIL, NIL] THEN NSExec.ServerName[] ELSE PSExecInternal.printServiceName; chUsed: BOOLEAN _ FALSE; <> chRetries: CARDINAL _ 0; BEGIN ENABLE UNWIND => NSString.FreeString[target]; <> <> < TRUSTED BEGIN>> <> <> <> <> < ERROR;>> DO <> target _ TextInput.GetText[tty: tty, prompt: M[mEnterNameOrAddr], text: target, maxLength: maxTargetStringSize, default: target]; <> <> <> <<[address, chUsed] _ NSAddressTranslation.StringToNetworkAddress[>> <> <> <>> <> < {>> <> <> <> < SELECT e.rc.code FROM>> < {>> <> <<[errorString,] _ MsgOps.Error[e.rc];>> <> <> <> <> <> <> <> < {>> <> <<[errorString,] _ MsgOps.Error[e.rc];>> <> <> <> <> <> < {>> <> <<[errorString,] _ MsgOps.Error[e.rc];>> <> <> < {>> <> <<[errorString,] _ MsgOps.Error[e.rc];>> <> <> < SELECT e.reason FROM>> < {>> <> <> <> < {>> <> <> <> < {>> <> <> <> <> <<];>> EXIT; --lookup successful! ENDLOOP; PSCommand.SetTargetPrintService[address, name ! PSCommand.Error => BEGIN WITH problem SELECT FROM targetPS => BEGIN <> <> stringArray: REF XMessage.StringArray _ NEW[XMessage.StringArray[1]]; outputHandle.NSLine[M[mSetTargetWarning]]; outputHandle.NSLine[M[mTargetAttrDefaulted]]; stringArray[0] _ M[mQueryTargetPS]; PSExecInternal.ExpandKeyAndPrint[exec, mUseCommand, stringArray]; END; ENDCASE; CONTINUE; END; ]; outputHandle.Blanks[tab2]; outputHandle.NSLine[M[mDone]]; NSString.FreeString[target]; END; -- of code and enable clause EXITS Exit => NULL; END; --SetTargetPrintService SetTrace: PUBLIC NSExec.ExecProc = BEGIN --This is NOT an officially supported command. ENABLE NSExec.Error => IF type = invalidExec THEN GOTO Exit; tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; traceChoices: REF XMessage.StringArray _ NEW [XMessage.StringArray[4]]; levelChoices: REF XMessage.StringArray _ NEW [XMessage.StringArray[3]]; traceParams: PSCommand.TraceParameters; GetTraceLevel: PROCEDURE RETURNS [level: PSState.TraceLevel] = BEGIN choice: TextInput.ChoiceIndex _ TextInput.GetChoice[tty: tty, prompt: nsNil, choices: levelChoices, default: 0]; RETURN [SELECT choice FROM 0 => none, 1 => mini, ENDCASE => verbose]; END; -- GetTraceLevel GetActivityTrace: PROCEDURE RETURNS [traceParms: PSCommand.TraceParameters] = BEGIN state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; traceParms _ [spooler: state.spoolerTrace, decomposer: state.formatterTrace, marker: state.markerTrace]; END; --GetActivityTrace traceParams _ GetActivityTrace[]; SELECT TextInput.GetChoice[tty: tty, prompt: nsNil, choices: traceChoices, default: 0] FROM 0 => traceParams.spooler _ traceParams.decomposer _ traceParams.marker _ GetTraceLevel[]; 1 => traceParams.spooler _ GetTraceLevel[]; 2 => traceParams.decomposer _ GetTraceLevel[]; 3 => traceParams.marker _ GetTraceLevel[]; ENDCASE => {outputHandle.NSLine[M[mInvalidChoice]]; GOTO Exit; }; PSCommand.SetTrace[traceParams]; EXITS Exit => NULL; END; --SetTrace <<***************************************************>> <> <<***************************************************>> <<***Banner Mode:>> Fax495BannerMode: PROCEDURE [exec: NSExec.Handle, current: PaperHandling.Fax495BannerMode] = TRUSTED BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; stringArray: REF XMessage.StringArray _ NEW [XMessage.StringArray[2]]; faxBanner: PaperHandling.Fax495BannerMode; faxBanner.local _ GetBannerChoice[exec: exec, prompt: M[mSelLocalBanner], default: current.local]; faxBanner.remote _ GetBannerChoice[exec: exec, prompt: M[mSelRemoteBanner], default: current.remote]; PSCommand.SetBanner[[fax495[faxBanner]]]; WITH s: state SELECT FROM < BEGIN>> <> <> < mPerCopy,>> < mPerSetOfCopies,>> < mSuppressed];>> <> <> <> ENDCASE => ERROR; END; --Fax495BannerMode BansheeBannerMode: PROCEDURE [exec: NSExec.Handle, current: PaperHandling.BannerMode] = TRUSTED BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; stringArray: REF XMessage.StringArray _ NEW [XMessage.StringArray[2]]; PSCommand.SetBanner[[bansheeDl[ GetBannerChoice[exec: exec, prompt: M[mSelBanner], default: current]]]]; <> WITH s: state SELECT FROM bansheeDl => stringArray[0] _ M[ SELECT s.banner FROM oncePerDocument => mPerCopy, oncePerJob => mPerSetOfCopies, ENDCASE => mSuppressed]; ENDCASE => ERROR; outputHandle.Blanks[tab0]; PSExecInternal.ExpandKeyAndPrint[exec, mBanner2, stringArray]; END; -- BansheeBannerMode D1BannerMode: PROCEDURE [exec: NSExec.Handle, current: PaperHandling.BannerMode] = TRUSTED BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; stringArray: REF XMessage.StringArray _ NEW [XMessage.StringArray[2]]; PSCommand.SetBanner[[d1[ GetBannerChoice[exec: exec, prompt: M[mSelBanner], default: current]]]]; <> <> < stringArray[0] _ M[>> <> < mPerCopy,>> < mPerSetOfCopies,>> < mSuppressed];>> < ERROR;>> outputHandle.Blanks[tab1]; PSExecInternal.ExpandKeyAndPrint[exec, mBanner2, stringArray]; END; -- FX3500BannerMode RavenBannerMode: PROCEDURE [exec: NSExec.Handle, current: PaperHandling.BannerMode] = TRUSTED BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; stringArray: REF XMessage.StringArray _ NEW [XMessage.StringArray[2]]; PSCommand.SetBanner[[raven[ GetBannerChoice[exec: exec, prompt: M[mSelBanner], default: current]]]]; <> WITH s: state SELECT FROM raven => stringArray[0] _ M[ SELECT s.banner FROM oncePerDocument => mPerCopy, oncePerJob => mPerSetOfCopies, ENDCASE => mSuppressed]; ENDCASE => ERROR; outputHandle.Blanks[tab1]; PSExecInternal.ExpandKeyAndPrint[exec, mBanner2, stringArray]; END; -- RavenBannerMode GetBannerChoice: PROCEDURE [exec: NSExec.Handle, prompt: NSString.String, default: PaperHandling.BannerMode] RETURNS [PaperHandling.BannerMode] = BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; choices: CARDINAL = 3; msgKeys: PSExecInternal.KeyList _ NEW[PSExecInternal.KeyListRep[choices]]; bannerChoices: PSExecInternal.ChoiceList _ NEW[XMessage.StringArray[choices]]; choice: TextInput.ChoiceIndex; defaultChoice: CARDINAL _ SELECT default FROM oncePerDocument => 0, oncePerJob => 1, ENDCASE => 2; PSExecInternal.GetList[choices, msgKeys, bannerChoices]; choice _ TextInput.GetChoice[tty: tty, prompt: prompt, choices: bannerChoices, default: defaultChoice]; RETURN [ SELECT choice FROM 0 => oncePerDocument, 1 => oncePerJob, ENDCASE => suppressed]; END; --GetBannerChoice <<***Fax Retries:>> FaxRetryMode: PROCEDURE [exec: NSExec.Handle, currentNoConnectionCount: CARDINAL, currentNoConnectionDelayInSecs: LONG CARDINAL, currentXMitErrorCount: CARDINAL, currentXMitErrorDelayInSecs: LONG CARDINAL] = TRUSTED BEGIN --NOTE: Should fix interface to provide another menu for each retry reason. tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; WITH s: state SELECT FROM fax495 => TRUSTED BEGIN count: CARDINAL; delayInMinutes: LONG CARDINAL; freeThisString: NSString.String; stringArray: REF XMessage.StringArray _ NEW[XMessage.StringArray[2]]; <<***Prompt for # of retries for no connection:>> stringArray[0] _ M[mNoConnection]; freeThisString _ XMessage.Compose[M[mRetries2], stringArray]; count _ TextInput.GetDecimal[tty: tty, prompt: freeThisString, min: 0, max: 100, default: currentNoConnectionCount]; NSString.FreeString[freeThisString]; IF count > 0 THEN delayInMinutes _ TextInput.GetLongDecimal[tty: tty, prompt: M[mRetryInterval], min: 0, max: 100, default: currentNoConnectionDelayInSecs/60] ELSE delayInMinutes _ 0; PSCommand.SetTransmissionRetries[ retries: count, delayInSeconds: delayInMinutes*60, reason: noConnectionMade]; <<***Prompt of # of retires for transmission failure:>> stringArray[0] _ M[mTransmitFailure]; freeThisString _ XMessage.Compose[M[mRetries2], stringArray]; count _ TextInput.GetDecimal[tty: tty, prompt: freeThisString, min: 0, max: 100, default: currentXMitErrorCount]; NSString.FreeString[freeThisString]; IF count > 0 THEN delayInMinutes _ TextInput.GetLongDecimal[tty: tty, prompt: M[mRetryInterval], min: 0, max: 100, default: currentXMitErrorDelayInSecs/60] ELSE delayInMinutes _ 0; PSCommand.SetTransmissionRetries[ retries: count, delayInSeconds: delayInMinutes*60, reason: transmitError]; END; ENDCASE => ERROR; <> <> < TRUSTED BEGIN>> <> <> <> <> <> <> <> <> <> < ERROR;>> END; --FaxRetryMode DisplayCurrentFaxRetries: PROCEDURE [exec: NSExec.Handle, currentCount: CARDINAL, currentDelay: LONG CARDINAL, reasonKey: PSExecMessages.Key] = BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; sCount1: NSString.String _ NEW[TEXT[20]]; sCount2: NSString.String _ NEW[TEXT[20]]; freeThisString: NSString.String; stringArray: REF XMessage.StringArray _ NEW[XMessage.StringArray[2]]; XFormat.NSString[outputHandle, NSString.AppendDecimal[sCount1, currentCount]]; IF currentCount > 0 THEN BEGIN stringArray[0] _ NEW[TEXT[20]]; XFormat.NSString[outputHandle, NSString.AppendLongDecimal[sCount2, currentDelay]]; stringArray[1] _ NEW[TEXT[20]]; freeThisString _ XMessage.Compose[M[mRetryDelay], stringArray]; stringArray[1] _ freeThisString; END ELSE stringArray[1] _ NEW[TEXT[20]]; stringArray[0] _ M[reasonKey]; outputHandle.Blanks[tab1]; PSExecInternal.ExpandKeyAndPrint[exec, mTransmissionRetries, stringArray]; IF currentCount > 0 THEN NSString.FreeString[freeThisString]; END; --DisplayCurrentFaxRetries <<***Fax Multiple Copies:>> FaxMultCopiesMode: PROCEDURE [exec: NSExec.Handle, currentLocal, currentRemote: BOOLEAN] = BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; choices: CARDINAL = 2; msgKeys: PSExecInternal.KeyList _ NEW[PSExecInternal.KeyListRep[choices]]; copyChoices: PSExecInternal.ChoiceList _ NEW[XMessage.StringArray[choices]]; multLocalCopiesAllowed, multRemoteCopiesAllowed: BOOLEAN _ FALSE; stringArray: REF XMessage.StringArray _ NEW[XMessage.StringArray[2]]; PSExecInternal.GetList[choices, msgKeys, copyChoices]; multLocalCopiesAllowed _ TextInput.GetChoice[tty: tty, prompt: M[mSelLocalDuplicate], choices: copyChoices, default: IF currentLocal THEN 0 ELSE 1] = 0; multRemoteCopiesAllowed _ TextInput.GetChoice[tty: tty, prompt: M[mSelRemoteDuplicate], choices: copyChoices, default: IF currentRemote THEN 0 ELSE 1] = 0; PSCommand.SetMultipleCopies[multLocalCopiesAllowed, multRemoteCopiesAllowed]; stringArray[0] _ M[ IF multLocalCopiesAllowed THEN mAllowed ELSE mSuppressed]; outputHandle.Blanks[tab1]; PSExecInternal.ExpandKeyAndPrint[exec, mLocalCopies, stringArray]; stringArray[0] _ M[ IF multRemoteCopiesAllowed THEN mAllowed ELSE mSuppressed]; outputHandle.Blanks[tab1]; PSExecInternal.ExpandKeyAndPrint[exec, mRemoteCopies, stringArray]; END; --FaxMultCopiesMode <<***Paper Feed:>> RavenPaperFeedMode: PROCEDURE [exec: NSExec.Handle, current: PaperHandling.PaperFeed, sameSizeBothTrays: BOOLEAN] = BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; stringArray: REF XMessage.StringArray _ NEW[XMessage.StringArray[2]]; choice: TextInput.ChoiceIndex; defaultChoice: CARDINAL _ 0; IF sameSizeBothTrays THEN TRUSTED BEGIN choices: CARDINAL = 2; msgKeys: PSExecInternal.KeyList _ NEW[PSExecInternal.KeyListRep[choices]]; feedChoices: PSExecInternal.ChoiceList _ NEW[XMessage.StringArray[choices]]; defaultChoice _ SELECT current FROM fromBottomBannerFromTop => 0, ENDCASE => 1; PSExecInternal.GetList[choices, msgKeys, feedChoices]; choice _ TextInput.GetChoice[ tty: tty, prompt: M[mSpecifyFeedTray], choices: feedChoices, default: defaultChoice]; PSCommand.SetPaperFeed[ SELECT choice FROM 0 => fromBottomBannerFromTop, ENDCASE => fromBottomOrTop]; END; WITH s: state SELECT FROM raven => BEGIN stringArray[0] _ IF NOT sameSizeBothTrays THEN M[mAsAppropriate] ELSE M[ SELECT s.paperFeed FROM fromBottomBannerFromTop => mFromBottomBannerfromTopTray, ENDCASE => mFromBottomorTopTray]; outputHandle.Blanks[tab1]; PSExecInternal.ExpandKeyAndPrint[exec, mPaperFeed, stringArray]; END; ENDCASE; END; -- RavenPaperFeedMode FX3500PaperFeedMode: PROCEDURE [exec: NSExec.Handle, current: PaperHandling.PaperFeed, sameSizeBothTrays: BOOLEAN] = BEGIN tty: TTY.Handle _ NSExec.GetTTY[exec]; outputHandle: XFormat.Handle _ NSExec.OutputHandle[exec]; state: PSState.StateHandle _ PSCommand.GetPrintServiceStatus[]; stringArray: REF XMessage.StringArray _ NEW[XMessage.StringArray[2]]; choice: TextInput.ChoiceIndex; defaultChoice: CARDINAL _ 0; IF sameSizeBothTrays THEN TRUSTED BEGIN choices: CARDINAL = 5; msgKeys: PSExecInternal.KeyList _ NEW[PSExecInternal.KeyListRep[choices]]; feedChoices: PSExecInternal.ChoiceList _ NEW[XMessage.StringArray[choices]]; defaultChoice _ SELECT current FROM fromBottom => 0, fromBottomBannerFromTop => 1, fromBottomOrTop => 2, alternateBottomAndTop => 3, ENDCASE => 4; PSExecInternal.GetList[choices, msgKeys, feedChoices]; choice _ TextInput.GetChoice[ tty: tty, prompt: M[mSpecifyFeedTray], choices: feedChoices, default: defaultChoice]; PSCommand.SetPaperFeed[ SELECT choice FROM 0 => fromBottom, 1 => fromBottomBannerFromTop, 2 => fromBottomOrTop, 3 => alternateBottomAndTop, ENDCASE => fromTop]; END; WITH s: state SELECT FROM fx3500 => BEGIN <> <> <> <