Discussion:
Programming beginner: first program won't run?
(too old to reply)
jbskaggs
2009-04-19 01:16:06 UTC
Permalink
Hi I hope this doesn't seem too basic- but did you create your form and draw
the textbox1, label1, and button1?

JB SKaggs
Hello,
I am trying to learn a little bit about OOP with Gambas. I attempted to
http://gambas.sourceforge.net/Getting%20Started%20with%20GAMBAS.odt , but
I can't even get it to run. When I
press play (or F5 or Debug>Run) it compiles, but the dialog box doesn't
pop up.
I have ran the "Object" example that comes with Gambas II, and it works
perfectly (the dialog box pops up and everything).
I'm using PCLinuxOS and installed Gambas II through Synaptic.
Does anyone have an idea as to why my program won't run?
(By the way my source looks like this: ' Gambas class file
PUBLIC SUB Button1_Click()
Label1.Text = "Hello " & Textbox1.Text & ". This is my first Gambas
project!"
END
).
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23118826.html
Sent from the gambas-user mailing list archive at Nabble.com.
phohammer
2009-04-19 02:15:08 UTC
Permalink
Yep, I created the form just as the tutorial said (in my first post):

Loading Image...
Post by jbskaggs
Hi I hope this doesn't seem too basic- but did you create your form and
draw the textbox1, label1, and button1?
JB SKaggs
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23118993.html
Sent from the gambas-user mailing list archive at Nabble.com.
jbskaggs
2009-04-19 03:36:24 UTC
Permalink
Okay two other things then:

make sure your control names match the names in your code (ie label1 is
actually named label1 on the form etc)
two make sure you dont have the controls set to visible.false on the form.

try this code:

public sub form_open()
label1.visible=true
button1.visible=true
textbox1.visible=true
textbox1.readonly=false
textbox1.text="Hello World!"
end

public sub button1_click()
label1.text = Textbox1.text
end


The first section makes sure your controls are visible and that textbox is
not set to readonly (although you shouldn't have to do this as by default
controls are visible and readonly = false), and sets the text of textbox1 to
hello world. You can type whatever you want in the textbox.

The second section assigns any text in the textbox1 to the label1.

Tell me if this runs for you?

JB Skaggs
Post by phohammer
http://www.nabble.com/file/p23118993/form.png
Post by jbskaggs
Hi I hope this doesn't seem too basic- but did you create your form and
draw the textbox1, label1, and button1?
JB SKaggs
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23119189.html
Sent from the gambas-user mailing list archive at Nabble.com.
phohammer
2009-04-19 03:54:48 UTC
Permalink
Post by jbskaggs
Tell me if this runs for you?
No luck. I even matched the cases (lower case) for the code and properties.
You can see my code and form in the files I uploaded:
Loading Image... fmainform.png and
Loading Image... fmainclass.png .

I figured a program so simple should run... hmmm...
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23119191.html
Sent from the gambas-user mailing list archive at Nabble.com.
jbskaggs
2009-04-19 04:06:03 UTC
Permalink
Please send a screenshot of what it does when it runs?

Oh what components do you have installed under project preferences? QT?

JB Skaggs
Post by phohammer
Post by jbskaggs
Tell me if this runs for you?
No luck. I even matched the cases (lower case) for the code and
http://www.nabble.com/file/p23119191/fmainform.png fmainform.png and
http://www.nabble.com/file/p23119191/fmainclass.png fmainclass.png .
I figured a program so simple should run... hmmm...
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23119193.html
Sent from the gambas-user mailing list archive at Nabble.com.
phohammer
2009-04-19 04:30:14 UTC
Permalink
Post by jbskaggs
Please send a screenshot of what it does when it runs?
Oh what components do you have installed under project preferences? QT?
JB Skaggs
It simply says "compiling project..." as seen
Loading Image... here .

I'm not sure what you mean by "project preferences".
There is a "project properties" and it says I have these components running:
Loading Image... properties.png ,

I tried to select the qt and gtk components but it said this:
Loading Image... properties1.png .

I wonder if I need to start a whole new project and enable the qt component
before doing anything?
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23119198.html
Sent from the gambas-user mailing list archive at Nabble.com.
jbskaggs
2009-04-19 05:07:18 UTC
Permalink
Try just unclicking the gb gui and gb gtk and click QT you shouldnt have to
rewrite the whole thing.

JB SKaggs
Post by phohammer
Post by jbskaggs
Please send a screenshot of what it does when it runs?
Oh what components do you have installed under project preferences? QT?
JB Skaggs
It simply says "compiling project..." as seen
http://www.nabble.com/file/p23119198/compiling.png here .
I'm not sure what you mean by "project preferences".
There is a "project properties" and it says I have these components
running: http://www.nabble.com/file/p23119198/properties.png
properties.png ,
http://www.nabble.com/file/p23119198/properties1.png properties1.png .
I wonder if I need to start a whole new project and enable the qt
component before doing anything?
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23119719.html
Sent from the gambas-user mailing list archive at Nabble.com.
phohammer
2009-04-19 05:16:41 UTC
Permalink
Post by jbskaggs
Try just unclicking the gb gui and gb gtk and click QT you shouldnt have
to rewrite the whole thing.
JB SKaggs
I tried it and it still won't run the dialog box - I only have these
components enabled now:
Loading Image...
onltgb_gbform_gbqt.png
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23119747.html
Sent from the gambas-user mailing list archive at Nabble.com.
jbskaggs
2009-04-19 06:39:17 UTC
Permalink
Well my thinking was maybe you didnt have gtk loaded so to try qt but maybe
you dont have qt either. Do you know if you hve gtk or qt loaded on your
version of linux? And if so what version it is? Or some other dependency.

Thats the only thng I can think of, but maybe the more experienced guys here
can help as they know more and well wrote the language.

Out of curiousity have you tried gambas on another linux on this same
computer? I run Gambas2 on Ubuntu 8.1 and Wolvix 2.0 just fine- Ubuntu was
one click install and Wolvix requires you to run qt config after
installation.

Sorry that I couldnt help more.
JB Skaggs
Post by phohammer
Post by jbskaggs
Try just unclicking the gb gui and gb gtk and click QT you shouldnt have
to rewrite the whole thing.
JB SKaggs
I tried it and it still won't run the dialog box - I only have these
http://www.nabble.com/file/p23119747/onltgb_gbform_gbqt.png
onltgb_gbform_gbqt.png
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23120056.html
Sent from the gambas-user mailing list archive at Nabble.com.
Charlie Reinl
2009-04-19 10:26:50 UTC
Permalink
Post by phohammer
Post by jbskaggs
Try just unclicking the gb gui and gb gtk and click QT you shouldnt have
to rewrite the whole thing.
JB SKaggs
I tried it and it still won't run the dialog box - I only have these
http://www.nabble.com/file/p23119747/onltgb_gbform_gbqt.png
onltgb_gbform_gbqt.png
Salut,

please start the IDE by typing gambas2 in an Terminal

and enter this _new sub into FMain.class

PUBLIC SUB _new()
ME.Center
END

at least, while debugging it (f8) you should, and you Form will be
center on the screen.

If you don't reach the _new sub, close the IDE and look if there are
Errors written in the Terminal

Something you also could do is to create a source archive package (
Ctrl+Alt+A or /Project/Make/Source archive) and send it to the list.
--
Amicalment
Charlie
phohammer
2009-04-19 16:41:34 UTC
Permalink
Ok, I tried copying every thing over to my project from the "Object" example.
I copied every single
thing from the project tree. And I deleted all of my stuff from my project,
essentially making an "Object" project
of my own that I could edit. It still wouldn't run.

I tried running the IDE from a terminal and there was no output into the
terminal whether the project ran (with
"Object") or it didn't (with mine).

On the having qt on my system, I am not too sure but here is what I have
installed that is qt related: Loading Image...
qt.png .
I'm not sure how that could be a problem since I have seen a project run
successfully on my system (the "Object" example.)

I have a question here though, maybe this is my problem. What project type
should I be using ( Loading Image...
whichtype.png )?
I've been using the "Graphical Application" thus far.
Post by Charlie Reinl
Post by phohammer
Post by jbskaggs
Try just unclicking the gb gui and gb gtk and click QT you shouldnt
have
Post by jbskaggs
to rewrite the whole thing.
JB SKaggs
I tried it and it still won't run the dialog box - I only have these
http://www.nabble.com/file/p23119747/onltgb_gbform_gbqt.png
onltgb_gbform_gbqt.png
Salut,
please start the IDE by typing gambas2 in an Terminal
and enter this _new sub into FMain.class
PUBLIC SUB _new()
ME.Center
END
at least, while debugging it (f8) you should, and you Form will be
center on the screen.
If you don't reach the _new sub, close the IDE and look if there are
Errors written in the Terminal
Something you also could do is to create a source archive package (
Ctrl+Alt+A or /Project/Make/Source archive) and send it to the list.
--
Amicalment
Charlie
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23124849.html
Sent from the gambas-user mailing list archive at Nabble.com.
Doriano Blengino
2009-04-19 17:37:44 UTC
Permalink
Post by phohammer
Ok, I tried copying every thing over to my project from the "Object" example.
I copied every single
thing from the project tree. And I deleted all of my stuff from my project,
essentially making an "Object" project
of my own that I could edit. It still wouldn't run.
I tried running the IDE from a terminal and there was no output into the
terminal whether the project ran (with
"Object") or it didn't (with mine).
On the having qt on my system, I am not too sure but here is what I have
installed that is qt related: http://www.nabble.com/file/p23124849/qt.png
qt.png .
I'm not sure how that could be a problem since I have seen a project run
successfully on my system (the "Object" example.)
I have a question here though, maybe this is my problem. What project type
should I be using ( http://www.nabble.com/file/p23124849/whichtype.png
whichtype.png )?
I've been using the "Graphical Application" thus far.
I assume you have QT installed, because gambas would'nt work without.
Graphical application should be ok.
No compilation errors - ok.
Next, try to understand, when you press GO (F5?), if the program really
runs or not. While the program "seems" to run, you can confirm by using
a terminal and the ps(1) command: on my system turns out:

9612 ? S 0:02 gbr2 /usr/bin/gambas2
9619 ? S 0:00 /usr/bin/gbx2 -g -f
/root/programmi/gambas/prove/Parted --

You see "gbr2 ...gambas2", which is the IDE, and "gbx2 ...Parted" which
is the program.
If your program does'nt show, then it is not running - try to execute it
step by step to see if terminates instead of opening a window and
entering the idle loop.
If it runs, look in the taskbar, where you see open
windows/applications. If a button is there, then your program has an
open window somewhere outside the desktop (window manager issue). You
can try to pull it inside a desktop by using the contestual menu.

If the program runs, but no window is shown, check with "lsof -p
<your_program_pid>"; on my system, at the end, it shows:

gbx2 9619 root 21r REG 3,70 14625 35686
/usr/lib/gambas2/gb.qt.gambas
gbx2 9619 root 22r REG 3,70 1033214 35701
/usr/lib/gambas2/gb.form.gambas

showing the the program actually uses QT (and many more information).
There other tools to see if your program really opened a window, but
things get more complicated... it is easier to see what is wrong in the
source.

Anyway, make a source tarball (Project->Create->Source package -- or
something like that) and send the .tar.gz; this will let other users on
this list to examine your project to find something you missed.

Regards,
--
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."
phohammer
2009-04-19 17:52:22 UTC
Permalink
I opened the IDE with a terminal and it shows nothing when I run it. I'm not
sure what you mean by
the "ps(1) command".

Here is a tarball of the project to scratch your head over:
http://www.nabble.com/file/p23125471/trythis-0.0.1.tar.gz
trythis-0.0.1.tar.gz

I'm no command line wizard (started using GNU/Linux in January of this year)
so bear with me, please :)
Post by Doriano Blengino
I assume you have QT installed, because gambas would'nt work without.
Graphical application should be ok.
No compilation errors - ok.
Next, try to understand, when you press GO (F5?), if the program really
runs or not. While the program "seems" to run, you can confirm by using
9612 ? S 0:02 gbr2 /usr/bin/gambas2
9619 ? S 0:00 /usr/bin/gbx2 -g -f
/root/programmi/gambas/prove/Parted --
You see "gbr2 ...gambas2", which is the IDE, and "gbx2 ...Parted" which
is the program.
If your program does'nt show, then it is not running - try to execute it
step by step to see if terminates instead of opening a window and
entering the idle loop.
If it runs, look in the taskbar, where you see open
windows/applications. If a button is there, then your program has an
open window somewhere outside the desktop (window manager issue). You
can try to pull it inside a desktop by using the contestual menu.
If the program runs, but no window is shown, check with "lsof -p
gbx2 9619 root 21r REG 3,70 14625 35686
/usr/lib/gambas2/gb.qt.gambas
gbx2 9619 root 22r REG 3,70 1033214 35701
/usr/lib/gambas2/gb.form.gambas
showing the the program actually uses QT (and many more information).
There other tools to see if your program really opened a window, but
things get more complicated... it is easier to see what is wrong in the
source.
Anyway, make a source tarball (Project->Create->Source package -- or
something like that) and send the .tar.gz; this will let other users on
this list to examine your project to find something you missed.
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23125471.html
Sent from the gambas-user mailing list archive at Nabble.com.
Charlie Reinl
2009-04-19 21:19:37 UTC
Permalink
Post by phohammer
I opened the IDE with a terminal and it shows nothing when I run it. I'm not
sure what you mean by
the "ps(1) command".
http://www.nabble.com/file/p23125471/trythis-0.0.1.tar.gz
trythis-0.0.1.tar.gz
I'm no command line wizard (started using GNU/Linux in January of this year)
so bear with me, please :)
Salut,

for the opend IDE in a Terminal, you find messages only after the IDE is
closed, by a crash or you.

I can't open your tarball, please create a new one.
--
Amicalment
Charlie
Ron_1st
2009-04-19 22:19:22 UTC
Permalink
Post by Charlie Reinl
Post by phohammer
I opened the IDE with a terminal and it shows nothing when I run it. I'm not
sure what you mean by
the "ps(1) command".
http://www.nabble.com/file/p23125471/trythis-0.0.1.tar.gz
trythis-0.0.1.tar.gz
I'm no command line wizard (started using GNU/Linux in January of this year)
so bear with me, please :)
Salut,
for the opend IDE in a Terminal, you find messages only after the IDE is
closed, by a crash or you.
I can't open your tarball, please create a new one.
I could untar and open it.


Found in the FMain.class


Static Public Sub Main()
Dim myForm As Form
myForm = New FStart
myForm.Show
End

Where is the FStart form ????
The form you want is FMain form ?

:)


Best regards,

Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
---
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Ron_1st
2009-04-19 22:23:05 UTC
Permalink
Post by Ron_1st
Post by Charlie Reinl
Post by phohammer
I opened the IDE with a terminal and it shows nothing when I run it. I'm not
sure what you mean by
the "ps(1) command".
http://www.nabble.com/file/p23125471/trythis-0.0.1.tar.gz
trythis-0.0.1.tar.gz
I'm no command line wizard (started using GNU/Linux in January of this year)
so bear with me, please :)
Salut,
for the opend IDE in a Terminal, you find messages only after the IDE is
closed, by a crash or you.
I can't open your tarball, please create a new one.
I could untar and open it.
Found in the FMain.class
Static Public Sub Main()
Dim myForm As Form
myForm = New FStart
myForm.Show
End
Where is the FStart form ????
The form you want is FMain form ?
:)
Best regards,
Ron_1st
BTW Program is working if you make the right correction.

Best regards,

Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
---
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Ron_1st
2009-04-19 18:44:42 UTC
Permalink
Post by phohammer
Ok, I tried copying every thing over to my project from the "Object" example.
I copied every single
thing from the project tree. And I deleted all of my stuff from my project,
essentially making an "Object" project
of my own that I could edit. It still wouldn't run.
I did suggest just the opposite.
Copy your form and code into the Object example and set your form as startup.
or
insert the label, textbox and button into the main form of the object example
together with your code.

This way you eliminate wrong project setup in the first place.

Good learning process is first to try to expand a existing project.
You see example code, helpfull to prevent syntax errors in your own code.
When it stops working then you know it is your own coding failure.


Best regards,

Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
---
A: Top-posting.
Q: What is the most annoying thing in e-mail?
phohammer
2009-04-19 19:57:07 UTC
Permalink
Post by Ron_1st
I did suggest just the opposite.
Copy your form and code into the Object example and set your form as startup.
or
insert the label, textbox and button into the main form of the object example
together with your code.
This way you eliminate wrong project setup in the first place.
Good learning process is first to try to expand a existing project.
You see example code, helpfull to prevent syntax errors in your own code.
When it stops working then you know it is your own coding failure.
Best regards,
Ron_1st
I would do as you said with the Object example, but those of infinite wisdom
made it read-only. I have attempted
to download an example project that was not read-only (I believe I found it
on a Gambas wiki page) but it would
not run the program made in the project either, even though I had not edited
it yet...
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23126753.html
Sent from the gambas-user mailing list archive at Nabble.com.
Ron_1st
2009-04-19 22:09:37 UTC
Permalink
Post by phohammer
I would do as you said with the Object example, but those of infinite wisdom
made it read-only.
When you make a copy to your home directory or the place where you want to
store your projects it is automagic not readonly any more.

copy /usr/local/share/gambas3/examples/Basic/Object
to /home/phohammer/gambas/projects/

(note: local is on my box, gambas3 may be gambas2)

If you check you will see your name as owner and read/write
for you is OK


The 'infinite wisdom' is to prevent you to damage a valuable example
you need the next time as possible template in your next project.
It should not to be to difficult to make a copy to your home place.

This copy should test first for good working before you start
working with it.



Best regards,

Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
---
A: Top-posting.
Q: What is the most annoying thing in e-mail?
phohammer
2009-04-19 23:10:39 UTC
Permalink
Post by Ron_1st
Post by phohammer
I would do as you said with the Object example, but those of infinite wisdom
made it read-only.
When you make a copy to your home directory or the place where you want to
store your projects it is automagic not readonly any more.
copy /usr/local/share/gambas3/examples/Basic/Object
to /home/phohammer/gambas/projects/
(note: local is on my box, gambas3 may be gambas2)
If you check you will see your name as owner and read/write
for you is OK
The 'infinite wisdom' is to prevent you to damage a valuable example
you need the next time as possible template in your next project.
It should not to be to difficult to make a copy to your home place.
This copy should test first for good working before you start
working with it.
Best regards,
Ron_1st
I tried to do this in terminal but I get this:

[***@localhost tr]# copy /usr/share/gambas2/examples/Basic/Object to
/home/tr/Documents/programming junk
bash: copy: command not found
[***@localhost tr]# apt-get install copy
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package copy

So I used my file manager to locate Object in
/usr/share/gambas2/examples/Basic/Object then right click, copy,
paste to my desired location. When I open the example and try to run it, it
reacts the same as my own project
and does not run.
Post by Ron_1st
BTW Program is working if you make the right correction.
Best regards,
Ron_1st
What does that mean, you got it running?
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23128377.html
Sent from the gambas-user mailing list archive at Nabble.com.
Ron_1st
2009-04-20 00:45:45 UTC
Permalink
Post by phohammer
Post by Ron_1st
Post by phohammer
I would do as you said with the Object example, but those of infinite wisdom
made it read-only.
When you make a copy to your home directory or the place where you want to
store your projects it is automagic not readonly any more.
copy /usr/local/share/gambas3/examples/Basic/Object
to /home/phohammer/gambas/projects/
(note: local is on my box, gambas3 may be gambas2)
If you check you will see your name as owner and read/write
for you is OK
The 'infinite wisdom' is to prevent you to damage a valuable example
you need the next time as possible template in your next project.
It should not to be to difficult to make a copy to your home place.
This copy should test first for good working before you start
working with it.
Best regards,
Ron_1st
/home/tr/Documents/programming junk
bash: copy: command not found
nice try but using the word copy in a conversation does not
always mean the same letters as command. :)

You should really read some help for linux. See below
Post by phohammer
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package copy
So I used my file manager to locate Object in
/usr/share/gambas2/examples/Basic/Object then right click, copy,
paste to my desired location.
The easy way and the way I did in my previous post to check
owner and rights.
Post by phohammer
When I open the example and try to run it, it
reacts the same as my own project and does not run.
That is very strange. Did you try also another example?
Post by phohammer
Post by Ron_1st
BTW Program is working if you make the right correction.
Best regards,
Ron_1st
What does that mean, you got it running?
I did unpack your code archive, started my gambas IDE
select the project and used compile all.
Then run and it did not work.
It told me it could not find FStart.
So I take a look in the code and made a correction.
After compile it did work as your want it to do.

This brings me to a question.
Did you change the look of your windows in PCLinux?
Plastic has/had some problems by some people with gambas.
(it is default in PCLinux for the Windows look and feel)
I use KDE2 as theme in PCLinux2007 and Kubuntu-8.04.
This because you did not mention the error message popup.
Post by phohammer
bash: copy: command not found
nice try but using the word 'copy' in a conversation does not
always mean the same letters as command. :)


There is alread many help installed and the first try you
could do when a command does not work is typing
***@pclinux:~$ man cp

CP(1) User Commands
NAME
cp - copy files and directories

SYNOPSIS
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
.....
and many more lines of help.
Post by phohammer
/home/tr/Documents/programming junk
bash: copy: command not found
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package copy
What the hell, does linux not have a copy command :)


True, the Windows 'copy' command does not exist in linux :)
It is typed as 'cp' in linux. (move is mv, remove is rm)

Second: cp <your_source> to <your_destination junc> will still not work
Just as in Windows the same rule exist in Linux based systems.
Filenames and paths with spaces inside should be quoted.
The single ' is the most safe to use and allows " in names.
The double " is need when a singl quote ' is in the name.
Ohhh and the 'to' is not need in linux (AFAiK even forbidden to use).

You need to or should type:
cp /usr/share/gambas2/examples/Basic/Object '/home/tr/Documents/programming junk'


When you buy a new car/dvd-player/ipod/windows/camera/mobile-phone you read the
userguide, why not when starting using linux?

For the commandline help you could do for 'The Advanced Bash-Scripting Guide':
apt-get install abs-guide
In /usr/share/doc/abs-guide you find also the example directory, very helpfull.

For more 'Documentation and examples for the The GNU Bourne Again SHell'
apt-get install bash-doc

In /usr/share/doc you will find it, and many more.

I/you know, you/I was born with acknowledge of Windows so it is much easy :)



I hope thist will help a bit and keep face up, time will learn.
Best regards,

Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
---
A: Top-posting.
Q: What is the most annoying thing in e-mail?
phohammer
2009-04-20 01:18:58 UTC
Permalink
Okay, I realize I should RTFM, but I intended to fly at this with gambas' GUI
and learn some programming, not Linux
terminal commands. I'm going to bow out for now. Thank you for your help,
Ron_1st, jbskaggs, Charlie Reinl and
Doriano Blengino. I guess I'm not/don't have the time to be an "Advanced
Bash-Scripter".
Post by Ron_1st
Post by phohammer
Post by Ron_1st
Post by phohammer
I would do as you said with the Object example, but those of infinite wisdom
made it read-only.
When you make a copy to your home directory or the place where you want
to
Post by Ron_1st
store your projects it is automagic not readonly any more.
copy /usr/local/share/gambas3/examples/Basic/Object
to /home/phohammer/gambas/projects/
(note: local is on my box, gambas3 may be gambas2)
If you check you will see your name as owner and read/write
for you is OK
The 'infinite wisdom' is to prevent you to damage a valuable example
you need the next time as possible template in your next project.
It should not to be to difficult to make a copy to your home place.
This copy should test first for good working before you start
working with it.
Best regards,
Ron_1st
/home/tr/Documents/programming junk
bash: copy: command not found
nice try but using the word copy in a conversation does not
always mean the same letters as command. :)
You should really read some help for linux. See below
Post by phohammer
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package copy
So I used my file manager to locate Object in
/usr/share/gambas2/examples/Basic/Object then right click, copy,
paste to my desired location.
The easy way and the way I did in my previous post to check
owner and rights.
Post by phohammer
When I open the example and try to run it, it
reacts the same as my own project and does not run.
That is very strange. Did you try also another example?
Post by phohammer
Post by Ron_1st
BTW Program is working if you make the right correction.
Best regards,
Ron_1st
What does that mean, you got it running?
I did unpack your code archive, started my gambas IDE
select the project and used compile all.
Then run and it did not work.
It told me it could not find FStart.
So I take a look in the code and made a correction.
After compile it did work as your want it to do.
This brings me to a question.
Did you change the look of your windows in PCLinux?
Plastic has/had some problems by some people with gambas.
(it is default in PCLinux for the Windows look and feel)
I use KDE2 as theme in PCLinux2007 and Kubuntu-8.04.
This because you did not mention the error message popup.
Post by phohammer
bash: copy: command not found
nice try but using the word 'copy' in a conversation does not
always mean the same letters as command. :)
There is alread many help installed and the first try you
could do when a command does not work is typing
CP(1) User Commands
NAME
cp - copy files and directories
SYNOPSIS
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...
DESCRIPTION
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
.....
and many more lines of help.
Post by phohammer
/home/tr/Documents/programming junk
bash: copy: command not found
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package copy
What the hell, does linux not have a copy command :)
True, the Windows 'copy' command does not exist in linux :)
It is typed as 'cp' in linux. (move is mv, remove is rm)
Second: cp <your_source> to <your_destination junc> will still not work
Just as in Windows the same rule exist in Linux based systems.
Filenames and paths with spaces inside should be quoted.
The single ' is the most safe to use and allows " in names.
The double " is need when a singl quote ' is in the name.
Ohhh and the 'to' is not need in linux (AFAiK even forbidden to use).
cp /usr/share/gambas2/examples/Basic/Object
'/home/tr/Documents/programming junk'
When you buy a new car/dvd-player/ipod/windows/camera/mobile-phone you read the
userguide, why not when starting using linux?
apt-get install abs-guide
In /usr/share/doc/abs-guide you find also the example directory, very helpfull.
For more 'Documentation and examples for the The GNU Bourne Again SHell'
apt-get install bash-doc
In /usr/share/doc you will find it, and many more.
I/you know, you/I was born with acknowledge of Windows so it is much easy :)
I hope thist will help a bit and keep face up, time will learn.
Best regards,
Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
---
A: Top-posting.
Q: What is the most annoying thing in e-mail?
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23129101.html
Sent from the gambas-user mailing list archive at Nabble.com.
Ron_1st
2009-04-20 01:30:24 UTC
Permalink
Post by phohammer
Okay, I realize I should RTFM, but I intended to fly at this with gambas' GUI
and learn some programming, not Linux
terminal commands. I'm going to bow out for now. Thank you for your help,
Ron_1st, jbskaggs, Charlie Reinl and
Doriano Blengino. I guess I'm not/don't have the time to be an "Advanced
Bash-Scripter".
The problem is you switched two things, Windows to Linux and VB to Gambas.
Both have a way of thinking how it should be done and are not 100% the same
by that. It will be a hard time but worth to do.
Ok Bash-scripter is no need but the command line wil very helpfull in time.


Success

Best regards,

Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
---
A: Top-posting.
Q: What is the most annoying thing in e-mail?
phohammer
2009-04-20 01:58:14 UTC
Permalink
Post by Ron_1st
Post by phohammer
Okay, I realize I should RTFM, but I intended to fly at this with gambas' GUI
and learn some programming, not Linux
terminal commands. I'm going to bow out for now. Thank you for your help,
Ron_1st, jbskaggs, Charlie Reinl and
Doriano Blengino. I guess I'm not/don't have the time to be an "Advanced
Bash-Scripter".
The problem is you switched two things, Windows to Linux and VB to Gambas.
Both have a way of thinking how it should be done and are not 100% the same
by that. It will be a hard time but worth to do.
Ok Bash-scripter is no need but the command line wil very helpfull in time.
Success
Best regards,
Ron_1st
I'm not sure what you're talking about with Windows and VB. I don't use
either one of them. I know Gambas uses a
lot of the BASIC language from VB, but other than that I'm not sure I
follow...
--
View this message in context: http://www.nabble.com/Programming-beginner%3A-first-program-won%27t-run--tp23117770p23129340.html
Sent from the gambas-user mailing list archive at Nabble.com.
Doriano Blengino
2009-04-20 08:06:53 UTC
Permalink
Post by phohammer
Post by phohammer
Okay, I realize I should RTFM, but I intended to fly at this with gambas' GUI
and learn some programming, not Linux
terminal commands. I'm going to bow out for now. Thank you for your help,
Ron_1st, jbskaggs, Charlie Reinl and
Doriano Blengino. I guess I'm not/don't have the time to be an "Advanced
Bash-Scripter".
I'm not sure what you're talking about with Windows and VB. I don't use
either one of them. I know Gambas uses a
lot of the BASIC language from VB, but other than that I'm not sure I
follow...
I like this! You have clear what you want, and what you want not. :->>

Anyway, I opened your tarball (strangely, I had to use a windows(tm)
program, the linux tar did'nt work).
The project was'nt running properly; at first it gave the error "Cannot
load class FStart".
Did you notice that?

Then, in sub Main():

STATIC PUBLIC SUB Main()
DIM myForm AS Form
myForm = NEW FStart
myForm.Show
END

I commented out the last two lines:

STATIC PUBLIC SUB Main()
DIM myForm AS Form
'myForm = NEW FStart
'myForm.Show
END

At this point, the program started, but immediately terminated. By
executing step by step, I noticed that after executing Main(), which
does nothing because of the commented out lines, the program terminated
- ie, it never entered the idle loop (the one where the program waits
for user interation). Probably a subroutine named Main indicates that
the program is embodied inside, and when Main() terminates the program
terminates too.

Then, I commented out the whole subroutine:

'STATIC PUBLIC SUB Main()
' DIM myForm AS Form
' myForm = NEW FStart
' myForm.Show
'END

... and the program ran.

Hope this helps you to understand; I leave to you to discover why the
subroutine Main() prevented the program from working (RTFM... :-) either
it is a documented thing, or an undocumented one, or a bug).

Last thing, if you ask for help, pay attention to all the things that
happen. I say so because my customers too many times say "it does'nt
work", and it is true, but they do not bother to read messages and other
things. You, as a programmer, should have noticed that error message
about class FStart, and perhaps should have described differently the
behaviour of the program: "it does nothing" it is not the optimal
description.

Have fun with gambas (and linux...)!

Cheers,
Doriano

Ron
2009-04-20 06:11:23 UTC
Permalink
Post by Ron_1st
Post by phohammer
I would do as you said with the Object example, but those of infinite wisdom
made it read-only.
When you make a copy to your home directory or the place where you want to
store your projects it is automagic not readonly any more.
copy /usr/local/share/gambas3/examples/Basic/Object
to /home/phohammer/gambas/projects/
(note: local is on my box, gambas3 may be gambas2)
If you check you will see your name as owner and read/write
for you is OK
The 'infinite wisdom' is to prevent you to damage a valuable example
you need the next time as possible template in your next project.
It should not to be to difficult to make a copy to your home place.
This copy should test first for good working before you start
working with it.
Best regards,
Ron_1st
You can also just open the example project with the IDE and do a 'Save
project as' to a different location first, then continue to change it.

Regards,
Ron_2nd.
Ron_1st
2009-04-19 10:44:19 UTC
Permalink
Post by phohammer
Post by jbskaggs
Tell me if this runs for you?
No luck. I even matched the cases (lower case) for the code and properties.
http://www.nabble.com/file/p23119191/fmainform.png fmainform.png and
http://www.nabble.com/file/p23119191/fmainclass.png fmainclass.png .
I figured a program so simple should run... hmmm...
You right, it should.

Interesting case you have now. I wil try to help but be aware it is
not a really first beginners stupid mistake,
I wil slap your PC from the table. :) ;=)


As I follow your conversation and see pictures your install looks OK.
PClinux2007 (used here to time by time) can/t be the problem IMHO.
For the fact the IDE works and you use the base components used by IDE
is also a good sign.

You did try the Object example and that was working.
Have you try more of them.
Post by phohammer
I have ran the "Object" example that comes with Gambas II, and it works
perfectly (the dialog box pops up and everything).
I'm using PCLinuxOS and installed Gambas II through Synaptic.
Does anyone have an idea as to why my program won't run?
(By the way my source looks like this: ' Gambas class file
PUBLIC SUB Button1_Click()
  Label1.Text = "Hello " & Textbox1.Text & ". This is my first Gambas
project!"
END
).
Is the Public SUB Button1_Click() routine the only code in the forms code class?

Then you may have here the problem.

If you use the wizard to create a project you wil see some extra code
like a Form_Main() sub.
Also it is need to set the form as the startup form, you can do it with a
right mouse button click in the project tree after select the form.

Just to try it is not the basic beginners mistake you could make a copy
of the object exammple (in fact any other should work to) and add your
label, textbox and button and code inside this example.

This way you can see your project is in fact at least two parts
a) the project setup (mistakes are prevented by using a a working example.)
b) your progamitself

For me highjacking a example to start with did help me many times with
new ways of programming, i.e. starting gambas (v0.46) over 5 years back. ;)


This could be help you to go on.


Best regards,

Ron_1st

--
Continue reading on narkive:
Loading...