Skip to main content

Timeline for Find an Illegal String

Current License: CC BY-SA 3.0

12 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited CommunityBot
Commonmark migration
Jul 23, 2017 at 15:44 comment added Taylor Raine @MegaMan I am not sure what you mean ... I'll just take that as a joke
Jul 23, 2017 at 8:19 comment added univalence In VBA, every string is illegal and results in an error...
Jul 21, 2017 at 12:46 comment added Taylor Raine Yes, that would cause an error. example test code function myfunction( _\n_ (slightly changed from your example as you cannot have a _ directly following a ( or any other character - I believe that this is why this works in VBA) - of note is that function myfunction( _\n _... would be valid (note the added space)
Jul 21, 2017 at 12:40 comment added Deduplicator so, myfunction(_ (newline) _ (newline) ) would be an error?
Jul 21, 2017 at 12:35 comment added Taylor Raine @Deduplicator I am not sue what you mean. There is no way to escape a newline (or any character) in VBA so it should not be necessary to add a newline before, and appending literally anything to the end of this VBA code will cause the illegal character error - eg \n_"test", \n_12321 , \n_#if, \n__ and \n_\n will all result in the the error as will all of the above with any prepended code
Jul 20, 2017 at 21:34 comment added Deduplicator Ok, in that case it's more like myfunction( _ \n_ ). Sorry for the confusion. To put it another way, you should have used two newlines.
Jul 20, 2017 at 21:00 comment added Taylor Raine @Deduplicator the line continuation character must be on the same line as it is continuing ie Public Function Foo( ByVal bar as Integer, _ (new line) bas as long) as double - so yes, it would result in an error if you called the function you described
Jul 20, 2017 at 20:00 comment added Deduplicator What if it is embedded like this: myfunction( \n_ )?
Jul 20, 2017 at 19:48 comment added Taylor Raine @Deduplicator it already has a new line, - it does not matter what follows the _, only that there is no valid line to the left or above it
Jul 20, 2017 at 19:18 comment added Deduplicator You do depend on your pattern starting on a new line... so, add a newline.
Jul 20, 2017 at 18:52 history answered Taylor Raine CC BY-SA 3.0