AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fixed - An illegal expression at line 70... What?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Robbo



Joined: 27 Jul 2008
Posts: 47
Location: England

PostPosted: Sat Aug 08, 2009 11:50 pm    Post subject: Fixed - An illegal expression at line 70... What? Reply with quote

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 Sun Aug 09, 2009 2:15 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
[VxE]



Joined: 07 Oct 2006
Posts: 3254
Location: Simi Valley, CA

PostPosted: Sun Aug 09, 2009 1:02 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Sun Aug 09, 2009 4:27 am    Post subject: Reply with quote

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?
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Sun Aug 09, 2009 7:04 am    Post subject: Reply with quote

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 =;
Surprised
Back to top
Robbo



Joined: 27 Jul 2008
Posts: 47
Location: England

PostPosted: Sun Aug 09, 2009 9:48 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Robbo



Joined: 27 Jul 2008
Posts: 47
Location: England

PostPosted: Sun Aug 09, 2009 9:56 am    Post subject: Reply with quote

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 Shocked

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.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
SpiderGames



Joined: 09 Jun 2008
Posts: 936
Location: Canada

PostPosted: Sun Aug 09, 2009 1:47 pm    Post subject: Reply with quote

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.
_________________

I know i have 6 legs. It's cuz I'm special.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Robbo



Joined: 27 Jul 2008
Posts: 47
Location: England

PostPosted: Sun Aug 09, 2009 2:14 pm    Post subject: Reply with quote

Hey to you to Razz . 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.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group