1. Forward reference causing this crash?
- Posted by eumini Jan 24, 2009
- 883 views
- Last edited Jan 25, 2009
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
2. Re: Forward reference causing this crash?
- Posted by jimcbrown (admin) Jan 24, 2009
- 888 views
- Last edited Jan 25, 2009
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
3. Re: Forward reference causing this crash?
- Posted by mattlewis (admin) Jan 25, 2009
- 873 views
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.
Which version are you using? I believe this has been fixed in the trunk as bug #19.
Matt
4. Re: Forward reference causing this crash?
- Posted by eumini Jan 26, 2009
- 826 views
- Last edited Jan 27, 2009
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.
Which version are you using? I believe this has been fixed in the trunk as bug #19.
Matt
Matt/Jim,
Thanks. I am using version 4alpha2, which might not have this correction.
'Debo