Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Check string[i] for content
Check string[i] for content [message #34460] Wed, 23 November 2011 13:51 Go to previous message
Wolfgang is currently offline  Wolfgang
Messages: 146
Registered: November 2011
Location: Germany
Experienced Member
Hello,

i try to make something like a parser....

void curve::term_op1(String &term, String &newterm, int &pos)
{
	String justOne = term.Mid(pos,1);
	
	if (justOne.IsEqual("+"))
	{
		newterm << " + ";
		pos++;
	} else if (justOne.IsEqual("-"))
	{
		newterm << " - ";
		pos++;
	} else
	{
		if (IsDigit(justOne))
		{ /* should trigger if it is a number 0-9) */
			newterm << " INT (" << justOne << ") ";
			pos++;
		} else
		{
			newterm << " Something else (" << justOne << ") ";
			pos++;	
		}
	}
}


Of course the "IsDigit" does not work.... can someone tell me how to do this... maybe without a String with 1 character in it (i think its really bad to do it this way?)


Thanks!

Best regards,
Wolfgang

[Updated on: Wed, 23 November 2011 13:52]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: What Type to give a Layout as parameter?
Next Topic: How do I get back to the .lay visual editor after a run
Goto Forum:
  


Current Time: Sun Aug 24 17:22:29 CEST 2025

Total time taken to generate the page: 0.04841 seconds