Interactive PowerBasic Forum

IT-Consultant: Charles Pegge => OxygenBasic Examples => Topic started by: Frank Brübach on April 26, 2024, 01:07:48 PM

Title: Questionmark AS command
Post by: Frank Brübach on April 26, 2024, 01:07:48 PM
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")
Title: Re: Questionmark AS command
Post by: Charles Pegge on April 26, 2024, 02:43:20 PM
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"
Title: Re: Questionmark AS command
Post by: Frank Brübach on April 26, 2024, 05:15:30 PM
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