Link to home
Start Free TrialLog in
Avatar of Rick_S
Rick_S

asked on

Testing to see if there is nothing in String?

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.
ASKER CERTIFIED SOLUTION
Avatar of ygolan
ygolan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rick_S
Rick_S

ASKER

is null #0 if it is then that does not work...
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'];
Avatar of Rick_S

ASKER

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.
Avatar of Rick_S

ASKER

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.
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.
Avatar of Rick_S

ASKER

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.