Sign in to follow this  
Followers 0
Bchaos

Help!Help!Help! Syntax ERROR ?? Help!Help!

9 posts in this topic

I write "IniWrite ( "Config.ini", "Other", "L Rot Count", $Input1 )"

and the result is [Other]

L Rot Count=51

But when i run the script this comes up:

C..\Config.ini(29,1) : ERROR: syntax error

[

^

C..\Need GUI!.au3 - 1 error(s), 0 warning(s)

!>16:39:18 AU3Check ended.rc:2

>Exit code: 0 Time: 2.442

I would appreciate any one's help thanks.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I write "IniWrite ( "Config.ini", "Other", "L Rot Count", $Input1 )"

and the result is [Other]

L Rot Count=51

But when i run the script this comes up:

C..\Config.ini(29,1) : ERROR: syntax error

[

^

C..\Need GUI!.au3 - 1 error(s), 0 warning(s)

!>16:39:18 AU3Check ended.rc:2

>Exit code: 0 Time: 2.442

I would appreciate any one's help thanks.

1. Quit using these descriptive impatient sounding thread titles.

2.Are you including the inifile or what are you exactly doing?

3. post the code snippet you get the error for.

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

1. Quit using these descriptive impatient sounding thread titles.

2.Are you including the inifile or what are you exactly doing?

3. post the code snippet you get the error for.

Ok the whole code is quiet large(mainly because of the size of the gui)

so i shortened it below to what i basically want to do.

;; first i have an input in my gui 
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Include <NomadMemory.au3>
#Include <Config.ini>
#Include <Misc.au3>

GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input1 = GUICtrlCreateInput("Input1", 200, 168, 49, 21)
GUISetState(@SW_SHOW)

;;then i save that input to .ini file
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
Exit
Case $Input1
        IniWrite ( "Config.ini", "Other", "L Rot Count", $Input1 )

;;;i then try to read function back so that i can use the value  

Func _select()
if $Select=0 then
    $Rotcount = Iniread ( "Config.ini", "Other", "L Rot Count", $Input1 )
    $StartcountSEQ = 1
endif
EndSwitch
WEnd
EndFunc

Its ok when i run 1st time but when i try run the second time it says syntax error..

Also iam trying to return a numerical value from the .ini file.

Thanks.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Is this supposed to give the same error as you posted in your first post?

This is the result when I run your snippet through Tidy:

;; first i have an input in my gui
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
#include <Config.ini>
#include <Misc.au3>

GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input1 = GUICtrlCreateInput("Input1", 200, 168, 49, 21)
GUISetState(@SW_SHOW)

;;then i save that input to .ini file
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Input1
            IniWrite("Config.ini", "Other", "L Rot Count", $Input1)

            ;;;i then try to read function back so that i can use the value

;### Tidy Error -> case Not closed before "Func" statement.
;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.
            Func _select()
                If $Select = 0 Then
                    $Rotcount = IniRead("Config.ini", "Other", "L Rot Count", $Input1)
                    $StartcountSEQ = 1
                EndIf
;### Tidy Error -> "endswitch" is closing previous "case" on line 20
        EndSwitch
;### Tidy Error -> "wend" is closing previous "switch" on line 19
    WEnd
;### Tidy Error -> "endfunc" is closing previous "while" on line 17
EndFunc   ;==>_select

One thing you need to do is use GuiCtrlRead($input1) to read the content of the control.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

OK i am going to try and fix it up from what you said.

If i have any more prob i will create a new post thanks Jos :mellow:

!!!Peace!!!

Share this post


Link to post
Share on other sites

OK i am going to try and fix it up from what you said.

If i have any more prob i will create a new post thanks Jos :mellow:

!!!Peace!!!

sorry one more thing what are all the possible reasons why it would say syntax error?

Share this post


Link to post
Share on other sites

sorry one more thing what are all the possible reasons why it would say syntax error?

ehhh.. i would say you specify the command/function wrongly?

Just check the syntax and compare it with the documentation in the helpfile.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Almost exact the same :mellow:

ill just have to change the method :(

Share this post


Link to post
Share on other sites

Almost exact the same :mellow:

ill just have to change the method :(

What are you talking about?

A syntax error means YOU have done something wrong and only requires normally to code it correctly.

As long as you do not post anything you have problems with, we will unable to help you.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0