print char os string?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
ibm5155
Posts: 1268
Joined: Wed Jul 20, 2011 4:24 pm
Contact:

print char os string?

Post by ibm5155 »

Hey guys, so i´m doing a function that print strings and chars, but i note that strings have a strange int value (at least for me), like the first string if you show the integrer value it´s 0, the second is 0 the third is 2...

write("test");//it´s going to print on screen test
write('C');//it´s going to print on screen C

i tryed this for solve the problem
Spoiler:
but some times some strings got bigger than 31 o_o...

Here´s my question, how to solve that problem, if you use a string it prints a string and if it´s a char it prints a char...?
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: print char os string?

Post by randi »

You need to add another parameter to your function to tell it whether you're printing a string or a character. As far as ACS is concerned, they are both just numbers. It's the c: and the s: in the print statement that tell it how to interpret them.
Locked

Return to “Editing (Archive)”