Thanks for the suggestion, Carl.
I am using C11.1 build 13768.
I believe you can see the problem in Topscan if you try to have it build ANY tps file or clarion file via rebuild-all-keys.
Below is small program, the sample program from the Clarion help. I am using it to make sure the problem is not due to my faulty code (i.e. my misunderstanding of how it is supposed to be done). (I removed an unnecessary bit where it offers to create a duplicate-key record)
It creates mytps.tps. When you click on the “build file (with events)” button, it seems to work, but then if you click on the close window (X) button, nothing seems to happen; pressing it again shows a “BUILD OK” Message box, but then if you exit and look in topscan, the keys are empty.
Under Clarion 11 (not 11.1) my build-keys-with-progress-events code is working fine, as is topscan from Clarion 11. In this 11.1 environment, it is broken.
At this point, I’m pretty sure it’s a clarion bug. I can work around it (though some aesthetic quality is lost), but I am concerned that the underlying bug in the runtime code that causes this may also cause problems for me and others in unexpected ways.
I did post an entry in the problem tracker system.
Here is the sample program:
PROGRAM
MAP
CheckError(), bool
END
Window WINDOW('Event:BuildDone Example'),AT(,,209,76),|
FONT('MS SansSerif',8,,FONT:regular,CHARSET:ANSI), |
CENTER,SYSTEM,GRAY,DOUBLE
BUTTON('Create file'),AT(3,5,57,22),USE(?Button:CreateFile)
BUTTON('Build File (With Events)'),AT(71,7,84,22),USE(?Button:Build)
END
MyTPS FILE, DRIVER('TOPSPEED'), CREATE, RECLAIM, NAME('MyTPS.tps'),PRE(MYT)
PK_IDKey KEY(MYT:ID), PRIMARY
K_DescKey KEY(MYT:Description), DUP, NOCASE
Record RECORD
ID LONG
Description CSTRING(256)
END
END
COUNT LONG, AUTO
CODE
OPEN(Window)
ACCEPT
CASE EVENT()
OF Event:Accepted
CASE FIELD()
OF ?Button:CreateFile
?Button:CreateFile{Prop:Disable} = TRUE
CREATE(MyTPS)
IF CheckError()
POST(Event:CloseWindow)
CYCLE
END
OPEN(MyTPS)
IF CheckError()
POST(Event:CloseWindow)
CYCLE
END
STREAM(MyTPS)
LOOP Count = 1 to 100
CLEAR(MyTPS)
MYT:ID = Count
MYT:Description = 'Desc#: ' & Count
APPEND(MyTPS)
IF CheckError() THEN BREAK.
END
FLUSH(MyTPS)
CLOSE(MyTPS)
?Button:CreateFile{Prop:Disable} = FALSE
OF ?Button:Build
?Button:Build{Prop:Disable} = TRUE
MyTPS{Prop:ProgressEvents} = 100
SEND(MyTPS, 'FULLBUILD=on')
BUILD(MyTPS)
IF CheckError() THEN POST(Event:CloseWindow).
END
OF Event:BuildFile OROF Event:BuildKey
OF Event:BuildDone
IF CheckError()
MESSAGE('BUILD FAILED !', 'BUILD', Icon:Hand)
ELSE
MESSAGE('BUILD OK', 'BUILD', Icon:Asterisk)
END
?Button:Build{Prop:Disable} = FALSE
END
END
!------------------------------------------------
CheckError FUNCTION()
CODE
IF ERRORCODE()
MESSAGE(ERROR(), 'CheckError: ' & ERRORCODE(), Icon:Hand)
RETURN TRUE
END
RETURN FALSE