;CH Turbo C Syntax Checker Macro 
;Olympic Software  Saline, MI  1988

(macro ch
	(
	(string selected
			  sel_msg
	)
	(int col_start
		  col_end
		  sel_len	
	)	
	(save_position)

;** Get command into variable selected
;	(= ret_val (search_fwd "<|[ \\t]\\c[~ \\t\\n]"))
;	(= ret_val (search_back "<|[ \\t]\\c[~ \\t\\n]"))

	(search_back "[( \t]")
	(inq_position NULL col_start)
	(next_char)
	(= selected (search_fwd "[( \t]"))
	(prev_char)
	(inq_position NULL col_end)
	(search_back "[( \t]")
	(next_char)
	(= sel_len (- col_end col_start))
	(= selected (read sel_len))
	(sprintf selected "{ \\*%s}|{ %s}" selected selected)
	(sprintf sel_msg "Start %d  Stop %d  Char %s" col_start col_end selected)
;	(message sel_msg)
;	(while (!= 13 (% (read_char) 256)))

;** Now find it in the chelp.hlp help file

	(create_edge 2)
	(change_window 2)
	(edit_file "chelp.hlp")
	(goto_line 1)
	(message "Searching ....")
	(search_fwd selected)
	(drop_anchor)
	(next_char)
	(= selected (search_fwd "[( \\t]"))
	(message "type Enter to continue")
	(while (!= 13 (% (read_char) 256)))
	(raise_anchor)
	(change_window 0)
	(delete_edge 2)
	(restore_position)
	)
)
