[jawsscripts] Re: ScheduleFunction passing function with parameter

Hi Alice,

It's possible to separate out the scheduling of a function and the passing of a parameter by scheduling a dummy function which then makes a simple function call to the real function. The latter call can include the parameter.

 hth

Martin


----- Original Message ----- From: "Smith, Alice A. HQ DCO" <Alice.A.Smith@xxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, December 21, 2007 8:19 PM
Subject: [jawsscripts] ScheduleFunction passing function with parameter


Hi All,

I am having a problem getting all of a scheduled function with a
parameter to fire in JAWS 9.0.515 in XP Pro.
Can anyone see where the problem is? I've included a vastly simplified
version of the code. Trust me, there is really a good reason I want to
do this. I'll check back on the 27th. Thanks in advance and Happy
Holidays!

Alice

Setup: Open a notepad file and fill it full of several pages of text.
Then create a frame about 3 lines high and 5 or 6 words wide in the
middle of the window. NewTextEvent will fire when you switch to notepad
and when you page down.

NotePad script
;Notepad.jss
;12/21/07

Include "HjGlobal.jsh" ; default HJ global variables
Include "hjconst.jsh" ; default HJ constants
Include "HjHelp.jsh" ; Help Topic Constants
Include "common.jsm" ; message file

Void Function SayASentence (int nMidScreenOnly)
Var
String sNewText
SayString("In say a sentence")
Let sNewText = "New text in MidScreen Frame"
If nMidScreenOnly then
SayString ("N Mid Screen Only is true")
SayString(sNewText)
EndIf
EndFunction


Void Function NewTextEvent (handle hwnd, string buffer, int nAttributes,
int nTextColor, int nBackgroundColor, int nEcho, string sFrameName)
Var
handle hWinSwitch,
string sMidScreenText,
int nScheduled

If sFrameName == "MidScreen1"  then
Let nScheduled = ScheduleFunction ("SayASentence(TRUE)", 2)
;If nScheduled then SayString("YES") Else SayString("Not") EndIf
EndIf

EndFunction


" I have learned the novice can often see things that the expert
overlooks. All that is necessary is not to be afraid of making mistakes,
or of appearing naive."
Abraham Maslow
<http://www.woopidoo.com/business_quotes/authors/abraham-maslow/index.ht
m>





__________ 
View the list's information and change your settings at http://www.freelists.org/list/jawsscripts

Other related posts: