home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
idedll.zip
/
WATCOM.PEL
< prev
Wrap
Text File
|
1995-11-23
|
3KB
|
92 lines
#########################################################################
#
# WATCOM.PEL
#
# ide_hilite( row, col, len)
# ide_hilite_err( row, col, len, resource, errmsg)
# ide_sethelp( helpfile)
#
# Implements the DDE functions called from the Watcom IDE to link the
# PREDITOR/2 Editor
#
#########################################################################
# ide_hilite( row, col, len)
#
# Position the cursor at the indicated point and then hilite the next len characters.
global function ide_hilite( row, col, len)
{ goto_pos( row, col)
center_cursor()
if (0 != len)
create_linecol_selection( NORMAL_SELECTION, row, col, row, col + len, 0, 0)
}
# ide_hilite_err( row, col, len, resource, token)
#
# Position the cursor at the indicated point and then hilite the next len characters.
# If col is zero, this seems to indicate that the Watcom IDE doesn't know the column
# position of the offending token. In this case, see if there is a single-quoted
# string in the error message. If so, try to find it in the line and use it to
# compute the column position and hilite information.
global function ide_hilite_err( row, col, len, resource, token)
{ # Unencode the token
token = space_decode( token)
# If Col = 0, then the IDE doesn't know the position of the error, so just hilight
# the whole line. Otherwise hilight the error.
if (0 == col)
{ goto_pos( row, 1)
goto_eol()
create_linecol_selection( NORMAL_SELECTION, row, current_column, row, 1, 0, 0)
}
else
{ if (0 != len)
create_linecol_selection( NORMAL_SELECTION, row, col + len, row, col, 0, 0)
else
goto_pos( row, col)
}
center_cursor()
}
# ide_sethelp( helpfile)
#
# Currently, I am not doing anything with the HelpFile.
global function ide_sethelp( helpfile)
{
}
# space_decode( coded_str)
#
# Decodes the string to restore it to plain text
local function space_decode( coded_str)
{ local token
local i
local flag
local chr
for (i = 0, flag = 0, token = "" ; i <= length( coded_str) ; i++)
{ chr = substr( coded_str, i, 1)
if ("~" == chr)
{ if (1 == flag)
{ token = token + chr
flag = 0
}
else
token = token + " "
}
else if ("$" == chr)
{ if (1 == flag)
{ token = token + chr
flag = 0
}
else
flag = 1
}
else
token = token + chr
}
return token
}