Re: Random Numbers
Ok. Thanks. 2013/4/11 Ariel Constenla-Haile arie...@apache.org Hi Jorge, On Thu, Apr 11, 2013 at 07:16:02PM -0500, jorge ivan poot diaz wrote: Hello, I have this code, I try to generate random numbers, but I have problems when I build: protected double getRandomDouble() { return (maRandom.nextInt(1000) * maRandom.nextDouble()); } Looks like you copied pasted from http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/odk/examples/DevelopersGuide/Text/TextDocuments.java#690 maRandom is a member variable in that Java class, of type java.util.Random. No way this will ever work in cui/source/tabpages/tpcolor.cxx What could be the error in this code? Java != C++ Regards -- Ariel Constenla-Haile La Plata, Argentina
Random Numbers
Hello, I have this code, I try to generate random numbers, but I have problems when I build: protected double getRandomDouble() { return (maRandom.nextInt(1000) * maRandom.nextDouble()); } Here is the error: /home/ivan/aoo/main/cui/source/tabpages/tpcolor.cxx: In member function 'long int SvxColorTabPage::ClickAddHdl_Impl(void*)': /home/ivan/aoo/main/cui/source/tabpages/tpcolor.cxx:547:2: error: expected primary-expression before 'protected' /home/ivan/aoo/main/cui/source/tabpages/tpcolor.cxx:547:2: error: expected ';' before 'protected' dmake: Error code 1, while making '../../unxlngi6.pro/slo/tpcolor.obj' ERROR: error 65280 occurred while making /home/ivan/aoo/main/cui/source/tabpages This snippet, I want to implement it in tpcolor.cxx http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/cui/source/tabpages/tpcolor.cxx#465 What could be the error in this code? Helpme! Regards.
Re: Random Numbers
Hi Jorge, On Thu, Apr 11, 2013 at 07:16:02PM -0500, jorge ivan poot diaz wrote: Hello, I have this code, I try to generate random numbers, but I have problems when I build: protected double getRandomDouble() { return (maRandom.nextInt(1000) * maRandom.nextDouble()); } Looks like you copied pasted from http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/odk/examples/DevelopersGuide/Text/TextDocuments.java#690 maRandom is a member variable in that Java class, of type java.util.Random. No way this will ever work in cui/source/tabpages/tpcolor.cxx What could be the error in this code? Java != C++ Regards -- Ariel Constenla-Haile La Plata, Argentina pgpZS4Co5Ie17.pgp Description: PGP signature