1. Forward reference causing this crash?

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 
new topic     » topic index » view message » categorize

2. Re: Forward reference causing this crash?

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.

eumini said...

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 
new topic     » goto parent     » topic index » view message » categorize

3. Re: Forward reference causing this crash?

eumini said...

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: Forward reference causing this crash?

mattlewis said...
eumini said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu