Solved

Testing to see if there is nothing in String?

Posted on 1997-08-07
7
143 Views
Last Modified: 2010-04-04
I'm trying to copy a string out of a string field and into a TMemo This is what i'm using:

  Memo1.Text := F_MainMenu.TB_Output['Comment']

but if the Comment field does not have a string in it then the system gives me a EVariant Error 'Invalid Variant Conversion' I tried testing like this:

if not (F_MainMenu.TB_Output['Comment'] = '') then
      Memo1.Text := F_MainMenu.TB_Output['Comment'];

but it does not help. Thanks for your time....

Rick S.
0
Comment
Question by:Rick_S
  • 4
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
ygolan earned 20 total points
Comment Utility
Try comparing F_MainMenu.TB_Output['Comment'] to null instead of ''.
0
 

Author Comment

by:Rick_S
Comment Utility
is null #0 if it is then that does not work...
0
 
LVL 1

Expert Comment

by:ygolan
Comment Utility
No, null is a special constant, of type variant. Here is the complete code :



if not (F_MainMenu.TB_Output['Comment'] = null) then
 Memo1.Text :=  F_MainMenu.TB_Output['Comment'];
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:Rick_S
Comment Utility
Thanks for your time and quick response. That Worked great I gave you an extra 10 points for the example... also, did you see my other question it's worth 350 and nobody has touched it. Thanks again...

Rick S.
0
 

Author Comment

by:Rick_S
Comment Utility
Sorry ygolan I tried to up the point value and it does not look like it worked if you would like I'll post a 10 point question and let you answer it and give you the points let me know thanks...

Rick S.
0
 
LVL 1

Expert Comment

by:ygolan
Comment Utility
Rick,

That's ok, don't worry about it.

Let me know what is the title of your other question, and I'll take a look at it.
0
 

Author Comment

by:Rick_S
Comment Utility
Thanks again.....

The title of the other question is:

    "SetScrollInfo and ScrollInfo"

The date was 7/31

Part of the second part of my question is also asked by PhiNet on 7/25 in the question 'Scrollbar In DBGrid ( Delphi 3 )' that has not yet been answered. If you can answer my question then you'll also be able to pick up the credit for the 100 point question of his.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now