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 » Coffee corner » Now this is pretty cool
Now this is pretty cool [message #57625] Mon, 11 October 2021 07:44
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 220
Registered: June 2011
Experienced Member
I keep finding neat functions in Upp. I live for stuff like this:

struct Records {
    Vector<String> colA;
    Vector<String> colB;
    Vector<String> colC;
    Vector<String> cold;
    
    void Add(String a, String b, String c, String d) {
        colA.Add(a);
        colB.Add(b);
        colC.Add(c);
        colD.Add(d);
    }

    void Sort() {
        CoIndexSort3(colA, colB, colC, colD);
    }
};

CONSOLE_APP_MAIN {
    FileIn f("whatever.csv");
    Records recs;

    while(!f.IsEof()) {
        auto cols = GetCsvLine(f, ',', CHARSET_DEFAULT);
        recs.Add(cols[0], cols[1], cols[2], cols[3]);
    }

    recs.Sort();
}
Previous Topic: files needed when distributing a u++ application (windows 10)
Next Topic: Little Quiz
Goto Forum:
  


Current Time: Wed Apr 24 20:27:54 CEST 2024

Total time taken to generate the page: 0.02392 seconds