home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
o
/
os2_util.zip
/
BRIEFINF.ZIP
/
INFHELP.CB
next >
Wrap
Text File
|
1992-03-15
|
3KB
|
142 lines
/* */
/* infhelp.cb */
/* */
/* Interface the IBM INF help subsystem supplied with the OS/2 2.0 */
/* toolkit into brief 3.x */
/* */
/* Marc A. Ache' */
/* */
/* This macro calls to the view program to invoke a window that */
/* descibes the queried function or topic. */
infhelp (...)
{
assign_to_key ("<Alt-q>", "do_infhelp");
}
do_infhelp (...)
{
string _hlptxt;
int ret_code;
global _hlptxt;
/* check if path is the root */
if ( inq_marked() )
{
_hlptxt = _armgt();
}
else
{
_hlptxt = _getarg();
}
if ( _hlptxt == "" )
{
if (!get_parm(0, _hlptxt, "Find Topic: ", NULL, _hlptxt))
return;
}
message("Searching for \"%s\"...", _hlptxt);
ret_code = dos("VIEW %PMREF%+%PROGREF20% " + _hlptxt + " >& nul", 1 );
message("");
}
/* */
/* Return marked string */
/* */
_armgt (...)
{
string mtxt;
int start_line,
end_line,
start_col,
end_col,
temp_int;
if (inq_marked ())
{
save_position ();
inq_position (end_line, end_col);
swap_anchor ();
inq_position (start_line, start_col);
raise_anchor ();
/* If the starting column is greater than the ending */
/* column, swap the variables */
if (start_col > end_col)
{
temp_int = start_col;
start_col = end_col;
end_col = temp_int;
move_abs (0, start_col);
}
if (start_line == end_line)
{
temp_int = (end_col - start_col) + 1;
mtxt = read (temp_int);
}
else
mtxt = read ();
restore_position ();
}
else
mtxt = "";
returns mtxt;
}
_getarg (...)
{
string mtxt;
int size;
save_position ();
mtxt = read(1);
if ( mtxt == " " )
prev_char(1);
if ( search_back( " |(|\t|\n|!", 1 ) == 2 )
{
next_char();
}
else
{
move_abs(0);
}
drop_anchor();
if ( search_fwd( " |(|\t|\n", 1 ) == 2 )
{
prev_char();
}
size = inq_mark_size();
prev_char( size-1 );
mtxt = read(size);
raise_anchor();
restore_position ();
mtxt = trim(mtxt);
return mtxt;
}