Questionmark "?"

New to FreeBASIC? Post your questions here.
Post Reply
Löwenherz
Posts: 74
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Questionmark "?"

Post by Löwenherz »

hello all
a silly question perhaps, but how to make a substitute For ? = print as reserved character?

Code: Select all

sub qmark(args() as string)
dim i as integer
for i = lbound(args) to ubound(args)
print args(i);
next
Print
end sub

'qmark("hello") ' error
sleep
SARG
Posts: 1788
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Questionmark "?"

Post by SARG »

Not sure to understand your question :-)
By the way, a string is not an array it's a special datatype.
Maybe this :

Code: Select all

sub qmark(args as string)
for i as integer  = 0 to len (args)-1
print chr(args[i]);
next
Print
end sub

qmark("hello") ' error
sleep
Löwenherz
Posts: 74
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Questionmark "?"

Post by Löwenherz »

Yes thats good many thanks Sarg :)
Imortis
Moderator
Posts: 1929
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Questionmark "?"

Post by Imortis »

Code: Select all

? "Hello"
Is that what you are trying to do? That works in FB. You don't need to do anything special to use the question mark in place of Print..
Löwenherz
Posts: 74
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Questionmark "?"

Post by Löwenherz »

Thank you imortis I wanted only to know how to build a ? Print message for another language and If thats possible with a function or SUB but there were Special reserved characters too so I couldnt Program that questionmark :)
Post Reply