I wanted to know if it is possible to write function in picbasic. By functions i am referring to the functions that you write in higher level languages like C, where you can pass a value to this function, it performs some operations and then returns a value. i have gone through the pic basic pro manual and i havent found anything that will do this. The closest thing is the gosub routine but gosub doesnt return a value, but other than that i havent found anything else. I want to use functions so that i can make the program more efficient and to save space of the program memory space, and also make debugging easier. The PIC i am using is an 18F2550. So if anyone has any suggestions please let me know.