Array of User Type Error

Coding + IDE + Code-Editor + Syntax + User-Functions + Anything else

Array of User Type Error

Postby Henning » Wed Apr 17, 2013 7:14 pm

Declared in Global
Code: Select all
Type rcArt
  arNr As Short
  arArt As String * 20
  arSize As Short
  arType As String
  arID As String * 15
  arIndate As String
  arInpris As Short
  arAntut As Short
  arTotut As Integer
  arStat As Byte
  arKvnr As Short
  arRedat As String
  arKr As Integer
  arKrtot As Integer
  arAge As Short
  arPris As Short
End Type

Public Dim ArtRec[1] As rcArt


In Module1 this line rise the error
Code: Select all
ArtRec[rc].arNr = Records.Value(sRecordsId, "artnr")


Q7B_ASSIGNMENT(q7b_type_get(*q7b_array_at(Q7B_Global_Class(Q7B_Global_Object())->ArtRec, rc, Q7B_ID((qint64) -1), Q7B_ID((qint64) -1), Q7B_ID((qint64) -1)), Q7B_ID((qint64) 0), Q7B_ID(-1), Q7B_ID(-1), Q7B_ID(-1), Q7B_ID(-1)), &Q7B__SHORT(Q7B_RECORDS_VALUE(Q7B_Records_Object(), sRecordsId, Q7B_ID("artnr"))));

Error2.jpg
Error2.jpg (15.74 KiB) Viewed 1325 times


Seems .arNr is missing?

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: Array of User Type Error

Postby Henning » Wed Apr 17, 2013 11:41 pm

Found the reason.

ReDim a Public variable holding an array of User Type fails!!

In Global: Public Dim ArtRec[1] As rcArt

In Module1: ReDim ArtRec[recCount + 1] !!!! This is what screws-up the array.

If I in Global: Public Dim ArtRec[10] As rcArt and comment out the ReDim it works correctly.

Will report as a BUG!

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm


Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 1 guest

cron