BT - Function calling
Posted: Sun Aug 31, 2014 4:31 am
Problem ?? calling a Function by label with no PARENS (), I thought was illegal
OR is it because I am not passing a value to it, just getting the RETURN value???
'
BT/compiler will call this function:
/////
function event_current_status()
dim current_status
current_status = AD(2) >>6
return current_status
end function
/////
with this result:
Executing...
starting Main:
1 to display time-- 2 to set time
3 live AD value -- 4 set threshold
5 reset data, 6 review data, 7 prnt data
8 battery voltage, 9 event logger - GO
choice was 2
* * RTC updated during 'EVENT logger
set time accordingly
D ? enter value
H ? enter value
M ? enter value
S ? enter value
time is set
30th 21:18:45
1 to display time-- 2 to set time
3 live AD value -- 4 set threshold
5 reset data, 6 review data, 7 prnt data
8 battery voltage, 9 event logger - GO
choice was 9
start status 420....................NO PARENS, to get this value
30th 21:19:OO
30th 21:19:O3
382........................I changed the AD potentiometer input - so the 'while loop would exit"
no parens !!
30th 21:19:O4
373
no parens !!
30th 21:19:O5
396
no parens !!
30th 21:19:O6
404
no parens !!
*******************************CODE SEGMENT that caused the above print out -- notice the parens () are missing !!!
Status:
event_start_status = event_current_status .......................NO PARENS
print "start status ",event_start_status
'
Monitor_loop:
'
if threshold >= 0
while event_start_status < (event_current_status() + hysteresis) AND event_start_status > (event_current_status() -hysteresis)
call RTC_update_time
loop 'checks event monitor input pin every second
else
'REM routine for digital change in value
endif
gosub RTC_read_time
'
print event_current_status.......................NO PARENS
print "no parens !!"
event_start_status = event_current_status()
'log info
'check for an end of job event/button
goto Monitor_loop
OR is it because I am not passing a value to it, just getting the RETURN value???
'
BT/compiler will call this function:
/////
function event_current_status()
dim current_status
current_status = AD(2) >>6
return current_status
end function
/////
with this result:
Executing...
starting Main:
1 to display time-- 2 to set time
3 live AD value -- 4 set threshold
5 reset data, 6 review data, 7 prnt data
8 battery voltage, 9 event logger - GO
choice was 2
* * RTC updated during 'EVENT logger
set time accordingly
D ? enter value
H ? enter value
M ? enter value
S ? enter value
time is set
30th 21:18:45
1 to display time-- 2 to set time
3 live AD value -- 4 set threshold
5 reset data, 6 review data, 7 prnt data
8 battery voltage, 9 event logger - GO
choice was 9
start status 420....................NO PARENS, to get this value
30th 21:19:OO
30th 21:19:O3
382........................I changed the AD potentiometer input - so the 'while loop would exit"
no parens !!
30th 21:19:O4
373
no parens !!
30th 21:19:O5
396
no parens !!
30th 21:19:O6
404
no parens !!
*******************************CODE SEGMENT that caused the above print out -- notice the parens () are missing !!!
Status:
event_start_status = event_current_status .......................NO PARENS
print "start status ",event_start_status
'
Monitor_loop:
'
if threshold >= 0
while event_start_status < (event_current_status() + hysteresis) AND event_start_status > (event_current_status() -hysteresis)
call RTC_update_time
loop 'checks event monitor input pin every second
else
'REM routine for digital change in value
endif
gosub RTC_read_time
'
print event_current_status.......................NO PARENS
print "no parens !!"
event_start_status = event_current_status()
'log info
'check for an end of job event/button
goto Monitor_loop