Forum

Checking the beginning of strings...

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Checking the beginning of strings...

Postby Morkai » Sat Mar 29, 2008 3:24 pm

Hi Everyone, (I'm new...ish)

Was playing the other day with DP and QuakeC.

Is there a way to check the beginning part of a string...?
(was trying to implement footsteps specific to texture)

eg. if the string has "METAL_" or "WOOD_" at the beginning.

I know I could do a check against all the possible texture names I have but I was trying to cut out a lot of code writing!

Thanks a bunch. :D
Morkai
 
Posts: 2
Joined: Sat Mar 29, 2008 3:08 pm

Postby Morkai » Sat Mar 29, 2008 4:37 pm

Sussed it...

strncasecmp etc. in the FTE_STRINGS bit of dpextensions.QC

No worries!
Morkai
 
Posts: 2
Joined: Sat Mar 29, 2008 3:08 pm

Postby CocoT » Tue Apr 01, 2008 3:46 am

I'm glad you find out the answer, Morkai :)
I'm afraid I personally wouldn't have been of much help :P
Neurotic Conversions - New location: Update your bookmarks!
User avatar
CocoT
 
Posts: 695
Joined: Tue Dec 14, 2004 5:39 pm
Location: Belly-Gum


Return to QuakeC Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest