Re: And another crm114 script language question about 'isolate'
Bill Y <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
From: "Ger Hobbelt" <[email protected]> isolate <default> (:var:) // to make sure the :var: is always there for the remainder of the code, even when the commandline abuser didn't specify it. Q: are these incantations _intended_ to be exactly the same? isolate (:var:) (Note the lack of /.../ there) and isolate <default> (:var:) // Verdict please? Yes (identical, and intentional) / No (not). Yes, identical and intentional, as the default value on an ISOLATE with no slash args is to use the prior value, and if there is no prior value, then the null string is used. The difference only becomes obvious if you _might_ have a prior value (i.e. "2048") but also want a default value (say, "1024"). Then, the results look like this: isolate (:var:) --> keeps prior value, makes isolated, default value NULL isolate (:var:) /value/ --> makes isolated, forces value. isolate (:var:) /value/ <default> --> makes isolated, applies value ONLY IF NO PRIOR VALUE (and NULL is a prior value!) Your case (isolate <default> (:var:) // ) is a redundant case, in that it specifies a NULL as the default value yes? ... because to me it looks like they are after looking into the crm114 implementation details + QUICKREF accompaniment. (Hadn't expected that, but then documentation reading skills are apparently not my forte. I 'read' the code and believed isolate (:var:) wasn't doing what it actually _did_. My bad. I expected it to be shorthand for isolate (:var:) // Nope - if a variable already has a value, ISOLATE copies it to it's own area but keeps the value. - Bill Yerazunis ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace