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 » U++ community news and announcements » Upp 610-dev2 released
Re: Upp 610-dev2 released [message #5848 is a reply to message #5847] Fri, 20 October 2006 22:52 Go to previous messageGo to previous message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
luzr wrote on Fri, 20 October 2006 17:43

Really strange, should not be affected by encoding...

Mirek


Ok, upon a closer look, it's really trivial.
The match for "printer" will obviously break in non-English locales:
Vector<String> l = Split(System("lpstat -p"), '\n');
for(int i = 0; i < l.GetCount(); i++) {
	Vector<String> w = Split(l[i], ' ');
	if(w[0] == "printer" && w.GetCount() > 1)
            printer.Add(w[1]);
}



Maybe lpstad -a is easier to parse. Although I'm not quite sure I understand the semantic differences from the -p option:

Vector<String> l = Split(System("lpstat -a"), '\n');
for(int i = 0; i < l.GetCount(); i++) {
	Vector<String> w = Split(l[i], ' ');
	printer.Add(w[0]);
}


Guido
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Quick start issues for new users
Next Topic: Upp 610-dev3 released
Goto Forum:
  


Current Time: Thu Mar 28 18:33:40 CET 2024

Total time taken to generate the page: 0.01237 seconds