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 Sat 25 Oct 2014, 06:24
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
BaCon - Bash-based Basic-to-C converter/compiler
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 30 of 36 Posts_count   Goto page: Previous 1, 2, 3, ..., 28, 29, 30, 31, 32, 33, 34, 35, 36 Next
Author Message
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: 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
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: Mon 28 Jan 2013, 20:41    Post_subject:  

Hey guys, thanks for responding. Very Happy

@ 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
View user's profile Send_private_message Visit_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Mon 28 Jan 2013, 21:25    Post_subject:  

Quote:
Global c TYPE chat


Try

Code:
Global c TYPE char


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
View user's profile Send_private_message Visit_website 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: 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 Very Happy ). 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
View user's profile Send_private_message Visit_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: 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 Very Happy ). 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
View user's profile Send_private_message Visit_website 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: 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
capture13515.png
 Description   demo.bac as currently written
 Filesize   6.67 KB
 Viewed   295 Time(s)

capture13515.png

capture12948.png
 Description   Problem given at compile
 Filesize   3.13 KB
 Viewed   292 Time(s)

capture12948.png

EsDemo.tar.gz
Description  Erics Demo.bac file and screens of the resulting errors
gz

 Download 
Filename  EsDemo.tar.gz 
Filesize  44.54 KB 
Downloaded  110 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Wed 30 Jan 2013, 14:14    Post_subject:
Sub_title: 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 Wink
Back to top
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: 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
View user's profile Send_private_message Visit_website 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: 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. Smile

I type in@ # ./PS1 - nothing. no window, no error message, no nothing. Crying or Very sad
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. Confused

I know I'm missing something here again. Shocked 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 Embarassed

Thanks!

E
capture10294.png
 Description   AS-written for PS1.bac
 Filesize   9.7 KB
 Viewed   282 Time(s)

capture10294.png

Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: 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
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: 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
PS1.tar.gz
Description  Current (013113) copy of PS1.bac file
gz

 Download 
Filename  PS1.tar.gz 
Filesize  273 Bytes 
Downloaded  115 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: 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
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: Fri 01 Feb 2013, 19:14    Post_subject:  

Moving along quit nicely now,thanks Barry, L18L, and everyone else! Very Happy

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. Confused

Also, how to display the window full-screen (just starting to search for that info but...) Shocked

Any help is appreciated!

E
Back to top
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: 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
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: 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
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 30 of 36 Posts_count   Goto page: Previous 1, 2, 3, ..., 28, 29, 30, 31, 32, 33, 34, 35, 36 Next
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.1201s ][ Queries: 13 (0.0411s) ][ GZIP on ]