Jump to content

quotes and variables


Recommended Posts

I don't know why but i always seem to have trouble with quotes and variables. I have a variable $CurrentCursor which contains the path to the current mouse cursor being used. Rather than the script reading this variable as windows\cursors\mycursor.cur I need it to be read as "windows\cursors\mycursor.cur". I've tried doubling up quotes around the variable but this doesn't work. The part of the script is as follows:

$Cursor = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", $CurrentCursor)

Can anyone help?

Link to comment
Share on other sites

  • Developers

Are you sure you need those quotes around it or is the path incorrect?

anyways:

$Cursor = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", '"' & $CurrentCursor & '"')
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

$Cursor = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", """" & $CurrentCursor & """")

Remember:

" "" " is a ", I condense it to get """"

alternatively use combinations of ' and "

$Cursor = DllCall('user32.dll', 'int', 'LoadCursorFromFile', 'str', '"' & $CurrentCursor & '"')

' " ' used here.

MDiesel

Edit: a close second place. :)

Edited by mdiesel
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...