Re: Forward reference causing this crash?
- Posted by jimcbrown (admin) Jan 24, 2009
- 886 views
This appears to be a result of the use of [$] with an undefined variable. Changing it to [length(data_result)] results in getting two unresolved forward references.
Hi,
Working with the below code (reduced to illustrate the problem) crashes EXW. It turns out that while using another routine as a template for this one an undefined variable was left in the code. However, rather than throw an undefined reference error EXW simply crashes with the familiar Window message: "..encountered a problem..". When this variable is deleted everything works, but because of this crash behavior it took some time to search through the entire file.
Is this due to the new forward reference feature? If so, the interpreter would need to be able to indentify this kind of reference error.
Perhaps there is a better interpretation of the problem.
Thanks.
'Debo
Code follows
global function sql_bind_col(integer statement_handle,object col_to_get=0) atom num_cols, void, return_length,data_col sequence col_attr,void1,void2 integer ColumnName, DataTypePtr,ColumnSizePtr,DecimalDigitsPtr,NullablePtr void1 = repeat(0,7) return_length = 0 ColumnName = 1 DataTypePtr = 2 ColumnSizePtr = 3 DecimalDigitsPtr = 4 NullablePtr = 5 void = 0 if atom(col_to_get) then col_to_get = {col_to_get} end if num_cols = length(col_to_get) col_attr = repeat({},num_cols) void2 = repeat(0,num_cols) --Get column attributes for i = 1 to num_cols do col_attr[i] = 0 --Offending line data_result[$][i] = sprintf("%s",{col_attr[i][ColumnName]}) --Offending line end for return void end function