The time now is Wed 25 Apr 2018, 22:16
All times are UTC - 4 |
Page 30 of 36 [526 Posts] |
Goto page: Previous 1, 2, 3, ..., 28, 29, 30, 31, 32, 33, 34, 35, 36 Next |
Author |
Message |
vovchik

Joined: 23 Oct 2006 Posts: 1447 Location: Ukraine
|
Posted: Mon 28 Jan 2013, 19:19 Post subject:
|
|
Dear e_mattis,
If you typed in Barry's example, I have a suspicion you included the line numbers. They should not be there. That is just a screenshot of Barry's editor, which is showing line numbers as a convenience to the programmer. BaCon does not use them!
With kind regards,
vovchik
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Mon 28 Jan 2013, 20:41 Post subject:
|
|
Hey guys, thanks for responding.
@ sunburnt
First line is a REM statement. Also removed it and tried to compile again, same error. The program is the demo from the 'getting started' tutorial. it follows:
Rem first test
Global c TYPE chat
a=125.6
e=345
b$="the big black dog"
print b$;
print a
print"a=",a," b=",b$ (as written in example instead of "a= ";a;" b= ";b$)
c='z'
print c,b$,a,e,Format :%c :s :%f %d\n"
@vovchik
It is Barry's example, didn't use the line numbers.
I have some basic programming skills - from before Q-B and with Libeerty Basic for Windoze. Some of the syntax shown in the demo is a little different than what I'm used to, but it still should parse past the 'REM' and GLOBAL decoration i would think. Any ideas?
Thanks!
E
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 8529 Location: Perth, Western Australia
|
Posted: Mon 28 Jan 2013, 21:25 Post subject:
|
|
Quote: | Global c TYPE chat |
Try
Hmm, yes, I see on my web page, those line numbers could cause confusion. I need to remove them.
_________________ http://bkhome.org/news/
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Mon 28 Jan 2013, 23:30 Post subject:
|
|
Het Barry!
yea -That was a typo on the post. The actual code does have 'GLOBAL c TYPE char' (my big fingers again ). As far as the line numbers, even I figured that one out, but a simple"*without line number*" statemnt should suffice I would think.
Thanks!
E
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 8529 Location: Perth, Western Australia
|
Posted: Tue 29 Jan 2013, 02:55 Post subject:
|
|
e_mattis wrote: | Het Barry!
yea -That was a typo on the post. The actual code does have 'GLOBAL c TYPE char' (my big fingers again ). As far as the line numbers, even I figured that one out, but a simple"*without line number*" statemnt should suffice I would think.
Thanks!
E |
Hmm, perhaps I need a cup of coffee... yes, "GLOBAL", not "Global".
As there seems to be some kind of fundamental problem with your demo.bac, perhaps start with a one-line application, then add to it. For example, start demo.bac with one line only:
PRINT "Hello world"
Then
# bacon -d /tmp demo.bac
...that should work! Then start adding more lines to it, to test those variables and printing behaviour.
Alternatively, you could gzip your demo.bac and post it here.
_________________ http://bkhome.org/news/
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Tue 29 Jan 2013, 23:41 Post subject:
|
|
Hey,
I went back in and made sure it was written exactly like the one on the website. It compiled and ran through to line 12 (FORMAT line). It gives a problem that '%d' is expected to be int, but is long int.
I have attached the gzip of demo (including screens) and the two screens showing the problem message.
BaCon is a little different than what i'm used to so i will have to pay closer attention to how I type things in - GLOBAL vs Global. Anyway, as far as I can tell, I have the file written correctly. Thanks again for the assist!
E
Description |
demo.bac as currently written |
Filesize |
6.67 KB |
Viewed |
352 Time(s) |

|
Description |
Problem given at compile |
Filesize |
3.13 KB |
Viewed |
333 Time(s) |

|
Description |
Erics Demo.bac file and screens of the resulting errors
|

Download |
Filename |
EsDemo.tar.gz |
Filesize |
44.54 KB |
Downloaded |
195 Time(s) |
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Wed 30 Jan 2013, 14:14 Post subject:
Subject description: ld |
|
change line 12 to
PRINT c,b$,a,e FORMAT "%c %s %.2f %ld\n"
ld instead of just l
# ./demo
the big black dog125.6
a=125.6 b=the big black dog
z the big black dog 125.60 345
#
file:///usr/share/doc/BaCon/documentation.html has an example under PRINT
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Wed 30 Jan 2013, 19:15 Post subject:
|
|
Thanks L18L,
That seems to have done the trick. I am assuming the 'l' in front of the d indicates a long integer for d (which corrects the problem). The example I saw in both the webste and the documentation.html shows it as "...%d\n".
Anyway, with that worked out I can now proceed to the next section...wo0h0o!
I'm sure I'll be needing assistance again, so keep a close eye on the post.
Thanks !
E
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Wed 30 Jan 2013, 20:44 Post subject:
|
|
Well, that didn't take long....
So I'm at the proxy_setup1.bac example (link to HostGator did not find the file). I type in the code as per the web page. Everything seems to go normally... Converted Hug, Compiled PS1.bac, and Program 'PS1' ready.
I type in@ # ./PS1 - nothing. no window, no error message, no nothing.
Did a recompile like "# bacon -b PS!.bac". Same as before, so again I type in "# ./PS1"-nothing. I go to the file and permission it executable. Again enterd "# ./PS1" - nothng. Clicked the file itself, still nothing.
I know I'm missing something here again. I am thinking a window should appear. Anyway, here is a screen of the code as I typed it.
What did I miss? Help appreciated!
E
{UPDATE}
I read on and copied the PS2.bac from the website, compiled it, and ran it. Noticed for a split second there was a window that appeared then disappeared. Thought on it some more then added a FOR/NEXT statement after the DISPLAY on the PS1 file. It worked - window appeared and stayed active. Even closed when the "close window" x was pressed.
I take it that some other 'action' needs to be implemented after the DISPLAY statement in order for the window to remain. Like say the proverbial 'wait' LOL
Sorry for jumping the gun on this post...took a min for the old brain to fire up
Thanks!
E
 |
Description |
AS-written for PS1.bac |
Filesize |
9.7 KB |
Viewed |
339 Time(s) |

|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Thu 31 Jan 2013, 08:30 Post subject:
|
|
BarryK wrote: | ...Alternatively, you could gzip your demo.bac and post it here. |
Please do this alternative
or copy your PS1.bac here.
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Thu 31 Jan 2013, 19:28 Post subject:
|
|
@L18L
Here is the PS1.bac file as I have it written at present. It works with the invokation of a 'wait' after DISPLAY.
Thanks!
E
Description |
Current (013113) copy of PS1.bac file
|

Download |
Filename |
PS1.tar.gz |
Filesize |
273 Bytes |
Downloaded |
202 Time(s) |
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Fri 01 Feb 2013, 12:46 Post subject:
|
|
e_mattis wrote: | @L18L
Here is the PS1.bac file as I have it written at present. It works with the invokation of a 'wait' after DISPLAY.
Thanks!
E |
Thank you.
It is not the wait but just the new line after DISPLAY that made it work.
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Fri 01 Feb 2013, 19:14 Post subject:
|
|
Moving along quit nicely now,thanks Barry, L18L, and everyone else!
Ran into a little snag, however. I need to put a menu in the window (Like 'file > open', etc.) I have been looking throughout the pages of the tutorials, documentations, etc and have not found out if it can be done or how to do it.
Also, how to display the window full-screen (just starting to search for that info but...)
Any help is appreciated!
E
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5087 Location: Arizona, U.S.A.
|
Posted: Sat 02 Feb 2013, 00:10 Post subject:
|
|
Hi e_mattis;
The window title bar control buttons are the only way I know to go full screen.
There might be a "properties request" for it, but they aren`t well documented.
There is no menu bar if you look at the HUG docs, however there`s a post at the BaCon site about importing the GTK+ menu bar.
I played with it a bit, what`s nice about importing is that it compiles fast.
Other than that, you can use a combo box for a single pull-down menu.
I hate the way the GTK made the combo box work, you must use a timer.
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Sat 02 Feb 2013, 12:28 Post subject:
|
|
Thanks sunburnt,
i'll look a little more and see about the GTK import. I think i'm going to like the idea about the combo boxes better though.
Maybe the best way to say what i am looking for is that I want it to open the full display width and height. fullscreen is the ideal, but full display would work. where would i find the dimension- which file?
thanks!
E
|
Back to top
|
|
 |
|
Page 30 of 36 [526 Posts] |
Goto page: Previous 1, 2, 3, ..., 28, 29, 30, 31, 32, 33, 34, 35, 36 Next |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|