[jawsscripts] Re: RUN function in JAWS Basic

  • From: Csaba Godo <arpadhazi68.jawsul@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Sat, 16 Nov 2013 16:00:15 +0100




Hi Paul,

Thanks for your piece of advice. Now I have played a little with my INI 
file and I have expected that all of the version you can see below were 
accepted by the compiler:

Ini entries:
V1.: Path=C:\Program Files\Fro ; it contains only one backslash
V2.: C:\\Program Files\\Fro ; In this path are backslashes doubled.
V3.: C:\Program Files\\Fro ; This is the most interesting, because the 
first backslash after the drive letter is simple, but the secont, after 
Program Files directory name is double.

In the program code they were used as follows:
sPath = IniReadString (...)
sPath = "\" + sPath + "\""

So it seemms, if the quote is escaped then the compiler accepts any form 
of backslashing. But without te escaped quote the compiler accepted only 
the version with double backslash. Good to know!

Thanks again!
Regards,

Csaba

2013.11.16. 13:09 keltezéssel, Paul Magill írta:
> Hi Csaba,
>
> I think that the file paths in the .INI file being read by your script, will
> not need double backslashes.
>
> It is my understanding that, only quoted file paths being directly read by
> the script compiler need double backslashes.
> That is, those within script or function bodies, or in constants or globals
> within the .JSS, JSM or .JSH files.
>
> File paths read from an .INI file for example, are read at runtime, & not by
> the compiler, so do not need double backslashes.
>
> See the sample .INI file below the following script:
>
> Script TestOnF9 ()
> VAR
> string TestPath
>
> let TestPath = IniReadString ("sample paths", "path1", "", "h:\\sample.ini")
>
> run ("\"" + TestPath  + "\"")
> EndScript
>
> The sample.ini file:
> [sample paths]
> path1=C:\Program Files\Freedom Scientific\FSReader\2.0\FSReader.exe
>
> Regards,
> Paul from Australia
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Csaba Godo
> Sent: Saturday, 16 November 2013 4:32 AM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: RUN function in JAWS Basic
>
>
> Thanks, Doug! The solution you have proposed me works well, so the following
> lines are enough to get the right path to pass to the RUN
> function:
>
> sPath = IniReadString (gsSection, "Path", "", gsIniFile) sPath = "\"" +
> sPath + "\""
> Run (sPath)
>
> So the user can simply save the desired pathes into the INI file with double
> backslashing and the spaces in the path have no importance.
>
> Csaba
>
>
> __________�
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
>
__________�

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

Other related posts: