Handler called in library can only used passed variables?

I have been redoing a 3000-line program to put handlers in an assortment of libraries.
I've been getting a lot of variable undefined errors after calls to the handlers in the library.
Previously, I declared global variables and the handlers, when they were in the same script, had no problem with them.
Global variables do not seem to include handlers in called libraries as part of their scope.
In fact, I can't even Set a new variable in one of these handlers, unless it has first been passed as a parameter in the handler call.
For example, variable var1 in handler HandyHandler
set var1 to 1
results in a variable undefined error unless I call the handler:
HandyHandler(var1)
thus passing the variable from the main script.
This is more than a little awkward.
Is my perception correct:  all variables in a handler must be defined in the calling script and passed as parameters?

Hello
It's hard to make advice without seeing actual codes. The boiled down essential version to demonstrate the problem would suffice. Also it might help to read the examples and explanations in the following threads.
Externalise functions into a library
https://discussions.apple.com/thread/5116224?tstart=0
tell/scoping problem
https://discussions.apple.com/thread/2477010?start=0&tstart=0
Re: re: my parent
https://discussions.apple.com/message/11852193
Regards,
H
Message was edited by: Hiroto (fixed the last link, but it still may not work...)

Similar Messages

  • I have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    i have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    Chris, I believe this link may have the information you're looking for. Welcome to discussions!
    http://docs.info.apple.com/article.html?artnum=300432

  • Is there any other ways to check whether is my phone faulty or my sim card issue. I can only use it for call, my network to 3G or 4G suddenly cannot use.

    Is there any other ways to check whether is my phone faulty or my sim card issue. I can only use it for call, my network to 3G or 4G suddenly cannot use. This happen since yesterday, suddenly can use but suddenly cut off. Called Telco and they reset account but still same.

    See this
    http://support.apple.com/kb/TS4148

  • HT201328 I have brought an iPhone 5 and did a sim swap with my orange contract (EE) since putting the sim in I can only use my 3G, iMessage and apple ID...can't send or receive calls or txt, what can I do?? I'm running on ios 6.1.3.

    I have brought an iPhone 5 and did a sim swap with my orange contract (EE) since putting the sim in I can only use my 3G, iMessage and apple ID...can't send or receive calls or txt, what can I do?? I'm running on ios 6.1.3.

    Contact the carrier and confirm the account is provisioned correctly.

  • How to play itunes music library from iMac using apple remote? Can only use my iPhone as a REMOTE to play on itunes to Apple TV!!

    how can i how can I play itunes library on my IPHONE4 from IMAC using APPLE REMOTE? I can only use my iPhone 4 as a REMOTE to play itunes from IMac to APPLE TV. 

    You cannot.  The remote app is exclusively for remotely controlling an apple tv for playback of a library on your computer.  If you want to play your computer's music on your iPhone you just use home sharing on both devices and play the music in the Music app on your phone, not using the Remote app on your phone.
    Source:
    Set up Remote app for iPhone, iPad, and iPod touch - Apple Support

  • I received a call but i can only hear if i use the speacker or the hands free

    Ireceived a call but i can only hear if use the speacker or the handfree.

    Look and see if you are in headset mode

  • TS1286 cannot hear voices en phone call can only use headset

    cannot hear voices en phone call can only use headset

    try to switch to loudspeaker mode. If both loudspeaker and normal mode doesn't work, then ur speaker would be damaged. Visit your nearest apple service center.

  • I seem to have lost carrier settings on my iPad1,I've tried a restore and update but get a message about the original sim card,which I still have but is inactive,really inconvenient as I can only use in wifi spots and off line mode,please help,sibear.

    I seem to have lost carrier settings on my iPad1,I've tried a restore and update but get a message about the original sim card,which I still have but is inactive,really inconvenient as I can only use in wifi spots and off line mode,please help,sibear.

    You might want to download something called an undelete utility. These can find files and recover them even after they appear to have been lost. There are some undelete utility programs that are free. Look at tucows.com
    Also, it appears that you have POSSIBLY overwritten the actual files, which you moved manually, with I don't know what, which you moved in PSE's folder location view.
    Next, in the future ... NEVER (that's: don't even think about it) move your photos in Windows. NEVER. NEVER. Not ever. Not once. This always (that's ALWAYS, as in 100% of the time) causes problems and usually makes things difficult to fix.
    Lastly ... make regular backups! I must say this in the forums about seventy bazillion times a month. Make regular backups! Regular depends on how often you take photographs and edit them. Since my photographic activity usually happens on the weekends, I make backups every Sunday night. You may need a different schedule, depending on your activity level. MAKE REGULAR BACKUPS!

  • How can i detach the video from a clip so i can only use the audio when using imovie?

    how can i detach the video from a clip so i can only use the audio when using imovie?

    First, go to iMovie/Preferences and enable the Advanced Tools.
    Import the video clip into an iMovie Event. When you get ready to use it in an iMovie Project, select the clip in the Event and drag & drop it on top of a video or photo clip in the project at the place where you want it to begin. When the pop-up menu appears, choose Audio Only.

  • With 10.2 I can only use system speaker output for audio, NOT my RME FF400 I used previously. The FF400 works fine with other apps. How can I set this device in FCP 10.2? (it is set in both system preferences and midi)

    With 10.2 I can only use a system (e.g. speaker) output for audio, NOT my RME FF400 I used without any problems previously. The FF400 works fine with other apps (some like TwistedWave) setup in the program, and others (like Spotify) using system preferences & audio midi setup. How can I set the FF400 to be the sound output device in FCP 10.2? N.B. The FF400 is set as sound output device in both system preferences and audio midi setup.

    From the fcp.co forum. See if this does anything for you.
    simon_hutchings
    OFFLINE
    Junior Boarder
    Posts: 24
    Thank you received: 5
    Karma: 1
    I have the solution! Well it at least worked for me. This is the response I got from Apple, Can you please try the following steps towards fixing your audio issue, and report back with your results?
    1. Open the application Audio Midi Setup (located in Applications : Utilities)
    2. Select the Output Tab for the current output device
    3. Select the Configure Speakers option
    4. Select the Multichannel tab
    5. Change the setting to Stereo Now mine was set to stereo but the left channel wasn't showing left. re-clicking on stereo reloaded the settings and after clicking apply it worked. 

  • I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. don't need the caps/lock or ctrl key and due to an injury my daughter can only use her left hand to type. She is using a text to speech app to verbaliz

    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. I don't need the caps/lock or ctrl key. Due to a brain injury my daughter can only use her left hand to type. She also uses a text to speech app to verbalize all of her needs since her speech isn't intelligible any longer either. And her vision was significantly affected also, so the keyboard has to be mounted about 6 inches from her face. So to reach across the keyboard with her left hand to the right side delete and enter button is physically difficult and causes typing errors, which cause people to not understand what shes trying to say.
    The best keyboard so far is the Zagg folio mini. I just had to make stickers to enlarge the letters on the key buttons.
    Does anyone know how I can reprogram these two keys? Or where I can buy a wireless mini keyboard for Ipad made for lefthanders with these two functions on the left side. I have searched for days and days. It's sooooo important to me that she be able to contribute her voice again. Imagine if you got in a car accident and couldn't speak clearly any longer, but understood everything still. Thanks for any help and suggestions you all take the time to share with me. I really appreciate the kindness of strangers to help me help my daughter.
    Sami's mom

    Sami\'s mom wrote:
    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini.
    You cannot.

  • I can only use Flash Player in one tab at a time, only on Firefox.

    Recently, when I downloaded the new Flash Player, I can only use flash player in one tab at a time. This is only in firefox. I'll open youtube, and the visual and sound both play perfectly. I open up a new tab, begin using a flash website in that tab, and the youtube sound is quiet, only the visual continues to play. I need to multitask with flash sometimes, and this is a big problem for me. Help!

    By default, Flash 11.3 and higher will spin up a lot of distinct processes. You should be able to get quite a cacophony going.
    Have you ever done any troubleshooting that involves changing how Firefox works with plugin-container.exe or the Flash player's protected mode?
    Often it is helpful to disable hardware graphics acceleration in Firefox and in Flash:
    (A) In Firefox, un-check the box here and restart:
    orange Firefox button (or Tools menu) > Options > Advanced > General > "Use hardware acceleration when available"
    (B) In Flash, see this support article from Adobe: http://helpx.adobe.com/flash-player/kb/video-playback-issues.html#main_Solve_video_playback_issues
    Unrelated, but you can remove the Java Console extensions unless you are a Java developer (and even then, you probably don't need the old ones):
    orange Firefox button (or Tools menu) > Add-ons > Extensions category

  • I just downloaded ios7 now i can only use the phone with the speaker, how can i fix this?

    I just downloaded ios7 now i can only use the phone with speaker, how can i fix this?

    x

  • Since installing an icon-editing add-on, I can't open tabs any more / I can only use one tab at a time.

    Ever since I installed the add-on Favicon Picker 2 that lets you change the bookmark icons, I can't open tabs any more. The second tab will open, but if you try to go to a site, the FIRST tab redirects to that site. Basically, I can only use one tab at a time. Is there any way I can keep this add-on and use tabs?

    Oh, wow - look at that, you're right :) I didn't want to uninstall the add-on as I like the feature, but simply by disabling it you can keep the new icons AND use tabs. Thanks dude!
    (The add-on is Favicon Picker 2 0.6.2.15 by the way - some of the user reviews report the same problem.)

  • 2 atv's both have home sharing enabled but one asks to turn on home sharing on my pc but it is on so can only use one at a time to watch movies from my computer

    2 atv's both have home sharing enabled but one asks to turn on home sharing on my pc, but it is enabled on pc so I  can only use one at a time to watch movies from my computer

    Both atv,s are on the same network, they are wirless and the computer can see them and they are named different.
    what ever one i switch on first gets to stream from my computer and the other one asks for home sharing to be switched on, then if i switch both off and start the other one first it gets to stream and the other one which worked asks for home sharing to be turned on. i have hidden all functionality, netflix etc as these are for my 7yr old kids.

Maybe you are looking for