Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bolt on August 19, 2019, 07:47:19 PM

Title: Empty String Compare Statement
Post by: Bolt on August 19, 2019, 07:47:19 PM
Is there an easy way to tell if a string is empty?  I don't think STRCMP can do it, without setting a dummy string to be empty.  And I also can't create a Symbolic Constant with a string content.  What am I missing?
Title: Re: Empty String Compare Statement
Post by: Andrew S on August 19, 2019, 10:00:44 PM
without setting a dummy string to be empty.
That's what I do. Works just fine.

Andrew.
Title: Re: Empty String Compare Statement
Post by: ATU on August 19, 2019, 11:04:24 PM
You could also use the ISCLEAR function
Title: Re: Empty String Compare Statement
Post by: franji1 on August 20, 2019, 06:34:25 AM
The string has a .Length member, so in an equal-to contact, do
MyString.Length = 0
Title: Re: Empty String Compare Statement
Post by: Bolt on August 20, 2019, 07:20:12 PM
The string has a .Length member, so in an equal-to contact, do
MyString.Length = 0

Doh!  I already did that in other parts of my program, not sure why that didn't register with me.  Thanks!