error: expected ';' before '(' token
Posted: 28 September 2009, 0:48 AM
Hi
I'm getting the following internal error, the test case is provided below.
project file is
The generated c file test28-9-09.c is
I'm getting the following internal error, the test case is provided below.
- test28_9_09.c:71: error: expected ';' before '(' token
test28_9_09.c:71: error: expected ';' before '}' token
test28_9_09.c:71: error: expected statement before ')' token
test28_9_09.c:75: error: expected ')' before 'else'
test28_9_09.c:82: error: expected ';' before '}' token
test28_9_09.c:104: error: expected declaration or statement at end of input
test28_9_09.c:97: warning: unused variable 'stringTbl'
Error: one or more errors occurred in the back-end build process for "test28-9-09.zxb"
>Exit code: 1
Code: Select all
Declare Sub wait4userInput(byVal str as String) Based wait4userInputAddr
private wait4userInputAddr as Long Attribute(used)
public waiting4UserInput as byte = 0
'~ Called from Menu_imp.c menu definition
public sub SetTime() Attribute(Used)
'~ Procedure for getting key input
waiting4UserInput = 1
'~ 2) register the call back routine
wait4userInputAddr = SetTimeDOIT.CodeAddress
'~ call displayMsg("FMT HH:MM")
'~ call DisplaySetPos(1, 5)
end sub
dim kbReadTask(1 to 260) as Byte
Dim keyVal as UnsignedInteger
Dim keyStr as String
Dim inputStr as String
sub kbRead()
do
'~ keyVal = kb_get()
'~ KeyStr = Chr(kb_decode(keyVal, 0))
KeyStr = "f"
'~ if (menuActive = 1) then
'~ if (waiting4UserInput = 1) then
select case keyVal
case 0 'We have finished, passed keys to waiting sub
Call wait4userInput(inputStr)
waiting4UserInput = 0
inputStr = ""
case else
if (Asc(keyStr) <> 0) then
inputStr = inputStr & keyStr
'~ call showUserKey(keyStr)
'~ call showUserKey(inputStr)
end if
end select
'~ end if
'~ end if
call delay(0.3)
loop
end sub
sub SetTimeDOIT(Byval s as String)
end sub
Sub Main()
callTask kbRead(), kbReadTask
end sub
Code: Select all
--verbose
--keep-files
test28-9-09.bas
Code: Select all
#include "test28_9_09.h"
#define HEAP_LIMIT (uint8_t *)0
#define HEAP_SIZE 512
PersistData sysData EEMEM = { 0, ZX_TRUE };
// default Com1 speed
#define DEF_COM1_SPEED 19200
// transmit and receive queues for Com1
uint8_t txQueue[25] NO_INIT;
uint8_t rxQueue[50] NO_INIT;
static int32_t mzv_wait4userInputAddr USED;
static uint8_t mzv_kbReadTask[260];
static uint16_t mzv_keyVal;
static String mzv_keyStr;
static String mzv_inputStr;
uint8_t zv_waiting4UserInput;
ZX_INIT_MAIN(init_test28_9_09, HEAP_LIMIT, HEAP_SIZE)
{
initHeap();
initQueue((Queue *)txQueue, sizeof(txQueue));
initQueue((Queue *)rxQueue, sizeof(rxQueue));
zxInit(BAUD_FACTOR_2X(DEF_COM1_SPEED));
#if defined(ENABLE_SW_UART)
enableSerialSW();
#endif
strInit(&mzv_keyStr, AN_STR);
strInit(&mzv_inputStr, AN_STR);
}
int
main(void)
{
#if defined(ZX_INIT)
ZX_INIT;
#endif
startMainTask(zf_Main);
for(;;);
}
void
zf_Main(void)
{
taskStart(zf_kbRead, mzv_kbReadTask, 260, 0);
}
void
zf_SetTime(void)
{
zv_waiting4UserInput = 1;
mzv_wait4userInputAddr = flashAddr(&zf_SetTimeDOIT);
}
void
zf_kbRead(void)
{
while (1)
{
strCopy(&mzv_keyStr, STRTBL(0));
{
uint16_t _zv_selectValTemp02;
_zv_selectValTemp02 = mzv_keyVal;
if (_zv_selectValTemp02 == 0)
{
IC0((void (*)(String))(uint16_t)(mzv_wait4userInputAddr), mzv_inputStr);
zv_waiting4UserInput = 0;
strCopy(&mzv_inputStr, STRTBL(2));
}
else
{
if ((strChar(mzv_keyStr, 1)))
{
strCopy(&mzv_inputStr, strCat(mzv_inputStr, mzv_keyStr));
}
}
}
taskDelay(0.3);
}
}
void
zf_SetTimeDOIT(String zp_s)
{
uint8_t strTypeSave1;
FIX_PARM_STR(strTypeSave1, zp_s);
FREE_PARM_STR(strTypeSave1, zp_s);
}
// string table
prog_char stringTbl[] =
{
// STRTBL(0) - "f"
0x01, 0x66,
// STRTBL(2) - ""
0x00,
};