Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 4 Jahren, 11 Monaten
Letzter Beitrag:
vor 4 Jahren, 11 Monaten
Beteiligte Autoren:
Danny Lauwers, Peter Holemans, Fabrice Harari, GuenterP

WD[18] SourceToScreen Failed ?

Startbeitrag von Danny Lauwers am 15.05.2013 15:39

Hi,

I am getting an error when I process the results of my class.

In my class there is a array of structures, this is filled from other data. When there is data in this array, the linked table control is filled correctly when I do call SourceToScreen and TableDisplay

But when my result is empty array, I would expect that the table control would just be empty when calling SourceToScreen but I get the following error:

Error at line 31 of Local Procedure OpenIWB process.
SourceToScreen function called.
Link error on the source control .
Dimension 1 of array contains 0 elements. Unable to access element 1.

----- Technical Information -----

Project : WSLCIO

WL call:
Process of 'Local Procedure OpenIWB' (WIN_Start.PROCEDURE.OpenIWB), line 31, thread 0
'SourceToScreen' function, syntax 1

What happened?
Link error on the source control .
Dimension 1 of array contains 0 elements. Unable to access element 1.

Error code: 2304
Level: fatal error (EL_FATAL)

Dump of the error of 'wd180vm.dll' module (18.0.132.0).
Identifier of detailed information (.err): 2304
Debugging information:
Fonction (1,380)
Additional Information:
EIT_PILEWL :
Local Procedure OpenIWB (WIN_Start.PROCEDURE.OpenIWB), line 31
Local Procedure CreateNewIWB (WIN_Start.PROCEDURE.CreateNewIWB), line 24
Local Procedure SelectIWB (WIN_Start.PROCEDURE.SelectIWB), line 27
Click BTN_Close2 (WIN_Start.BTN_Close2), line 1
EIT_DATEHEURE : 15/05/2013 17:32:45

Help


Any idea why and how I can solve this ?

I could remove the link, but then I have to fill the table myself ?
In this case it is a small table, but I would like to know what the core problem is !

Thanks
Danny

Antworten:

Hi Danny

there is a big difference between an EMPTY array line, and an empty array (ie an array without any line in it)...

The error messages says:
Dimension 1 of array contains 0 elements. Unable to access element 1.

This means that your array is empty (as in the is no line/row in it)...

For what you want to do, you need to have ONE line with empty fields in it...

Best regards

von Fabrice Harari - am 15.05.2013 15:58
Hi Danny,

I assume that you should look into the difference of static arrays and dynamic arrays. Dynamic arrays can grow and shrink in size while a static array is declared once and contains the defined number of array elements.

Regards,
Guenter

von GuenterP - am 15.05.2013 16:40
Hi Danny,

I don't have any problem with similar code but recall having something similar where my reference to the array was incomplete.
Def.:
ListClass is Class
PUBLIC
MyList is Array of SomeClass

Declaration/Use in Window:
GLOBAL
MyListInst is ListClass

What happened sometimes was that I was referring to
MyListInst
where this should have been
MyListInst.MyList

I guess this may be your case as well.

Cheers,

Peter H.

von Peter Holemans - am 15.05.2013 17:32

Re: WD[18] SourceToScreen Failed (SOLVED)

Thank you for your quick responses...

Ok, because I am still new to Windev I had made the mistake of filling in the Link property of the table to the array to display. I also had the content pointing to the same array.
In the Link property ther was an Array[1] displayed that I found odd.

I removed the Link in the 7 Tab screen and set it to NONE and the content was still pointing to my array.

Problem solved, When the array is empty, I get an empty table as espected !

Thanks
Danny

von Danny Lauwers - am 15.05.2013 19:35
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.