Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

source: trunk/lingosource/castlib2/commonMovieScript.ls

Last change on this file was 253, checked in by alex, 8 months ago

updated scripts, fixed personal folder on windows, which points to documents on NOT to home as I thought, added fix for subversion 1.7

File size: 107.7 KB
Line 
1-- commonMovieScript
2-----------------------------------
3-- CREATED:
4--              11.02.2008
5--
6-- DESCRIPTION:     
7--              Shared Global Handlers c03 Alex da Franca -- alex@farbflash.de
8--              -------------------------------------------------------------------
9--              these handlers are shared between all of my scripts Alex da Franca c2003 alex@farbflash.de
10--              for private use of my scripts -> poor documentation -> use at own risk ;-)
11
12-- HISTORY:
13--              geaendert am 21.06.03
14--              mGetInstance 0 -- clears all stored instances -> same as recompile all scripts, but that would clear all contents of (script "commonMovieScript").pGList
15--              mApplyDynamic
16
17--              alex am 13.03.2004 um 13:49
18--              added DEBUG_FUNCTIONS
19
20--              alex am 15.03.2004 um 08:50
21--              added mGetPlatform() to get OSX
22--              alex am 31.03.2004 um 11:42
23--              added clearglobals to mDestroy handler
24
25--              added support for new director MX2004 sprite names in my handlers by changing mGetKanal() to accept strings
26
27--              alex am Freitag, 4. Juni 2004
28--              took care about missing font asset xtra, if it isn't present, we'll get not a script error anymore
29--              but rather the presence of the font is not checked instead, but rather assumed
30
31--              alex am 16. Juni 2004 um 10:12
32--              added mGetNextLowerPowerOfTwo
33
34--              alex am 18. Juli 2004 um 08:02
35--              added mMyClearGlobals() to erase the faked globals and get the new globallist
36
37--              alex am 8. Oktober 2004 um 10:31
38--              new tempmember handling due to a bug in director
39
40--              alex am 23. November 2004 um 10:59
41--              added mGetThisMovieName() and mSetThisMovieName() to identify the movie independant of the filename
42--              this is needed for some places, where the standard scripts act differently in the different movies
43
44--              Scriptmarker (21.07.2005 at 11:55 Uhr): changes // Scriptmarker
45--              added mSplitPath
46
47--
48-- WARNINGS:
49--              IMPORTANT NOTE !!
50--              if you use my scripts you MUST call 'mCallDestroy()' at stopmovie in order to clean up temporary members used by my scripts
51--              due to a bug in director I had to change the old behaavior of erasing the members on endsprite, when I was done with it !
52--              so now I use a list of temporary members, which is maintained during runtime, but must be processed when the movie is stopped
53--              (unless you want to fill up your castlib with temporary members :-)
54
55--              If this script is NOT the first moviescript in your movie containing a stopmovie handler this one gets overriddden and
56--              you must call 'mCallDestroy()' in your stopmovie handler.
57--              otherwise when it this script comes before your script with the stopmovie handler your handler will never be called
58--              since the stopmovie event is caught here...
59--              in that case just comment it out here and add the 'mCallDestroy()' to your own stopmovie handler
60
61--              on stopmovie me
62--              mCallDestroy
63--              end
64-- TODO:
65--              -
66-----------------------------------
67
68on _____________________PROPERTY_DECLARATION me
69end
70-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
71property ancestor
72property pGList
73property pCaseLists
74
75
76-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
77on ___________________STANDARD_EVENTS me
78end
79-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
80
81on new me
82  Script_Root_Object = member("Script_Root_Object")
83  if ilk(Script_Root_Object) = #member then
84    if Script_Root_Object.type = #script then
85      ancestor = new(script "Script_Root_Object")
86      mSetScriptName me, "commonMovieScript"
87    end if
88  end if
89  return me
90end
91
92-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
93
94on mFilterString me, string_Input, string_keyword
95  -----------------------------------
96  -- CREATED: 26.02.2010
97  -- ACTION: Filter to constrain the results
98  --                       use "%" or "^" as the first char if the filter shall be =>
99  --                                                     'word STARTS with <string_keyword>'
100  --                       use "$" as the last char if the filter shall be =>
101  --                                                     'word ENDS with <string_keyword>'
102  --                       (HINT: if searching for the exact phrase use ^keyword$ as filter)
103  --                       otherwise the string <string_keyword> may appear anywhere in the word =>
104  --                                                     'word CONTAINS <string_keyword>'
105  -- INPUT: <string_Input> ; string
106  --        <string_keyword> ; string
107  -- RETURNS: boolean (integer 1 or 0) ; true or false
108  -- EXAMPLE: put xscr().mFilterString("commonmoviescript", "%comm") -- STARTS
109  --          -- 1
110  --          put xscr().mFilterString("commonmoviescript", "ript$")
111  --          -- 1
112  --          put xscr().mFilterString("commonmoviescript", "%commonmoviescript$")
113  --          -- 1
114  --          put xscr().mFilterString("commonmoviescript", "movie")
115  --          -- 1
116  -----------------------------------
117 
118  string_Input = string(string_Input)
119  if length(string_Input) < 1 then return 0
120 
121  string_keyword = string(string_keyword)
122  if length(string_keyword) < 1 then return 1
123 
124  if string_keyword starts "^" then
125    delete char 1 of string_keyword
126    offs = offset(string_keyword, string_Input)
127    return (offs = 1)
128  else if string_keyword starts "%" then
129    delete char 1 of string_keyword
130    offs = offset(string_keyword, string_Input)
131    return (offs = 1)
132  else if the last char of string_keyword = "$" then
133    delete the last char of string_keyword
134    offs = offset(string_keyword, string_Input)
135    return (offs = (length(string_Input) - length(string_keyword) + 1))
136  else
137    offs = offset(string_keyword, string_Input)
138    return (offs > 0)
139  end if
140 
141end
142
143-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
144
145on mGetGlobalList me
146  -----------------------------------
147  --         ACTION: We keep a list of "faked global variables"
148  --                 Using real global variables has the drawback,
149  --                 that they may clash with the host movies globals
150  --                 and even worse: all movie instances running in the same player
151  --                 instance -> MIAWs share only one global space
152  --                 Since these scripts are also used in my authoring tools
153  --                 they can behave nicely, if running as miaws in any environment
154  --         INPUT: -
155  --         RETURNS: property list with global variables
156  --         NOTES: If possible only use the set and get handlers (mSetGlobalValue, mGetGlobalValue)
157  -----------------------------------
158 
159  if voidP(pGList) then
160    pGList = [:]
161    scr = mGetXScript(#regisx)
162    if not listP(scr) then
163      if mCheckForXtra(me, "BudAPI") = 1 then call(#regisb, scr)
164      if mCheckForXtra(me, "vList") = 1 then call(#regisv, scr)
165    end if
166  end if
167  return pGList
168end
169
170-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
171
172on mMyClearGlobals me
173  -----------------------------------
174  --         CREATED: 11.02.2008
175  --         ACTION: Clear the global list at runtime (at authortime a "Recompile all scripts" does the same)
176  --                 See description for "Faked globals" at handler [#mGetGlobalList_commonMovieScript mGetGlobalList]
177  --         INPUT: -
178  --         RETURNS: -
179  -----------------------------------
180 
181  pGList = [:]
182  return pGList
183end
184
185
186-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
187
188on mSetGlobalValue me, propName, newValue
189  -----------------------------------
190  --         ACTION: Set the value for a "global" variable
191  --                 If the "global" with the name #propname doesn't exits it gets created
192 
193  --                 Interface to the "private globals" stored in this uninstatiated script as property
194  --                 See description for "Faked globals" at handler [#mGetGlobalList_commonMovieScript mGetGlobalList]
195 
196  --         INPUT: propName: symbol; name of global value
197  --                newValue: any value
198  --         RETURNS: -
199  -----------------------------------
200 
201  g = mGetGlobalList(me)
202  g.setaprop(propName, newValue)
203end
204
205
206-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
207
208on mGetGlobalValue me, propName
209  -----------------------------------
210  --         ACTION: Get the value for a "global" variable
211  --                 If the "global" with the name #propname doesn't exits it returns void
212 
213  --                 Interface to the "private globals" stored in this uninstatiated script as property
214  --                 See description for "Faked globals" at handler [#mGetGlobalList_commonMovieScript mGetGlobalList]
215 
216  --         INPUT: propName: symbol; name of global value
217  --         RETURNS: -
218  -----------------------------------
219 
220  g = mGetGlobalList(me)
221  return g.getaprop(propName)
222end
223
224-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
225
226on mCallDestroy me
227  -----------------------------------
228  --         CREATED: 12.02.2008
229  --         ACTION: Call to clean everything up on stopmovie
230  --         INPUT: -
231  --         RETURNS: -
232  -----------------------------------
233 
234  delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList)
235  if ilk(delayedCallBackList) = #proplist then
236    jobs = delayedCallBackList[#jobs]
237    repeat with n = count(jobs) down to 1
238      toName = jobs.getPropAt(n)
239      dto = timeout(toName)
240      if ilk(dto) = #timeout then dto.forget()
241    end repeat
242    delayedCallBackList[#jobs] = [:]
243  end if
244 
245  sendAllSprites(#mStopMovieWasCalled)
246 
247  theGlobs = mGetGlobalList(me)
248  gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances)
249 
250  if listP(gParentScriptInstances) then call(#mDestroy, gParentScriptInstances)
251 
252 
253  --------------- some instances in the actorlist delete other instances from the actorlist
254  --------------- therefore, we can't simply repeat through all, we need a duplicate
255  --------------- the same is true for the timeoutlist
256 
257  lists = [the actorList, the timeoutlist]
258  repeat with theList in lists
259    dupL = []
260    repeat with obj in theList
261      add dupL, obj
262    end repeat
263    cnt = count(dupL)
264    repeat with n = cnt down to 1
265      call(#mDestroy, [dupL[n]])
266    end repeat
267  end repeat
268 
269 
270 
271  f = member("debuginfotextmember")
272  if mGetMemType(me, f) = #field then f.text = ""
273 
274  theGlobs[#gParentScriptInstances] = [:]
275 
276  mEraseAllTempMembers me
277 
278  --  clearglobals
279end
280
281-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
282
283on mGetPlayBackModeValue me, symbol_Prop
284  if ilk(symbol_Prop) <> #symbol then symbol_Prop = #playBackMode
285  playBackModeValueList = mGetGlobalValue(me, #playBackModeValueList)
286  if not(objectP(playBackModeValueList)) then playBackModeValueList = [:]
287  return playBackModeValueList[symbol_Prop]
288end
289
290-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
291
292on mSetPlayBackModeValue me, symbol_Prop, any_value
293  if ilk(symbol_Prop) <> #symbol then exit
294  playBackModeValueList = mGetGlobalValue(me, #playBackModeValueList)
295  if not(objectP(playBackModeValueList)) then
296    playBackModeValueList = [:]
297    mSetGlobalValue(me, #playBackModeValueList, playBackModeValueList)
298  end if
299  playBackModeValueList[symbol_Prop] = any_value
300end
301
302-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
303on ____WOODY_CHANGES
304end
305-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
306
307
308-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
309-- xxxxxxxxxxxxxxxxxx color( -> rgb(
310--
311
312on Authoring_ExchangeScriptListColorsToRGBs me
313  -----------------------------------
314  --         CREATED: 12.02.2008
315  --         ACTION: fix the score data which has #color instead of #rgb when authored with D10
316  --                 which fails with the older player (AUTHORING ONLY!)
317  --         INPUT: -
318  --         RETURNS: -
319  -----------------------------------
320 
321  theLastFrame = the lastFrame
322  theLastChannel = the lastChannel
323 
324  repeat with theFrame = 1 to theLastFrame
325    go to theFrame
326   
327    repeat with theSprite = 1 to theLastChannel
328      tScriptList = sprite(theSprite).scriptList
329      if listP(tScriptList) then
330        cnt = count(tScriptList)
331        doChange = 0
332       
333        repeat with behNr = 1 to cnt
334          thisBeh = tScriptList[behNr]
335          if stringP(thisBeh[2]) then
336            tString = thisBeh[2]
337            offs = offset("color(", tString)
338            repeat while offs > 0 
339              doChange = 1
340              put "rgb(" into char offs to (offs+5) of tString
341              offs = offset("color(", tString)
342            end repeat
343            thisBeh[2] = tString
344          end if
345        end repeat
346       
347        if doChange then
348          sprite(theSprite).setScriptList(tScriptList)
349        end if
350      end if
351    end repeat
352   
353  end repeat
354end
355
356-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
357
358on mCheckWoody me
359  glob = mGetGlobalList(me)
360  woody = glob.getaprop(#gWoody)
361  if voidP(woody) then
362    prodVers = the productVersion
363    offs = offset(".", prodVers)
364    if offs > 0 then prodVers = char 1 to offs-1 of prodVers
365    prodVers = integer(prodVers)
366    if prodVers >= 10 then woody = 1
367    else woody = 0
368    glob[#gWoody] = woody
369  end if
370  return woody
371end
372
373
374-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
375
376on mGetVersionNumber me
377  -----------------------------------
378  --         CREATED: 12.02.2008
379  --         ACTION: Get player veersion number as float, so that proper maths can be made
380  --         INPUT: -
381  --         RETURNS: float => director player version number
382  -----------------------------------
383 
384  glob = mGetGlobalList(me)
385  vNum = glob.getaprop(#gVersionNumber)
386  if voidP(vNum) then
387    prodVers = the productVersion
388    vNum = mGetFloatVersionNumber(me, prodVers)
389    glob[#gVersionNumber] = vNum
390  end if
391 
392  return vNum
393end
394
395-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
396
397on mGetFloatVersionNumber me, prodVers
398  offs = offset(".", prodVers)
399  if offs > 0 then
400    intVers = char 1 to offs of prodVers
401    delete char 1 to offs of prodVers
402  else
403    intVers = ""
404  end if
405  cnt = length(prodVers)
406  repeat with n = 1 to cnt
407    c = prodVers.char[n]
408    if integerP(integer(c)) then
409      put c after intVers
410    else if c <> "." then
411      exit repeat
412    end if
413  end repeat
414 
415  return value(intVers)
416end
417
418
419-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
420
421on mIsAtLeastVersionOf me, proplist_or_number_productVersionInfo
422  -----------------------------------
423  --         CREATED: 08.02.2011
424  --         ACTION: Check whether player version number and productbuildversion
425  --                 meet at least a certain value
426  --         INPUT: <proplist_or_number_productVersionInfo> ; proplist or number ; if number: =>
427  --                                                             at least version xy
428  --                             if proplist then at least version productVersionInfo[#versionNumber] => #number
429  --                                  AND (if defined) productVersionInfo[#buildnumber] => number
430  --         RETURNS: boolean (integer) => true if current version is at least the specified version or higher
431  -----------------------------------
432 
433  if ilk(proplist_or_number_productVersionInfo) = #proplist then
434    versionNumber = proplist_or_number_productVersionInfo[#versionNumber]
435    buildnumber = proplist_or_number_productVersionInfo[#buildnumber]
436  else
437    versionNumber = proplist_or_number_productVersionInfo
438    buildnumber = 0
439  end if
440 
441  if ilk(versionNumber, #number) <> 1 then versionNumber = 0 -- in dubio pro reo
442  if ilk(buildnumber, #number) <> 1 then buildnumber = 0 -- in dubio pro reo
443 
444  currVersion = mGetVersionNumber(me)
445 
446  if currVersion > versionNumber then return true
447  if currVersion < versionNumber then return false
448 
449  env = mGetEnvironment(me)
450  currentBuildNumber = integer(env[#productBuildVersion])
451  if buildnumber > currentBuildNumber then return false
452  return true
453end
454
455-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
456
457on mGetEnvironment me
458  -----------------------------------
459  --         CREATED: 18.05.2009
460  --         ACTION: Getting the environment properts list is very slow,
461  --                 therefore we make sure to get it only once and store the rsult
462  --         INPUT: -
463  --         RETURNS: property list => the environment
464  -----------------------------------
465 
466  env = mGetGlobalValue(me, #theEnvironment)
467  if not(objectP(env)) then
468   
469    if the runmode contains "aut" then
470      -- there is a really lame bug in the mac version
471      -- where querying the environment takes ages!
472      -- now it is only the first call, therefore we save the result
473      -- and in authoring we even save it in a global, so that we
474      -- do not have to wait on each moviestart!
475      global gLameAuthoringHack_forSlowEnvironment_onMac
476      if not(objectP(gLameAuthoringHack_forSlowEnvironment_onMac)) then
477        gLameAuthoringHack_forSlowEnvironment_onMac = the environment
478      end if
479      env = gLameAuthoringHack_forSlowEnvironment_onMac
480    else
481      env = the environment
482    end if
483   
484    mSetGlobalValue(me, #theEnvironment, env)
485  end if
486  return env
487end
488
489-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
490
491on mGetPlatform me
492  -----------------------------------
493  --         CREATED: 12.02.2008
494  --         ACTION: Get the platform as symbol
495  --                 the advantage is that the result is cached in the global list
496  --                 and the distinction between OS9 and OSX is made
497  --         INPUT: -
498  --         RETURNS: symbol => platform identifier; range: #os9, #osx, #win
499  -----------------------------------
500 
501  glob = mGetGlobalList(me)
502  gPlatform = glob.getaprop(#gPlatform)
503 
504  if voidP(gPlatform) then
505   
506    isMac = the platform contains "Macintosh"
507    if isMac then
508     
509      onX = value(char 1 of (the last word of (mGetEnvironment(me)).osversion)) <= 5
510      if onX then gPlatform = #osx
511      else gPlatform = #os9
512    else
513      gPlatform = #win
514    end if
515   
516    glob.setaprop(#gPlatform, gPlatform)
517  end if
518 
519  return gPlatform
520end
521
522-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
523
524on mCheckMemberType me, memref, aType
525  -----------------------------------
526  --         CREATED: 12.02.2008
527  --         ACTION: Check if the member reference <memref> is of type <aType>
528  --                 This handler works in D<10 and D>=10
529  --         INPUT: member reference
530  --                symbol
531  --         RETURNS: boolean (integer)
532  -----------------------------------
533 
534  if voidP(memref) then return 0
535  return (memref.type = aType)
536end
537
538-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
539
540on mGetMemType me, memref
541  -----------------------------------
542  --         CREATED: 12.02.2008
543  --         ACTION: Return the type of member <memref>
544  --                 This handler works in D<10 and D>=10
545  --                 If memref is not a valid member this handler returns #empty, like D<10 used to
546  --         INPUT: member reference
547  --         RETURNS: symbol => member type; range: every member type and #empty
548  -----------------------------------
549  if ilk(memref) <> #member then return #empty
550  return memref.type
551end
552
553-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
554
555on mCreateTimeout me, theName, theDuration, theHandler, theTarget
556  -----------------------------------
557  --         CREATED: 12.02.2008
558  --         ACTION: Create/Get timeout object
559  --                 This handler works the same with the old player <10 and the new player >=10
560  --         INPUT: || theName     || string  || name for new timeout object||
561  --                || theDuration || integer || timeout perios in milliseconds||
562  --                || theHandler  || symbol  || handler to be called on each timepout event||
563  --                || theTarget   || object  || object to be sent the timeout event <theHandler>||
564  --         RETURNS: timeout object
565  -----------------------------------
566 
567  dto = timeout(theName)
568 
569  if ilk(dto) = #timeout then return dto.new(theDuration, theHandler, theTarget)
570 
571  return timeout().new(theName, theDuration, theHandler, theTarget)
572 
573 
574  if mCheckWoody(me) = 1 then
575    return timeout().new(theName, theDuration, theHandler, theTarget)
576  else
577    return timeout(theName).new(theDuration, theHandler, theTarget)
578  end if
579end
580
581-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
582on ____HANDLE_KEY_EVENTS
583end
584-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
585
586-- this handler is supposed to get keyevents first to decide, if there are high level things to do
587
588-- for example to quit the movie
589-- some of my scripts use the keydownscript to get keyevents
590-- and they call this handler first to give some keyevents precedence
591
592on mHandleKeyEvent me, tk, kc
593 
594  theGlobs = mGetGlobalList(me)
595  if theGlobs.getaprop(#gCustomKeyHandling) = 1 then return mProcessKeyDownEvent(tk, kc)
596 
597  retval = 0
598 
599  if (the exitlock = 1) then
600    if the commanddown then
601      case kc of
602        12, 47:
603          retval = 1
604          dto = mCreateTimeout(me, "quitTimeOut", 100, #mDoQuit, me)
605        otherwise
606          if ((tk = "q") or (tk = ".")) then
607            retval = 1
608            dto = mCreateTimeout(me, "quitTimeOut", 100, #mDoQuit, me)
609          end if
610      end case
611    end if
612   
613  end if
614 
615 
616  return retval
617end
618
619-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
620
621on mSuspendAllKeyEvents me, flag
622  sendAllSprites(#mSuspendKeyEvents, flag)
623end
624
625-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
626
627on mSuspendAllMouseEvents me, flag
628 
629end
630
631
632-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
633
634on mDoQuit me
635 
636  if (the markerlist).getaprop(marker(0)) <> "abspann" then
637    dto = mCreateTimeout(me, "quitTimeOut", 5000, #mQuitMovie, me)
638    go "abspann"
639  else
640    mQuitMovie me
641  end if
642 
643end
644
645-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
646
647on mQuitMovie me
648  if ilk(timeout("quitTimeOut")) = #timeout then timeout("quitTimeOut").forget()
649  mCallDestroy me
650  if not(the runmode contains "plug") then halt
651end
652
653-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
654on ____PROCESS_CALLBACK_EVENTS
655end
656-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
657
658on mDoCallBack me, callbackObject, p1, p2, p3
659  -----------------------------------
660  -- CREATED: 22.07.2009
661  -- ACTION: This is the standard way to send callback events to callbackObjects of the format:
662  --             [#handler:symbol, #target:object]
663  --             NOTE: If the #handler property is NOT a symbol, then it is considered a special case
664  --                   where the result will simply be "put" into the message window => suited for debugging
665  -- INPUT: <callbackObject> ; object (propertylist) ; required ; a callBack object of the format:
666  --             [#handler:symbol, #target:object], which can be any number of additional properties
667  --             since this object will be provided as parameter to the recipient
668  --             the recipient can access all these additional properties
669  --         <p1 - p3> ; arbitrary parameters ; just in case additional parameters are required,
670  --             which can not, for some reason, be stored in the object <callbackObject> itself
671  -- RETURNS: either a string or any value. In case of a parameter error
672  --             an errorstring is returned and the callback was NOT successfully called.
673  -- EXAMPLE: theResult = xscr().mDoCallBack(callBackObject)
674  -----------------------------------
675 
676  if not(objectP(callbackObject)) then return "Wrong paramater, callbackObject is not an object!"
677 
678  hnd = callbackObject[#handler]
679  if not(symbolP(hnd)) then
680    put "Script 'commonMovieScript': Handler 'mDoCallBack':"
681    put "---------------------------"
682    put "callbackObject:" && callbackObject
683    put "------"
684    put "p1:" && p1
685    put "------"
686    put "p2:" && p2
687    put "------"
688    put "p3:" && p3
689    put "---------------------------"
690    return "callbackObject[#handler] is not a symbol"
691  end if
692 
693  tgt = callbackObject[#target]
694  case ilk(tgt) of
695    #script, #instance:
696      retval = call(hnd, [tgt], callbackObject, p1, p2, p3)
697    #list, #proplist:
698      if count(tgt) = 0 then
699        put "Script 'commonMovieScript': Handler 'mDoCallBack':"
700        put "---------------------------"
701        put "callbackObject:" && callbackObject
702        put "------"
703        put "p1:" && p1
704        put "------"
705        put "p2:" && p2
706        put "------"
707        put "p3:" && p3
708        put "---------------------------"
709        retval = 1
710      else
711        retval = call(hnd, tgt, callbackObject, p1, p2, p3)
712      end if
713     
714    otherwise:
715      spr = mGetKanal(me, tgt)
716      if spr < 1 then return "callbackObject[#target] is neither an object nor a spritenumber/name:" && callbackObject[#target]
717      retval = sendSprite(spr, hnd, callbackObject, p1, p2, p3)
718  end case
719 
720  -- due to a stupid bug in 11.5.9.629 we can get <NULL> as a result of call() and on windows/shockwave it compares to 1 as true
721  -- voidP(<NULL>) = false, but ilk(<NULL>) = #void therefore we force void here
722  -- unfortunately there is another bug in director, which will throw a script error, if we use ilk() on deeted 3-D models
723  -- therefore we have to check voidP() BEFORE ilk()! oh well...
724  if voidP(retval) then retval = void
725  if ilk(retval) = #void then retval = void
726 
727  return retval
728end
729
730-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
731
732on mDoDelayedCallback me, proplist_callbackObject, integer_DelayTime, any_param1, any_param2, any_param3
733  -----------------------------------
734  -- CREATED: 04.02.2010
735  -- ACTION: Break the event chain by deleying a call by at least one milliseconds
736  -- INPUT:  <callbackObject> ; object (propertylist) ; required ; a callBack object of the format:
737  --             [#handler:symbol, #target:object], which can be any number of additional properties
738  --             since this object will be provided as parameter to the recipient
739  --             the recipient can access all these additional properties
740  --         <integer_DelayTime> ; integer ; timeoutlength in milliseconds, optional, default = 1
741  --         <any_param1 - any_param3> ; arbitrary parameters ; just in case additional parameters are required,
742  --             which can not, for some reason, be stored in the object <callbackObject> itself
743  -- RETURNS: true for success
744  -- EXAMPLE: cb = [#target:me, #handler:#foo]
745  --          xscr().mDoDelayedCallback(cb, 1, "abc", 3, [])
746  -----------------------------------
747 
748  delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList)
749  if ilk(delayedCallBackList) <> #proplist then
750    delayedCallBackList = [:]
751    delayedCallBackList[#lastIndex] = 0
752    delayedCallBackList[#jobs] = [:]
753    mSetGlobalValue(me, #delayedCallBackList, delayedCallBackList)
754  end if
755 
756  if ilk(integer_DelayTime) <> #integer then integer_DelayTime = 1
757  integer_DelayTime = max(1, integer_DelayTime)
758 
759  delayedCallBackList[#lastIndex] = delayedCallBackList[#lastIndex] + 1
760  if delayedCallBackList[#lastIndex] = the maxinteger then delayedCallBackList[#lastIndex] = 1
761 
762  toName = "delayedCallbackTimeout" & mGetMemoryAddress(me, me) & delayedCallBackList[#lastIndex]
763 
764  delayedCallBackList[#jobs][toName] = [#cobj: proplist_callbackObject, #params:[any_param1, any_param2, any_param3]]
765 
766  dto = mCreateTimeOut(me, toName, integer_DelayTime, #delayedCallCallback, me)
767 
768  return 1
769end
770
771-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
772-- cal the callback after the delay timeout
773
774on delayedCallCallback me, dto
775  if ilk(dto) <> #timeout then exit
776  toName = dto.name
777  dto.forget()
778  delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList)
779  if ilk(delayedCallBackList) <> #proplist then exit
780  thisJob = delayedCallBackList[#jobs][toName]
781  if voidP(thisJob) then exit
782  delayedCallBackList[#jobs].deleteProp(toName)
783  mDoCallBack me, thisJob[#cobj], thisJob[#params][1], thisJob[#params][2], thisJob[#params][3]
784end
785
786-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
787on ____MOVIE_IDENTIFIER_HANDLERS
788end
789-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
790
791
792on mSetThisMovieName me, aName
793  glob = mGetGlobalList(me)
794  glob.setaprop(#movieIdentifier, aName)
795end
796
797-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
798
799on mGetThisMovieName me
800  glob = mGetGlobalList(me)
801  str = string(glob.getaprop(#movieIdentifier))
802  if length(str) > 0 then return str
803  str = mSplitPath(me, the moviename).basename
804  mSetThisMovieName me, str
805  return str
806end
807
808
809
810-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
811on ____SPRITE_NAMING_HANDLERS
812end
813-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
814
815-- these are handlers for my own sprite naming routines with the names of the named sprites currently in the score
816-- with director >= 10 you can name the sprites as a built into director function, which is in most circumstances more convenient
817-- but with this approach you can
818-- a.) change the sprite names at runtime (to temporarely enable/disable sendSprite calls)
819-- b.) have multiple different names for one sprite
820
821on mGetKanal me, einname
822  theGlobs = mGetGlobalList(me)
823  if not listP(theGlobs.getaprop(#gSpriteNamenliste)) then theGlobs[#gSpriteNamenliste] = [:]
824  kanalnummer = getaprop((theGlobs.gSpriteNamenliste), einname)
825 
826  if voidP(kanalnummer) then
827   
828    if ilk(einname) = #integer then -- integer passed ? check if the sprite is empty
829      if sprite(einname).member.type = #empty then kanalnummer = -1
830      else kanalnummer = einname
831     
832    else -- otherwise (string ?), if this is MX 2004, we check for regular sprite names:
833     
834      if mCheckWoody(me) = 1 then
835        sprnam = string(einname)
836        if length(sprnam) > 0 then -- unfortunately sprite("") yields a result in D10
837          spr = sprite(sprnam)
838          if voidP(spr) then
839            kanalnummer = -1
840          else
841            kanalnummer = spr.spritenum
842            if ((kanalnummer = 1) and (the scriptexecutionstyle = 9)) then
843              if sprite(1).name = "" then kanalnummer = -1
844            end if
845          end if
846        else
847          kanalnummer = -1
848        end if
849      else
850        kanalnummer = -1
851      end if
852    end if
853  end if
854 
855  return kanalnummer
856end
857
858-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
859
860on mMeldeKanalname me, einname, einkanal
861  theGlobs = mGetGlobalList(me)
862  if not listP(theGlobs.getaprop(#gSpriteNamenliste)) then theGlobs[#gSpriteNamenliste] = [:]
863  (theGlobs.gSpriteNamenliste)[einname] = einkanal
864end
865
866-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
867
868on mMeldeAbKanalname me, einname, einkanal
869  theGlobs = mGetGlobalList(me)
870  if not listP(theGlobs.getaprop(#gSpriteNamenliste)) then theGlobs[#gSpriteNamenliste] = [:]
871  derwert = getaprop((theGlobs.gSpriteNamenliste), einname)
872  if derwert = einkanal then deleteProp (theGlobs.gSpriteNamenliste), einname
873end
874
875
876
877-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
878on ____DEBUG_FUNCTIONS
879end
880-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
881
882-- my own 'put' function, which can be enabled and disabled (to avoid clutter in the message window)
883-- which can 'put' image objects (create new #bitmap members)
884-- logs the put results in a field, which can be used to put at runtime
885-- and send the put results in an email back to the movie author to trouble shoot projectors
886
887on mEnablePut me, val
888 
889  glob = mGetGlobalList(me)
890 
891  if voidP(val) then val = not(glob.getaprop(#gDebugDisabled))
892  else val = not(val)
893 
894  glob[#gDebugDisabled] = val
895end
896
897-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
898
899on mPut me, str, overwrite, dername
900 
901  global gDebug
902  if not voidP(gDebug) then
903    if gDebug = 0 then exit
904  end if
905 
906  if (mGetGlobalList(me)).getaprop(#gDebugDisabled) then exit
907 
908  debugFlags = xscr().mGetGlobalValue(#gDebugFlags)
909  if not(listP(debugFlags)) then debugFlags = []
910 
911  if debugFlags.getPos(4) then -- critical messages!
912    sendSprite(xscr().mGetKanal(#keynaviStatus), #mSetText, str)
913  end if
914 
915  if ilk(overwrite) = #integer then
916    doit = (debugFlags.getPos(overwrite) > 0)
917  else
918    doit = 1
919  end if
920 
921  if doit then mLogDebugInfo me, str
922 
923  if ilk(str) = #image then
924    mDebugImage me, str, overwrite, dername
925  else
926    if the runmode contains "aut" then
927      if overwrite = 64 then
928        put str
929      else
930        if debugFlags.getPos(1) then
931          put str
932        end if
933      end if
934    end if
935  end if
936 
937end
938
939-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
940
941on mDebugImage me, img, overwrite, dername
942 
943  if not(the runmode contains "aut") then exit
944 
945  if voidP(dername) then dername = "DebugImg"
946 
947  if overwrite = 1 then
948    neuer = member(dername)
949    if mGetMemType(me, neuer) <> #bitmap then overwrite = 0
950  end if
951 
952  if not(overwrite) then
953    neuer = new(#bitmap)
954    neuer.name = dername
955  end if
956 
957  neuer.image = img
958end
959
960-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
961
962on mLogDebugInfo me, str
963  f = member("debuginfotextmember")
964  if mGetMemType(me, f) <> #field then
965    f = new(#field)
966    f.name = "debuginfotextmember"
967  end if
968 
969  if mGetVersionNumber(me) > 11 then
970    oldscrolltop = f.scrolltop
971    if oldscrolltop > f.height - f.pageheight - f.lineheight then
972      oldscrolltop = #unten
973    end if
974  end if
975 
976  altertext = f.text
977  if the number of lines of altertext > 500 then put line 300 to 500 of altertext into field "debuginfotextmember"
978  put "------------------------"&RETURN&RETURN & str & return after field "debuginfotextmember"
979 
980  if not voidP(oldscrolltop) then
981    if oldscrolltop = #unten then
982      f.scrolltop = f.height - f.pageheight + f.lineheight
983    else
984      f.scrolltop = oldscrolltop
985    end if
986  end if
987end
988
989
990-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
991
992on mWatch me, theIdentifier, theValue
993 
994  t = member("temp_watcher_field")
995  if ilk(t) <> #member then
996    t = new(#field)
997    t.name = "temp_watcher_field"
998  end if
999 
1000  if mGetMemType(me, t) <> #field then
1001    put "Hey !! temp_watcher_field is NOT a #field"
1002    exit -- something must ne very wrong
1003  end if
1004 
1005  offs = offset(RETURN & theIdentifier & ": ", t.text)
1006  if offs > 0 then
1007    l = the number of lines of char 1 to offs of field t
1008    put theIdentifier & ": " & theValue into line l of field t
1009  else
1010    put RETURN & theIdentifier & ": " & theValue after field t
1011  end if
1012 
1013end
1014
1015-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1016on ____MEMBER_UTILITIES
1017end
1018-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1019
1020-- Referencing members by name is slow
1021-- this searches through a given castlib starting at a given slotnumber
1022-- this is also useful, to avoid conflicts with duplicate names
1023
1024-- this handler is here for compatibility with my older scripts
1025
1026-- prueft die existenz eines members nach namen von der stelle <num> bis zum ende der castlib <cl>
1027-- musste ich machen als ich festgestellt habe, dass director dafuer 4x solange braucht, weil er alle casts durchsucht
1028
1029on mSuchMemFwd me, num, cl, dername
1030  anz = the number of members of castlib cl
1031  repeat with n = num to anz
1032    mem = member(n, cl)
1033    if mem.name = dername then return mem
1034  end repeat
1035  return 0
1036end
1037
1038
1039-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1040-- xxxxxxxxxxxxxxxxxx Creation of New Members - ROUTINEN
1041-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1042
1043-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1044
1045on mGetNewMember me, aType
1046 
1047  if voidP(aType) then aType = #bitmap
1048 
1049  if ilk(aType) <> #symbol then aType = symbol(aType)
1050 
1051  tempMembers = mGetTempMemberList(me, aType)
1052  if count(tempMembers) < 1 then
1053    neuer = new(aType)
1054  else
1055    neuer = tempMembers[1]
1056    tempMembers.deleteAt(1)
1057  end if
1058 
1059  --  ((mGetGlobalList(me)).gDeleteListe).add(neuer)
1060 
1061  return neuer
1062end
1063
1064-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1065
1066on mEraseMember me, aMember
1067  if ilk(aMember) <> #member then exit
1068  aType = aMember.type
1069 
1070  glob = mGetGlobalList(me)
1071  gTempMemberList = glob.getaprop(#gTempMemberList)
1072  if gTempMemberList = #moviestopped then
1073    -- stopmoviehandler already was called (this is perhaps a stack inited by endsprite)
1074    -- so we just delete the thing and leave, no risk of running into the bug we want to prevent
1075    aMember.erase()
1076    exit
1077  end if
1078 
1079  tempMembers = mGetTempMemberList(me, aType)
1080  if tempMembers.getPos(aMember) < 1 then tempMembers.add(aMember)
1081 
1082end
1083
1084-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1085
1086on mGetTempMemberList me, aType
1087 
1088  glob = mGetGlobalList(me)
1089 
1090  gTempMemberList = glob.getaprop(#gTempMemberList)
1091  if ilk(gTempMemberList) <> #proplist then
1092    gTempMemberList = [:]
1093    glob.setaprop(#gTempMemberList, gTempMemberList)
1094  end if
1095 
1096  thisType = gTempMemberList.getaprop(aType)
1097  if ilk(thisType) <> #list then
1098    thisType = []
1099    gTempMemberList.setaprop(aType, thisType)
1100  end if
1101 
1102  return thisType
1103 
1104end
1105
1106-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1107
1108on mEraseAllTempMembers me
1109  glob = mGetGlobalList(me)
1110 
1111  gTempMemberList = glob.getaprop(#gTempMemberList)
1112  if ilk(gTempMemberList) = #proplist then
1113    anz = count(gTempMemberList)
1114    repeat with n = anz down to 1
1115      li = gTempMemberList[n]
1116      gTempMemberList.deleteAt(n)
1117      liCnt = count(li)
1118      repeat with m = liCnt down to 1
1119        mem = li[m]
1120        li.deleteAt(m)
1121        if ilk(mem) = #member then mem.erase()
1122      end repeat
1123    end repeat
1124  end if
1125  glob.setaprop(#gTempMemberList, #moviestopped)
1126end
1127
1128-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1129on ____TEXT_UTILITIES
1130end
1131-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1132-- common textmember and font handlers
1133
1134
1135-- xxxxxxxxxxxxxxxxxx get a list of all installed fonts
1136-- and save it as global for further use, since it is slow to get the complete list
1137
1138on InitFonts me
1139  -- comment here to use a *real* global:
1140 
1141  if not the runmode contains "aut" then return ["Arial"] -- just to be safe
1142  -- this handler should not be called anymore in runtime
1143  -- as mGetAFont() doesn't call it anymore
1144  -- the lame reason is:
1145  -- the new D11 player fucked up the unsupported function FontList()
1146  -- :-( SHAME!
1147 
1148  -- faked global:
1149  globs = mGetGlobalList(me)
1150  gFontList = globs.getaprop(#gFontList)
1151 
1152  -- -- real global:
1153  --  global gFontlist
1154 
1155 
1156  if voidP(gFontList) then
1157    m = new(#font)
1158   
1159    -- alex am Freitag, 4. Juni 2004
1160    if not objectP(m) then
1161      gFontList = ["Arial"]
1162    else
1163      gFontList = m.FontList()
1164      m.erase()
1165    end if
1166    --/ alex am Freitag, 4. Juni 2004
1167   
1168    gFontList.sort()
1169   
1170    if not gFontList[1].length then gFontList.deleteAt(1)
1171   
1172    -- comment here to use a *real* global:
1173    -- faked global:
1174    theGlobs = mGetGlobalList(me)
1175    theGlobs[#gFontList] = gFontList
1176   
1177    -- -- real global: <nothing>
1178   
1179  end if
1180  return gFontList
1181end
1182
1183-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1184
1185
1186-- xxxxxxxxxxxxxxxxxx there's a bug in textmembers, which are larger than 16383 lines
1187-- Thank you James Newton for the following bugfix !
1188
1189on GetScrollRatio me, aMember -------------------------------------------
1190  -- INPUT: <aMember> is a text member (or any other kind of member)
1191  -- OUTPUT: an integer power of 2 representing the factor by which
1192  --         a member of that height is scrolled
1193  --------------------------------------------------------------------
1194 
1195  tRatio = 1
1196 
1197  if mGetMemType(me, aMember) = #text then
1198    -- Text members with more than 16383 lines of text scroll in
1199    -- steps of a power of two and the scrollTop value indicates
1200    -- the number of steps (not the number of pixels) from the top
1201    tHeight = aMember.height / 16384
1202   
1203    repeat while tHeight
1204      tHeight = tHeight / 2
1205      tRatio = tRatio * 2
1206    end repeat
1207   
1208  end if
1209 
1210  return tRatio
1211end
1212
1213-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1214
1215-- xxxxxxxxxxxxxxxxxx get a temporary textmember named "tempDruckText"
1216-- creates a new textmember if member("tempTextMem") is not found in the current movie
1217
1218on mGetATextMem me, theFont, theFontsize, aliasFlag
1219 
1220  temptext = member("tempTextMem")
1221 
1222  if mGetMemType(me, temptext) <> #text then
1223    temptext = new(#text)
1224    temptext.name = "tempTextMem"
1225    temptext.text = " "
1226   
1227    temptext.leftindent = 0
1228    temptext.rightindent = 0
1229    temptext.firstindent = 0
1230    temptext.topspacing = 0
1231    temptext.bottomspacing = 0
1232    temptext.charspacing = 0
1233    temptext.alignment = #left
1234  end if
1235 
1236  if (temptext.font <> theFont) then temptext.font = theFont
1237  if (temptext.fontsize <> theFontsize) then temptext.fontsize = theFontsize
1238 
1239  -- polen problem:
1240  thePrefs = (mGetGlobalList(me)).getaprop(#gPrefs)
1241  if ilk(thePrefs) = #proplist then
1242    textAA = thePrefs.getaprop(#textAA)
1243    if not voidP(textAA) then
1244      if textAA = 0 then aliasFlag = 0
1245    end if
1246  end if
1247  --/ polen problem
1248 
1249  if aliasFlag then
1250    if not(temptext.antialias) then temptext.antialias = 1
1251    if (temptext.antialiasThreshold > theFontsize - 1) then temptext.antialiasThreshold = theFontsize - 1
1252   
1253    if not(temptext.kerning) then temptext.kerning = 1
1254    if (temptext.kerningThreshold > theFontsize - 1) then temptext.kerningThreshold = theFontsize - 1
1255   
1256  else
1257    if (temptext.antialias) then temptext.antialias = 0
1258    if (temptext.kerning) then temptext.kerning = 0
1259  end if
1260 
1261  return temptext
1262end
1263
1264-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1265
1266-- xxxxxxxxxxxxxxxxxx gets a font by name and returns the name if successful
1267-- if not successful checks for "Arial"
1268-- if that fails also, takes the first installed font of the list of installed fonts
1269on mGetAFont me, theFont
1270 
1271  return theFont -- :-( the unsupported fontlist() method of font members now can crash the browser - tolle wurst!
1272 
1273 
1274  fontliste = InitFonts(me)
1275  if not (fontliste).getPos(theFont) then
1276   
1277    -- alex am Freitag, 4. Juni 2004
1278    if count(fontliste) = 1 then return theFont
1279    -- special case: font asset xtra is missing, so initFonts() returned ["Arial"] and we can't check the font
1280    -- and instead simply use it at the 'own risk' of the caller
1281    -- it will replaced by the default font from director if missing
1282    --/ alex am Freitag, 4. Juni 2004
1283   
1284    schriftname = ""
1285    repeat with schrift in fontliste
1286      if schrift contains "Arial" then
1287        schriftname = schrift
1288        exit repeat
1289      end if
1290    end repeat
1291    if schriftname = "" then theFont = fontliste[1] -- if Arial doesn't exist take the first font in the fontlist
1292    else theFont = schriftname
1293  end if
1294 
1295  if mGetMemType(me, member("sprachnemenufield")) = #field then
1296    spr = call(#mGetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage)
1297    if ilk(spr) = #integer then
1298      spr = spr + 1
1299      dertext = member("sprachnemenufield").text
1300     
1301      -- !!! russisch hardcode !!
1302      if spr = 14 then spr = 3
1303     
1304      if dertext.line.count >= spr then
1305       
1306        case dertext.line[spr] of
1307           
1308          "Russian":
1309           
1310            if the platform contains "mac" then
1311              if (fontliste).getPos("Lucida Grande CY *") then
1312                return "Lucida Grande CY *"
1313              end if
1314            else
1315              if (fontliste).getPos("Futura Cyr Bk *") then
1316                return "Futura Cyr Bk *"
1317              end if
1318             
1319            end if
1320           
1321           
1322          "Czech", "Polish":
1323            if the platform contains "mac" then
1324              if (fontliste).getPos("Geneva CE *") then
1325                return "Geneva CE *"
1326              end if
1327            else
1328              if (fontliste).getPos("Futura CE Bk *") then
1329                return "Futura CE Bk *"
1330              end if
1331            end if
1332           
1333        end case
1334      end if
1335    end if
1336  end if
1337 
1338  return theFont
1339end
1340
1341-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1342
1343on mGetLineHeight me, textOrField
1344 
1345  -- not a member:
1346  if ilk(textOrField) <> #member then return 0
1347 
1348  -- #field member:
1349  if textOrField.type = #field then return textOrField.lineheight
1350 
1351  -- #text member:
1352  if textOrField.type = #text then
1353   
1354    -- if there the linespace <> #automatic, we are done
1355    if textOrField.fixedLinespace > 0 then return textOrField.fixedLinespace
1356   
1357    -- if the textmember is empty, we fill a dummy char:
1358    if textOrField.char.count < 1 then
1359      textOrField.text = "J"
1360      firstlocV = textOrField.charPosToLoc(1)[2]
1361      textOrField.text = ""
1362      return firstlocV
1363    end if
1364   
1365    -- now we look at the charPos of the first chars of each line:
1366    firstlocV = textOrField.charPosToLoc(1)[2]
1367   
1368    secondLine = textOrField.locToCharPos(point(0, firstlocV + 1))
1369    if secondLine = 1 then return firstlocV
1370   
1371    secondLocV = textOrField.charPosToLoc(secondLine)[2]
1372   
1373    --    return secondLocV - firstlocV -- height of line 1 maybe header line...
1374   
1375    thirdLine = textOrField.locToCharPos(point(0, secondLocV + 1))
1376    if thirdLine = secondLine then return secondLocV - firstlocV
1377   
1378    thirdLocV = textOrField.charPosToLoc(thirdLine)[2]
1379   
1380    return thirdLocV - secondLocV
1381   
1382  end if
1383 
1384  return 0
1385end
1386
1387-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1388
1389-- build a list of lists of *wrapped* lines of the following format:
1390-- [[firstCharOfLine, lastCharOfLine, topOfLineInPixels, bottomOfLineInPixels], ...]
1391-- so the count of the returned list is the real number of lines after wordwrapping
1392
1393-- beware, that this handler is slow, especially for fields
1394-- don't use it with very huge text or fieldmembers
1395
1396on mGetLinesOfWrappedText me, textOrField
1397  retlist = []
1398 
1399  --  ms = the milliseconds
1400 
1401  -- not a textmember:
1402  theType = mGetMemType(me, textOrField)
1403  case theType of
1404    #text:
1405     
1406      if textOrField.char.count < 1 then return retlist
1407     
1408      lc = textOrField.char.count
1409      firstline = 1
1410      oben = 0
1411     
1412      firstlocV = textOrField.charPosToLoc(firstline)[2]
1413     
1414      secondLine = textOrField.locToCharPos(point(0, firstlocV + 1))
1415     
1416      repeat while firstline <> secondLine
1417        retlist.add([firstline, secondLine - 1, oben, firstlocV])
1418        oben = firstlocV + 1
1419        firstline = secondLine
1420        firstlocV = textOrField.charPosToLoc(firstline)[2]
1421        if firstlocV < 1 then exit repeat
1422        secondLine = textOrField.locToCharPos(point(0, firstlocV + 1))
1423      end repeat
1424     
1425      retlist.add([firstline, lc, oben, firstlocV])
1426     
1427    #field:
1428     
1429      if textOrField.char.count < 1 then return retlist
1430     
1431      lc = textOrField.char.count
1432      firstline = 1
1433      oben = 0
1434      unten = textOrField.charPosToLoc(lc)[2]
1435     
1436      firstlocV = textOrField.charPosToLoc(firstline)[2]
1437     
1438      secondLine = textOrField.locToCharPos(point(0, firstlocV + 1))
1439     
1440      repeat while firstlocV < unten
1441        if firstline <> secondLine then
1442          retlist.add([firstline, secondLine - 1, oben, firstlocV])
1443          oben = firstlocV + 1
1444          firstline = secondLine
1445          firstlocV = textOrField.charPosToLoc(firstline)[2]
1446          if firstlocV < 1 then exit repeat
1447          secondLine = textOrField.locToCharPos(point(0, firstlocV + 1))
1448        else
1449          firstlocV = firstlocV + 1
1450          secondLine = textOrField.locToCharPos(point(0, firstlocV + 1))
1451        end if
1452      end repeat
1453     
1454      retlist.add([firstline, lc, oben, firstlocV])
1455     
1456  end case
1457 
1458  --  mPut the milliseconds - ms
1459 
1460  return retlist
1461 
1462end
1463
1464
1465-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1466
1467-- polnisches problem:
1468-- xxxxxxxxxxxxxxxxxx some fonts on easter european machines crash, when antialiasing = 1 :-(
1469
1470-- usually I store the result in the preferences, so that every user can force non-antialiasing of fonts, when there is a font problem
1471-- so on startmovie, when I read the prefs in I do something like:
1472--  if ilk(prefliste.getaprop(#textAA)) <> #integer then prefliste[#textAA] = mCheckForTextAA()
1473
1474on mCheckForTextAA me
1475  retval = 1
1476  temptext = mGetATextMem(me, mGetAFont(me, "Arial"), 14, 0)
1477  temptext.text = "I"
1478  img = temptext.image.extractAlpha()
1479  img = img.trimwhitespace()
1480 
1481  w1 = img.width
1482 
1483  if w1 < 1 then return 0
1484 
1485  temptext.antialias = 1
1486  temptext.antialiasThreshold = 10
1487 
1488  temptext.kerning = 1
1489  temptext.kerningThreshold = 10
1490 
1491  temptext.text = "I"
1492  img = temptext.image.extractAlpha()
1493  img = img.trimwhitespace()
1494 
1495  w2 = img.width
1496 
1497  diff = abs(w2 - w1)
1498 
1499  return (diff < 2)
1500end
1501
1502
1503-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1504on ____OBJECT_REFERENCING
1505end
1506-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1507
1508
1509
1510-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1511-- xxxxxxxxxxxxxxxxxx check for availability of scripting xtra by name and store result for further access
1512-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1513
1514on mCheckForXtra me, whichXtra
1515  globs = mGetGlobalList(me)
1516  theXtras = globs.getaprop(#gXtras)
1517  if ilk(theXtras) <> #proplist then
1518    theXtras = [:]
1519    globs[#gXtras] = theXtras
1520  end if
1521  xtraPresent = theXtras.getaprop(whichXtra)
1522  if voidP(xtraPresent) then
1523    xtraPresent = 0
1524    numX = the number of xtras
1525    repeat with n = 1 to numX
1526      if (the name of xtra n = whichXtra) then
1527        xtraPresent = 1
1528        exit repeat
1529      end if
1530    end repeat
1531    theXtras.setaprop(whichXtra, xtraPresent)
1532  end if
1533  return xtraPresent
1534end
1535
1536
1537-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1538-- xxxxxxxxxxxxxxxxxx stored script instances:
1539
1540on mGetInstance me, instName, useRawNew
1541 
1542  if ilk(instName) = #string then instName = symbol(instName)
1543 
1544  theGlobs = mGetGlobalList(me)
1545  gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances)
1546 
1547  if ilk(gParentScriptInstances) <> #proplist then
1548    gParentScriptInstances = [:]
1549    theGlobs[#gParentScriptInstances] = gParentScriptInstances
1550  end if
1551 
1552  saveScr = gParentScriptInstances.getaprop(instName)
1553  if ilk(saveScr) = #instance then return saveScr
1554 
1555  if mGetMemType(me, member(string(instName))) = #script then
1556    if useRawNew = 1 then saveScr = rawnew(script string(instName))
1557    else saveScr = new(script string(instName))
1558    gParentScriptInstances.setaprop(instName, saveScr)
1559    return saveScr
1560  end if
1561 
1562  if saveScr = -1 then return 0
1563  gParentScriptInstances.setaprop(instName, -1)
1564  inst = mGetXScript(instName)
1565  if not(listP(inst)) then
1566    if ilk(inst) = #instance then inst = inst.script
1567    if useRawNew = 1 then saveScr = rawnew(inst)
1568    else saveScr = new(inst)
1569    gParentScriptInstances.setaprop(instName, saveScr)
1570    return saveScr
1571  end if
1572 
1573  return 0
1574 
1575end
1576
1577-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1578------------- get an instance WITHOUT instantiating, if it doesn't existing
1579------------- "mGetInstance" creates automatically an instance, sometimes, this is not what we want
1580
1581on mGetInstanceReference me, instName
1582 
1583  theGlobs = mGetGlobalList(me)
1584  gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances)
1585 
1586  if ilk(gParentScriptInstances) <> #proplist then return 0
1587 
1588  saveScr = gParentScriptInstances.getaprop(instName)
1589 
1590  return saveScr
1591 
1592end
1593
1594
1595-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1596-- xxxxxxxxxxxxxxxxxx delete a stored script instance:
1597
1598on mDeleteInstance me, instName, dontCallDestroyHandler
1599  theGlobs = mGetGlobalList(me)
1600  gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances)
1601  if ilk(gParentScriptInstances) <> #proplist then exit
1602  if dontCallDestroyHandler <> 1 then
1603    saveScr = gParentScriptInstances.getaprop(instName)
1604    if ilk(saveScr) = #instance then call(#mDestroy, [saveScr])
1605  end if
1606  gParentScriptInstances.deleteprop(instName)
1607end
1608
1609
1610-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1611-- xxxxxxxxxxxxxxxxxx reload a stored script instance:
1612
1613on mReloadInstance me, instName, useRawNew, dontCallDestroyHandler
1614  mDeleteInstance me, instName, dontCallDestroyHandler
1615  return mGetInstance(me, instName, useRawNew)
1616end
1617
1618-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1619-- xxxxxxxxxxxxxxxxxx replace a stored script instance:
1620
1621on mReplaceInstance me, instName, scriptInstance, dontCallDestroyHandler
1622  if not(objectP(scriptInstance)) then exit
1623  theGlobs = mGetGlobalList(me)
1624  gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances)
1625  if ilk(gParentScriptInstances) <> #proplist then exit
1626  if dontCallDestroyHandler <> 1 then
1627    saveScr = gParentScriptInstances.getaprop(instName)
1628    if ilk(saveScr) = #instance then call(#mDestroy, [saveScr])
1629  end if
1630  gParentScriptInstances.setaprop(instName, scriptInstance)
1631end
1632
1633
1634-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1635-- xxxxxxxxxxxxxxxxxx script instances in the models userdata[#myParentScript]:
1636-- many of my behaviors use model.userdata[#myParentScript] to store script objects, which then get the events sent by the Event Router Behavior for mouse Events
1637
1638on mGetParentScriptList me, theModel
1639  retval = []
1640  if voidP(theModel) then return retval
1641  if [#model, #group, #camera, #light].getPos(ilk(theModel)) > 0 then
1642    ud = theModel.userdata
1643    scr = ud.getaprop(#myParentScript)
1644    if ilk(scr) = #instance then
1645      scr = [scr]
1646      ud.setaprop(#myParentScript, scr)
1647    end if
1648    if not(listP(scr)) then
1649      scr = []
1650      ud.setaprop(#myParentScript, scr)
1651    end if
1652    return scr
1653  end if
1654  return retval
1655end
1656
1657-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1658
1659on mGetMemoryAddress me, theObject
1660  -----------------------------------
1661  -- CREATED: 08.12.2009
1662  -- ACTION: Convert argument into a string and chop the last char
1663  --         Usually used to get a unique identifier for a scriptinstance (=> the last word of string(me))
1664  --         but without the trailing ">".
1665  --         Not only this looks nicer, but also if used for a filename the ">" character is problematic in a filename
1666  -- INPUT: <theObject> ; any ilk which can be converted to a string
1667  -- RETURNS: string ; the stringified object without the trailing char
1668  -- EXAMPLE: uniqueInstanceIdentifier = xscr().mGetMemoryAddress(me)
1669  -----------------------------------
1670 
1671  theObject = the last word of string(theObject)
1672  delete the last char of theObject
1673  return theObject
1674end
1675
1676-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1677
1678on mGetPropertyRecursive me, proplist_source, list_propnames
1679  -----------------------------------
1680  -- CREATED: 08.03.2010
1681  -- ACTION: Dereference a proplist recursively
1682  -- INPUT: <proplist_source> ; property list ; the source list
1683  --        <list_propnames> ; linear list ; linear list with property names, which lead to the last property
1684  -- RETURNS: any value
1685  -- EXAMPLE: sourceList = [#one:[#two:[#three:3]]]
1686  --          val = xscr().mGetPropertyRecursive(sourceList, [#one, #two, #three])
1687  -----------------------------------
1688 
1689  if ilk(proplist_source) <> #proplist then return void
1690  if not(listP(list_propnames)) then return void
1691  cnt = count(list_propnames)
1692  if cnt < 1 then return void
1693  if cnt = 1 then return proplist_source[list_propnames[1]]
1694  propname = list_propnames[1]
1695  list_propnames.deleteAt(1)
1696  return mGetPropertyRecursive(me, proplist_source[propname], list_propnames)
1697end
1698
1699-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1700
1701on mCheckForValidImage me, image_img
1702  -----------------------------------
1703  -- CREATED: 21.04.2010
1704  -- ACTION: Check whether the parameter is a valid image object.
1705  --         Unfortunately there are sometimes cases where we end up with an
1706  --         image object, which errors out on each IL operation
1707  --         It is image:0 its ilk() is #image, but you can't even refer to its width
1708  --         without running into script errors. Therefore we need a lame string comparison
1709  --         as this image object has none of an image objects properties and methods :-(
1710  --         LAME!! Because string comaparison is a lame and slow hack. So don't use this handler "for fun"
1711  -- INPUT: <image_img> ; any
1712  -- RETURNS: boolean ; true if the parameter is an image with a with or height > 0
1713  -- EXAMPLE: put xscr().mCheckForValidImage(image(1,1,1))
1714  --          -- 1
1715  -----------------------------------
1716 
1717  if ilk(image_img) <> #image then return 0
1718  if string(image_img) = "<image:0>" then return 0
1719  if image_img.width * image_img.height < 1 then return 0
1720  return 1
1721end
1722
1723-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1724on ____MATH_UTILITIES
1725end
1726-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1727
1728-- xxxxxxxxxxxxxxxxxx Ease in, Ease out with sin() and cos()
1729on mApplyDynamic me, proz, methode
1730  proz = min(1.0, max(0.0, proz))
1731 
1732  case methode of
1733    #easeIn:
1734      --      methode = #cosinus
1735      return 1 - cos(pi()/2 * proz)
1736    #easeOut:
1737      --      methode = #sinus
1738      return sin(pi()/2 * proz)
1739    #easeInOut:
1740      --      if proz < 0.5 then methode = #cosinus
1741      --      else methode = #sinus
1742      return (1 - ((cos(pi() * proz) + 1) / 2.0))
1743  end case
1744 
1745  return proz
1746 
1747end
1748
1749
1750-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1751-- xxxxxxxxxxxxxxxxxx powers of 2 for textures
1752-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1753
1754on mIsPowerOfTwo me, integer_num
1755  return (bitand(integer_num, integer_num - 1) = 0)
1756end
1757
1758-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1759
1760on mGetNextPowerOfTwo me, breite
1761  powerList = mGetPowerOf2List(me)
1762  retval = powerList.findPosNear(integer(breite))
1763  return powerList[min(retval, powerList.count)]
1764end
1765
1766-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1767
1768on mGetNextLowerPowerOfTwo me, breite
1769  powerList = mGetPowerOf2List(me)
1770  if powerList.getPos(breite) > 0 then return breite
1771  return powerList[max(1, powerList.findPosNear(integer(breite)) - 1)]
1772end
1773
1774-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1775
1776on mGetPowerOf2List me
1777  theGlobs = mGetGlobalList(me)
1778  gPowerList = theGlobs.getaprop(#gPowerList)
1779  if ilk(gPowerList) <> #list then
1780    gPowerList = [1,2,4,8,16,32,64,128,256,512,1024]
1781    gPowerList.sort()
1782    theGlobs[#gPowerList] = gPowerList
1783  end if
1784  return gPowerList
1785end
1786
1787-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1788on ____STRING_FUNCTIONS
1789end
1790-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1791
1792
1793
1794-- split a path into its three elements => base directory, basename and extension:
1795
1796on mSplitPath me, fname, delim -- delim optional: default = the systems pathdelimiter
1797 
1798  olddelim = the itemdelimiter
1799  delim = string(delim)
1800  if length(delim) < 1 then
1801    delim =  the last char of the moviepath
1802    if length(delim) < 1 then
1803     
1804      if the runmode contains "plug" then
1805        delim = "/"
1806      else
1807        delim = the last char of the applicationpath
1808      end if
1809     
1810     
1811      if length(delim) < 1 then delim = "/"
1812    end if
1813  end if
1814  the itemdelimiter = delim
1815  dateiname = the last item of fname
1816  delete the last item of fname
1817  put delim after fname
1818  the itemdelimiter = olddelim
1819 
1820  ext = mSplitFromEnd(me, dateiname, ".")
1821 
1822  return [#basedir:fname, #basename:ext[#basename], #extension:ext[#extension]]
1823 
1824end
1825
1826-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1827
1828on mSplitFromEnd me, string_source, char_delim
1829  -----------------------------------
1830  -- CREATED: 23.03.2010
1831  -- ACTION: Get the file extension
1832  --         (or use any other SINGLE char to get the remaining bits of a string AFTER that char)
1833  -- INPUT: <string_source> ; string ; the input string
1834  --        <char_delim> ; string ; one char to be used as the itemdelimiter => optional, default = "."
1835  -- RETURNS: property list with [#basename:"", #extension:""]
1836  -- EXAMPLE: put xscr().mSplitFromEnd("com.adobe.director.plist", ".")
1837  --          -- [#basename:"com.adobe.director", #extension:"plist"]
1838  -----------------------------------
1839 
1840  char_delim = string(char_delim)
1841  if length(char_delim) > 0 then
1842    char_delim = char 1 of char_delim
1843  else
1844    char_delim = "." -- defaults to . => find file extension
1845  end if
1846 
1847  if offset(char_delim, string_source) < 1 then
1848    return [#basename:string_source, #extension:""]
1849  end if
1850 
1851  olddelim = the itemdelimiter
1852  the itemdelimiter = char_delim
1853  ext = the last item of string_source
1854  delete the last item of string_source
1855  the itemdelimiter = olddelim
1856  return [#basename:string_source, #extension:ext]
1857end
1858
1859-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1860
1861on mConvertAbsolutePathToRelative me, aPath, newDelim, anAbsoluteBasedir
1862 
1863 
1864 
1865  anAbsoluteBasedir = string(anAbsoluteBasedir)
1866  if length(anAbsoluteBasedir) < 1 then
1867   
1868    if not(the runmode contains "auth") then
1869      externalPathHackList = mGetPlayBackModeValue(me, #externalPathHackList)
1870      if listP(externalPathHackList) then
1871       
1872        delim = the last char of the moviepath
1873        if length(delim) < 1 then
1874          if (the runmode contains "plug") then
1875            delim = "/"
1876          else
1877            delim = the last char of the applicationpath
1878          end if
1879        end if
1880       
1881        repeat with thisHack in externalPathHackList
1882          if ilk(thisHack) = #proplist then
1883            ident = thisHack[#identifier]
1884           
1885            if delim <> "/" then
1886              offs = offset("/", ident)
1887              repeat while offs > 0
1888                put delim into char offs of ident
1889                offs = offset("/", ident)
1890              end repeat
1891            end if
1892           
1893            if offset(ident, aPath) > 0 then
1894              if aPath starts thisHack[#basePath] & ident then
1895                anAbsoluteBasedir = thisHack[#basePath]
1896                exit repeat
1897              end if
1898            end if
1899          end if
1900        end repeat
1901      end if
1902    end if
1903   
1904  if length(anAbsoluteBasedir) < 1 then anAbsoluteBasedir = the moviepath
1905   
1906  end if
1907 
1908  if length(anAbsoluteBasedir) < 1 then return aPath
1909 
1910  delim = the last char of the moviepath
1911  if length(delim) < 1 then delim = the last char of the applicationpath
1912 
1913  newDelim = string(newDelim)
1914  if length(newDelim) < 1 then newDelim = delim
1915 
1916  offs = offset(anAbsoluteBasedir, aPath)
1917  if offs <> 1 then
1918    put "Script:commonMovieScript; Handler:mConvertAbsolutePathToRelative; The path:" &&QUOTE& aPath &QUOTE&& "is not inside the current path specified" &&QUOTE& anAbsoluteBasedir &QUOTE
1919    return aPath
1920  end if
1921  delete char 1 to length(anAbsoluteBasedir) of aPath
1922  if delim = newDelim then return aPath
1923 
1924  offs = offset(delim, aPath)
1925  repeat while offs > 0
1926    put newDelim into char offs of aPath
1927    offs = offset(delim, aPath)
1928  end repeat
1929 
1930  return aPath
1931end
1932
1933-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1934
1935-- convert a relative path to an absolute path: (Sorry, the name of this handler couldn't be more stupid ;-)
1936on mGetRelativePath me, aPath, mp -- mp optional: default = the moviepath
1937 
1938  if aPath contains "maxState" then
1939    nothing
1940  end if
1941 
1942  if not(the runmode contains "auth") then
1943    externalPathHackList = mGetPlayBackModeValue(me, #externalPathHackList)
1944    if listP(externalPathHackList) then
1945      repeat with thisHack in externalPathHackList
1946        if ilk(thisHack) = #proplist then
1947          if aPath starts thisHack[#identifier] then
1948            mp = thisHack[#basePath]
1949            --            alert "changed basepath to:" && mp
1950            regexp = thisHack[#regexp]
1951            if ilk(regexp) = #proplist then
1952              searchString = string(regexp[#searchString])
1953              if length(searchString) > 0 then
1954                replacementString = string(regexp[#replacementString])
1955                aPath = jReplaceAll(aPath, searchString, replacementString, "ig", 1)
1956              end if
1957            end if
1958            exit repeat
1959          end if
1960        end if
1961      end repeat
1962    end if
1963  end if
1964 
1965  mp = string(mp)
1966  if length(mp) < 1 then
1967    mp = the moviepath
1968    if length(mp) < 1 then
1969      if the runmode contains "plug" then
1970        mp = ""
1971      else
1972        mp = the applicationpath
1973      end if
1974      if length(mp) < 1 then
1975        mp = "@/"
1976      end if
1977    end if
1978  end if
1979 
1980  offs = offset(mp, aPath)
1981  if offs = 1 then
1982    delete char 1 to length(mp) - 1 of aPath
1983  end if
1984 
1985  delim = the last char of mp
1986  if ["\", "/", ":"].getPos(delim) < 1 then
1987    delim =  the last char of the moviepath
1988    if length(delim) < 1 then
1989      if the runmode contains "plug" then
1990        --        delim = ""
1991      else
1992        delim = the last char of the applicationpath
1993      end if
1994      if length(delim) < 1 then delim = "/"
1995    end if
1996    put delim after mp
1997  end if
1998 
1999  --  delimList = ["\", "/", ":"]
2000  --  delimList.deleteOne(delim)
2001  -- 
2002  --  repeat with thisDelim in delimList
2003  --    offs =  offset(thisDelim, aPath)
2004  --    repeat while offs > 0
2005  --      put delim into char offs of aPath
2006  --      offs =  offset(thisDelim, aPath)
2007  --    end repeat
2008  --  end repeat
2009 
2010  aPath = mGetDelimitedPath(me, aPath, delim)
2011 
2012  offs = offset("://", aPath)
2013  if ((offs > 3) and (offs < 7)) then
2014    -- ought to be an absolute internet link
2015    return aPath
2016  end if
2017 
2018  if char 1 of aPath = "@" then delete char 1 of aPath
2019 
2020  if (aPath.char[1 .. 3] = ".."&delim) then put delim before aPath
2021  offs = offset(delim&".."&delim, aPath)
2022  repeat while offs > 0
2023    put delim&delim into char offs to (offs + 3) of aPath
2024    offs = offset(delim&".."&delim, aPath)
2025  end repeat
2026 
2027 
2028  if (char 2 of aPath = delim) then
2029    delete char 1 of aPath
2030    olddelim = the itemdelimiter
2031    the itemdelimiter = delim
2032    delete the last item of mp
2033    repeat while char 1 of aPath = delim
2034      delete char 1 of aPath
2035      delete the last item of mp
2036    end repeat
2037    put delim after mp
2038  end if
2039 
2040  if char 1 of aPath = delim then delete char 1 of aPath
2041 
2042  olddelim = the itemdelimiter
2043  the itemdelimiter = delim
2044  platte = item 1 of mp
2045  anf = item 1 of aPath
2046  the itemdelimiter = olddelim
2047 
2048  if anf = "http:" or anf = "ftp:" or anf = "https:" then return aPath
2049  else if anf = platte then return aPath
2050  return mp & aPath
2051 
2052end
2053
2054-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2055-- converts each of the three pathdelimiters ("\", ":", "/") to the platform specific delimiter
2056
2057on mGetDelimitedPath me, thePath, delim -- delim optional: default = the systems pathdelimiter
2058 
2059  delim = string(delim)
2060  if length(delim) < 1 then
2061    delim = the last char of the moviepath
2062    if length(delim) < 1 then
2063      if not(the runmode contains "plug") then
2064        delim = the last char of the applicationpath
2065      end if
2066      if length(delim) < 1 then delim = "/"
2067    end if
2068  end if
2069 
2070  offs = offset("://", thePath)
2071  if ((offs > 3) and (offs < 7)) then
2072    -- must be an internet link
2073    delim = "/"
2074  end if
2075 
2076 
2077  if delim = "\" then
2078    if length(thePath) > 1 then
2079      if thePath.char[2] = ":" then
2080        num = charToNum(thePath.char[1])
2081        if (num > 64 and num < 91) or (num > 96 and num < 123) then
2082          praef = thePath.char[1 .. 2]
2083          delete char 1 to 2 of thePath
2084        else
2085          praef = ""
2086        end if
2087      else
2088        praef = ""
2089      end if
2090    else
2091      praef = ""
2092    end if
2093   
2094  else if delim = "/" then
2095   
2096    if offset("https:", thePath) = 1 then
2097      praef = thePath.char[1 .. 6]
2098      delete char 1 to 6 of thePath
2099    else if offset("http:", thePath) = 1 then
2100      praef = thePath.char[1 .. 5]
2101      delete char 1 to 5 of thePath
2102    else if offset("ftp:", thePath) = 1 then
2103      praef = thePath.char[1 .. 4]
2104      delete char 1 to 4 of thePath
2105    else
2106      praef = ""
2107    end if
2108   
2109    ----------- now we want to strip the domain too, because there could be a : for the port
2110    ----------- but : is one of the chars we want to translate, therefore we exclude the doamin also
2111    if length(praef) > 0 then
2112     
2113      repeat with xy = 1 to 2
2114        if char 1 of thePath = "/" then
2115          praef = praef & "/"
2116          delete char 1 of thePath
2117        end if
2118      end repeat
2119     
2120      domain = offset("/", thePath)
2121      if domain = 0 then domain = length(thePath)
2122      praef = praef & thePath.char[1 .. domain]
2123      delete char 1 to domain of thePath
2124    end if
2125    ------------
2126   
2127  else
2128    praef = ""
2129  end if
2130 
2131  delimLi = ["\", ":", "/"]
2132  delimLi.deleteOne(delim)
2133 
2134  repeat with thisDelim in delimLi
2135    offs = offset(thisDelim, thePath)
2136    repeat while offs > 0
2137      put delim into char offs of thePath
2138      offs = offset(thisDelim, thePath)
2139    end repeat
2140  end repeat
2141 
2142  put praef before thePath
2143 
2144  return thePath
2145end
2146
2147
2148-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2149
2150-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2151-- xxxxxxxxxxxxxxxxxx Check for file existence
2152-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2153
2154on mCheckFileExists me, aPath
2155  if ilk(aPath) <> #string then return 0
2156  if not(aPath.length) then return 0
2157 
2158  if (the runmode contains "plug") then
2159    retValue = 1 -- can't do this check in shockwave
2160   
2161  else
2162   
2163    retValue = 0
2164   
2165    if mCheckForXtra(me, "BudAPI") then -- if buddy is present...
2166      --  -- budApi version:
2167     
2168      -- alex am 6.03.2004 um 09:06
2169     
2170      -- ich weiss nicht wirklich, ob es schlauer ist baShortFileName() zu verwenden
2171      -- wegen alten versionen von BudApi, OS9, windows... ???
2172      -- so: handle with care
2173      --    retValue = baFileExists(aPath)
2174     
2175      retValue = (string(baShortFileName(aPath)) <> "")
2176      --/ alex am 6.03.2004 um 09:06
2177     
2178    else if mCheckForXtra(me, "FileXtra4") then -- if not buddy then try filextra
2179      --  -- filextra3 version:
2180      fx = (xtra "filextra4").new()
2181      if objectP(fx) then retValue = fx.fx_FileExists(aPath)
2182      fx = 0
2183    else if mCheckForXtra(me, "fileio") then
2184      -- if all else fails, try the slower fileio version by trying to open the file
2185      -- -- fileio version:
2186      fio = (xtra "fileio").new()
2187      if objectP(fio) then
2188        fio.openFile(aPath, 0)
2189        if fio.status() = 0 then
2190          fio.closeFile()
2191          retValue = 1
2192        end if
2193      end if
2194      fio = 0
2195     
2196    else
2197      retValue = 1 -- in dubio pro reo
2198    end if
2199   
2200  end if
2201 
2202  return retValue
2203end
2204
2205-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2206
2207on mGetUniqueFilename me, fullPath, backUpSuffix
2208 
2209  backUpSuffix = string(backUpSuffix)
2210  if length(backUpSuffix) < 1 then
2211    backUpSuffix = mCreateDateSuffix(me, "_BAK_")
2212  end if
2213 
2214  if mCheckFileExists(me, fullPath) = 1 then
2215   
2216    splitPath = mSplitPath(me, fullPath)
2217    dd = 0
2218    dup = splitPath.getaprop(#basedir) & splitPath.getaprop(#basename) & backUpSuffix & "." & splitPath.getaprop(#extension) & "_" & dd
2219    repeat while mCheckFileExists(me, dup) = 1
2220      dd = dd + 1
2221      dup = splitPath.getaprop(#basedir) & splitPath.getaprop(#basename) & backUpSuffix & "." & splitPath.getaprop(#extension) & "_" & dd
2222    end repeat
2223   
2224  end if
2225 
2226end
2227
2228-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2229
2230on mCreateDateSuffix me, praefix
2231 
2232  d = the systemdate
2233 
2234  monat = integer(d.month)
2235  if monat < 10 then monat = "0" & monat
2236  tag = integer(d.day)
2237  if tag < 10 then tag = "0" & tag
2238 
2239  return praefix & monat & "_" & tag
2240 
2241end
2242
2243
2244-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2245
2246-- dummy handler for translate function
2247
2248on mTranslate me, aString, variablesList
2249  theGlobs = mGetGlobalList(me)
2250  uebersetzungsListe = theGlobs.getaprop(#gUebersetzung)
2251  if ilk(uebersetzungsListe) <> #proplist then return mReplacePlaceHoldersInString(me, aString, variablesList)
2252 
2253  uebersetzung = uebersetzungsListe.getaprop(aString)
2254  if voidP(uebersetzung) then return mReplacePlaceHoldersInString(me, aString, variablesList)
2255 
2256  currLang = call(#mGetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage)
2257  if voidP(currLang) then
2258    currLang = theGlobs.getaprop(#gSprache)
2259    if voidP(currLang) then currLang = 0
2260    call(#mSetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage, currLang)
2261  end if
2262  ind = currLang + 1
2263  if ind > count(uebersetzung) then ind = 1
2264 
2265  return mReplacePlaceHoldersInString(me, uebersetzung[ind], variablesList)
2266end
2267
2268-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2269
2270on mReplacePlaceHoldersInString me, aString, variablesList
2271  theIlk = ilk(variablesList)
2272  if theIlk = #proplist then
2273    cnt = count(variablesList)
2274    if cnt > 0 then
2275      repeat with n = 1 to cnt
2276        str = string(variablesList[n])
2277        prop = variablesList.getPropAt(n)
2278        srchStr = "%%" & prop & "%%"
2279        len = length(srchStr) - 1
2280        offs = offset(srchStr, aString)
2281        repeat while offs > 0
2282          put str into char offs to offs + len of aString
2283          offs = offset(srchStr, aString)
2284        end repeat
2285      end repeat       
2286    end if
2287  else if theIlk = #list then -- printf like replacement
2288    if count(variablesList) > 0 then
2289      offs = offset("%s", aString)
2290      str = string(variablesList[1])
2291      repeat while offs > 0
2292        put str into char offs to offs + 1 of aString
2293        if count(variablesList) > 1 then variablesList.deleteAt(1)
2294        str = string(variablesList[1])
2295        offs = offset("%s", aString)
2296      end repeat
2297    end if
2298  end if
2299  return aString
2300end
2301
2302-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2303-- xxxxxxxxxxxxxxxxxx encodes spaces as %20 rather than "+" as lingos urlencode does
2304-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2305
2306
2307on mUrlEncode me, srcText
2308 
2309  srcText = urlencode(string(srcText))
2310 
2311  offs = offset("+", srcText)
2312 
2313  if offs then
2314   
2315    newtext = ""
2316    replText = "%20"
2317   
2318    repeat while offs
2319     
2320      if offs > 1 then put char 1 to (offs - 1) of srcText & replText after newtext
2321      else put replText after newtext
2322     
2323      delete char 1 to offs of srcText
2324     
2325      offs = offset("+", srcText)
2326     
2327      if offs = 0 then put srcText after newtext
2328     
2329    end repeat
2330   
2331  else
2332   
2333    return srcText
2334  end if
2335 
2336  return newtext
2337 
2338end
2339
2340
2341
2342-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2343-- xxxxxxxxxxxxxxxxxx the missing reverse for urlencode
2344-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2345
2346
2347on urlDecode me, theString
2348 
2349  newString = ""
2350 
2351  -- replace all %
2352  proc_pos = offset("%", theString)
2353  -- replace the + with SPACE
2354  plus_pos = offset("+", theString)
2355 
2356  repeat while (proc_pos > 0) or (plus_pos > 0)
2357   
2358    if (plus_pos < proc_pos) and (plus_pos > 0) then
2359      if plus_pos > 1 then put char 1 to (plus_pos - 1) of theString after newString
2360     
2361      put SPACE after newString
2362     
2363      delete char 1 to plus_pos of theString
2364     
2365    else
2366      if proc_pos > 1 then put char 1 to (proc_pos - 1) of theString after newString
2367     
2368      tHH = bitAnd(chartonum(char (proc_pos + 1) of theString), 95)
2369      if (tHH > 26) then tHH = tHH - 55
2370      else tHH = tHH - 16
2371     
2372      tHL = bitAnd(chartonum(char (proc_pos + 2) of theString), 95)
2373      if (tHL > 26) then tHL = tHL - 55
2374      else tHL = tHL - 16
2375     
2376      put numtoChar((tHH * 16) + tHL) after newString
2377     
2378      delete char 1 to (proc_pos + 2) of theString
2379    end if
2380   
2381    proc_pos = offset("%", theString)
2382    plus_pos = offset("+", theString)
2383   
2384  end repeat
2385 
2386  put theString after newString
2387 
2388  return newString
2389end
2390
2391-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2392
2393on mSymbolify me, any_var
2394  any_var = string(any_var)
2395  repeat while char 1 of any_var = "#"
2396    delete char 1 of any_var
2397  end repeat
2398  any_var = mString2Symb(me, any_var)
2399  return symbol(any_var)
2400end
2401
2402-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2403
2404on mString2Symb me, str
2405 
2406  offs = offset(" ", str)
2407  repeat while offs > 0
2408    put "_s_" into char offs of str
2409    offs = offset(" ", str)
2410  end repeat
2411 
2412  offs = offset(".", str)
2413  repeat while offs > 0
2414    put "_d_" into char offs of str
2415    offs = offset(".", str)
2416  end repeat
2417 
2418  offs = offset("-", str)
2419  repeat while offs > 0
2420    put "_b_" into char offs of str
2421    offs = offset("-", str)
2422  end repeat
2423 
2424  if integerP(integer(str.char[1])) then put "n__" before str
2425 
2426  if length(str) < 1 then str = "xxx_" & the milliseconds
2427 
2428  return str
2429end
2430
2431-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2432
2433on mSymb2String me, sym
2434  str = string(sym)
2435 
2436  offs = offset("_s_", str)
2437  repeat while offs > 0
2438    put " " into char offs to offs+2 of str
2439    offs = offset("_s_", str)
2440  end repeat
2441 
2442  offs = offset("_d_", str)
2443  repeat while offs > 0
2444    put "." into char offs to offs+2 of str
2445    offs = offset("_d_", str)
2446  end repeat
2447 
2448  offs = offset("_b_", str)
2449  repeat while offs > 0
2450    put "-" into char offs to offs+2 of str
2451    offs = offset("_b_", str)
2452  end repeat
2453 
2454  if str starts "n__" then delete char 1 to 3 of str
2455 
2456  return str
2457end
2458
2459
2460-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2461
2462on mHTMLize me, str
2463  if offset("<html", str) < 1 then
2464    titlePos = offset("</title>", str)
2465    if titlePos < 1 then
2466      theTitle = "<title>untitled</title>"
2467      put theTitle before str
2468      firstchar = length(theTitle)
2469    else
2470      firstchar = titlePos + 7
2471    end if
2472    if offset("<body", str) < 1 then
2473      put "<body>" after char firstchar of str
2474      put "</body>" after str
2475    end if
2476    put "<html>" before str
2477    put "</html>" after str
2478  end if
2479  return str
2480end
2481
2482
2483-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2484
2485on mValidateEmailAddress me, emailAddress
2486  retval = 0
2487  oldd = the itemdelimiter
2488  the itemdelimiter = "@"
2489  numItems = the number of items of emailAddress
2490  if numitems > 1 then
2491    if length(item 1 of emailAddress) > 0 then
2492      if length(item 2 of emailAddress) > 0 then
2493        offs = offset(".", item 2 of emailAddress)
2494        if offs > 1 then
2495          if offs < (length(item 2 of emailAddress) - 1) then
2496            if offs > (length(item 2 of emailAddress) - 4) then
2497              retval = 1
2498            end if
2499          end if
2500        end if
2501      end if
2502    end if
2503  end if
2504  the itemdelimiter = oldd
2505  return retval
2506end
2507
2508-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2509-- the naming convention used throughout all my movies for names, filename etc.:
2510-- Names must be only alphanumeric chars and the underscore and should not start with a number
2511-- As a rule of thumb: every string which can be made into a symbol is valid.
2512
2513on mValidateName me, str
2514  if ilk(str) <> #string then return 0
2515  if length(str) < 1 then return 0
2516  if "0123456789" contains char 1 of str then return 0
2517  return string(symbol(str)) = str
2518end
2519
2520-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2521on ____________CONVERT_CASE
2522end
2523-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2524
2525on mUpperCase me, aString
2526 
2527  if not(listP(pCaseLists)) then mCreateCaseLists me
2528 
2529  lowercase = pCaseLists.getaprop(#lowercase)
2530  uppercase = pCaseLists.getaprop(#uppercase)
2531 
2532  repeat with i = length(aString) down to 1
2533    pos = getPos(lowercase, char i of aString)
2534    if pos > 0 then
2535      put uppercase[pos] into char i of aString
2536    end if
2537  end repeat
2538 
2539  return aString
2540 
2541end
2542
2543-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2544
2545on mLowerCase me, aString
2546 
2547  if not(listP(pCaseLists)) then mCreateCaseLists me
2548 
2549  lowercase = pCaseLists.getaprop(#lowercase)
2550  uppercase = pCaseLists.getaprop(#uppercase)
2551 
2552  repeat with i = length(aString) down to 1
2553    pos = getPos(uppercase, char i of aString)
2554    if pos > 0 then
2555      put lowercase[pos] into char i of aString
2556    end if
2557  end repeat
2558 
2559  return aString
2560end
2561
2562-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2563
2564on mCreateCaseLists me
2565 
2566  pCaseLists = [:]
2567 
2568  if the platform contains "Macintosh" then
2569    vA = numToChar(229)
2570  else
2571    vA = numToChar(194)
2572  end if
2573 
2574  -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZÁÀ"&vA& "ÄÃÃ
2575ÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙ€ÜÆØŒŞ"
2576  -- pLowercase = "abcdefghijklmnopqrstuvwxyzáà"&"â"&"ÀãåçéÚêëíìîïñóòÎöõúùûÌÊÞœÿ"
2577  pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Á", "À", vA, "A", "Ä", "Ã", "Ã
2578", "Ç", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ñ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ú", "Ù", "U", "Ü", "Æ", "Ø", "Œ", "Åž"])
2579  pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "á", "à", vA, "â", "À", "ã", "Ã¥", "ç", "é", "Ú", "ê", "ë", "í", "ì", "î", "ï", "ñ", "ó", "ò", "ÃŽ", "ö", "õ", "ú", "ù", "û", "ÃŒ", "Ê", "Þ", "œ", "ÿ"])
2580 
2581end
2582
2583
2584-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2585on ____DATE_FUNCTIONS
2586end
2587-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2588
2589on mGetWeekDay me, dateObject, lang
2590  if ilk(dateObject) <> #date then dateObject = the systemdate
2591  vN = (dateObject - date(20030505)) mod 7
2592  vN = vN + 1 + (7 * (vN < 0))
2593  case lang of
2594    "de":
2595      li = ["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"]
2596    "pt":
2597      li = ["Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado","Domingo"]
2598    "fr":
2599      li = ["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"]
2600    "es":
2601      li = ["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"]
2602    "it":
2603      li = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"]
2604    "nl":
2605      li = ["Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"]
2606    "en":
2607      li = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
2608    otherwise:
2609      return vN
2610  end case
2611  return li.getAt(vN)
2612end
2613
2614
2615-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2616
2617on mFormatdate me, theFormat, theDate
2618  theFormat = string(theFormat)
2619  if length(theFormat) < 1 then theFormat = "yyyy/mm/dd"
2620  if ilk(theDate) <> #date then theDate = the systemdate
2621 
2622  offs = offset("y", theFormat)
2623  if offs > 0 then
2624    ende = offs+1
2625    repeat while char ende of theFormat = "y"
2626      if ende > length(theFormat) then exit repeat
2627      ende = ende+1
2628    end repeat
2629    len = ende - offs
2630    if len < 3 then theYear = char 3 to 4 of string(theDate.year)
2631    else theYear = string(theDate.year)
2632    put theYear into char offs to offs + len -1 of theFormat
2633  end if
2634 
2635  theFormat = mReplaceCharWithNumber(me, theFormat, "m", theDate.month)
2636 
2637  theFormat = mReplaceCharWithNumber(me, theFormat, "d", theDate.day)
2638 
2639  return theFormat
2640end
2641
2642-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2643
2644on mReplaceCharWithNumber me, theString, theChar, theNumber
2645  offs = offset(theChar, theString)
2646  if offs > 0 then
2647    ende = offs+1
2648    repeat while char ende of theString = theChar
2649      if ende > length(theString) then exit repeat
2650      ende = ende+1
2651    end repeat
2652    len = ende - offs
2653    theNumber = string(theNumber)
2654    repeat while length(theNumber) < len
2655      put "0" before theNumber
2656    end repeat
2657    put theNumber into char offs to offs + len -1 of theString
2658  end if
2659  return theString
2660end
2661
2662-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2663
2664on mGetCurrentDateAmerican me
2665  return mGetDateAmericanFormat(me, the systemdate)
2666end
2667
2668
2669-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2670
2671on mGetCurrentTimeAmerican me
2672  return mGetTimeAmericanFormat(me, the systemdate)
2673end
2674
2675
2676-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2677
2678on mGetDateAmericanFormat me, dateObject
2679  return dateObject.month & "/" & dateObject.day & "/" & dateObject.year
2680end
2681
2682
2683-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2684
2685on mGetTimeAmericanFormat me, dateObject, withoutSeconds
2686 
2687  secs = dateObject.seconds
2688  hr = secs / (60*60)
2689  if hr > 11 then ampm = "pm"
2690  else ampm = "am"
2691 
2692  secs = secs - (60*60*hr)
2693 
2694  mins = secs / 60
2695  if mins < 10 then mins = "0" & mins
2696 
2697  if not withoutSeconds then
2698   
2699    secs = secs - (60*mins)
2700    if secs < 10 then secs = "0" & secs
2701   
2702    return hr & ":" & mins & ":" & secs && ampm
2703   
2704  else
2705    return hr & ":" & mins && ampm
2706  end if
2707 
2708end
2709
2710-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2711
2712on mGetDateTimeString me, date_Date
2713 
2714  if ilk(date_Date) <> #date then theDate = the systemdate
2715  else theDate = date_Date
2716 
2717  theYear = theDate.year
2718 
2719  theDay = theDate.day
2720  if theDay < 10 then theDay = "0" & theDay
2721 
2722  theMonth = theDate.month
2723  if theMonth < 10 then theMonth = "0" & theMonth
2724 
2725  theTime = mGetTimeStringFromSeconds(me, theDate.seconds)
2726 
2727  return theYear & "-" & theMonth & "-" & theDay & "T" & theTime
2728end
2729
2730-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2731
2732on mGetTimeStringFromSeconds me, integer_SecondsSinceMidnight
2733 
2734  if ilk(integer_SecondsSinceMidnight) <> #integer then secs = (the systemdate).seconds
2735  else secs = integer_SecondsSinceMidnight
2736 
2737  hours = secs / 3600
2738  if hours < 10 then hours = "0" & hours
2739  secs = secs mod 3600
2740  mins = secs / 60
2741  if mins < 10 then mins = "0" & mins
2742  secs = secs mod 60
2743  if secs < 10 then secs = "0" & secs
2744 
2745  return hours & ":" & mins & ":" & secs
2746end
2747
2748-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2749
2750on interface me
2751  str = "Common Movie Script  by alex da franca c2003 -- alex@farbflash.de -- all rigths reserved"
2752  put RETURN & "Shared Global Handlers" after str
2753 
2754  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2755  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2756  put RETURN & "on mGetGlobalList me" after str
2757  put RETURN & "" after str
2758 
2759  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2760  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2761  put RETURN & "on mMyClearGlobals me" after str
2762  put RETURN & "" after str
2763 
2764  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2765  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2766  put RETURN & "on mCallDestroy me" after str
2767  put RETURN & "" after str
2768 
2769  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2770  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2771  put RETURN & "on ____WOODY_CHANGES" after str
2772  put RETURN & "" after str
2773 
2774  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2775  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2776  put RETURN & "on Authoring_ExchangeScriptListColorsToRGBs me" after str
2777  put RETURN & "" after str
2778 
2779  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2780  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2781  put RETURN & "on mCheckWoody me" after str
2782  put RETURN & "" after str
2783 
2784  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2785  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2786  put RETURN & "on mGetVersionNumber me" after str
2787  put RETURN & "" after str
2788 
2789  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2790  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2791  put RETURN & "on mGetPlatform me" after str
2792  put RETURN & "" after str
2793 
2794  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2795  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2796  put RETURN & "on mCheckMemberType me, memref, aType" after str
2797  put RETURN & "" after str
2798 
2799  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2800  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2801  put RETURN & "on mGetMemType me, memref" after str
2802  put RETURN & "" after str
2803 
2804  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2805  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2806  put RETURN & "on mCreateTimeout me, theName, theDuration, theHandler, theTarget" after str
2807  put RETURN & "" after str
2808 
2809  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2810  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2811  put RETURN & "on ____HANDLE_KEY_EVENTS" after str
2812  put RETURN & "" after str
2813 
2814  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2815  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2816  put RETURN & "on mHandleKeyEvent me, tk, kc" after str
2817  put RETURN & "" after str
2818 
2819  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2820  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2821  put RETURN & "on mSuspendAllKeyEvents me, flag" after str
2822  put RETURN & "" after str
2823 
2824  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2825  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2826  put RETURN & "on mSuspendAllMouseEvents me, flag" after str
2827  put RETURN & "" after str
2828 
2829  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2830  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2831  put RETURN & "on mDoQuit me" after str
2832  put RETURN & "" after str
2833 
2834  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2835  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2836  put RETURN & "on mQuitMovie me" after str
2837  put RETURN & "" after str
2838 
2839  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2840  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2841  put RETURN & "on ____MOVIE_IDENTIFIER_HANDLERS" after str
2842  put RETURN & "" after str
2843 
2844  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2845  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2846  put RETURN & "on mSetThisMovieName me, aName" after str
2847  put RETURN & "" after str
2848 
2849  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2850  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2851  put RETURN & "on mGetThisMovieName me" after str
2852  put RETURN & "" after str
2853 
2854  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2855  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2856  put RETURN & "on ____SPRITE_NAMING_HANDLERS" after str
2857  put RETURN & "" after str
2858 
2859  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2860  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2861  put RETURN & "on mGetKanal me, einname" after str
2862  put RETURN & "" after str
2863 
2864  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2865  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2866  put RETURN & "on mMeldeKanalname me, einname, einkanal" after str
2867  put RETURN & "" after str
2868 
2869  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2870  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2871  put RETURN & "on mMeldeAbKanalname me, einname, einkanal" after str
2872  put RETURN & "" after str
2873 
2874  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2875  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2876  put RETURN & "on ____DEBUG_FUNCTIONS" after str
2877  put RETURN & "" after str
2878 
2879  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2880  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2881  put RETURN & "on mEnablePut me, val" after str
2882  put RETURN & "" after str
2883 
2884  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2885  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2886  put RETURN & "on mPut me, str, overwrite, dername" after str
2887  put RETURN & "" after str
2888 
2889  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2890  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2891  put RETURN & "on mDebugImage me, img, overwrite, dername" after str
2892  put RETURN & "" after str
2893 
2894  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2895  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2896  put RETURN & "on mLogDebugInfo me, str" after str
2897  put RETURN & "" after str
2898 
2899  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2900  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2901  put RETURN & "on ____MEMBER_UTILITIES" after str
2902  put RETURN & "" after str
2903 
2904  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2905  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2906  put RETURN & "on mSuchMemFwd me, num, cl, dername" after str
2907  put RETURN & "" after str
2908 
2909  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2910  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2911  put RETURN & "on mGetNewMember me, aType" after str
2912  put RETURN & "" after str
2913 
2914  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2915  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2916  put RETURN & "on mEraseMember me, aMember" after str
2917  put RETURN & "" after str
2918 
2919  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2920  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2921  put RETURN & "on mGetTempMemberList me, aType" after str
2922  put RETURN & "" after str
2923 
2924  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2925  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2926  put RETURN & "on mEraseAllTempMembers me" after str
2927  put RETURN & "" after str
2928 
2929  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2930  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2931  put RETURN & "on ____TEXT_UTILITIES" after str
2932  put RETURN & "" after str
2933 
2934  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2935  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2936  put RETURN & "on InitFonts me" after str
2937  put RETURN & "" after str
2938 
2939  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2940  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2941  put RETURN & "on GetScrollRatio me, aMember -------------------------------------------" after str
2942  put RETURN & "" after str
2943 
2944  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2945  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2946  put RETURN & "on mGetATextMem me, theFont, theFontsize, aliasFlag" after str
2947  put RETURN & "" after str
2948 
2949  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2950  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2951  put RETURN & "on mGetAFont me, theFont" after str
2952  put RETURN & "" after str
2953 
2954  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2955  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2956  put RETURN & "on mGetLineHeight me, textOrField" after str
2957  put RETURN & "" after str
2958 
2959  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2960  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2961  put RETURN & "on mGetLinesOfWrappedText me, textOrField" after str
2962  put RETURN & "" after str
2963 
2964  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2965  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2966  put RETURN & "on mCheckForTextAA me" after str
2967  put RETURN & "" after str
2968 
2969  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2970  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2971  put RETURN & "on ____OBJECT_REFERENCING" after str
2972  put RETURN & "" after str
2973 
2974  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2975  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2976  put RETURN & "on mCheckForXtra me, whichXtra" after str
2977  put RETURN & "" after str
2978 
2979  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2980  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2981  put RETURN & "on mGetInstance me, instName" after str
2982  put RETURN & "" after str
2983 
2984  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2985  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2986  put RETURN & "on mGetParentScriptList me, theModel" after str
2987  put RETURN & "" after str
2988 
2989  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2990  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2991  put RETURN & "on ____MATH_UTILITIES" after str
2992  put RETURN & "" after str
2993 
2994  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
2995  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
2996  put RETURN & "on mApplyDynamic me, proz, methode" after str
2997  put RETURN & "" after str
2998 
2999  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3000  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3001  put RETURN & "on mGetNextPowerOfTwo me, breite" after str
3002  put RETURN & "" after str
3003 
3004  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3005  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3006  put RETURN & "on mGetNextLowerPowerOfTwo me, breite" after str
3007  put RETURN & "" after str
3008 
3009  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3010  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3011  put RETURN & "on ____STRING_FUNCTIONS" after str
3012  put RETURN & "" after str
3013 
3014  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3015  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3016  put RETURN & "on mSplitPath me, fname, delim -- delim optional: default = the systems pathdelimiter" after str
3017  put RETURN & "" after str
3018 
3019  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3020  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3021  put RETURN & "on mGetRelativePath me, aPath, mp -- mp optional: default = the moviepath" after str
3022  put RETURN & "" after str
3023 
3024  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3025  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3026  put RETURN & "on mGetDelimitedPath me, thePath, delim -- delim optional: default = the systems pathdelimiter" after str
3027  put RETURN & "" after str
3028 
3029  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3030  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3031  put RETURN & "on mCheckFileExists me, aPath" after str
3032  put RETURN & "" after str
3033 
3034  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3035  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3036  put RETURN & "on mTranslate me, aString" after str
3037  put RETURN & "" after str
3038 
3039  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3040  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3041  put RETURN & "on mUrlEncode me, srcText" after str
3042  put RETURN & "" after str
3043 
3044  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3045  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3046  put RETURN & "on urlDecode me, theString" after str
3047  put RETURN & "" after str
3048 
3049  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3050  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3051  put RETURN & "on mString2Symb me, str" after str
3052  put RETURN & "" after str
3053 
3054  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3055  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3056  put RETURN & "on mSymb2String me, sym" after str
3057  put RETURN & "" after str
3058 
3059  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3060  put RETURN & "-- xxxxxxxxxxxxxxxxxx put <html>, <title> and <body> tags around chunk in order to use it as html of a text member" after str
3061  put RETURN & "on mHTMLize me, str" after str
3062  put RETURN & "" after str
3063 
3064  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3065  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3066  put RETURN & "on ____DATE_FUNCTIONS" after str
3067  put RETURN & "" after str
3068 
3069  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3070  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3071  put RETURN & "on mGetWeekDay me, dateObject, lang" after str
3072  put RETURN & "" after str
3073 
3074  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3075  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3076  put RETURN & "on mGetCurrentDateAmerican me" after str
3077  put RETURN & "" after str
3078 
3079  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3080  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3081  put RETURN & "on mGetCurrentTimeAmerican me" after str
3082  put RETURN & "" after str
3083 
3084  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3085  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3086  put RETURN & "on mGetDateAmericanFormat me, dateObject" after str
3087  put RETURN & "" after str
3088 
3089  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
3090  put RETURN & "-- xxxxxxxxxxxxxxxxxx Description" after str
3091  put RETURN & "on mGetTimeAmericanFormat me, dateObject, withoutSeconds" after str
3092  put RETURN & "" after str
3093 
3094  return str
3095end
3096
3097-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3098
3099on getReferenceString me
3100  return "xscr()"
3101end
Note: See TracBrowser for help on using the repository browser.