Page 22 of 27

Posted: Sat 17 Dec 2011, 05:33
by sunburnt
Installed the latest Puppy528-3 so Firefox could have a working Flash player.

As usual, BaCon doesn`t work in the new install.
I need to write another setup script to get it running for every new Save file.

Error:

Code: Select all

Symbol not found in library /usr/share/BaCon/hug.so: undefined symbol: METHOD
hug.so has the METHOD function in it of course...

### Also I posted about getting mouse info. 2 posts above here.

Posted: Sat 17 Dec 2011, 10:03
by vovchik
Dear Terry,

I know it slows the compile/debug process, but I just use hug.bac as an INCLUDE for everything. Later I go and determine which functions I use from the HUG lib. That way I never run in to your type of problem - where the system may have an old hug.so or can't find the right one. And if you have a working BaCon or BaConGui, the program with the hug.bac INCLUDE will compile. Later you can make your hug.so and recompile, once you know that everything is working.

With kind regards,
vovchik

Posted: Sat 17 Dec 2011, 12:53
by sunburnt
I replaced /usr/lib/hug.so with a link to the newer hug.so
Barry should make /usr/lib/hug.so a link to /root/my-applications/lib/hug.so

Puppy`s Save file is it`s biggest problem, it corrupts occasionally.
So I replaced the dirs. my-applications and my-documents with links to /apps and /docs dirs. on a partition so nothing`s lost.
Keep a backup Save file, to restore just copy it over the old one.

This should be a menu item, to make a gzip backup Save file, and have an option to restore it at the bootup menu.

New HUG with sliders

Posted: Sun 18 Dec 2011, 00:57
by vovchik
Dear puppians,

Peter has just posted a new HUG (0.66) that now has support for vscale and hscale sliders. If you want to use these widgets, please download the latest HUG http://www.basic-converter.org/hug.bac. The documentation will be updated in due course.

With kind regards,
vovchik

Posted: Sun 18 Dec 2011, 06:21
by GatorDog
vovchik,

Thanks for update :D

gatordog

Posted: Sun 18 Dec 2011, 10:18
by vovchik
Dear puppians,

Here is a little demo to show how to use the new slider widgets, done some time ago by 2lss and modded by me a bit:

Code: Select all

' ************************
' INCLUDES
' ************************

' INCLUDE ../hug-slider.bac

INCLUDE "hug.bac", ATTACH, CALLBACK, \
	DISPLAY, ENTRY, GET, HUGOPTIONS, \
	INIT, SET, \
	TEXT, WINDOW, HUGLIB$, HSLIDE, VSLIDE

' ************************
' END INCLUDES
' ************************


' ************************
' SUBS & FUNCTIONS
' ************************

' -----------------
SUB update_hslide_entry()
' -----------------
    num = GET(hslide)
    TEXT(hentry, STR$(num))
END SUB

' -----------------
SUB update_vslide_entry()
' -----------------
    num = GET(vslide)
    TEXT(ventry, STR$(num))
END SUB

' -----------------
SUB make_gui()
' -----------------
	HUGOPTIONS("TABLE 20 20")
	win = WINDOW("Hug Slide Test", 300, 300)
	hslide = HSLIDE(12, 3, 1, 20, 1)
	ATTACH(win, hslide, 1, 1)
	SET(hslide, 5)
	vslide = VSLIDE(3, 12, 1, 30, 2)
	ATTACH(win, vslide, 15, 1)
	SET(vslide, 10)
	hentry = ENTRY(STR$(GET(hslide)), 2, 2)
	ATTACH(win, hentry, 4, 6)
	ventry = ENTRY(STR$(GET(vslide)), 2, 2)
	ATTACH(win, ventry, 15, 14)
	CALLBACK(hslide, update_hslide_entry)
	CALLBACK(vslide, update_vslide_entry)
END SUB

' ************************
' END SUBS & FUNCTIONS
' ************************


' ************************
' MAIN
' ************************

' Start hug
INIT
' Make gui
make_gui
' Show gui
DISPLAY

' ************************
' END MAIN
' ************************
With kind regards,
vovchik

Posted: Mon 16 Jan 2012, 01:46
by sunburnt
I`m writing a function file to do file I/O for text and arrays.

Strange problem with writing an array to a file.

Code: Select all

SUB OUTARRAY(STRING Txt$[Size], int Size)
	OPEN File$ FOR WRITING AS file
	FOR i = 0 TO Size-1
		WRITELN Txt$[i] TO file
	NEXT
	CLOSE FILE file
END SUB
Error is: Cause: 'Size' undeclared here (not in a function)
It looks like the Size needs to be declared in the SUB.
If so, then passing an array to a SUB can`t be done.

The Bacon docs say the array dimension isn`t needed to pass it to a SUB.
But that errors saying:
ERROR: cannot pass string array without dimension at line 54 in file 'test_FileIO.bac'!
So you can pass a numerical array without a dimension, but not a string array?
If that`s the case, then the Bacon docs should mention that little detail...
.

Posted: Fri 04 May 2012, 16:20
by Mobeus
Some of you may find this interesting so I thought it deserves a post here.
I just had an educational experience over at the BaCon forum http://basic-converter.proboards.com/in ... thread=254

BaCon can use gtkbuilder with *.glade files in Puppy!

Posted: Sun 06 May 2012, 14:58
by Mobeus
In Wary 5.3 you cannot use a compile command like

Code: Select all

bacon -o -export-dynamic -o `pkg-config --cflags --libs gtk+-2.0` test.bac 
You will get an error of

Code: Select all

/usr/lib/gcc/i486-t2-linux-gnu/4.3.4/../../../../i486-t2-linux-gnu/bin/ld: cannot find -lfontconfig
collect2: ld returned 1 exit status 
You can work around this by echoing the command and copying the output to a bash script, then use the script to compile with. This is what I am using.

Code: Select all

#! /bin/bash

bacon -o -export-dynamic -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/X11R7/include/pixman-1 -I/usr/X11R7/include -pthread -L/usr/X11R7/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpng12 -lpango-1.0 -lfreetype -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 test.bac 
Everything after -export-dynamic up to the test.bac file name is the output from `pkg-config --cflags --libs gtk+-2.0` with the offending -lfontconfig removed. You could also remove some unnecessary linkage this way.

Regards

Posted: Tue 20 Nov 2012, 10:38
by linuph
Running Dpup Exprimo 5.X.3.4.12

I'm a bit stuck with Bacon.... I wrote a screensaver (see http://www.murga-linux.com/puppy/viewto ... start=1275) more as an exercise than an useful project. But it got me underway. Thus motivated, I started on a more complex project concerning GPS.
I use a Bluetooth GPS module. I connect to it with 'rfcomm /dev/rfcomm 0 > pipe &' in BASH. Then I read the GPS data from the other end of the pipe.
In Bacon it should be, as I understand it 'SYSTEM "rfcomm /dev/rfcomm0 > pipe &". But it cannot connect ('host is down') while in BASH (terminal) all is OK.

I registered with the BACON forum 2-3 weeks ago but sofar no reply. I hope someone here can help and give me some pointers?

Posted: Tue 20 Nov 2012, 17:17
by vovchik
Dear linuph,

I haven't seen any questions from you on the Bacon forum. Please try there and post your source code. People will advise or suggest things. Lots of helpful people there....like here.

With kind regards,
vovchik

Posted: Wed 21 Nov 2012, 04:53
by linuph
@vovchik

I registered on 31 October at Proboards but cannot access. It awaits confirmation by an administrator since then....

Posted: Wed 21 Nov 2012, 11:39
by vovchik
Dear linuph,

I cannot understand why your registration failed. BaCon's author, Peter van Eerten, allows everybody except spammers, so I don't think he has blocked your registration. Try again. It is a good place to see code and to get advice from many people doing BaCon projects.

http://basic-converter.proboards.com/

With kind regards,
vovchik

PS. You may want to do this using another handle, since there may have been a previous "linuph", and not you.

BaCon Help!

Posted: Mon 28 Jan 2013, 22:20
by e_mattis
Hey all,

I decided to try out BaCon and see if I can write some programs that I need so I can run them on Puppy rather than the M$-crap. I started reading what I could to find out how to set it up and get it started on Precise 5.4.3. I followed the tutorial here http://bkhome.org/bacon/gettingstarted.htm.

Wrote the program in leafpad, downloaded the devx.sfs, opened the term, made sure I was in the correct directory, entered 'bacon demo.bac' and got an error - "could not parse line 1 in file 'demo.bac'"

Did I miss something? Do I need to "turn on" something? Totally lost as to why it would not parse.

Any help appreciated!

Thanks!

E

Posted: Mon 28 Jan 2013, 22:56
by sunburnt
Hi e_mattis; What was line one in the file? Better yet, post the file here.

It seems like you have the needed BaCon and system files installed.

Posted: Mon 28 Jan 2013, 23:19
by vovchik
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

Posted: Tue 29 Jan 2013, 00:41
by e_mattis
Hey guys, thanks for responding. :D

@ 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

Posted: Tue 29 Jan 2013, 01:25
by BarryK
Global c TYPE chat
Try

Code: Select all

Global c TYPE char
Hmm, yes, I see on my web page, those line numbers could cause confusion. I need to remove them.

Posted: Tue 29 Jan 2013, 03:30
by e_mattis
Het Barry!

yea -That was a typo on the post. The actual code does have 'GLOBAL c TYPE char' (my big fingers again :D ). 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

Posted: Tue 29 Jan 2013, 06:55
by BarryK
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 :D ). 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.