Jump to content

Syntax Error: Illegal Text: One Statement Per Line


Recommended Posts

Simple question.. obscured to my eyes but probably a simple answer. How do I correct this error?

;;;;;;;;;;gui which takes cityid input from user until i improve the code to find it myself;;;;;;;;;;
Func cityinput()
Local $a,$a1,$a2,$a3,$a4,$a5,$ci0,$ci1,$ci2,$ci3,$ci4,$ci5
    GuiCreate("Ikariam City ID's.", 350, 200)
    $s=GuiSetState(@sw_show)
    GuiCtrlCreateLabel("Input City1 ID Here",20,10)
    GuiCtrlCreateLabel("Input City2 ID Here",20,60)
    GuiCtrlCreateLabel("Input City3 ID Here",125,10)
    GUICtrlCreateLabel("Input City4 ID Here",125,60)
    GuiCtrlCreateLabel("Input City5 ID Here",230,10)
    GuiCtrlCreateLabel("Input City6 ID Here",230,60)
    $ci0=GUICtrlCreateInput($a,20,30,100,20)
    $ci1=GUICtrlCreateInput($a1,20,80,100,20)
    $ci2=GuiCtrlCreateInput($a2,125,30,100,20)
    $ci3=GuiCtrlCreateInput($a3,125,80,100,20)
    $ci4=GuiCtrlCreateInput($a4,230,30)
    $ci5=GUICtrlCreateInput($a5,230,80)
    $button1=GuiCtrlCreateButton("Store", 270,165,60,20)
    GuiCtrlCreateLabel("The city id can be found by right clicking on Show Town",25,110)
    GuiCtrlCreateLabel("and clicking Properties, city by city.",25,125)
    While 1
        Local $msg=GUIGetMsg()
        Select
            Case $msg=$button1
                GuiCtrlRead($s)=0
        EndSelect       
    WEnd
EndFunc

cityinput()

C:\Documents and Settings\...\Desktop\Script Library\Project IkaLate\ActionTest.au3 (27) : ==> Illegal text at the end of statement (one statement per line).:

GuiCtrlRead($s)=0

GuiCtrlRead($s)^ ERROR

Edited by myxomatosii
Link to comment
Share on other sites

Simple question.. obscured to my eyes but probably a simple answer. How do I correct this error?

;;;;;;;;;;gui which takes cityid input from user until i improve the code to find it myself;;;;;;;;;;
 Func cityinput()
 Local $a,$a1,$a2,$a3,$a4,$a5,$ci0,$ci1,$ci2,$ci3,$ci4,$ci5
     GuiCreate("Ikariam City ID's.", 350, 200)
     $s=GuiSetState(@sw_show)
     GuiCtrlCreateLabel("Input City1 ID Here",20,10)
     GuiCtrlCreateLabel("Input City2 ID Here",20,60)
     GuiCtrlCreateLabel("Input City3 ID Here",125,10)
     GUICtrlCreateLabel("Input City4 ID Here",125,60)
     GuiCtrlCreateLabel("Input City5 ID Here",230,10)
     GuiCtrlCreateLabel("Input City6 ID Here",230,60)
     $ci0=GUICtrlCreateInput($a,20,30,100,20)
     $ci1=GUICtrlCreateInput($a1,20,80,100,20)
     $ci2=GuiCtrlCreateInput($a2,125,30,100,20)
     $ci3=GuiCtrlCreateInput($a3,125,80,100,20)
     $ci4=GuiCtrlCreateInput($a4,230,30)
     $ci5=GUICtrlCreateInput($a5,230,80)
     $button1=GuiCtrlCreateButton("Store", 270,165,60,20)
     GuiCtrlCreateLabel("The city id can be found by right clicking on Show Town",25,110)
     GuiCtrlCreateLabel("and clicking Properties, city by city.",25,125)
     While 1
         Local $msg=GUIGetMsg()
         Select
             Case $msg=$button1
                 GuiCtrlRead($s)=0
         EndSelect      
     WEnd
 EndFunc
 
 cityinput()

C:\Documents and Settings\...\Desktop\Script Library\Project IkaLate\ActionTest.au3 (27) : ==> Illegal text at the end of statement (one statement per line).:

GuiCtrlRead($s)=0

GuiCtrlRead($s)^ ERROR

Well the line

GuiCtrlRead($s)=0

isn't a valid statement and I can't guess what you want to happen there. What do you want to be done by that line?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Oh. Well I am indirectly getting the result that I want.

I'm trying to change the state of @sw_show to @sw_hide

so I...

$s=GuiSetState(@sw_show)

GuiCtrlRead($s)=0

and I thought that would give me the result of changing it from true to false, hiding the window.

Anyway, some how it is working. But I am not sure how.

There is probably a better way to do it, I just like to try to figure things out myself before asking questions.

Link to comment
Share on other sites

Oh. Well I am indirectly getting the result that I want.

I'm trying to change the state of @sw_show to @sw_hide

so I...

$s=GuiSetState(@sw_show)

GuiCtrlRead($s)=0

and I thought that would give me the result of changing it from true to false, hiding the window.

Anyway, some how it is working. But I am not sure how.

There is probably a better way to do it, I just like to try to figure things out myself before asking questions.

To hide

GuiSetState(@SW_HIDE)

The return from GuiSetState is either 0 or 1 so $s will be 1.

GuiCtrlRead(1) tries to read the control with ID 1, and setting that result to be 0 makes no sense to me.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...