The use of (* *) and

Joined
Oct 17, 2011
Messages
112
Reaction score
1
Points
18
Location
Born in Brooklyn, bred in Manhattan, living in VT
Your Mac's Specs
iMac Mid-2011 27”: MacBook Pro (13-inch, 2017) MacOS 12.2.1: iPad Pro (12.9”) (4th Gen) iPadOS 15.
Et AL:

I haven't found this in using the web so far, so while I am still hunting this down, mayhaps someone could give me and quick explanation on the use of (*, *), and -- ?
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
What's the context for this question?
 

pigoo3

Well-known member
Staff member
Admin
Joined
May 20, 2008
Messages
44,210
Reaction score
1,418
Points
113
Location
U.S.
Your Mac's Specs
2017 15" MBP, 16gig ram, 1TB SSD, OS 10.15
Are we talking (*,*) as an emoticon...or the super super super old MS-DOS search command *.*??

- Nick
 
OP
Brooklynguy
Joined
Oct 17, 2011
Messages
112
Reaction score
1
Points
18
Location
Born in Brooklyn, bred in Manhattan, living in VT
Your Mac's Specs
iMac Mid-2011 27”: MacBook Pro (13-inch, 2017) MacOS 12.2.1: iPad Pro (12.9”) (4th Gen) iPadOS 15.
What's the context for this question?

oops ... sorry about that ... normally I'm way more aware of what I'm doing :):keeps telling myself::)

Applescript ... just starting to use it .... I use 2 dashes for comments and line breaks, one for each line or break.

But I have seen in other's examples at times the use of (* followed by lines of text ending with *)

My only guess is that this is from another kind of programming language or script perhaps?

BG
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Ahh..context, such a wonderful thing..:)

Yes, the "--" is for single line comments that will end with the newline. the (* and *) convention can be used for multi-line comments..

See here for how that works..

Other languages use other conventions, but the theory is the same..

C++ uses "//" for a single line comment and uses C-style /* and */ for multi-line comments. A lot of scripting languages use # for a single line comment and don't support multi-line comments, so every line has to be prefixed with # and so on..
 
OP
Brooklynguy
Joined
Oct 17, 2011
Messages
112
Reaction score
1
Points
18
Location
Born in Brooklyn, bred in Manhattan, living in VT
Your Mac's Specs
iMac Mid-2011 27”: MacBook Pro (13-inch, 2017) MacOS 12.2.1: iPad Pro (12.9”) (4th Gen) iPadOS 15.
Ahh..context, such a wonderful thing..:)

Yes, the "--" is for single line comments that will end with the newline. the (* and *) convention can be used for multi-line comments.


RazOrEdge: That's what I was guessing first.

But whether I had put the (* and *) on the same line as the first line and last line of text, or had put each of those on a separate line from the actual text I wanted there (see below) an error message showed up when compilng.

example 1:
(* App name: Dual Side-by-Side Finder Windows version 1.0
Written by Dave 'Brooklynguy" Leav
created 2013-09-16 version 1.0
last modified 2013-09-20 version 1.1
Function: Replaces all Finder windows with dual-windows side-by-side *)
--

example 2:
(*
App name: Dual Side-by-Side Finder Windows version 1.0
Written by Dave 'Brooklynguy" Leav
created 2013-09-16 version 1.0
last modified 2013-09-20 version 1.1
Function: Replaces all Finder windows with dual-windows side-by-side
*)
--

syntax_error .jpg
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top