←  Technical Questions

nanoCAD forum

»

multicad.net string character check

Robse Ponte's Photo Robse Ponte 08 Jan 2021

Hello,

i have a question to a specific problem with multicad.net

What kind of language is this? C?

i have a string that works: =If(Exist(Object);Object;"")

How do I check strings? When I want to check for example the first character of the object string, how do I do this?

Can I stack if-cases like =If(Exist(Object);If((FirstcharacterofObject not #);Object;"");"")

Best regards
Quote

Robse Ponte's Photo Robse Ponte 08 Jan 2021

Hello, nearly done but still far away...

If cases are stackable in Nanocad Report Table.

=Iff(Exist(Object);Iff((Object[0]!="#");Object;"");"")

but how to check the first character of the object??
Quote

Kreator's Photo Kreator 10 Jan 2021

Hi.
You should use Object's property like Object.Value or Object.Text or whatever. Object is object - not array, dictionary or any other enumerable.
To get any letter from a string use SubLeft, SubRight or SubSplit functions.
SubLeft(Object.Text; 1) will return you 1st letter.
Quote

Kreator's Photo Kreator 10 Jan 2021

About language - it seems to be something like C#, but it is not. Anyway, it is common and intuitive to use.
Quote

Robse Ponte's Photo Robse Ponte 12 Jan 2021

It works perfect! Thank you very much for your help!
Quote

MСAD's Photo MСAD 02 Dec 2021

View PostRobse Ponte, on 08 January 2021 - 03:14 PM, said:

Can I stack if-cases like =If(Exist(Object);If((FirstcharacterofObject not #);Object;"");"")
Maybe this movie will help you

Visual representation ⚠️ of the formula in the expression builder
Quote