🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.nativeapi
1 messages
1 total messages Started by S Thu, 18 Mar 2004 21:18
TwwDBGrid and ALT key
#186
Author: S
Date: Thu, 18 Mar 2004 21:18
65 lines
2909 bytes
Hello, It looks like I have run into some unknown glitch in retrieving
data
via the ibdataset FieldByName method from a TwwDBGrid, and it's
associated with the ALT key.

Specifically:  

When I hit a Save button on this form, I have a validation routine
loop
through all of the row (records) in the grid, and this works properly.

(if both fields of all the records are filled in by user, it will 
loop through all records, and line number 12 below *wont* 
gets executed.)

But if I do not click on the button, and instead use the keyboard,
using the ALT-S combo for the button (I put a "&" in the 
name property for the button), somehow the sString2 value
below comes up empty evey time. ( line 10)

 ... As if somehow, the ALT key clears the Description field
internally
even though there is clearly text in there.


portion of Save button handler:

------------------
while not ibdsCustomer.EOF do
      begin
        sString1 := ibdsCustomer.FieldByname('Customer_ID').AsString;
        sString2 := ibdsCustomer.FieldByName('DESCRIPTION').AsString;
        if (Trim(sString1) = '') and (Trim(sString2) = '') then
           ibdsCustomer.Delete
        else
           ibdsCustomer.Next;

10.   if (Trim(sString1) <> '') and (Trim(sString2) = '') then
11.      begin
12.          bIncompleteDesc := True;
13.      break;
        end;
      end;
------------------

Note: 
 I made sure to clear all colEnter handlers or other properties of the
TwwGrid that would be
causing problems.

A sequential 'Use-Case' description would be:

-You have a two column grid.
-User has focus on third record of grid, (2 recs exist)
-Enters a value in first column,
-Hits Tab
-Enters a value in second column
-Hits ALT-S on kbrd
-"sString2 := ibdsCustomer.FieldByName('DESCRIPTION').AsString"
        gets executed.
-sString2 is empty (whereas by clicking Save button, it has
                      a value).

Any suggestions welcome, 
Steve
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads