Multi-Line Comments in MortScript
The MortScript batch language for Windows Mobile may not be as powerful as the UNIX shell scripting language, but you can still get a lot of things done with it. The thing is that MortScript only support single line comments, with a hash (#) mark. So to comment out the following example, you'd have to put a hash mark in front of every line:
# If (extension eq "")
Well, that's a lot of work. As you can see in the example above, that's five lines and a lot of typing. And you'd have to change the cursor position for every line. Don't you wish there is a C or Java-like multi-line comment (/* */) sequence?
Well, you can comment out multi-line statements by surrounding them with a subroutine keywords. The same example above would be changed to the following:
The only catch is that MortScript only allows subroutines at the end of the program. Whenever the interpreter encounters the "Sub" keyword, it will stop executing. So you have to move the commented out code to the end of your script. Now, isn't that easier than commenting out every line?
Did your message disappear? Read the Forums FAQ.
Spam Control | * indicates required field
TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.
Messages, files, and images copyright by respective owners.
38 Users Online
Copyright © 1996 - 2021. All Rights Reserved.