[jawsscripts] Re: An ini value retrieval problem

  • From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 21 Aug 2009 21:18:28 +0100

Hi Jitendra,

  Immediately before the line:

If IniReadInteger ("1by1", "eq_enable", 1, Spath) == 1 then

  if you arrange to speak, spell or print out the value of the variable 
Spath, do you get the exact path you expect?

  You say the ini file contains the current values for the program, yet the 
line I have quoted above is checking for the default value (only returned if 
the actual values cannot be retrieved).  Are you sure that the actual values 
are not being returned, thus activating the 'false' leg of the if statement 
every time?

  Also the script ToggleEq does not appear to change anything, unless 
TypeCurrentScriptKey alternately overwrites the ini file with the default 
value and the current one.  Is this the case?

  hth

  Martin


----- Original Message ----- 
From: "Jitendra" <jeet.invincible@xxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, August 21, 2009 7:36 PM
Subject: [jawsscripts] An ini value retrieval problem


> Hello friends, I have an ini values problem, where I am unable to get
> the value from the external file, the file holds the current values for
> the program and is located in the program's installation folder. see the
> code, it may however is a bit longer, but do help me please.
> Thank you, Jitendra.
> ;code start.
> Include "HjGlobal.jsh" ; default HJ global variables
> Include "hjconst.jsh" ; default HJ constants
> Include "common.jsm" ; message file
> Include "1by1.jsm" ;Message file for 1by1
> ;special thanks for doug lee for creating and providing the following
> modules for free.
> include "olchar.jsl"   ; Character to/from ANSI value converter,
> required by xlist.jsl
> include "olstring.jsl"   ; String manipulation utilities
> include "olutil.jsl"   ; Miscellaneous utility functions
> Void Function AutostartEvent ()
> SayString (Autostart_L)
> EndFunction
>
> int Function IsEquOn ()
> Var
> String sPath,
> String Sname,
> Object fso,
> Object File
> Let Spath = GetAppFilePath ()
> Let Sname = GetAppFileName ()
> Let Spath = stringChopRight (Spath, 9)
> Let Spath = shortenFolderPath (FSO, Spath)
> Let Sname = stringChopRight (Sname, 3)+"ini"
> Let Spath = Spath+"\\"+Sname
> If IniReadInteger ("1by1", "eq_enable", 1, Spath) == 1 then
> Return true
> Else
> Return False
> EndIf
> EndFunction
>
> Script ToggleEq ()
> if IsEquOn () then
> TypeCurrentScriptKey ()
> SayString ("off")
> Else
> TypeCurrentScriptKey ()
> SayString ("on")
> EndIf
> EndScript
>
> string Function shortenFolderPath (object ByRef fso, string fname)
> ; Convert long folder paths (names containing components not adhering to
> the old DOS 8.3 format) to short
>
> (8.3-compatible) paths.
> ; Used by CompileSkypeScripts below to avoid numerous problems with
> passing space-containing file
>
> paths through batch files.
> var
>    object oFolder
> if !fso then
> let fso = olGetFSObject()
>    if !fso then
>        ; Can't shorten, so return what we got.
>        return fname
>    endIf
> endIf
> let oFolder = fso.getFolder(fname)
> if !oFolder then
>    return fname
> endIf
> return oFolder.shortPath
> EndFunction
> ;code end.
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
>


--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.63/2317 - Release Date: 08/21/09 
06:04:00

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

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

Other related posts: