I am taring to get my listbox code to compile and owkr properly. In interpreted 
mode it works great and no errors are generated. But if i Compile it the code 
fails telling my that I have an illegal index. It seems like the Find In Array 
function fails with a -1 result when I am compiled, but when I cam interpreted 
it works great. Is there a straightforward way to debug this in compiled mode? 
Or is there some fundamental quirk in compiled mode that I am missing. This 
code exists in my on after sort event.


This is the code I am using.

in the setup code I have OrderDirection defined as c_Boolean, and 
ColumnHeaderVars is an Array Pointer defined by the following.

LISTBOX GET 
ARRAYS(Self->;ColumnNames;ColumnHeaders;ColumnVars;ColumnHeaderVars;ColumnVisible;ColumnStyles)

$oldColHeader is defined as a c_Longint


ColumnHeaderVars:=Find in array(ColumnHeaderVars;Self)
$oldColHeader:=Find in array(ColumnHeaderVars;ColumnHeaderVars{0})
If ($oldColHeader=-1)
$oldColHeader:=2
End if
ColumnHeaderVars{0}:=ColumnHeaderVars{ColumnHeaderVars}
If (ColumnHeaderVars=$oldColHeader)
If (OrderDirection=False)
ColumnHeaderVars{ColumnHeaderVars}->:=2
OrderDirection:=True
Else 
ColumnHeaderVars{ColumnHeaderVars}->:=1
OrderDirection:=False
End if 
Else 
ColumnHeaderVars{ColumnHeaderVars}->:=2
ColumnHeaderVars{$oldColHeader}->:=0
OrderDirection:=True
End if 


-----------------------------------------------------------------------

MacCafe
4405 Talmadge  St.
Toledo, OH 43623
Eric Naujock  -  ACSA 10.2, 10.3, 10.4 Apple - ACTC 10.5, 10.6, 10.7, 10.8, 
10.9, 10.10
http://www.mac-cafe.com
email: e <mailto:[email protected]>[email protected] <mailto:[email protected]>
AOL IM: erlic



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to