but I keep getting an "END expected" error at the line containing
Code: Select all
sub myNeededFunc() prototype
Jerry
Moderators: David Barker, Jerry Messina
Code: Select all
sub myNeededFunc() prototype
Code: Select all
prototype sub myNeededFunc()
Code: Select all
'prototype declaration causes incorrect code generation with inline
prototype function funct_with_prototype() as word
'uncommenting the following causes this function to screw up too
'prototype function funct_without_prototype() as word
dim w as word
dim ticks as word
sub IncrTicks()
inc(ticks)
end sub
' disable intr while accessing ticks
inline function GetTicks() as word
INTCON.bits(7) = 0
result = ticks
INTCON.bits(7) = 1
end function
function funct_with_prototype() as word
result = GetTicks()
end function
function funct_without_prototype() as word
result = GetTicks()
end function
main:
ticks = 0
' this generates correct code
w = GetTicks()
IncrTicks()
' so does this
w = funct_without_prototype()
IncrTicks()
' this does NOT
w = funct_with_prototype()
end