I'm learning A4D by modifying the code in the A4D demo. My app was designed to feed a lot of arrays into listboxes, so I'd like to use the rowset.newfromarrays library to display my data.

I declare the arrays (global at the moment), pass the array from 4D to A4D, and then try to use the rowset command. All goes fine until the rowset command and then an error is thrown from the method "_arrayInit" in the rowset library:

"$_size:=size of array(=My_Array
Expecting a field or a variable"

It seems unlikely this is a bug in the method. Can anyone point me to what I'm doing wrong?

My code follows... excuse the awkward array names. They make sense in the world of ListBoxes.

Thanks in advance.

Eliot Mason

*********
  <%
  //following 4d code copied from the method "GS_NationSelect"
$vl_selectedsetid:=1 //hard code modification of the code for testing purposes, normally this would be a variable
QUERY([NationSets];[NationSets]SetID=$Vl_Selectedsetid)

array string (30;GS_NSLB_C2;0)
array string (30;GS_NSLB_C3;0)
array longint(GS_NSLB_C7;0)
array longint(GS_NSLB_C6;0)
array longint (GS_NSLB_C4;0)
array longint (GS_NSLB_C5;0)

execute in 4d ("BLOB TO VARIABLE([NationSets]NameArray;GS_NSLB_C2)")
execute in 4d ("BLOB TO VARIABLE([NationSets]IDNumArray;GS_NSLB_C7)")
execute in 4d ("BLOB TO VARIABLE([NationSets] RegionNameArray;GS_NSLB_C3)")
execute in 4d ("BLOB TO VARIABLE([NationSets]RegionIDArray;GS_NSLB_C6)")
execute in 4d ("BLOB TO VARIABLE([NationSets] PopulationArray;GS_NSLB_C4)") execute in 4d ("BLOB TO VARIABLE([NationSets] UrbanPopulationArray;GS_NSLB_C5)")
  //end copied code

  $rs_nation_dmap:="""
  NationName:=GS_NSLB_C2
  NationID:=GS_NSLB_C7
  NationRegionID:=GS_NSLB_C6
  NationRegionName:=GS_NSLB_C3
  NationPopulation:=GS_NSLB_C4
  NationUrbPopulation:=GS_NSLB_C5"""

$rs_nations:=rowset.newFromArrays($rs_nation_dmap)


  for($i;$rs->getstart;$rs->getEnd)
  %>
  <tr>
  <td><%=row{"NationName"} %></td>
  <td><%=row{"NationRegionName"} %></td>
  <td><%=row{"NationPopulation"} %></td>
  <td><%=row{"NationUrbPopulation"} %></td>
</tr>
<% end for %>
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to