New to FreeBASIC? Post your questions here.
Löwenherz
Posts: 48 Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany
Post
by Löwenherz » Apr 26, 2024 6:36
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: 1774 Joined: May 27, 2005 7:15
Location: FRANCE
Post
by SARG » Apr 26, 2024 7:48
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: 48 Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany
Post
by Löwenherz » Apr 26, 2024 11:12
Yes thats good many thanks Sarg
Imortis
Moderator
Posts: 1926 Joined: Jun 02, 2005 15:10
Location: USA
Contact:
Post
by Imortis » Apr 26, 2024 14:00
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: 48 Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany
Post
by Löwenherz » Apr 26, 2024 18:35
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