Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 01 Oct 2014, 14:43
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
C++
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sun 20 Sep 2009, 14:39    Post_subject:  C++
Sub_title: Lobster tries to object orientate
 

There I was trying to learn C++ programming
and before I knew it created this:

CE Registration Program
Compiling details of available participants
for Puppy Community Edition


Here is the code:

Code:
/*
CE Registration
Compiling details of available participants
for Puppy Community Edition
* Lobster Sep 2009
 */
#include <iostream.h>
#include <fstream.h>
using namespace std;

int main ()
{

/////////////// Welcome
system("clear");
    cout << "== Community Edition Registration == \n\n"; // This lets us show a message
    string web_name;
      cout << "Enter your Web Name: ";
      getline (cin, web_name);
      cout << "\nHi ";
      cout << web_name ;
      cout << "\nThis program will collect some details \n to help us compile talents \n for the Puppy CE editions \n\n" ;

/////////////// Questions
system("clear");
    string skills_offered, contact_details, misc_info ;
      cout << "What Puppy Skills are you offering? \n eg. Coordinating, programming, compiling, testing, maintaining wiki, hosting, artwork, \n\n Type them in (separated by commas): ";
      getline (cin, skills_offered);
system("clear");      
      cout << "How do you prefer to be contacted? \n eg. forum (provide forum name), email (address)\n Type in contact details: ";
      getline (cin, contact_details);
system("clear");
      cout << "Any other Info? ";
      getline (cin, misc_info);

/////////////// Create file
  ofstream myfile ("registration.txt");
  if (myfile.is_open())
  {
    myfile << "Puppy Details for ** ";
    myfile << web_name ; //add variable write
    myfile << " **\n\n";
    myfile << "Skills offered: ";
    myfile << skills_offered ; //add skills
        myfile << " \n";
    myfile << "Contact Details: ";
    myfile << contact_details ; //add skills
         myfile << " \n";
    myfile << "Misc Info: ";
    myfile << misc_info ; //add skills
         myfile << " \n\n\n";   
         myfile << " Please send 'registration.txt to ed.jason@gmail.com \n or add details to wiki \n http://puppylinux.org/wikka/Puppy44 " ;
 
   myfile.close();
  }
  else cout << "Unable to open file";


/////////////// Thanks and Bye
system("clear");
cout << "\nOK ";
      cout << web_name ;
      cout << "\nA text file called 'registration.txt' \n has been created, which you can edit \n Please send 'registration.txt to ed.jason@gmail.com \n or add details to wiki \n http://puppylinux.org/wikka/Puppy44 \n" ;
system("defaulttexteditor registration.txt");
  return 0; // Quits the program
}




run the program from the terminal
Code:
# ./cereg


Years ago I did a couple of weeks of C programming
Yuk!
Luckily the most ridiculous aspect of C (atrocious string handling)
has been rectified Laughing

What I have learned so far:

C++ in easy steps is the book I used
but loads of great tutorials on the web

Make sure you have devx.sfs

Geany is GREAT as an IDE for C++
and it is in Puppy 4.3
compile and then build
and then run from the terminal with
Code:
./myfirstprog.cpp


Make use of the web.
Quite often C++ wouldn't work
I looked up examples until something worked

my code uses old commands
but it compiles

_________________
Puppy WIKI

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Mon 21 Sep 2009, 07:02    Post_subject:  

Objects?
Here's a Puppy class and object for you [from Tronkel]
thanks Tronkel - will have to study that . . .

Code:
#include <string>

using namespace std;

class Puppy
{

private:
string colour;
int lengthOfTail;
int noOfTeeth;
string name;
string address;

public:
Puppy(); //default ctor
//set, get class data members follow e.g.

int retnoOfTeeth();



};

if you need a Puppy object;

int main()
{

Puppy aPup; //declare a Puppy instance
//do what you need here e.g.
cout << aPup.retnoOfTeeth() << endl;

return 0;

}

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 22 Sep 2009, 05:41    Post_subject:  

OK still working on understanding Objects

Meanwhile . . . working on the Puppy bug reporter as my second program . . .
I have been working on combining gtkdialog3 with C++
- it is in Alpha - will be gardening the rest of today
so anyone able to improve and pass the labels into the created text file - would be great Smile

Code:
/* * Name of Reporter:
    * Email Id of Reporter:
    * Version or Build: <Version or Build of the product>
    * Module or component: <mention here the name of tested module or component>
    * Platform / Operating System:
    * Type of error: <coding error / design error / suggestion / UI / documentation / text error / hardware error >
    * Priority:
    * Severity:
    * Status:
    * Assigned to:
    * Summary:
    * Description: <mention here the steps to reproduce, expected result and actual result>

*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream.h>
#include <fstream.h>
using namespace std;

int main ()

{
/////////////// Open form
   FILE *stream;
   char line[256];
   
   putenv(
"MAIN_DIALOG=<hbox>"
"  <frame Generate Report>"
"<hbox><text><label>Name of Reporter:</label></text><entry><variable>NAME</variable><default>add your name1</default></entry></hbox>"
"<hbox><text><label>Version of Puppy</label></text><entry><variable>VERSION</variable><default>Put 'latest' if not sure</default></entry></hbox>"
"<hbox><text><label>Hardware:</label></text><entry><variable>HARDWARE</variable><default>CPU, Graphics card, relevant other hardware</default></entry></hbox>"
"<hbox><text><label>Type of error:</label></text><entry><variable>ERRORTYPE</variable><default>eg. program, operating ystem, driver etc3</default></entry></hbox>"
"<hbox><text><label>Description:</label></text><entry><variable>DESC</variable><default>More details rather than less please</default></entry></hbox>"
"<hbox><text><label>Suggestions:</label></text><entry><variable>SUGGEST</variable><default>Found solution or suggested area to investigate</default></entry></hbox></frame>"
"  <frame buttons>"
"  <button ok></button>"
"  <button cancel></button>"
"  <button><label>Insert Data</label></button>"
"  <button><label>GNumeric View</label></button>"
"  <button><label>Edit Record</label></button>"
"  <button><label>Configure Labels</label></button></frame>"
"</hbox>\n");
   stream = popen("gtkdialog3 --program=MAIN_DIALOG", "r");
   fgets(line, 255, stream);
   if (strstr(line, "OK") != NULL)
      printf("You pressed the OK button.\n");
   else
      printf("This is not the OK button.\n");
   pclose(stream);
   
   
/////////////// Display or load data
string NAME, VERSION, HARDWARE, ERRORTYPE, DESC, SUGGEST ;

  ofstream myfile ("errorreport.txt");
  if (myfile.is_open())
  {
    myfile << "Puppy Details for ** ";
    myfile << NAME ; //add variable write
        myfile << " **\n\n";
    myfile << "Version of Puppy: ";
    myfile << VERSION ; //add skills
        myfile << " \n";
    myfile << "HARDWARE: ";
    myfile << HARDWARE ; //add skills
         myfile << " \n";
    myfile << "ERRORTYPE: ";
    myfile << ERRORTYPE ; //add skills
         myfile << " \n";
    myfile << "DESC: ";
    myfile << DESC ; //add skills
         myfile << " \n";
    myfile << "SUGGEST: ";
    myfile << SUGGEST ; //add skills
   
         myfile << " \n\n\n";   
         myfile << " Please send 'errorreport.txt to ed.jason@gmail.com \n or add details to wiki \n http://puppylinux.org/wikka/Puppy44 " ;
 
   myfile.close();
  }
  else cout << "Unable to open file";

/////////////// Provide data
   
}

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 22 Sep 2009, 10:48    Post_subject:  

Me again Embarassed pretending to be a programmer Rolling Eyes

Created this in Glade
easy enough

Code:
<?xml version="1.0"?>
<glade-interface>
  <requires-version lib="gtk+" version="2.12"/>
  <widget class="GtkDialog" id="dialog1">
    <property name="border_width">5</property>
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
    <property name="has_separator">False</property>
    <child internal-child="vbox">
      <widget class="GtkVBox" id="dialog-vbox1">
        <property name="visible">True</property>
        <property name="spacing">2</property>
        <child>
          <widget class="GtkImage" id="image2">
            <property name="visible">True</property>
            <property name="pixbuf">l1.jpg</property>
          </widget>
          <packing>
            <property name="position">1</property>
          </packing>
        </child>
        <child internal-child="action_area">
          <widget class="GtkHButtonBox" id="dialog-action_area1">
            <property name="visible">True</property>
            <property name="layout_style">GTK_BUTTONBOX_END</property>
            <child>
              <widget class="GtkButton" id="button1">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="label" translatable="yes">button</property>
                <property name="response_id">0</property>
              </widget>
            </child>
            <child>
              <widget class="GtkToggleButton" id="togglebutton1">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="label" translatable="yes">togglebutton</property>
                <property name="response_id">0</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
          </widget>
          <packing>
            <property name="expand">False</property>
            <property name="pack_type">GTK_PACK_END</property>
          </packing>
        </child>
      </widget>
    </child>
  </widget>
  <widget class="GtkWindow" id="window1">
    <child>
      <widget class="GtkImage" id="image1">
        <property name="visible">True</property>
        <property name="pixbuf">l1.jpg</property>
      </widget>
    </child>
  </widget>
</glade-interface>


What c++ code will call/display that xml?
Every example I look at is in C
or calls libs I don't seem to have.

I am being tortured here. The fish are laughing at me. Help!

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Wed 23 Sep 2009, 08:29    Post_subject:  

OK this is my Puppy 4.4CE program
It is basically a mashup of my C++ programs so far using the YAP
program I wrote for gtkdailog3

I think this is is my third day of C++
I only do bits to avoid brain strain

I could not get to grips with interfacing XML produced
by Glade
but am finding the compiling IDE capacity of Genie Editor ideal

If you want to compile it
make sure you have devxx
and make sure the program ends on a new line
(I remember C needed this as well)

OK plan is to have a cup of tea (I am English you know)
and then turn it into something useful Smile

Update:
Well the tea was nice
just had another with a cinnamon whirl
and now the program is beginning to do things - reporting bugs- not yet
but some of the pull down menu is working . . .


Code:
 //      Puppy44CE.cpp v0.3
//      Copyright Sep 2009 Lobster <ed.jason@gmail.com>
//     
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//     
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream.h>
#include <fstream.h>
using namespace std;

int main ()

{
/////////////// Open Program
   FILE *stream;
   char line[256];
   putenv(
"MAIN_DIALOG=<hbox>"
// "<window title="Puppy44CE" window-position="1">"
"  <vbox>"
"<menubar>"
"    <menu>"
"       <menuitem>"
"            <label>Set Up Puppy</label>"
"               <action>/usr/sbin/wizardwizard &</action>"
"         </menuitem>"
"          <menuitem>"
"             <label>Help</label>"
"               <action>defaultbrowser file:///usr/share/doc/index.html &</action>"
"         </menuitem>"
"         <menuitem>"
"             <label>Puppy Desktop</label>"
"               <action>defaultbrowser http://pupweb.org/desktop/ &</action>"
"         </menuitem>"
"         <menuitem>"
"              <label>Not yet used . . .</label>"
"                 <action>wavplay sound/gong-burmese.wav &</action>"
"         </menuitem>"
"         <menuitem>"
"               <label>Not yet used . . .</label>"
"                   <action>wavplay sound/gong-chinese.wav &</action>"
"         </menuitem>"   
"              <label>First Steps</label>"
"          </menu>"
"      <menu>"
"         <menuitem>"
"            <action>wavplay /usr/share/audio/2barks.wav &</action>"
"            <label>Woof Woof</label>"
"            <action>exit</action>"
"         </menuitem>"
"           <menuitem>"
"            <action>defaultbrowser file://`pwd`/videos/mudra.swf &</action>"
"            <label>Not yet used . . .</label>"
"            <action>exit</action>"
"         </menuitem>"
"         <menuitem>"
"               <label>Not yet used . . .</label>"
"                <action>wavplay sound/cyberspace_1.wav &</action>"
"            <action>defaultbrowser file://`pwd`/videos/vajra.swf &</action>"
"               <action>exit</action>"
"         </menuitem>"       
"         <menuitem>"
"                <action>defaultbrowser file://`pwd`/html/chant.html &</action>"
"                <action>defaultbrowser file://`pwd`/sound/tarafast.swf &</action>"
"            <label>Not yet used . . .</label>"
"         </menuitem>"
"         <menuitem>"
"            <label>Not yet used . . .</label>"
"               <action>defaultbrowser file://`pwd`/videos/taraom.swf &</action>"         
"         </menuitem>"   
"         <menuitem>"
"                 <label>Not yet used . . .</label>"
"                      <action>wavplay sound/cyberspace_1.wav &</action>"
"                     <action>wavplay sound/cyberspace_1.wav &</action>"
"                      <action>defaultbrowser file://`pwd`/videos/shingon.swf &</action>"
"                      <action>exit</action>"
"              </menuitem>" 
"         <label>Programs</label>"
"    </menu>"
"    <menu>"
"        <menuitem>"
"           <label>Wiki</label>"
"              <action>defaultbrowser http://puppylinux.org/wikka/ &</action>"
"        </menuitem> "
"        <menuitem>"
"           <label>Forum Thread</label>"
"               <action>defaultbrowser http://www.murga-linux.com/puppy/viewtopic.php?t=46497 &</action>"
"        </menuitem>"
"            <menuitem>"
"            <label>Not yet used . . .</label>"
"              <action>wavplay sound/cyberspace_1.wav &</action>"
"              <action>defaultbrowser http://buddhism.kalachakranet.org/meditation_practice.html &</action>"
"        </menuitem>" 
"        <menuitem>"
"                    <action>wavplay sound/cyberspace_1.wav &</action>"
"            <label>Not yet used . . .</label>"
"              <action>defaultbrowser http://www.youtube.com/watch?v=F3g4cNJgVwo &</action>"
"                 <action>exit</action>"
"        </menuitem>"   
"        <menuitem>"
"           <label>Not yet used . . .</label>"
"               <action>defaultbrowser file://`pwd`/html/faqs.html &</action>"
"         </menuitem>"
"                    <label>Info</label>"
"   </menu>"
"  </menubar>"
"  <frame>"
"       <pixmap>"
"         <input file>runpup.gif</input>"
"       </pixmap>"
"       <text><label>4.4 Community Edition</label></text>"
"       <text><label>Sep 2009 </label></text>"
"   </frame>"
"  <frame Generate Report>"
"<hbox><text><label>Name of Reporter:</label></text><entry><variable>NAME</variable><default>add your name1</default></entry></hbox>"
"<hbox><text><label>Version of Puppy</label></text><entry><variable>VERSION</variable><default>Put 'latest' if not sure</default></entry></hbox>"
"<hbox><text><label>Hardware:</label></text><entry><variable>HARDWARE</variable><default>CPU, Graphics card, relevant other hardware</default></entry></hbox>"
"<hbox><text><label>Type of error:</label></text><entry><variable>ERRORTYPE</variable><default>eg. program, operating ystem, driver etc3</default></entry></hbox>"
"<hbox><text><label>Description:</label></text><entry><variable>DESC</variable><default>More details rather than less please</default></entry></hbox>"
"<hbox><text><label>Suggestions:</label></text><entry><variable>SUGGEST</variable><default>Found solution or suggested area to investigate</default></entry></hbox></frame>"
"  <button ok></button><button cancel></button>"
"  </vbox>"
"</hbox>\n");


/////////////// Call gtkDialog3
   stream = popen("gtkdialog3 --program=MAIN_DIALOG", "r");
   fgets(line, 255, stream);
   if (strstr(line, "OK") != NULL)
      printf("You pressed the OK button.\n");
   else
      printf("This is not the OK button.\n");
   pclose(stream);
   
   
/////////////// Generate text report
string NAME, VERSION, HARDWARE, ERRORTYPE, DESC, SUGGEST ;

  ofstream myfile ("errorreport.txt");
  if (myfile.is_open())
  {
    myfile << "Puppy Details for ** ";
    myfile << NAME ; //add variable write
        myfile << " **\n\n";
    myfile << "Version of Puppy: ";
    myfile << VERSION ; //add skills
        myfile << " \n";
    myfile << "HARDWARE: ";
    myfile << HARDWARE ; //add skills
         myfile << " \n";
    myfile << "ERRORTYPE: ";
    myfile << ERRORTYPE ; //add skills
         myfile << " \n";
    myfile << "DESC: ";
    myfile << DESC ; //add skills
         myfile << " \n";
    myfile << "SUGGEST: ";
    myfile << SUGGEST ; //add skills
   
         myfile << " \n\n\n";   
         myfile << " Please send 'errorreport.txt to ed.jason@gmail.com \n or add details to wiki \n http://puppylinux.org/wikka/Puppy44 " ;
 
   myfile.close();
  }
  else cout << "Unable to open file";
}

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
gyro

Joined: 28 Oct 2008
Posts: 433
Location: Brisbane, Australia

PostPosted: Wed 23 Sep 2009, 13:33    Post_subject: C++ in Puppy  

I use Codeblocks 8.02 and wxWidgets 2.8.10, both compiled on Puppy 4.1.2. to produce a "wx_cb.sfs" file which I use alongside the "devx" ".sfs" file.

gyro
Back to top
View user's profile Send_private_message 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Wed 23 Sep 2009, 14:46    Post_subject:  

Advice:

Keep the resources (strings, UI Definition) in external files so you don't have to recompile to change wording or translations.

Good for you! C++ is an awesome language. just make sure to use OO judiciously instead of using it as if it was plain C.

When I learned I used Bruce Eckel's Thinking in C++

and Scott Meyers Effective C++: 55 Specific Ways to Improve Your Programs and Designs

Those books take you beyond the syntax to show you the idiosyncrasy of the language and how to use it properly.

You will learn the language faster if you "understand" how it was meant to be used.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Wed 23 Sep 2009, 20:00    Post_subject:  

Very good advice, Thanks Rarsa - this in particular looks excellent
Bruce Eckel's Thinking in C++

Strangely I understand why OO is useful
how a Quantum computing language is likely to owe much to OO
It is how to make use of it that will need to be implemented

It really was an accident how I started
I joined up to do some Tai Chi Chuan at a local college
and joined their library
Looking at their books
nothing very much on Linux
Very easy looking book on C++
OK I will try
This thread is me trying

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Thu 24 Sep 2009, 04:28    Post_subject:  

OK has all come together in this simple 44CE development portal program


Download with source code here:
http://www.murga-linux.com/puppy/viewtopic.php?p=343973#343973

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Mon 28 Sep 2009, 08:25    Post_subject:  

I am working on this head/tail (or 0/1 at the moment)
random event generator (that RNG is not so random incidentally)
and am trying to get a gtkdialog3 output
the problem is this type of line

Code:
"<window title="Question" icon-name="gtk-dialog-question">"


the compiler sees this as complete
"<window title="Question" icon-name="
rather than part of the gtkdialog3

Is there a simple solution?
here is the complete code

Code:
#include <cstdlib>
#include <ctime>
#include <iostream>

using namespace std;

int main()

////////////// run head tail program
{
    srand((unsigned)time(0));
    int random_integer, running_total_ones;
   
    for(int index=0; index<2000; index++)
    {
        random_integer = (rand()%2)+1;
        cout << random_integer-1 << endl;
      if (random_integer == 1) 
          {
           running_total_ones = running_total_ones++;
         }
    }
    cout << running_total_ones;

/////////////// Open Program
   FILE *stream;
   char line[256];
   putenv(
"export DIALOG='"
"<window title="Question" icon-name="gtk-dialog-question">"
"  <vbox>"
"    <hbox>"
"      <text>"
"        <label>Label:</label>"
"      </text>"
"      <entry activates-default="true">"
"        <default>Default text</default>"
"   <variable>ENTRY</variable>"
"      </entry>"
"    </hbox>"
"    <hbox>"
"      <button cancel></button>"
"      <button can-default="true" has-default="true" use-stock="true">"
"        <label>gtk-ok</label>"
"      </button>"
"    </hbox>"
"  </vbox>"
"</window>"
"'"
/////////////// Call gtkDialog3
   stream = popen("gtkdialog3 --program=MAIN_DIALOG", "r");
   fgets(line, 255, stream);
   pclose(stream);
}

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Mon 28 Sep 2009, 10:59    Post_subject:  

Lobster wrote:
Code:
"<window title="Question" icon-name="gtk-dialog-question">"


the compiler sees this as complete
Code:
"<window title="Question" icon-name="

Is there a simple solution?

Try escaping the inside quotation marks (so the compiler interprets it properly)
Code:
"<window title=\"Question\" icon-name=\"gtk-dialog-question\">"

Or using single quotation marks inside. In XML double and single quotes can be used to delimit attribute values.
Code:
"<window title='Question' icon-name='gtk-dialog-question'>"


Both should work.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send_private_message Visit_website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Mon 28 Sep 2009, 11:34    Post_subject:  

Oh, but I see that you are single-quoting around the whole thing
Code:
"export DIALOG='"

So you'll need to escape all double quotes.

If you want to use single quotes, there are other solutions such as doing the assignment in "steps"

First assign the content of the XML to a variable (changing all double quotes to single quotes
From <window ..
to </window>

then concatenating it with the export string.

Or even better.

Define the XML in an external file using double quotes or single quotes (your choice) and then just load it and use it.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Mon 28 Sep 2009, 13:24    Post_subject:  

Quote:
Try escaping the inside quotation marks (so the compiler interprets it properly)


Thanks rarsa that seems to have worked Smile

Now onto the next problem Rolling Eyes
it's compiling but getting probs with gtkDialog3

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Wed 07 Oct 2009, 21:54    Post_subject:  

More praise for Geany as an IDE Smile

highlight code with shift and keyboard (or mouse)
and ctrl + e to toggle comments on off

Click on error message to go to that error in edit space

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1791s ][ Queries: 12 (0.0139s) ][ GZIP on ]