• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: what does this error mean?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what does this error mean?


  • Subject: Re: what does this error mean?
  • From: Axel Luttgens <email@hidden>
  • Date: Fri, 16 Jul 2010 10:49:48 +0200

Le 15 juil. 2010 à 17:09:03, tom wible a écrit :

>
> On Jul 15, 2010, at 10:13 AM, axel wrote:
>
>> Where exactly does that "The variable rec is not defined" error occur?
>
> that's the problem: i can't seem to get anything out that localizes it:-( and running in s.e. doesn't show the problem:-(

Hello Tom,

A quick and dirty way could be to define a handler like this one:

	on LogMessage(Msg)
		do shell script "/usr/bin/logger -t TomsScripts " & quoted form of Msg
	end LogMessage

and to call it from various relevant places so as to get some kind of trace in system.log.

For example, guessing the overall organization of your code, you should face something like this:

	on initRecList()
		-- various statements
		-- possibly calls to other handlers
	end initRecList

	on NewRec()
		script rec
			on toList(n)
				-- various statements
				-- possibly calls to other handlers
			end toList
			-- other handlers
		end script
	end NewRec

	on listTDL()
		-- various statements, with possible calls to:
		initRecList()
		rec's toList(n)
	end listTDL

You might then begin with:

	on initRecList()
		LogMessage("Entering initRecList()")
		-- various statements
		-- possibly calls to other handlers
		LogMessage("Leaving initRecList()")
	end initRecList

	on NewRec()
		script rec
			on toList(n)
				LogMessage("Entering rec's toList()")
				-- various statements
				-- possibly calls to other handlers
			end toList
			-- other handlers
			LogMessage("Leaving rec's toList()")
		end script
	end NewRec

	on listTDL()
		LogMessage("Entering listTDL()")
		-- various statements, with possible calls to:
		initRecList()
		rec's toList(n)
		LogMessage("Leaving listTDL()")
	end listTDL

and look at the last message written to system.log before the error occurs.
And so on, adding calls to LogMessage() where relevant for narrowing the location of the problematic code.

HTH,
Axel

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: what does this error mean?
      • From: "Mark J. Reed" <email@hidden>
References: 
 >what does this error mean? (From: tom wible <email@hidden>)
 >Re: what does this error mean? (From: "email@hidden" <email@hidden>)
 >Re: what does this error mean? (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: what does this error mean?
  • Next by Date: Re: Rant Generator
  • Previous by thread: Re: what does this error mean?
  • Next by thread: Re: what does this error mean?
  • Index(es):
    • Date
    • Thread