Just hold the value in a variable:
if INKEY$ ( ) = "1" then camnum = 1
if INKEY$ ( ) = "2" then camnum = 2
if camnum = 1 then set camera to follow object position x ( 2 ), object position y ( 2 ), object position z ( 2 ),3, 4, 2, 1, 1
if camnum = 2 then set camera to follow object position x ( 2 ), object position y ( 2 ), object position z ( 2 ),3, 8, 2, 4, 1
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.