this one comes from Melabs code example
Code:
' PicBasic Pro program to read pot and display on LCD

' Define LCD pins
Define  LCD_DREG        PORTA
Define  LCD_DBIT        0
Define  LCD_RSREG       PORTA
Define  LCD_RSBIT       4
Define  LCD_EREG        PORTB
Define  LCD_EBIT        3

' Allocate variables
x       var     byte


        CMCON = 7               ' Set PORTA to digital

        Pause 100               ' Wait for LCD to start


mainloop: Pot PORTB.0, 127, x

        Lcdout $fe, 1, "pot=", #x       ' Send value to LCD

        Pause   100             ' Do it about 10 times a second

        Goto    mainloop        ' Do it forever

        End
in the PBP you have also one code example for POT and the according schematic. BTW if you don't have any book on hand, they provide one online

pdf:
http://www.melabs.com/downloads/pbpm304.pdf

Html:
http://microengineeringlabs.com/resources/pbpmanual


CMCON is the register for analog comparator of the PIC16F628. You'll find it in the datasheet section 9.0
datasheet:
http://ww1.microchip.com/downloads/e...Doc/40300c.pdf