Appendix E: Listing of Const.oph for Series 5
Appendix E: Listing of Const.oph for Series 5
REM CONST.OPH version 1.10
REM Constants for OPL
REM Last edited on 19 May 1997
REM (C) Copyright Psion PLC 1997
REM General constants
CONST KTrue%=-1
CONST KFalse%=0
REM Data type ranges
CONST KMaxStringLen%=255
CONST KMaxFloat=1.7976931348623157E+308
CONST KMinFloat=2.2250738585072015E-308
REM Minimum with full precision in mantissa
CONST KMinFloatDenorm=5e-324
REM Denormalised (just one bit of precision left)
CONST KMinInt%=$8000
REM -32768 (translator needs hex for maximum ints)
CONST KMaxInt%=32767
CONST KMinLong&=&80000000 REM -2147483648 (hex for translator)
CONST KMaxLong&=2147483647
REM Special keys
CONST KKeyEsc%=27
CONST KKeySpace%=32
CONST KKeyDel%=8
CONST KKeyTab%=9
CONST KKeyEnter%=13
CONST KGetMenu%=4150
CONST KKeyUpArrow%=4105
CONST KKeyDownArrow%=4106
CONST KKeyLeftArrow%=4103
CONST KKeyRightArrow%=4104
CONST KKeyPageUp%=4100
CONST KKeyPageDown%=4101
CONST KKeyPageLeft%=4098
CONST KKeyPageRight%=4099
REM Month numbers
CONST KJanuary%=1
CONST KFebruary%=2
CONST KMarch%=3
CONST KApril%=4
CONST KMay%=5
CONST KJune%=6
CONST KJuly%=7
CONST KAugust%=8
CONST KSeptember%=9
CONST KOctober%=10
CONST KNovember%=11
CONST KDecember%=12
REM Graphics
CONST KDefaultWin%=1
CONST KgModeSet%=0
CONST KgModeClear%=1
CONST KgModeInvert%=2
CONST KtModeSet%=0
CONST KtModeClear%=1
CONST KtModeInvert%=2
CONST KtModeReplace%=3
CONST KgStyleNormal%=0
CONST KgStyleBold%=1
CONST KgStyleUnder%=2
CONST KgStyleInverse%=4
CONST KgStyleDoubleHeight%=8
CONST KgStyleMonoFont%=16
CONST KgStyleItalic%=32
REM For 32-bit status words IOWAIT and IOWAITSTAT32
REM Use KErrFilePending% (-46) for 16-bit status words
CONST KStatusPending32&=&80000001
REM Error codes
CONST KErrGenFail%=-1
CONST KErrInvalidArgs%=-2
CONST KErrOs%=-3
CONST KErrNotSupported%=-4
CONST KErrUnderflow%=-5
CONST KErrOverflow%=-6
CONST KErrOutOfRange%=-7
CONST KErrDivideByZero%=-8
CONST KErrInUse%=-9
CONST KErrNoMemory%=-10
CONST KErrNoSegments%=-11
CONST KErrNoSemaphore%=-12
CONST KErrNoProcess%=-13
CONST KErrAlreadyOpen%=-14
CONST KErrNotOpen%=-15
CONST KErrImage%=-16
CONST KErrNoReceiver%=-17
CONST KErrNoDevices%=-18
CONST KErrNoFileSystem%=-19
CONST KErrFailedToStart%=-20
CONST KErrFontNotLoaded%=-21
CONST KErrTooWide%=-22
CONST KErrTooManyItems%=-23
CONST KErrBatLowSound%=-24
CONST KErrBatLowFlash%=-25
CONST KErrExists%=-32
CONST KErrNotExists%=-33
CONST KErrWrite%=-34
CONST KErrRead%=-35
CONST KErrEof%=-36
CONST KErrFull%=-37
CONST KErrName%=-38
CONST KErrAccess%=-39
CONST KErrLocked%=-40
CONST KErrDevNotExist%=-41
CONST KErrDir%=-42
CONST KErrRecord%=-43
CONST KErrReadOnly%=-44
CONST KErrInvalidIO%=-45
CONST KErrFilePending%=-46
CONST KErrVolume%=-47
CONST KErrIOCancelled%=-48
REM OPL specific errors
CONST KErrSyntax%=-77
CONST KOplStructure%=-85
CONST KErrIllegal%=-96
CONST KErrNumArg%=-97
CONST KErrUndef%=-98
CONST KErrNoProc%=-99
CONST KErrNoFld%=-100
CONST KErrOpen%=-101
CONST KErrClosed%=-102
CONST KErrRecSize%=-103
CONST KErrModLoad%=-104
CONST KErrMaxLoad%=-105
CONST KErrNoMod%=-106
CONST KErrNewVer%=-107
CONST KErrModNotLoaded%=-108
CONST KErrBadFileType%=-109
CONST KErrTypeViol%=-110
CONST KErrSubs%=-111
CONST KErrStrTooLong%=-112
CONST KErrDevOpen%=-113
CONST KErrEsc%=-114
CONST KErrMaxDraw%=-117
CONST KErrDrawNotOpen%=-118
CONST KErrInvalidWindow%=-119
CONST KErrScreenDenied%=-120
CONST KErrOpxNotFound%=-121
CONST KErrOpxVersion%=-122
CONST KErrOpxProcNotFound%=-123
CONST KErrStopInCallback%=-124
CONST KErrIncompUpdateMode%=-125
CONST KErrInTransaction%=-126
REM For ALERT
CONST KAlertEsc%=1
CONST KAlertEnter%=2
CONST KAlertSpace%=3
REM For BUSY and GIPRINT
CONST KBusyTopLeft%=0
CONST KBusyBottomLeft%=1
CONST KBusyTopRight%=2
CONST KBusyBottomRight%=3
CONST KBusyMaxText%=80
REM For CMD$
CONST KCmdAppName%=1 REM Full path name used to start program
CONST KCmdUsedFile%=2
CONST KCmdLetter%=3
REM For CMD$(3)
CONST KCmdLetterCreate$="C"
CONST KCmdLetterOpen$="O"
CONST KCmdLetterRun$="R"
REM For CURSOR
CONST KCursorTypeNotFlashing%=2
CONST KCursorTypeGrey%=4
REM For DATIM$ - offsets
CONST KDatimOffDayName%=1
CONST KDatimOffDay%=5
CONST KDatimOffMonth%=8
CONST KDatimOffYear%=12
CONST KDatimOffHour%=17
CONST KDatimOffMinute%=20
CONST KDatimOffSecond%=23
REM For dBUTTON
CONST KDButtonNoLabel%=$100
CONST KDButtonPlainKey%=$200
CONST KDButtonDel%=8
CONST KDButtonTab%=9
CONST KDButtonEnter%=13
CONST KDButtonEsc%=27
CONST KDButtonSpace%=32
REM For dEDITMULTI and printing
CONST KParagraphDelimiter%=$06
CONST KLineBreak%=$07
CONST KPageBreak%=$08
CONST KTabCharacter%=$09
CONST KNonBreakingTab%=$0a
CONST KNonBreakingHyphen%=$0b
CONST KPotentialHyphen%=$0c
CONST KNonBreakingSpace%=$10
CONST KPictureCharacter%=$0e
CONST KVisibleSpaceCharacter%=$0f
REM For DEFAULTWIN
CONST KDefWin4ColourMode%=1
CONST KDefWin16ColourMode%=2
REM For dFILE
CONST KDFileNameLen%=255
REM flags
CONST KDFileEditBox%=$0001
CONST KDFileAllowFolders%=$0002
CONST KDFileFoldersOnly%=$0004
CONST KDFileEditorDisallowExisting%=$0008
CONST KDFileEditorQueryExisting%=$0010
CONST KDFileAllowNullStrings%=$0020
CONST KDFileAllowWildCards%=$0080
CONST KDFileSelectorWithRom%=$0100
CONST KDFileSelectorWithSystem%=$0200
REM Opl-related Uids for dFILE
CONST KUidOplInterpreter&=268435575
CONST KUidOplApp&=268435572
CONST KUidOplDoc&=268435573
CONST KUidOPO&=268435571
CONST KUidOplFile&=268435594
CONST KUidOpxDll&=268435549
REM For DIALOG
CONST KDlgCancel%=0
REM For dINIT (flags for dialogs)
CONST KDlgButRight%=1
CONST KDlgNoTitle%=2
CONST KDlgFillScreen%=4
CONST KDlgNoDrag%=8
CONST KDlgDensePack%=16
REM For DOW
CONST KMonday%=1
CONST KTuesday%=2
CONST KWednesday%=3
CONST KThursday%=4
CONST KFriday%=5
CONST KSaturday%=6
CONST KSunday%=7
REM For dPOSITION
CONST KDPositionLeft%=-1
CONST KDPositionCentre%=0
CONST KDPositionRight%=1
REM For dTEXT
CONST KDTextLeft%=0
CONST KDTextRight%=1
CONST KDTextCentre%=2
CONST KDTextBold%=$100 REM Ignored in Eikon
CONST KDTextLineBelow%=$200
CONST KDTextAllowSelection%=$400
CONST KDTextSeparator%=$800
REM For dTIME
CONST KDTimeAbsNoSecs%=0
CONST KDTimeAbsWithSecs%=1
CONST KDTimeDurationNoSecs%=2
CONST KDTimeDurationWithSecs%=3
REM Flags for dTIME (for ORing combinations)
CONST KDTimeWithSeconds%=1
CONST KDTimeDuration%=2
CONST KDTimeNoHours%=4
CONST KDTime24Hour%=8
REM For dXINPUT
CONST KDXInputMaxLen%=16
REM For FINDFIELD
CONST KFindCaseDependent%=16
CONST KFindBackwards%=0
CONST KFindForwards%=1
CONST KFindBackwardsFromEnd%=2
CONST KFindForwardsFromStart%=3
REM For FLAGS
CONST KFlagsAppFileBased%=1
CONST KFlagsAppIsHidden%=2
REM For gBORDER and gXBORDER
CONST KBordSglShadow%=1
CONST KBordSglGap%=2
CONST KBordDblShadow%=3
CONST KBordDblGap%=4
CONST KBordGapAllRound%=$100
CONST KBordRoundCorners%=$200
CONST KBordLosePixel%=$400
REM For gBUTTON
CONST KButtS3%=0
CONST KButtS3Raised%=0
CONST KButtS3Pressed%=1
CONST KButtS3a%=1
CONST KButtS3aRaised%=0
CONST KButtS3aSemiPressed%=1
CONST KButtS3aSunken%=2
CONST KButtS5%=2
CONST KButtS5Raised%=0
CONST KButtS5SemiPressed%=1
CONST KButtS5Sunken%=2
CONST KButtLayoutTextRightPictureLeft%=0
CONST KButtLayoutTextBottomPictureTop%=1
CONST KButtLayoutTextTopPictureBottom%=2
CONST KButtLayoutTextLeftPictureRight%=3
CONST KButtTextRight%=0
CONST KButtTextBottom%=1
CONST KButtTextTop%=2
CONST KButtTextLeft%=3
CONST KButtExcessShare%=$00
CONST KButtExcessToText%=$10
CONST KButtExcessToPicture%=$20
REM For gCLOCK
CONST KgClockS5System%=6
CONST KgClockS5Analog%=7
CONST KgClockS5Digital%=8
CONST KgClockS5LargeAnalog%=9
CONST KgClockS5Formatted%=11
REM For gCREATE
CONST KgCreateInvisible%=0
CONST KgCreateVisible%=1
CONST KgCreate2ColourMode%=$0000
CONST KgCreate4ColourMode%=$0001
CONST KgCreate16ColourMode%=$0002
CONST KgCreateHasShadow%=$0010
REM For GETCMD$
CONST KGetCmdLetterCreate$="C"
CONST KGetCmdLetterOpen$="O"
CONST KGetCmdLetterExit$="X"
CONST KGetCmdLetterUnknown$="U"
REM For gLOADBIT
CONST KgLoadBitReadOnly%=0
CONST KgLoadBitWriteable%=1
REM For gRANK
CONST KgRankForeground%=1
CONST KgRankBackGround%=32767
REM For gPOLY - array subscripts
CONST KgPolyAStartX%=1
CONST KgPolyAStartY%=2
CONST KgPolyANumPairs%=3
CONST KgPolyANumDx1%=4
CONST KgPolyANumDy1%=5
REM For gPRINTB
CONST KgPrintBRightAligned%=1
CONST KgPrintBLeftAligned%=2
CONST KgPrintBCentredAligned%=3
REM The defaults
CONST KgPrintBDefAligned%=KgPrintBLeftAligned%
CONST KgPrintBDefTop%=0
CONST KgPrintBDefBottom%=0
CONST KgPrintBDefMargin%=0
REM For gXBORDER
CONST KgXBorderS3Type%=0
CONST KgXBorderS3aType%=1
CONST KgXBorderS5Type%=2
REM For gXPRINT
CONST KgXPrintNormal%=0
CONST KgXPrintInverse%=1
CONST KgXPrintInverseRound%=2
CONST KgXPrintThinInverse%=3
CONST KgXPrintThinInverseRound%=4
CONST KgXPrintUnderlined%=5
CONST KgXPrintThinUnderlined%=6
REM For KMOD
CONST KKmodShift%=2
CONST KKmodControl%=4
CONST KKmodPsion%=8
CONST KKmodCaps%=16
CONST KKmodFn%=32
REM For mCARD and mCASC
CONST KMenuDimmed%=$1000
CONST KMenuSymbolOn%=$2000
CONST KMenuSymbolIndeterminate%=$4000
CONST KMenuCheckBox%=$0800
CONST KMenuOptionStart%=$0900
CONST KMenuOptionMiddle%=$0A00
CONST KMenuOptionEnd%=$0B00
REM For mPOPUP position type
REM Specifies which corner of the popup is given by the coordinates
CONST KMPopupPosTopLeft%=0
CONST KMPopupPosTopRight%=1
CONST KMPopupPosBottomLeft%=2
CONST KMPopupPosBottomRight%=3
REM For PARSE$ - array subscripts
CONST KParseAOffFSys%=1
CONST KParseAOffDev%=2
CONST KParseAOffPath%=3
CONST KParseAOffFilename%=4
CONST KParseAOffExt%=5
CONST KParseAOffWild%=6
REM Wild-card flags
CONST KParseWildNone%=0
CONST KParseWildFilename%=1
CONST KParseWildExt%=2
CONST KParseWildBoth%=3
REM For SCREENINFO - array subscripts
CONST KSInfoALeft%=1
CONST KSInfoATop%=2
CONST KSInfoAScrW%=3
CONST KSInfoAScrH%=4
CONST KSInfoAReserved1%=5
CONST KSInfoAFont%=6
CONST KSInfoAPixW%=7
CONST KSInfoAPixH%=8
CONST KSInfoAReserved2%=9
CONST KSInfoAReserved3%=10
REM For SETFLAGS
CONST KRestrictTo64K&=&0001
CONST KAutoCompact&=&0002
CONST KTwoDigitExponent&=&0004
CONST KSendSwitchOnMessage&=&010000
REM For GetEvent32
REM Array indexes
CONST KEvAType%=1
CONST KEvATime%=2
REM Event array keypress subscripts
CONST KEvAKMod%=4
CONST KEvAKRep%=5
REM Pointer event array subscripts
CONST KEvAPtrOplWindowId%=3
CONST KEvAPtrWindowId%=3
CONST KEvAPtrType%=4
CONST KEvAPtrModifiers%=5
CONST KEvAPtrPositionX%=6
CONST KEvAPtrPositionY%=7
CONST KEvAPtrScreenPosX%=8
CONST KEvAPtrScreenPosY%=9
REM Event types
CONST KEvNotKeyMask&=&400
CONST KEvFocusGained&=&401
CONST KEvFocusLost&=&402
CONST KEvSwitchOn&=&403
CONST KEvCommand&=&404
CONST KEvDateChanged&=&405
CONST KEvKeyDown&=&406
CONST KEvKeyUp&=&407
CONST KEvPtr&=&408
CONST KEvPtrEnter&=&409
CONST KEvPtrExit&=&40A
REM Pointer event types
CONST KEvPtrPenDown&=0
CONST KEvPtrPenUp&=1
CONST KEvPtrButton1Down&=KEvPtrPenDown&
CONST KEvPtrButton1Up&=KEvPtrPenUp&
CONST KEvPtrButton2Down&=2
CONST KEvPtrButton2Up&=3
CONST KEvPtrButton3Down&=4
CONST KEvPtrButton3Up&=5
CONST KEvPtrDrag&=6
CONST KEvPtrMove&=7
CONST KEvPtrButtonRepeat&=8
CONST KEvPtrSwitchOn&=9
CONST KKeyMenu%=4150
CONST KKeySidebarMenu%=10000
REM For PointerFilter
CONST KPointerFilterEnterExit%=$1
CONST KPointerFilterMove%=$2
CONST KPointerFilterDrag%=$4
REM Code page 1252 ellipsis ("windows latin 1")
CONST KScreenEllipsis%=133
CONST KScreenLineFeed%=10
REM For gCLOCK
CONST KClockLocaleConformant%=6
CONST KClockSystemSetting%=KClockLocaleConformant%
CONST KClockAnalog%=7
CONST KClockDigital%=8
CONST KClockLargeAnalog%=9
REM GClock 10 no longer supported (use slightly changed gCLOCK 11)
CONST KClockFormattedDigital%=11
REM For gFONT (these may change before release)
CONST KFontArialBold8&= 268435951
CONST KFontArialBold11&= 268435952
CONST KFontArialBold13&= 268435953
CONST KFontArialNormal8&= 268435954
CONST KFontArialNormal11&= 268435955
CONST KFontArialNormal13&= 268435956
CONST KFontArialNormal15&= 268435957
CONST KFontArialNormal18&= 268435958
CONST KFontArialNormal22&= 268435959
CONST KFontArialNormal27&= 268435960
CONST KFontArialNormal32&= 268435961
CONST KFontTimesBold8&= 268435962
CONST KFontTimesBold11&= 268435963
CONST KFontTimesBold13&= 268435964
CONST KFontTimesNormal8&= 268435965
CONST KFontTimesNormal11&= 268435966
CONST KFontTimesNormal13&= 268435967
CONST KFontTimesNormal15&= 268435968
CONST KFontTimesNormal18&= 268435969
CONST KFontTimesNormal22&= 268435970
CONST KFontTimesNormal27&= 268435971
CONST KFontTimesNormal32&= 268435972
CONST KFontCourierBold8&= 268436062
CONST KFontCourierBold11&= 268436063
CONST KFontCourierBold13&= 268436064
CONST KFontCourierNormal8&= 268436065
CONST KFontCourierNormal11&= 268436066
CONST KFontCourierNormal13&= 268436067
CONST KFontCourierNormal15&= 268436068
CONST KFontCourierNormal18&= 268436069
CONST KFontCourierNormal22&= 268436070
CONST KFontCourierNormal27&= 268436071
CONST KFontCourierNormal32&= 268436072
CONST KFontCalc13n&= 268435493
CONST KFontCalc18n&= 268435494
CONST KFontCalc24n&= 268435495
CONST KFontMon18n&= 268435497
CONST KFontMon18b&= 268435498
CONST KFontMon9n&= 268435499
CONST KFontMon9b&= 268435500
CONST KFontTiny1&= 268435501
CONST KFontTiny2&= 268435502
CONST KFontTiny3&= 268435503
CONST KFontTiny4&= 268435504
CONST KFontEiksym15&= 268435661
CONST KFontSquashed&= 268435701
CONST KFontDigital35&= 268435752
REM For IOOPEN
REM Mode category 1
CONST KIoOpenModeOpen%=$0000
CONST KIoOpenModeCreate%=$0001
CONST KIoOpenModeReplace%=$0002
CONST KIoOpenModeAppend%=$0003
CONST KIoOpenModeUnique%=$0004
REM Mode category 2
CONST KIoOpenFormatBinary%=$0000
CONST KIoOpenFormatText%=$0020
REM Mode category 3
CONST KIoOpenAccessUpdate%=$0100
CONST KIoOpenAccessRandom%=$0200
CONST KIoOpenAccessShare%=$0400
REM Language code for CAPTION
CONST KLangEnglish%=1
CONST KLangFrench%=2
CONST KLangGerman%=3
CONST KLangSpanish%=4
CONST KLangItalian%=5
CONST KLangSwedish%=6
CONST KLangDanish%=7
CONST KLangNorwegian%=8
CONST KLangFinnish%=9
CONST KLangAmerican%=10
CONST KLangSwissFrench%=11
CONST KLangSwissGerman%=12
CONST KLangPortuguese%=13
CONST KLangTurkish%=14
CONST KLangIcelandic%=15
CONST KLangRussian%=16
CONST KLangHungarian%=17
CONST KLangDutch%=18
CONST KLangBelgianFlemish%=19
CONST KLangAustralian%=20
CONST KLangBelgianFrench%=21
REM End of Const.oph