home *** CD-ROM | disk | FTP | other *** search
- on fileExists aFile
- set vFile to FileIO(mnew, "Read", aFile)
- if objectp(vFile) then
- vFile(mdispose)
- return 1
- else
- return 0
- end if
- end
-
- on stripCRLF aString
- repeat with vI = 1 to length(aString)
- set vCurrChar to char vI of aString
- if (vCurrChar = numToChar(10)) or (vCurrChar = numToChar(13)) then
- delete char vI of aString
- end if
- end repeat
- return aString
- end
-
- on stripChars aString, aStripChars
- set vI to 1
- repeat while vI <= length(aString)
- set vCurrChar to char vI of aString
- set vStripIt to 0
- repeat with vJ = 1 to length(aStripChars)
- if vCurrChar = char vJ of aStripChars then
- set vStripIt to 1
- exit repeat
- end if
- end repeat
- if vStripIt then
- delete char vI of aString
- next repeat
- end if
- set vI to vI + 1
- end repeat
- return aString
- end
-
- on SetCursor aCursor
- if aCursor = #none then
- cursor(200)
- else
- if aCursor = #normal then
- cursor(-1)
- else
- if aCursor = #Wait then
- cursor(4)
- else
- if aCursor = #updown then
- cursor([the number of member "UD_CURSOR", the number of member "UD_MASK"])
- else
- if aCursor = #leftright then
- cursor([the number of member "LR_CURSOR", the number of member "LR_MASK"])
- else
- if aCursor = #hand then
- cursor([the number of member "HAND_CURSOR", the number of member "HAND_MASK"])
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on HideAllSprites
- repeat with vI = 1 to 48
- set the visible of sprite vI to 0
- end repeat
- updateStage()
- end
-
- on ShowAllSprites
- repeat with vI = 1 to 48
- set the visible of sprite vI to 1
- end repeat
- updateStage()
- end
-
- on StartBufferingEvents
- global gSystem, gEventQ
- if gSystem = "WIN" then
- if gEventQ(mBufferStatus) = 0 then
- gEventQ(mBufferEvents)
- end if
- end if
- end
-
- on EndBufferingEvents
- global gSystem, gEventQ
- if gSystem = "WIN" then
- if gEventQ(mBufferStatus) = 1 then
- gEventQ(mFlushEvents)
- end if
- else
- if gSystem = "MAC" then
- gFlush(mFlush)
- end if
- end if
- end
-
- on Wait aTix, aWaitHandler
- set t to the ticks + aTix
- repeat while t > the ticks
- if voidp(aWaitHandler) then
- nothing()
- next repeat
- end if
- do(aWaitHandler)
- end repeat
- end
-
- on MessagePut aStr
- put aStr
- end
-
- on ShowDim fromCst, toCst
- if voidp(toCst) then
- put the width of cast fromCst && the height of cast fromCst
- else
- repeat with i = fromCst to toCst
- put the width of cast i && the height of cast i
- end repeat
- end if
- end
-
- on PutCst fromCst, toCst
- if voidp(toCst) then
- put the rect of cast toCst && ":" && the regPoint of cast toCst
- else
- repeat with i = fromCst to toCst
- put the rect of cast i && ":" && the regPoint of cast i
- end repeat
- end if
- end
-
- on SetReg fromCst, toCst
- if voidp(toCst) then
- set the regPoint of cast fromCst to point(0, 0)
- else
- repeat with i = fromCst to toCst
- set the regPoint of cast i to point(0, 0)
- end repeat
- end if
- end
-
- on MoveReg movH, movV, fromCst, toCst
- if voidp(toCst) then
- set the regPoint of cast fromCst to the regPoint of cast fromCst + point(movH, movV)
- else
- repeat with i = fromCst to toCst
- set the regPoint of cast i to the regPoint of cast i + point(movH, movV)
- end repeat
- end if
- end
-