Jump to content
Salesforce and other SMB Solutions are coming soon. ×

variable covering more than 2 possible values


daanvdn
 Share

Recommended Posts

Hi,

 

I want to use variable called $punctuation in a calculation with the Let funtion. I want the variable to cover alll of the following punctuation marks:

 

. ! ? , ;

 

I know that if a variable covers only two values it should be defined with the or operator, e.g.

 

$punctuation = "." or "!"

 

I'm pretty sure this is dead-easy, but I don't know how to define the variable if there are more than 2 possible values..

 

Any suggestions?

 

Thanks

 

Daan

Link to comment
Share on other sites

Daan,

Need just a little more info about what you are trying to do...

 

I know that if a variable covers only two values it should be defined with the or operator, e.g.

 

$punctuation = "." or "!"

 

It may be as simple as:

$punctuation - "." or "!" or "," or "..."

or you could check out the Case () or Choose () functions.

 

But without knowing what you are trying to do, it's difficult to make a suggestion.

Link to comment
Share on other sites

Hi,

 

I want to semi-automatically select whole sentences.

 

The beginning is the position of the cursor (determined using the Get (StartActiveSelection)-function).

 

The ending should be one of the following punctuation marks:

"."

"?"

"!"

 

I thought I could create a variable to cover these three and then use that in a Calculation to determine the final position of the selection

 

e.g..

 

Let [(

$punctuation = "." or "?" or "!"

];

 

Position (

Get(ActiveFieldContents);

Get(ActiveSelectionStart);

$punctuation

)

 

Thanks

 

Daan

Link to comment
Share on other sites

i would use substitute.

 

let (MyFC = Substitute (Get(ActiveFieldContents); ["?"; "."]; ["!"; "."])

 

{then continue your original function but assess MyFC not Get(ActiveFieldContents}

 

)

Link to comment
Share on other sites

I want to semi-automatically select whole sentences.

 

The beginning is the position of the cursor (determined using the Get (StartActiveSelection)-function).

 

The ending should be one of the following punctuation marks:

"."

"?"

"!"

 

I thought I could create a variable to cover these three and then use that in a Calculation to determine the final position of the selection

 

e.g..

 

Let [(

$punctuation = "." or "?" or "!"

];

 

Position (

Get(ActiveFieldContents);

Get(ActiveSelectionStart);

$punctuation

)

 

What Ahunter3 said...

 

Use the Set Selection script step:

Start Position = Get ( ActiveSelectionStart )

End Position = Let ([MyFC = Substitute (Get(ActiveFieldContents); ["?"; "."]; ["!"; "."])]; Position ( MyFC; "."; Get ( ActiveSelectionStart ); 1))

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use