The above listing is my first attempt on this forum, so I’m not up to speed on the details of how to enter something. But i see that although I typed in the line
Solve[g1==0,g2 somehow the got left off immediately after g1 and g2. It probably will do it again here. So please note that what I actually typed has the open square bracket, x, close square bracket after g1 and g2 in my Solve expression that does not work.
In[1]:= Solve[-7 + a x + y == 0 && -1 + b x - y == 0, {x, y}]
Out[1]= {{x -> 8/(a + b), y -> -((a - 7 b)/(a + b))}}
In[2]:= g1[x_, y_] := -7 + a x + y;
g2[x_, y_] := -1 + b x - y;
Solve[g1[x, y] == 0 && g2[x, y] == 0, {x, y}]
Out[4]= {{x -> 8/(a + b), y -> -((a - 7 b)/(a + b))}}
Note: I make heavy use of the little <> icon towards the right end of the second row above the reply box. That used to provide a single box where code could be pasted and would usually not be corrupted in the process. Now it makes multiple single line boxes when I paste code, but I scrape-n-paste-delete-empty-boxes to accomplish the same. And I check carefully both before and after clicking the Publish button, and repeatedly edit if need be, to get the posting to be something that can be directly scrape-n-pasted into a notebook by the readers.