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: 105
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: Sound and plugin/portaudio
Goto Forum:
  


Current Time: Fri Dec 03 13:36:34 CET 2021

Total time taken to generate the page: 0.01177 seconds