.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
text format question
Old
  (#1)
commonbullet
Member
 
commonbullet's Avatar
 
Status: Offline
Posts: 49
Join Date: Nov 2004
Default text format question - 14-09-2005



i'm sorry, i'm really stupid with these things. i was messing with condition-zero mission files. they use a text format like that
Quote:

"CareerGame"
{
"InitialPoints" "2"
"MatchWins" "3"
"MatchWinBy" "2"
"Characters" "Cooper Floyd Kenny Morris Stanley Vern Quincy Gus Ben Eddie Kent Oscar Phil Leon Pete Roger Maverick Cole Igor Larry Ray Sam Travis Kirk Alex Brent Jake Tex Lou Ace Rooster Eagle Sandman Barney Steel Duke Bear"

// If a value is not present or 0, that cost and higher are assumed to be always available.
"CostAvailability"

...
i was wondering if it's a standard notation, and if there's some 'reader component' as so to make things easier...


Last edited by commonbullet; 14-09-2005 at 21:15..
  
Reply With Quote
Re: text format question
Old
  (#2)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: text format question - 14-09-2005

You can do quite a bit of cheap string hacks to read something like that.
For example, at some point in time I needed to parse something like "variable/value".
What I did was do strstr with the "/" character and if it was found I set the character to a null terminator.
So now original_string is the variable and slash_character + 1 is the value.

Or atleast thats how I remember it.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com