AutoHotkey Community

It is currently May 26th, 2012, 9:31 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: August 9th, 2009, 12:50 am 
Offline

Joined: July 27th, 2008, 7:31 am
Posts: 47
Location: England
I'm having trouble with part of a script. Error at line 70 - ";" is an illegal expression. I've cut a couple of lines of the script so you won't need the files to run it. If anyone can tell me why it keeps exiting after giving me that error message and how I can fix it I would be very grateful.

Code:
Gui, Add, Button, x405 y580 w100 h20, Apply
Gui, Add, Button, x300 y580 w100 h20, Cancel
Gui, Add, Button, x195 y580 w100 h20, OK
Gui, Add, Tab, x5 y10 w490 h540 +Theme -Background, General|Command Prompt|Task Manager|Run Command


;--------------------GENERAL TAB--------------------;

Gui, Tab, General

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Icon 48x48.JPG

Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans, Here you can change the settings or revert the taskbar back to its installation settings.

IniRead, Setpx, C:\Users\Public\Documents\R Taskbar V2\Configuration Settings\R Taskbar Configuration Settings.ini, General, Coords
Gui, Add, GroupBox, x25 y100 w440 h100, Co-ordinates
Gui, Add, Text, x30 y115 w430 BackgroundTrans, At default the taskbar is set to appear 60 pixels (px) above the bottom of your screen. You can change this

setting here:
Gui, Add, Text, x30 y150 BackgroundTrans, Place the taskbar
Gui, Add, Edit, x+3 y150 BackgroundTrans Limit2 vPxlevel, %Setpx%
Gui, Add, Text, x+3 y150 BackgroundTrans, px above the bottom of my screen.

IniRead, Setpass, C:\Users\Public\Documents\R Taskbar V2\Configuration Settings\R Taskbar Configuration Settings.ini, General, Passwordset
If Setpass = 0
{
Gui, Add, GroupBox, x30 y270 w210 h100, New Password
Gui, Add, Edit, x35 y290 w100 Password vOpenpass1,
Gui, Add, Text, x+3 y290 +BackgroundTrans vPasstext1, New Password
Gui, Add, Edit, x35 y315 w100 Password vOpenpass2,
Gui, Add, Text, x+3 y315 +BackgroundTrans vPasstext2, Confirm Password
Gui, Add, Groupbox, x250 y270 w210 h100, Change Current Password
Gui, Add, Edit, x255 y290 w100 Password Disabled vChangepass1,
Gui, Add, Text, x+3 y290 +BackgroundTrans Disabled vCpasstext1, New Password
Gui, Add, Edit, x255 y315 w100 Password Disabled vChangepass2,
Gui, Add, Text, x+3 y315 +BackgroundTrans Disabled vCpasstext2, Confirm Password
Gui, Add, Groupbox, x30 y375 w430 h45, Remove Current Password
Gui, Add, Edit, x35 y395 Password Disabled vRemovepass,
Gui, Add, Text, x+3 y395 +BackgroundTrans Disabled vRpasstext1, Enter your current password and select "Apply" to remove it.
}
If Setpass = 1
{
Gui, Add, GroupBox, x30 y270 w210 h100, New Password
Gui, Add, Edit, x35 y290 w100 Password vOpenpass1 Disabled,
Gui, Add, Text, x+3 y290 +BackgroundTrans vPasstext1 Disabled, New Password
Gui, Add, Edit, x35 y315 w100 Password vOpenpass2 Disabled,
Gui, Add, Text, x+3 y315 +BackgroundTrans vPasstext2 Disabled, Confirm Password
Gui, Add, Groupbox, x250 y270 w210 h100, Change Current Password
Gui, Add, Edit, x255 y290 w100 Password vChangepass1,
Gui, Add, Text, x+3 y290 +BackgroundTrans vCpasstext1, New Password
Gui, Add, Edit, x255 y315 w100 Password vChangepass2,
Gui, Add, Text, x+3 y315 +BackgroundTrans vCpasstext2, Confirm Password
Gui, Add, Groupbox, x30 y375 w430 h45, Remove Current Password
Gui, Add, Edit, x35 y395 Password vRemovepass,
Gui, Add, Text, x+3 y395 +BackgroundTrans vRpasstext1, Enter your current password and select "Apply" to remove it.
}

Gui, Add, GroupBox, x25 y435 w440 h100, Suggestions?
Gui, Add, Text, x30 y450 w430 BackgroundTrans, If you have found any bugs, glitches or etc; have an idea on how to improve aspects of the taskbar or have any

additions you would like to see, e-mail me here:
Gui, Add, Text, x30 y480 cBlue gRmail +BackgroundTrans, **********************
Gui, Add, Text, x30 y500 +BackgroundTrans, R Taskbar V2.0 - Created by *****

;--------------------COMMAND PROMPT TAB--------------------;

Gui, Tab, Command Prompt

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Command Prompt W 20x20.jpg

Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans, Here you can change the settings for the Command Prompt such as where to locate the file or revert it back

to its installation settings.


;--------------------TASK MANAGER TAB--------------------;



Gui, Tab, Task Manager

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Task Manager W 20x20.jpg

Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans, Here you can change the settings for the Task Manager such as where to locate the file or revert it back

to its installation settings.


;--------------------RUN COMMAND TAB--------------------;

Gui, Tab, Run Command

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Run Prompt W 20x20.jpg

Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans, Here you can change the settings for the Run Command such as where to locate the file or revert it back to

its installation settings.


Gui, Show, w510 h610, R Taskbar - Configure
Return,

;--------------------CONFIGURE--------------------;

ButtonOk:
Clickok = 1
GoSub Setbuttonselect
Return,

ButtonApply:
Clickok = 0
GoSub Setbuttonselect
Return,

Setbuttonselect:
If Clickok = 1
{
If Setpass = 1
{
If Changepass1 !=
{
If Changepass1 = %Changepass2%
{
IniWrite, %Changepass1%, C:\Users\Public\Documents\R Taskbar V2\Configuration Settings\R Taskbar Configuration Settings.ini, General, Password
MsgBox, Your password has been changed.
}
}
If Removepass = %Curpass%
{
Curpass =
MsgBox, Your password has been removed.
}
IniWrite, %Setpx%, C:\Users\Public\Documents\R Taskbar V2\Configuration Settings\R Taskbar Configuration Settings.ini, General, Coords
ExitApp
}

Rmail:
Return,


Please note: I am in no way intrested in improving the general script other than fixing this problem. Thanks in advance.

This code has been tested and does not work

_________________
All scripts are untested unless otherwise mentioned.


Last edited by Robbo on August 9th, 2009, 3:15 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 2:02 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
I could not reproduce that error with the code you posted, even after fixing the mismatched braces in the 'Setbuttonselect' subroutine and rejoining the extra-long lines.

As a consideration to maintainability, I recommend that you indent code blocks and use continuation sections for text that is longer than 50 characters, for example:
Code:
Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans,
   ( C Ltrim Join%A_Space%
            ; C = Allow comments. Ltrim = ignore indentation whitespace.
            ; Join%A_Space% = use a space in between each line instead of a newline/cr
      Here you can change the settings for the Command Prompt such as
      where to locate the file or revert it back to its installation settings.
   )

Perhaps making these changes will fix the error...

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 5:27 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Is this the line you're having trouble with?

Code:
Gui, Add, Text, x30 y450 w430 BackgroundTrans, If you have found any bugs, glitches or etc; have an idea on how to improve aspects of the taskbar or have any


If it is did you try escaping the semi-colon?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 8:04 am 
sinkfaze wrote:
If it is did you try escaping the semi-colon?

For future reference:
Quote:
Notes for AutoIt v2 Users
However, a semicolon is not considered a comment unless there is at least one space or tab to the left of it. If there's ever a need to have a literal semicolon with a space or tab to its left, you can escape it by preceding it with an accent/backtick (`). In both of the following examples, a literal semicolon is stored in the variable:
var = `;
var =;
:o


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 10:48 am 
Offline

Joined: July 27th, 2008, 7:31 am
Posts: 47
Location: England
After process of trial and error this is the part of the script that is causing the problem.

Code:
Gui, Tab, Task Manager

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Task Manager W 20x20.jpg


;--------------------RUN COMMAND TAB--------------------;

Gui, Tab, Run Command

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Run Prompt W 20x20.jpg

Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans, Here you can change the settings for the Run Command such as where to locate the file or revert it back to

its installation settings.


Gui, Show, w510 h610, R Taskbar - Configure
Return,

;--------------------COMMAND PROMPT TAB--------------------;

Gui, Tab, Command Prompt

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Command Prompt W 20x20.jpg

Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans, Here you can change the settings for the Command Prompt such as where to locate the file or revert it back

to its installation settings.


;--------------------TASK MANAGER TAB--------------------;



Gui, Tab, Task Manager

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Task Manager W 20x20.jpg


;--------------------RUN COMMAND TAB--------------------;

Gui, Tab, Run Command

Gui, Add, Picture, x25 y50 w40 h40 , C:\Program Files\R Taskbar V2\Configuration Settings\Image Files\Run Prompt W 20x20.jpg

Gui, Add, Text, x75 y60 w390 h30 +BackgroundTrans, Here you can change the settings for the Run Command such as where to locate the file or revert it back to

its installation settings.


I'm still searching for the reason it's causing the problem.

Thanks [VxE] for the idea of improving it, but for now, same applies - I'm not looking for ways of improving it other than fixing this problem.

@sinkfaze It turns out there's no trouble with that line and its ";".

Thanks in advance.

_________________
All scripts are untested unless otherwise mentioned.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 10:56 am 
Offline

Joined: July 27th, 2008, 7:31 am
Posts: 47
Location: England
And after even more random guessing, it's this line:

Code:
;--------------------TASK MANAGER TAB--------------------;


Quite frankly I want to know why that is causing problems with the rest of the script. In my case, if removed from the script, the script works no problem :shock:

Edit: After it started working again, I made some slight changes, namely moving some controls on the general tab. I put back in the ";--------------------TASK MANAGER TAB--------------------;" and all was fine! Now I'm just plain confused...

_________________
All scripts are untested unless otherwise mentioned.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 2:47 pm 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
Hey Robbo. It might be because it thinks you want to Double comment that line? Its a weird problem your script worked fine when i tryed to run it.

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 3:14 pm 
Offline

Joined: July 27th, 2008, 7:31 am
Posts: 47
Location: England
Hey to you to :P . That can't be the problem as none of the other comments like that haven't had any problems. Nice to hear from you - haven't been on AHK Forums for a while. Any way, problem's fixed now. Though why I don't know lol.

_________________
All scripts are untested unless otherwise mentioned.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google [Bot], JSLover, SKAN and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group