Questionmark AS command

Started by Frank Brübach, April 26, 2024, 01:07:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Frank Brübach

Hi Charles have a little question
How to make a ? AS Print command in oxygen?

' how to make a ? as print command?
' I assume it's an reserved character in oxygen?

' declare ?(string st) as string
' ? = print

sub questionmark(args as string)
dim i as Integer
For i=0 To Len(args)-1
'Print Chr(args[i])
Next
return Print chr(args[i]) 'chr(9)+chr(13)+ 
End Sub

questionmark("hello world")

Charles Pegge

#1
Hi Frank,
'?' is used as a sys casting operator.

It cannot be redefined because it is not an alpha character. But you can do this using for example, an upper ascii £ (156) :

def £ print
£ "ok"

Also, you ccould use '?' as a suffix:

def p? print
p? "ok"

Frank Brübach

Thank you Charles I Had a similar Idea with simple "d" and "p"

Have built an example too
I tried ? and ?? as sys but doesn't Work but thats Not important for me :)

Regards Frank