Hello,
i try to implemet functions of the time-librarie with in line c.
I have found some code-snippets in the form and have try to change this
for my use.
But i get a lot of compiler-errors for the inline-c.
...
sketch\b4r_timework.cpp: In function 'void tMinute(B4R::Object*)':
b4r_timework.cpp:18: error: '_minute' is not a member of 'b4r_main'
b4r_main::_minute = minute();
^
b4r_timework.cpp:18: error: 'minute' was not declared in this scope
b4r_main::_minute = minute();
^
....
The code is following:
i try to implemet functions of the time-librarie with in line c.
I have found some code-snippets in the form and have try to change this
for my use.
But i get a lot of compiler-errors for the inline-c.
...
sketch\b4r_timework.cpp: In function 'void tMinute(B4R::Object*)':
b4r_timework.cpp:18: error: '_minute' is not a member of 'b4r_main'
b4r_main::_minute = minute();
^
b4r_timework.cpp:18: error: 'minute' was not declared in this scope
b4r_main::_minute = minute();
^
....
The code is following:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Private Year As Int
Private Month As Int
Private Day As Int
Private WeekDay As Int
Private Hour As Int
Private Minute As Int
Private Second As Int
End Sub
Sub GetMinute As Int
RunNative("tSecond", Null)
Return Minute
End Sub
Sub GetSecond As Int
RunNative("tSecond", Null)
Return Second
End Sub
Sub SetTime
RunNative("tSetTime", Null)
End Sub
#If C
#include <Time.h>
void tMinute(B4R::Object* o) {
b4r_main::_minute = minute();
}
void tSecond(B4R::Object* o) {
b4r_main::_second = second();
}
void tSetTime(B4R::Object* o) {
settime(b4r_main::_hour,b4r_main::_minute,b4r_main::_second,b4r_main::_day,b4r_main::_month,b4r_main::_year);
}
#End If