AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   retrieving 1 character from a string (https://forums.alliedmods.net/showthread.php?t=27579)

GHW_Chronic 04-24-2006 19:52

retrieving 1 character from a string
 
Look:
Code:
new filename[200], len if(read[i3]!='[') {     len += format(filename[len],199-len,"%s",read[i3]) }

Obviously that isn't how I would place the character "read[i3]" at the end of "filename", it would of course place the entire string starting with "read[i3]" onto the end of "filename". So question is, how do I place only the 1 character "read[i3]" onto the end of "filename"?

Anyone that does not believe I gave sufficient enough code to answer this question, clearly you do not understand the question. To those people, please do not post.

v3x 04-24-2006 19:54

copy();

GHW_Chronic 04-24-2006 20:02

I think I got it

Code:
new char[1] format(char,0,"%s",read[i3]) len += format(filename[len],199-len,"%s",char)

Edit: and of course not "char" as a variable name.

Greenberet 04-25-2006 03:16

Code:
new filename[200], len if(read[i3]!='[') {     len += format(filename[len],199-len,"%c",read[i3]) }

v3x 04-25-2006 03:19

What is '%c'?

GHW_Chronic 04-25-2006 03:20

careface. I figured this out hours ago.

Greenberet 04-25-2006 03:28

%c = char

GHW_Chronic 04-25-2006 03:32

that was a hard one to figure out :roll:


All times are GMT -4. The time now is 04:59.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.