Can't figure out how to declare a string array on multiple lines

This code caused runtime errors, but it compiled.

Local $acceptable[] = ["Chrome",_ "Firefox",_ "IE"] 

It works if I move it all on one line. However, I want to declare many elements. How to declare it in several lines?

+1
source share
1 answer

By Language Reference - Comments (highlighted by me):

Although only one statement is allowed per line, a long statement can span multiple lines if an underscore " _ " is preceded at the end of a "broken" line , followed by a blank . The definition of a string cannot be divided into several lines; you must use concatenation.

Example ( space before each underscore):

 #include <Array.au3> Global Const $g_aAcceptable[] = ["Chrome", _ "Firefox", _ "IE"] _ArrayDisplay($g_aAcceptable) 
+1
source

Source: https://habr.com/ru/post/907619/


All Articles