Maker Pro
Maker Pro

create a function in basic language

hi my friends:):) i need create a function in mikroBasic PRO for PIC compiler ,

I need your help:rolleyes::rolleyes:


My question is how do I create a function in mikroBasic???
 

Harald Kapp

Moderator
Moderator
sub function shift (dim i as integer) as word
defines a sub function named shift with an input parameter named i as a byte and a return value as word.

"Return value of the function shift is not defined" tells you that per definition shift() sholuld return a word value, but there is no such statement in the code.
Depending on the basic dialect (and sorrry, I'm not familiar with mikroBasic) this is typically done bei either
shift = return_value where return_value is a word that is returned to the calling routine or by
return(return_value)
You'll have to look up the precise statement in the mikrbasic language reference manual.

The other errors are probably somewhere else in the code. lacking the complete code and matching line numbers it is hard to tell.
 
Top