cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Failing function

Level 1

Failing function

I am at a loss. Like Matt, I am working on my first bit of ACL coding. My
last programming course (aside from the Adept ACL courses last year) was
BASIC in 1984.

I have the following function, the last two lines plagiarized from Svante
the other day. This is just one piece of the application. What I expect
this to do is as I traverse an instance, look for the element table and then
read one of the table attributes (tabstyle) values. If I'm in a table that
is inline, I'll proceed into the remainder of the function.

function test () {
o=oid_name(oid_current_tag());
t=oid_caret();
{message "You are not there yet. The caret is at $o $t"}
if (inside_tag("table") && oid_attr(oid_caret(),tabstyle)=="inline")
{message "You did it $o"}

win_id=current_window();
window_set(win_id,"caretMovedCallback", "test")
}

My problem is though I can traverse the document, the message in the status
bar is telling me that, when I get to my test table, the if statement isn't
invoked. I can run the
"if (inside_tag("table") && oid_attr(oid_caret(),tabstyle)=="inline")
{message "You did it $o"}"
from the command line and if the cursor is inside the table where it can
read the table attributes, the logic works.

Does anyone have an idea as to why this works from the command line and not
as a function?

Thanks,

Lynn E. Hales
Information Systems Specialist
AMSEC LLC
(757)688-9324
hales_le@nns.com
Tags (2)
1 REPLY 1

Failing function

I am at a loss. Like Matt, I am working on my first bit of ACL coding. My
last programming course (aside from the Adept ACL courses last year) was
BASIC in 1984.

I have the following function, the last two lines plagiarized from Svante
the other day. This is just one piece of the application. What I expect
this to do is as I traverse an instance, look for the element table and then
read one of the table attributes (tabstyle) values. If I'm in a table that
is inline, I'll proceed into the remainder of the function.

function test () {
o=oid_name(oid_current_tag());
t=oid_caret();
{message "You are not there yet. The caret is at $o $t"}
if (inside_tag("table") && oid_attr(oid_caret(),tabstyle)=="inline")
{message "You did it $o"}

win_id=current_window();
window_set(win_id,"caretMovedCallback", "test")
}

My problem is though I can traverse the document, the message in the status
bar is telling me that, when I get to my test table, the if statement isn't
invoked. I can run the
"if (inside_tag("table") && oid_attr(oid_caret(),tabstyle)=="inline")
{message "You did it $o"}"
from the command line and if the cursor is inside the table where it can
read the table attributes, the logic works.

Does anyone have an idea as to why this works from the command line and not
as a function?

Thanks,

Lynn E. Hales
Information Systems Specialist
AMSEC LLC
(757)688-9324
hales_le@nns.com