Board index » delphi » Q: How to load data aware component value to a pgm variable

Q: How to load data aware component value to a pgm variable

You know, I'm tired of being a Delphi "newbie".  I'm ready to go back
to VB or PowerBuilder 5!!

Software:   Delphi 2, client/server
Platform:    win /95
Database:        oracle7

I'd like to take the value found in dbeComposer and move it to a
program variable, nustring - either global or local.

I've tried the following,

        { declared this is a global variable }
        nustring: string;

        { code in here }

         nustring := tSongTitle.FieldByName('composer').AsString;
         nustring := dbeComposer.field.AsString;
         nustring := dbeComposer.field.DisplayText;

         { more code }

I've got nustring set up as a watch, and as I step through the above
code, the nustring variable NEVER has any value in it.  According to
the dbeComposer as it is displayed on the form, dbeComposer contains
the value "aunt thelma".  

I've struggled on this for 3 hours.  What am I missing here?

Thx in advance, for your assistance.

Don
donde...@teleport.com

 

Re:Q: How to load data aware component value to a pgm variable


Difficult to say with the small chunk of code you've listed, but I would
hazard a guess that at the point you are examining the value, Delphi has
detected that the nustring value is changed three times without being used
and optimized the code.

If you store the final value and use it elsewhere, then viewing it at that
point should show the correct value. To see the value you want here,
either turn optimisation off or examine the value of dbeComposer itself.

Other Threads