mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-01 13:50:36 +00:00
Introduces _ECHO, which will output a string to the console.
_ECHO is more of a macro than a new statement, as it'll perform the following actions: 1- Save current _DEST; 2- Switch to _CONSOLE; 3- Print the passed string (only strings accepted); 4- Switch back to previous _DEST. None of the PRINT features such as USING, numeric variables, retaining the cursor are implemented/planned for this statement. Closes #29
This commit is contained in:
parent
bf99e30c30
commit
688e31c0f3
|
@ -26433,6 +26433,20 @@ void sub__maptriangle(int32 cull_options,float sx1,float sy1,float sx2,float sy2
|
|||
}//title
|
||||
|
||||
|
||||
void sub__echo(qbs *message){
|
||||
if (new_error) return;
|
||||
|
||||
int32 prevDest=func__dest();
|
||||
sub__dest(func__console());
|
||||
|
||||
makefit(message);
|
||||
qbs_print(message,0);
|
||||
qbs_print(nothingstring,1);
|
||||
|
||||
sub__dest(prevDest);
|
||||
|
||||
}//echo
|
||||
|
||||
// 0 1 2 0 1 2
|
||||
void sub__resize(int32 on_off, int32 stretch_smooth){
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ extern int32 FontRenderTextASCII(int i,uint8*codepoint,int32 codepoints,int32 op
|
|||
|
||||
|
||||
extern void sub__title(qbs *title);
|
||||
extern void sub__echo(qbs *message);
|
||||
|
||||
extern void sub__glrender(int32 method);
|
||||
extern void sub__displayorder(int32 method1,int32 method2,int32 method3,int32 method4);
|
||||
|
|
|
@ -7337,7 +7337,12 @@ DO
|
|||
END IF
|
||||
|
||||
|
||||
|
||||
'_ECHO checking
|
||||
IF firstelement$ = "_ECHO" THEN
|
||||
IF Console = 0 THEN
|
||||
a$ = "_ECHO requires $CONSOLE or $CONSOLE:ONLY to be set first": GOTO errmes
|
||||
END IF
|
||||
END IF
|
||||
|
||||
|
||||
'ASC statement (fully inline)
|
||||
|
|
|
@ -871,6 +871,15 @@ id.arg = MKL$(STRINGTYPE - ISPOINTER)
|
|||
id.NoCloud = 1
|
||||
regid
|
||||
|
||||
clearid
|
||||
id.n = "_ECHO"
|
||||
id.subfunc = 2
|
||||
id.callname = "sub__echo"
|
||||
id.args = 1
|
||||
id.arg = MKL$(STRINGTYPE - ISPOINTER)
|
||||
id.NoCloud = 1
|
||||
regid
|
||||
|
||||
clearid
|
||||
id.n = "CLEAR"
|
||||
id.subfunc = 2
|
||||
|
|
Loading…
Reference in a new issue