SteveMyres Posted September 10, 2014 Share Posted September 10, 2014 Is there a character that will do the reverse of "\", IOW allow multiple statements on a single line? It would be convenient for compact if()'s, as in if(); do stuff; endif or equally compact try()'s or while()'s or multiple short declaration/assignment statements. If there is not current such a character, please move this to feature requests. Thanks! Link to comment Share on other sites More sharing options...
AzeoTech Posted September 11, 2014 Share Posted September 11, 2014 No, DAQFactory uses the carriage return (or maybe its the line feed, I've forgotten which) to mark the end of a line. This alleviates the necessity for a ; like many other languages, but also means you can't stack code into one line. We personally believe this is good thing as it encourages more readable code, especially when many of our customers are starting out with programming. That said, an optional other character to mark the end of the line might be a good idea and wouldn't be particularly hard to do, though I'm not sure what character to use. Maybe just follow everyone else and use a semicolon; Link to comment Share on other sites More sharing options...
SteveMyres Posted September 11, 2014 Author Share Posted September 11, 2014 Agreed, I think a lot of times it would detract from code clarity and would be bad to use, but there are a lot of cases where I think you could use it and it wouldn't create any confusion. Long lists of variable declarations, for example. You could look at a whole screenful of those and it would still be clear, especially if you lined up the semicolons or whatever character we end up with on subsequent lines so that it created columns. In the case of a very simple if(), I'm not convinced it wouldn't be MORE readable. Link to comment Share on other sites More sharing options...
RodSwan Posted October 29, 2014 Share Posted October 29, 2014 I agree, ";" to concatenate multiple lines would be extremely useful in the command/alert window. so for example things like: for(i=1;i<100;i++); x.addvalue(i);endfor could be done (on the fly, during development/testing). Rod. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.