diff --git a/HISTORY b/HISTORY index fe72ee4..7323058 100755 --- a/HISTORY +++ b/HISTORY @@ -2,6 +2,7 @@ Feb. 25 2016 Improved importing directory detection Fixed a bug with the END and RETURN statement with FOR loop Fixed an array index calculation bug +Fixed a wrong variable manipulation bug with the PRINT statement Feb. 24 2016 Added a TO_ARRAY statement diff --git a/core/my_basic.c b/core/my_basic.c index b6e8c73..2e17b2e 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -14766,9 +14766,6 @@ static int _std_print(mb_interpreter_t* s, void** l) { mb_assert(s && l); - val_ptr = &val_obj; - _MAKE_NIL(val_ptr); - ++s->no_eat_comma_mark; ast = (_ls_node_t*)*l; ast = ast->next; @@ -14778,6 +14775,8 @@ static int _std_print(mb_interpreter_t* s, void** l) { obj = (_object_t*)ast->data; do { + val_ptr = &val_obj; + _MAKE_NIL(val_ptr); switch(obj->type) { case _DT_VAR: if(obj->data.variable->data->type == _DT_ROUTINE) { diff --git a/output/my_basic.exe b/output/my_basic.exe index 57f9e25..ba20059 100755 Binary files a/output/my_basic.exe and b/output/my_basic.exe differ