LoneWolf_2106 Posted June 30, 2017 Share Posted June 30, 2017 Dear all, sorry for the stupid question, i have added an ElseIf to my function and i get "Syntax error", i don't understand the reason. Global $configuration_search=_ArraySearch($content_array,"configuration",0,0,0,1,1,0) MsgBox($MB_OK, "test",@error) if @error = 6 then $folder_search[0][0] = "configuration" And $folder_search[0][1] = "not in use" ElseIf $configuration_search <> -1 Then $content_array[$configuration_search][1] = "in use" And $folder_search[0][0] = $content_array[$configuration_search][0] And $folder_search[0][1] = "in use" _ArrayDisplay($folder_search) EndIf Can anyone support me to understand? Thanks in advance Link to comment Share on other sites More sharing options...
RTFC Posted June 30, 2017 Share Posted June 30, 2017 ElseIf $configuration_search <> -1 Then $content_array[$configuration_search][1] = "in use" $folder_search[0][0] = $content_array[$configuration_search][0] $folder_search[0][1] = "in use" You can't catenate multiple statements with a logical "And" operator! My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O Link to comment Share on other sites More sharing options...
LoneWolf_2106 Posted June 30, 2017 Author Share Posted June 30, 2017 (edited) solved, "then" on one line and the rest on the bottom line ElseIf $configuration_search <> -1 Then $content_array[$configuration_search][1] = "in use" And $folder_search[0][0] = $content_array[$configuration_search][0] And $folder_search[0][1] = "in use" And then i have removed the And Edited June 30, 2017 by LoneWolf_2106 Link to comment Share on other sites More sharing options...
LoneWolf_2106 Posted June 30, 2017 Author Share Posted June 30, 2017 How can i close/delete this topic? Link to comment Share on other sites More sharing options...
LoneWolf_2106 Posted June 30, 2017 Author Share Posted June 30, 2017 Now i have another issue which also i don't understand: If the value i search for is not present in the array and i have @error=6, it doesn't write anything in the array folder_search. I have tried to show MsgBox after the if, but it seems to be totally skipped. Global $workspace_search=_ArraySearch($content_array,"workspace",0,0,0,1,1,0) MsgBox($MB_OK, "test",@error) if @error = 6 then $folder_search[7][0] = "workspace" $folder_search[7][1] = "not in use" ElseIf $workspace_search <> -1 Then $content_array[$workspace_search][1] = "in use" $folder_search[7][0] = $content_array[$workspace_search][0] $folder_search[7][1] = "in use" EndIf Can anyone try my code or explain me why the if is skipped? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 30, 2017 Developers Share Posted June 30, 2017 4 minutes ago, LoneWolf_2106 said: Can anyone try my code or explain me why the if is skipped? Don't we need to whole code to try? 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 More sharing options...
LoneWolf_2106 Posted June 30, 2017 Author Share Posted June 30, 2017 I didn't post the rest of the code, because it was just the array declaration.(the rest is just an Array having an item with a substring "workspace") Anyway i have removed the MsgBox above the if and it seems to be working, even if i don't know why that behavior. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 30, 2017 Developers Share Posted June 30, 2017 11 minutes ago, LoneWolf_2106 said: I didn't post the rest of the code, because it was just the array declaration. Doubt that ... anyway, when you want us to run/test a script, you will have to post a version that we can run without having to add code to it. 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 More sharing options...
LoneWolf_2106 Posted June 30, 2017 Author Share Posted June 30, 2017 4 minutes ago, Jos said: Doubt that ... anyway, when you want us to run/test a script, you will have to post a version that we can run without having to add code to it. Jos alright, next time i will do it, thanks for your support :-) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now