.dot operators problem


(Aemmen Liao) #1

Hey, friends, do any guys know how to start with dot operator, especially for uppercase and lowercase. I followed the instruction to set the code in my note, but nothing happened, I don’t know where to find the result. If it is not convenient, please give me some detail instructions.


(Mark Anderson) #2

This is hard to answer as it would help to know what you were trying to do and how you intuit the codes work. At simplest they are just like existing actions. So, format() and .format() do the same thing, but dot operators can be chained allowing a single action expression to do multiple tasks.

A key basic point is you still need to store the output:

$MyString.size;

should give you the character length of the value of $MyString, i.e. a number, but you need to collect the output. so:

$MyNumber = $Mystring.size;

The dot operation most likely to trip you is .replace. It seems natural to write:

$Text.replace("xxx","yyy");

When actually you need to write:

$Text=$Text.replace("xxx","yyy");

In order the $Text ends up being altered.

Does that help?


(Paul Walters) #3

Are you putting the code (e.g., as @mwra explained) in the text body of the note? Nothing will happen if you do that.

The code is intended for use in Stamps, or Agent Actions, or Rules, etc.


(Aemmen Liao) #4

Dear PaulWalters, I think the err was happened in where I put the code as you said in “text” column, so there was no result produced. Thanks for your help. Now I can amend the code to the right place.


(Aemmen Liao) #5

After I put the code to where PaulWalters said, and use the way you offered to rewrite the code, it certainly works. Thanks for your help.