Cynosure.X International LLC

: :

Add Comment | Related Links | TrackBack
Related Content

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 "")
# Message ("Empty extension.", "Error!")
# else
# extension = "." & extension
# action = 1
# EndIf

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:

Sub comment1
If (extension eq "")
Message ("Empty extension.", "Error!")
else
extension = "." & extension
action = 1
EndIf
EndSub

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?

Chieh Cheng
Tue, 19 Aug 2008 00:00:37 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Related Links

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 9 + 7?
Click button only once, please!

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

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.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

99 Users Online

Hacking Digital Cameras
Fun for Photographers


Get Our

Memecoins!



Amazon Associate

Copyright © 1996 - 2024. All Rights Reserved.