DIRECTORY
AccessCH USING [Problem],
AdobeCommon USING [--ChangeSystem, DataHandle, FreeHintStrings, GetDataSW, GetDescList, --Handle, InitialSetStatus--, LockedSysDescPtr--, PostMessage, ReportFields, ReportFieldsSeq, SetStatus--, StringArray--],
AdobeCommonInternal USING [ClickToConfirm, InstanceDataHandle],
AdobeOps USING [ARNumber, ARSystemHandle--, DefaultInfoObject--, FieldList, nilARNumber, QLHandle, QueryList, SetOfARs, ToolType, UserOrderSequence, UserSpecifiedOrder],
AdobeServer USING [Error, GetSystemDefaultUserFile],
AdobeP75V2,
AdobeToolContext,
ARAccess,
Ascii USING [NUL],
BasicTime USING [GMT],
Convert USING [CardFromRope, RopeFromTime],
FormSW USING [ItemHandle, line0, MenuProcType, ProcType],
IO USING [Close, EndOf, GetChar, PutChar, STREAM],
MFile USING [Acquire, Delete, Handle],
MStream USING [WriteOnly],
CmFile
USING [
Close, Error, FindSection, FreeString, Handle, NextItem, Open],
CrRPC USING [BulkDataSink],
NSName USING [maxFullNameLength],
PFS USING [Delete, PathFromRope, StreamOpen],
Put USING [CR, Text],
Rope USING [Cat, Concat, Equal, Fetch, Length, Substr, ROPE],
Stream USING [Delete, Handle],
String USING [
AppendExtensionIfNeeded, CopyToNewString, Equal, Equivalent,
Length, MakeString, StringToDecimal],
System USING [nullNetworkAddress],
Token
USING [
Alphabetic, AlphaNumeric, Brackets, Decimal, Filtered,
FilterProcType, FreeTokenString, FreeStringHandle, Line,
MaybeQuoted, NonWhiteSpace, Handle, StringToHandle, SyntaxError],
XNSAdobeClientOps USING [GetSystemDefaultUserFile, StubError, UnknownAddress];
--Window USING [Handle, Place];
ReadTil:
PROCEDURE [r: Rope.
ROPE, currentIndex:
CARD, c:
CHAR]
RETURNS [newIndex:
CARD] ~ {
i: INT;
FOR i ¬ currentIndex + 1, i + 1 UNTIL i >= r.Length[] OR r.Fetch[i] = c DO ENDLOOP;
RETURN[i];
};
AdobeTimeRope:
PUBLIC
PROCEDURE [time: BasicTime.
GMT]
RETURNS [timeRope: Rope.
ROPE ¬
NIL] = {
cedarTime: Rope.ROPE ¬ Convert.RopeFromTime[time, years, seconds, FALSE, FALSE, FALSE];
index, tmp: CARD ¬ 0;
timeRope ¬ timeRope.Cat["-", Rope.Substr[cedarTime, index, 3], "-"];
index ¬ ReadTil[cedarTime, index, ' ] + 1;
tmp ¬ ReadTil[cedarTime, index, ',] ;
timeRope ¬ Rope.Concat[Rope.Substr[cedarTime, index, tmp - index], timeRope];
index ¬ tmp + 4;
timeRope ¬ timeRope.Cat[Rope.Substr[cedarTime, index, 2], " "];
index ¬ index + 3;
tmp ¬ ReadTil[cedarTime, index, 'X];
timeRope ¬ timeRope.Concat[Rope.Substr[cedarTime, index, tmp-index]];
};
SetFSWOrderAndDefaultFromUserFile:
PUBLIC
PROCEDURE [
systemName: Rope.ROPE, arSH: AdobeOps.ARSystemHandle, server: Rope.ROPE] =
BEGIN
fL: AdobeOps.FieldList ¬ arSH.fieldList;
localName: Rope.ROPE ¬ GetLocalName[systemName];
userFile: Rope.ROPE ¬ localName;
cmH: CmFile.Handle ¬ NIL;
noUserFile: BOOLEAN ¬ FALSE;
localName ¬
NIL;
FreeLocalName[localName];
userFile ¬ ConvertToUserFileName[userFile];
userFile ¬ userFile.Concat[".user"];
[] ← String.AppendExtensionIfNeeded[
@userFile, ".user", AdobeOps.z];
open local user file
cmH ¬ CmFile.Open[
userFile !
CmFile.Error =>
IF code = fileNotFound
THEN {
[cmH, noUserFile] ¬ GetUserFileFromService[
systemName, userFile];
IF noUserFile THEN CONTINUE ELSE RETRY}];
FOR tool: AdobeOps.ToolType
IN AdobeOps.ToolType
DO
free old value
AdobeOps.z.FREE[@arSH.formSWOrderArray[tool]];
IF noUserFile
THEN
arSH.formSWOrderArray[tool] ¬ AllDisplayed[fL.length]
ELSE
arSH.formSWOrderArray[tool] ¬ SearchUserFileForDisplayed[
cmH, fL, tool];
ENDLOOP;
use IF only until can go to service for noUserFile
IF ~noUserFile
THEN {
cmH ¬ CmFile.Close[cmH];
};
AdobeOps.z.FREE[@userFile];
END;