Possible culprit found for strange exception?

This forum is meant for questions and discussions about the X# language and tools
Post Reply
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Possible culprit found for strange exception?

Post by FFF »

Chris,
you'll remember my fight with the "Kunden" window in my _kv project i sent you some time ago. The form failed to display, while a stddatawindow, which VO uses in "File-Open", works.
Digging around, i now built a new dtaWindow from designer, using "my" basewindow class and added only two sles for kdno and name. And, i assigned directly "my" db, inherited from my baseserverclass. Then modified the shellmenu to call this form - and this works.
Now, i added a mle to the form for the free-text field of my db- and the exception is back. Remove the mle, all ok.

The point is, could it be, that there's a problem with the fieldname? The free-text field is named "Memo" (don't ask me why, did that a very long time ago)...
I ask this, as in another app, which uses the same form and serverbases, i don't see such a problem, but there the memo-field uses another name.
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Possible culprit found for strange exception?

Post by Chris »

Hi Karl,

Can't tell for sure, I did a small sample here as you described it and it seems to work fine, but I might be doing something in a different way to you...
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

Possible culprit found for strange exception?

Post by Karl-Heinz »

Hi Karl,

i changed the name of my DBFCDX memofield to "MEMO" and there are no problems. When i open my DtaDlg window i see the content of each memo in my MLE. When i change in XIDE the dtaDlg layout and restart, there are still no problems.

regards
Karl-Heinz
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Possible culprit found for strange exception?

Post by FFF »

Karl-Heinz,
unfortunately, it's not so easy...
1) There is no problem viewing/manipulating the table via StdDatawindow, as Vo etc. use, when i open with File-Open from the StandardMdi-Sample.
2) There is no problem, if i open it with the generic Datawindow in my app, which uses my customized serverclass, but displays with a enhanced StdDatawindow based on my dtaWinbase class.
3) There is no problem, if i show a dtaWinbase using the custom server, as long as this window has no control which references the memo field.
4) There is a crash, when i open using my enhanced "dtaKunden" window based on the same dtaWinbase, using the same custom server.
So, it seems there should be a problem with dtaKunden, but that does not give an explanation for #3, nor does dtaKunden contain any "special" things. It was autogenerated x-years ago, arranged, and got a bunch of buttons to start some actions, that's all.
FTR, i use only datawindows, no dtadialogs...
One week of holiday is left, will continue hunting...
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Possible culprit found for strange exception?

Post by FFF »

Chris,
further into the "Kunden" issue: With the new build i see now on opening the window the exeption pointing to the access of my field "Straße".
Went to dbServereditor in Xide und hit export, and get "Field STRAßE has invalid values" (casing of fieldname as shown, the lowercase character is the german "sharp s", replacing "ss").
Could that create the problem? In similar apps i always named "STRASSE" and have no problem...
EDIT:
Replaced the definitions, fieldspecs etc, no go ;-(
Beschreibung : Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Sammlung sein.
Parametername: index
Subsystem : BASE
Generischer Code : EG_EXCEPTION Exception ausgelöst durch CLR oder exteren Code
FuncSym : OOPHELPERS:IVARGET
Schwere : ES_ERROR
Kann Default : False
Kann erneut versuchen : False
Kann ersetzen : False
Aufrufreihenfolge :
bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
bei XSharp.__Array.__GetElement(Int32[] index)
bei XSharp.__Array.get_Item(Int32[] index)
bei dbBufferedServer.FIELDGET(__Usual[] Xs$Args) in C:XIDEProjectskv4ApplicationsMSG_dbServerLibPrgdbBufferedServer.prg:Zeile 156.
bei pdb_Kunden.get_STRASSE() in C:XIDEProjectskv4ApplicationsDB_Dict_KVPrgpdb_Kunden.prg:Zeile 308.

ACCESS STRASSE AS STRING PASCAL
RETURN SELF:FieldGet(#STRASSE) // this is line 308

If i open the table with the generic FileOpen from the app, it displays & skips fine, all values and memo values are in place.
If i open the table with my generic FileOpen, which uses "my" DBServer for this table, it fails, but here accessing the memo field.

Next steps: i'll zap the table - this should take care of any table corruption, no?
If that helps, i'll do what you suggested long ago, rewrite the table by hand ;-)
If it does not, i'm finally at a loss, i think.
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Possible culprit found for strange exception?

Post by robert »

Karl,

What is the field name in the DBF file? STRAßE or STRASSE

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Possible culprit found for strange exception?

Post by FFF »

Robert,
AFAIS, prior to my modifications, STRAßE.

FTR, made a new StandardMDI-X#-runtime app. This, using File/Open, displays the field caption as "Stra?E:" (sic!)
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Possible culprit found for strange exception?

Post by Chris »

Hi Karl,

Please create a new app, add in it the code of "your" DBServer that causes the problem in your original app and load in it the same dbf file the same way as you do in your main app. If the error happens again, please zip the project and send it to me (let's try .7z format) to have a look. If it doesn't, it means that something else in the main app isa causing the problem.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply