Jump to content

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


Bchaos
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Developers

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

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

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.

Link to comment
Share on other sites

  • Developers

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

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

  • Developers

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.

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

  • Developers

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

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

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